Files
c3c/test/unit/regression/interface_inheritance.c3
2025-08-23 22:31:29 +02:00

33 lines
290 B
Plaintext

module inherit_interface;
import std;
interface Test
{
fn int x();
}
struct Foo (Test)
{
int z;
}
fn int Foo.x(&self) @dynamic
{
return 42;
}
struct Baz
{
inline Bar b;
}
struct Bar
{
inline Foo f;
}
fn void test_inheritance() @test
{
Baz x;
Test t = &x;
test::eq(t.x(), 42);
}