flan/web/examples/bounds.flan
Joseph Ferano fc47489802 Show the bounds check failing, because "checked" without a message says little
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.
2026-09-12 03:49:41 +07:00

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")))