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.
15 lines
453 B
Plaintext
15 lines
453 B
Plaintext
module abc;
|
|
|
|
macro int mtest1(int a) @nodiscard { return 0; }
|
|
macro int? mtest2(int a) { return 0; }
|
|
fn int ftest1(int a) @nodiscard { return 0; }
|
|
fn int? ftest2(int a) { return 0; }
|
|
|
|
|
|
fn void main()
|
|
{
|
|
mtest1(3); // #error: The called macro is marked `@nodiscard`
|
|
mtest2(3); // #error: The macro returns 'int?', which is an optional
|
|
ftest1(3); // #error: The called function is marked `@nodiscard`
|
|
ftest2(3); // #error: The function returns 'int?'
|
|
} |