Files
c3c/test/test_suite/errors/more_optional_discard.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

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?'
}