Files
c3c/test/unit/regression/unwrapping.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

19 lines
255 B
Plaintext

module unwrapping;
fn bool? get_bool()
{
return true;
}
fn void bool_chain_unwrap() @test
{
bool b;
if (try v = get_bool() && b)
{
assert(v == true);
}
if (try v = get_bool() && v)
{
assert(v == true);
}
}