15 lines
316 B
Text
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])
|
|
}
|