Files
c3c/test/test_suite/struct/member_expr.c3
Christoffer Lerno 3e54d13b62 Prefer def
2023-06-02 20:08:45 +02:00

32 lines
428 B
Plaintext

def Func = fn int(int);
def 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);
}