Files
c3c/test/test_suite/errors/try_unwrap_using_assert.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

12 lines
189 B
Plaintext

module test;
extern fn int? maybe();
fn int tester(int n)
{
int? num = maybe();
assert(try num, "Hello"); // #error: An expression was expected
int x = num;
return num;
}