mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
{| |} expression blocks deprecated.
This commit is contained in:
@@ -3,19 +3,19 @@ module catch_err @test;
|
||||
fn void test()
|
||||
{
|
||||
anyfault a;
|
||||
int! z = {|
|
||||
int! z = fn int!(anyfault* a) {
|
||||
const ABC = 4;
|
||||
int! x = SearchResult.MISSING?;
|
||||
defer (catch err) a = err;
|
||||
defer (catch err) *a = err;
|
||||
return x;
|
||||
|};
|
||||
}(&a);
|
||||
assert(a == SearchResult.MISSING);
|
||||
anyfault y;
|
||||
z = {|
|
||||
z = fn int!(anyfault* y) {
|
||||
const ABC = 4;
|
||||
int! x = 1;
|
||||
defer (catch err) y = err;
|
||||
defer (catch err) *y = err;
|
||||
return x;
|
||||
|};
|
||||
}(&y);
|
||||
assert(!y);
|
||||
}
|
||||
Reference in New Issue
Block a user