$ let c(): Int { let i = a(1); let a(i: Int): Int { i + 1 }; i }
1: c(): Int { let i = a(1); let a(i: Int):
⇧
[interactive#5:1+23-24]@T: a__3 is not initialized along branches at [:1+15]
1: let c(): Int { let i = a(1); let a(
⇧
interactive#5: void
$ let d(): Int { let b(i: Int): Int { a(i) * 2 }; let i = b(1); let a(i: Int): Int { i + 1 }; i }
interactive#6: void
$ let e(): Int { let b(i: Int): Int { a(i) * 2 }; let a(i: Int): Int { i + 1 }; b(1) }
interactive#7: void
$ c()
1: c(): Int { let i = a(1); let a(i: Int):
⇧
[interactive#5:1+23-24]@R: Interpreter encountered error()
Interpretation ended due to runtime panic
interactive#8: fail
$ d()
interactive#9: fail
$ e()
interactive#10: 4
Cases above:
Static and dynamic errors with messages
Missing static error; dynamic error without message
Working because things aren't out of order
We really should have a static error message for case 2. A runtime error message would also be nice.
Some examples:
Cases above:
We really should have a static error message for case 2. A runtime error message would also be nice.