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