Rudimentary implementation

Adds an identify_recursive_static_params; doesn't handle all shadowing cases yet
This commit is contained in:
Pi Lanningham
2023-07-28 21:55:50 -04:00
committed by Kasey
parent 09f889b121
commit c45caaefc8
3 changed files with 128 additions and 21 deletions

View File

@@ -21,3 +21,32 @@ validator {
must_say_hello && must_be_signed
}
}
type ABC {
a: ByteArray,
b: Int,
c: ByteArray,
}
type XYZ {
a: ByteArray,
b: ByteArray,
c: ByteArray,
d: Int,
e: ABC,
}
fn recursive(a: ByteArray, b: Int, c: XYZ, d: Int, e: Int) -> ByteArray {
if c.e.a == "a" {
"d"
} else if b == 0 {
a
} else {
recursive(a, b - 1, c, d, e)
}
}
test hah() {
expect "a" == recursive("a", 30, XYZ("", "", "", 1, ABC("", 1, "")), 2, 5)
True
}