slovo/tests/struct.surface.lower
2026-05-22 08:38:43 +02:00

34 lines
624 B
Plaintext

program main
struct Point
field x: i32
field y: i32
fn point_sum() -> i32
binary +
field-access x
construct Point
field x
int 20
field y
int 22
field-access y
construct Point
field x
int 20
field y
int 22
fn main() -> i32
call point_sum
test "struct field access"
binary =
call point_sum
int 42
test "struct field compares"
binary =
field-access y
construct Point
field x
int 7
field y
int 9
int 9