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

26 lines
713 B
Plaintext

interface TestProto
{
fn int test(int ag);
}
struct Foo (TestProto) { int a; }
fn int? Foo.test(Foo* f) @dynamic { return 1; } // #error: The prototype method has a return type 'int'
struct Foo1 (TestProto) { int a; }
fn int Foo1.test(Foo1* f, int a) @dynamic { return 1; }
struct Foo2 (TestProto) { int a; }
fn int Foo2.test(Foo2* f) @dynamic { return 1; } // #error: This function is missing parameters, 2
struct Foo3 (TestProto) { int a; }
fn int Foo3.test(Foo3* f, double a) @dynamic { return 1; } // #error: The prototype argument has type 'int'
struct Foo4 (TestProto) { int a; }
fn int Foo4.test(Foo4* f, double a, int x) @dynamic { return 1; } // #error: This function has too many parameters