Files
c3c/test/test_suite/errors/optional_contracts.c3
Christoffer Lerno cdabe8fd9e - Create optional with ~ instead of ?. return io::EOF?; becomes return io::EOF~.
- Deprecated use of `?` to create optional.
2026-01-20 16:10:28 +01:00

30 lines
391 B
Plaintext

faultdef
ABC,
DEF,
ZED;
faultdef XYZ;
<*
hello world
@return? XYZ, ABC
*>
fn void? abc(int a, int b, int z)
{
return ZED~; // #error: This value does not match declared optional returns
}
<*
hello world
@return? XYZ, ABC
*>
macro void? @abc(int a, int b, int z)
{
return ZED~; // #error: This value does not match declared optional returns
}
fn void main()
{
@abc(2,3,3)!!;
}