mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 03:51:18 +00:00
26 lines
292 B
Plaintext
26 lines
292 B
Plaintext
module foo;
|
|
import std;
|
|
interface Test
|
|
{
|
|
fn void x();
|
|
}
|
|
|
|
typedef Foo (Test) = int;
|
|
|
|
fn void Foo.x(&self) @dynamic
|
|
{
|
|
io::printn("Foo!");
|
|
}
|
|
|
|
constdef Tester : inline Foo
|
|
{
|
|
ABC = 1
|
|
}
|
|
|
|
fn int main()
|
|
{
|
|
Tester x;
|
|
Test t = &x; // #error: but you can use an explicit cast to
|
|
t.x();
|
|
return 0;
|
|
} |