Skip to content

Commit 3e7fdae

Browse files
committed
CI Add explanatory comments to type safety tests
1 parent 2fccca6 commit 3e7fdae

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

regression-tests/mixed-type-safety-1.cpp2

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ print: ( msg: std::string, b: bool ) =
2727

2828
main: () -> int =
2929
{
30+
// Full qualification is necessary to avoid ambiguity in C++23
31+
// C++23 defines std::print, which would be picked up here by ADL
3032
::print( "1.1 is int? ", 1.1 is int );
3133
::print( "1 is int? ", 1 is int );
3234

regression-tests/pure2-type-safety-1.cpp2

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ main: () -> int =
2323

2424
test_generic: ( x, msg ) = {
2525
msgx: std::string = msg;
26+
// Full qualification is necessary to avoid ambiguity in C++23
27+
// C++23 defines std::print, which would be picked up here by ADL
2628
::print( msgx + " is int? ", x is int );
2729
}
2830

regression-tests/test-results/mixed-type-safety-1.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ auto print(cpp2::impl::in<std::string> msg, cpp2::impl::in<bool> b) -> void
5656
#line 28 "mixed-type-safety-1.cpp2"
5757
[[nodiscard]] auto main() -> int
5858
{
59+
// Full qualification is necessary to avoid ambiguity in C++23
60+
// C++23 defines std::print, which would be picked up here by ADL
5961
::print("1.1 is int? ", cpp2::impl::is<int>(1.1));
6062
::print( "1 is int? ", cpp2::impl::is<int>(1));
6163

regression-tests/test-results/pure2-type-safety-1.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
#line 24 "pure2-type-safety-1.cpp2"
2020
auto test_generic(auto const& x, auto const& msg) -> void;
2121

22-
#line 29 "pure2-type-safety-1.cpp2"
22+
#line 31 "pure2-type-safety-1.cpp2"
2323
auto print(cpp2::impl::in<std::string> msg, cpp2::impl::in<bool> b) -> void;
24-
#line 35 "pure2-type-safety-1.cpp2"
24+
#line 37 "pure2-type-safety-1.cpp2"
2525

2626
#line 1 "pure2-type-safety-1.cpp2"
2727

@@ -55,10 +55,12 @@ auto print(cpp2::impl::in<std::string> msg, cpp2::impl::in<bool> b) -> void;
5555
#line 24 "pure2-type-safety-1.cpp2"
5656
auto test_generic(auto const& x, auto const& msg) -> void{
5757
std::string msgx {msg};
58+
// Full qualification is necessary to avoid ambiguity in C++23
59+
// C++23 defines std::print, which would be picked up here by ADL
5860
::print(cpp2::move(msgx) + " is int? ", cpp2::impl::is<int>(x));
5961
}
6062

61-
#line 29 "pure2-type-safety-1.cpp2"
63+
#line 31 "pure2-type-safety-1.cpp2"
6264
auto print(cpp2::impl::in<std::string> msg, cpp2::impl::in<bool> b) -> void{
6365
cpp2::impl::deferred_init<char const*> bmsg;
6466
if (b) { bmsg.construct("true");}

0 commit comments

Comments
 (0)