Skip to content

Commit fc5f757

Browse files
committed
CI Add explanatory comments to type safety tests
1 parent 87738e6 commit fc5f757

File tree

4 files changed

+11
-3
lines changed

4 files changed

+11
-3
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ print: <T : type> ( msg: std::string, x: T ) =
1414

1515
main: () -> int =
1616
{
17+
// Full qualification is necessary to avoid ambiguity in C++23
18+
// C++23 defines std::print, which would be picked up here by ADL
1719
::print( "1.1 is int?", 1.1 is int );
1820
::print( "1 is int?", 1 is int );
1921

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

Lines changed: 2 additions & 0 deletions
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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ template<typename T> auto print(cpp2::impl::in<std::string> msg, T const& x) ->
3838
#line 15 "mixed-type-safety-1.cpp2"
3939
[[nodiscard]] auto main() -> int
4040
{
41+
// Full qualification is necessary to avoid ambiguity in C++23
42+
// C++23 defines std::print, which would be picked up here by ADL
4143
::print("1.1 is int?", cpp2::impl::is<int>(1.1));
4244
::print( "1 is int?", cpp2::impl::is<int>(1));
4345

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

Lines changed: 5 additions & 3 deletions
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)