Files
c3c/test/test_suite/expressions/plus_int.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

27 lines
369 B
Plaintext

fn void test1()
{
short? a = 1;
@ok(+a);
short b = +a; // #error: 'short?' to 'short'.
}
fn void test2()
{
int? a = 1;
@ok(+a);
int b = +a; // #error: 'int?' to 'int'
}
fn void test3()
{
long? a = 1;
@ok(+a);
long b = +a; // #error: 'long?' to 'long'
}
fn void test4()
{
int a = 1;
+a = 3; // #error: An assignable expression
}