Files
c3c/test/test_suite/cast/cast_to_failable.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

12 lines
251 B
Plaintext

faultdef FOO;
fn void test()
{
int? x;
double? y;
int? d = ($typeof(FOO~))(x); // #error: Casting to an optional
int? df = ($typeof(y))(x); // #error: Casting to an optional type is not allowed
double? df2 = ($typeof(y!!))(x);
}