Files
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

26 lines
443 B
Plaintext

fn void test1()
{
bool x = $defined(1);
}
struct Foo
{
int x;
}
fn void test2()
{
$assert $defined(int[1]);
bool x = $defined(int[y]); // #error: 'y' could not be found, did you spell it right?
}
fn void test3()
{
$assert $defined(Foo[1]);
$assert $defined(Foo*);
$assert $defined(Foo[]);
$assert $defined(Foo[*]);
bool x = $defined(Foo[y]); // #error: 'y' could not be found, did you spell it right?
}