mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Macro methods added.
This commit is contained in:
committed by
Christoffer Lerno
parent
9572c4afc9
commit
038ed7f9d5
37
test/test_suite/methods/access.c3
Normal file
37
test/test_suite/methods/access.c3
Normal file
@@ -0,0 +1,37 @@
|
||||
extern func void printf(...);
|
||||
|
||||
struct An1
|
||||
{
|
||||
An3 x;
|
||||
}
|
||||
|
||||
struct An3
|
||||
{
|
||||
An2 y;
|
||||
}
|
||||
|
||||
define AnCall = func void();
|
||||
|
||||
struct An2
|
||||
{
|
||||
AnCall t;
|
||||
}
|
||||
|
||||
func void An2.helloWorld(An2 *an2)
|
||||
{
|
||||
printf("An2 hello\n");
|
||||
}
|
||||
|
||||
func void check()
|
||||
{
|
||||
printf("Checking\n");
|
||||
}
|
||||
|
||||
|
||||
func void main()
|
||||
{
|
||||
An1 an;
|
||||
an.x.y.helloWorld();
|
||||
an.x.y.t = ✓
|
||||
an.x.y.t();
|
||||
}
|
||||
Reference in New Issue
Block a user