suicmez/tests/structs.sui

17 lines
255 B
Text
Raw Normal View History

2025-12-15 13:53:57 +05:30
# Struct test
struct Point
x: int,
y: int,
end
2025-12-17 13:16:53 +05:30
struct Person
2025-12-15 13:53:57 +05:30
name: string,
2025-12-17 13:16:53 +05:30
age: int,
2025-12-15 13:53:57 +05:30
end
2025-12-16 01:49:49 +05:30
fn main() -> int do
2025-12-15 13:53:57 +05:30
let p = Point { x: 5, y: 10 };
let person = Person { name: "Alice", age: 30 };
2025-12-17 13:16:53 +05:30
let _ = p.x + person.age;
0
2025-12-15 13:53:57 +05:30
end