Files
c3c/test/test_suite/dynamic/any_cast.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

23 lines
256 B
Plaintext

module test;
interface Abc : Def
{}
interface Def
{}
fn void? test()
{
any x;
Abc d = x; // #error: cannot implicitly be converted to 'Abc'
}
fn void? test2()
{
Abc x;
any d = x;
Def e = x;
x = e; // #error: is not a parent interface of 'Def'
}