Init new repository

This commit is contained in:
Krzosa Karol
2024-04-13 15:29:53 +02:00
commit 5a2e3dcec4
335 changed files with 61571 additions and 0 deletions

37
tests/field_access.txt Normal file
View File

@@ -0,0 +1,37 @@
import "libc";
T :: struct {
a: int;
t2: T2;
}
T2 :: struct {
b: int;
}
T3 :: struct {
om: T;
}
main :: proc(): int {
t: T;
a := t.a; @unused
b := (t).a; @unused
i0 := :T{10}.a;
i1 := :T{}.t2.b;
i2 := :T{t2={1}}.t2;
assert(i0 == 10);
assert(i1 == 0);
assert(i2.b == 1);
assert(t.t2.b == 0);
i3: T3;
i3.om.a = 10;
i3.om.t2.b = 10;
return 0;
}