Files
c3c/test/test_suite/errors/try_with_weird_stuff.c3
Christoffer Lerno 25bccf4883 New faults and syntax (#2034)
- Remove `[?]` syntax.
- Change `int!` to `int?` syntax.
- New `fault` declarations.
- Enum associated values can reference the calling enum.
2025-03-10 00:11:35 +01:00

16 lines
275 B
Plaintext

fn void test1()
{
int? a;
int b;
int*? x;
if (try int 1 = a) {} // #error: A new variable was expected.
}
fn void test2()
{
int? a;
int b;
int*? x;
if (try foo::z = a, b += 1) {} // #error: The 'try' must be placed last, can you change it?
}