anglais/tests/types.ang
Neemek 7879184d56
All checks were successful
/ test (push) Successful in 51s
fix wasm and tests
2026-07-15 21:46:14 +02:00

15 lines
316 B
Text

assertEq(typeof(1), "int")
assertEq(typeof("Hello"), "str")
assertEq(typeof(true), "boolean")
# lists
assertEq(typeof(["Hello", "world"]), "[str]")
assertEq(typeof([0, 1]), "[int]")
assertEq(typeof((0, 1)), "(int, int)")
type Vec2 = (int, int)
fn add(a: Vec2, b: Vec2) -> Vec2 {
(a[0] + b[0], a[1] + b[1])
}