Basic type system working

This commit is contained in:
Neemek 2025-03-16 22:46:49 +01:00
parent 3f260e7ffd
commit 84cc845748
Signed by: neemek
GPG key ID: 28360A8951CD0E9B
19 changed files with 900 additions and 131 deletions

View file

@ -3,14 +3,14 @@ list := []
x := 1
while x <= 1000 {
list.append(x)
assertEq(list.reduce(func(tot, a){
assertEq(list.reduce(func(tot: number, a: number) number {
return tot + a
}, 0), x*(x + 1)/2)
x = x + 1
}
func sum(a, b) {
func sum(a: number, b: number) number {
return a + b
}