Files
c3c/test/test_suite/struct/member_expr.c3
Christoffer Lerno e605a21fd3 Revert "Revert 0.7.6 code for 0.7.5 re-release"
This reverts commit d1349c9cfb.
2025-09-05 23:30:35 +02:00

32 lines
434 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_struct_func1()
{
Func2 a = &Foo.func2;
}
fn void test_nonstatic_struct_func2()
{
int b = Foo.func2(null, 2);
}