mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
- Remove `[?]` syntax. - Change `int!` to `int?` syntax. - New `fault` declarations. - Enum associated values can reference the calling enum.
42 lines
582 B
Plaintext
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'
|
|
}
|