flan/test/programs/stale-generic.flan

14 lines
611 B
Plaintext

;;;; A stale caller that asks for a generic copy on its way to failing.
;;;;
;;;; When [scale]'s return type changes to f64, [through]'s unchanged source
;;;; instantiates [same] at f64 and then fails to return it as an i64. The
;;;; session excuses that — [through] is a caller compiled against the old
;;;; signature — and the checker takes back what the failed check made. The
;;;; copy has to go with it, or a body in the same form that really needs
;;;; [same] at f64 is handed a copy nothing generated.
(defn same [x $t] $t x)
(defn scale [x i64] i64 (* x 2))
(defn through [] i64 (same (scale 1)))