Skip to content

Commit

Permalink
Fixed more expected files.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ingo Prötel committed Feb 24, 2024
1 parent 2e7d802 commit d4bbc15
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
7 changes: 6 additions & 1 deletion regression-tests/pure2-intro-example-three-loops.cpp2
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ main: () -> int = {
( "hello", "big", "world" );
view: std::span<std::string> = words;

i := new<int>(0);
p_i := new<int>(0);
if (!p_i) {
return 1;
}
i := p_i*;

while i* < view.ssize() next i*++ {
print( view[i*] );
}
Expand Down
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion regression-tests/test-results/mixed-type-safety-1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ auto print(cpp2::in<std::string> msg, cpp2::in<bool> b) -> void
print( "1 is int? ", cpp2::is<int>(1));

auto c {cpp2_new<Circle>()}; // safe by construction
Shape* s {CPP2_UFCS(get)(std::move(c))}; // safe by Lifetime
Shape* s {CPP2_UFCS(get)((*cpp2::assert_not_null(std::move(c))))}; // safe by Lifetime
print("\ns* is Shape? ", cpp2::is<Shape>(*cpp2::assert_not_null(s)));
print( "s* is Circle? ", cpp2::is<Circle>(*cpp2::assert_not_null(s)));
print( "s* is Square? ", cpp2::is<Square>(*cpp2::assert_not_null(std::move(s))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ auto decorate_and_print(auto& thing) -> void;

#line 10 "pure2-intro-example-three-loops.cpp2"
[[nodiscard]] auto main() -> int;
#line 30 "pure2-intro-example-three-loops.cpp2"
#line 35 "pure2-intro-example-three-loops.cpp2"

#line 1 "pure2-intro-example-three-loops.cpp2"

Expand All @@ -45,7 +45,12 @@ auto decorate_and_print(auto& thing) -> void{
"hello", "big", "world"};
std::span<std::string> view {words};

auto i {cpp2_new<int>(0)};
auto p_i {cpp2_new<int>(0)};
if ((!(p_i))) {
return 1;
}
auto i {*cpp2::assert_not_null(std::move(p_i))};

for( ; cpp2::cmp_less(*cpp2::assert_not_null(i),CPP2_UFCS(ssize)(view)); ++*cpp2::assert_not_null(i) ) {
print(CPP2_ASSERT_IN_BOUNDS(view, *cpp2::assert_not_null(i)));
}
Expand Down

0 comments on commit d4bbc15

Please sign in to comment.