mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
32 lines
432 B
Plaintext
32 lines
432 B
Plaintext
|
|
alias Func = fn int(int);
|
|
|
|
alias Func2 = fn int(Foo*, int);
|
|
|
|
struct Foo
|
|
{
|
|
int a;
|
|
Func callback;
|
|
}
|
|
|
|
fn int Foo.func2(Foo* f, int i)
|
|
{
|
|
return f.a + i;
|
|
}
|
|
|
|
fn void test_unknown_member()
|
|
{
|
|
int a = Foo.b; // #error: No method or inner struct/union 'Foo.b' found.
|
|
}
|
|
|
|
|
|
fn void test_nonstatic_stuct_func1()
|
|
{
|
|
Func2 a = &Foo.func2;
|
|
}
|
|
|
|
fn void test_nonstatic_stuct_func2()
|
|
{
|
|
int b = Foo.func2(null, 2);
|
|
}
|