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

42 lines
582 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()
{
short? a = 1;
@ok(~a);
short b = ~a; // #error: 'short?' to 'short'
}
fn void test5()
{
int? a = 1;
@ok(~a);
int b = ~a; // #error: 'int?' to 'int'
}
fn void test6()
{
long? a = 1;
@ok(~a);
long b = ~a; // #error: 'long?' to 'long'
}