The claim worth making is not that there is a check but that a failure names the line, and the only way to show that is to trip one.
11 lines
382 B
Plaintext
11 lines
382 B
Plaintext
(defconst xs [3 i32] [1 2 3])
|
|
|
|
;; (at xs 7) with a literal index does not reach the backend at all: check.ml
|
|
;; rejects it. This one goes through a local, so it is the runtime check that
|
|
;; catches it — the same message, and the program stops where it happened.
|
|
(defn main []
|
|
(let [i 7]
|
|
(print-line "before")
|
|
(print-i64 (i64 (at xs i)))
|
|
(print-line "unreachable")))
|