unison/unison-src/errors/effect-inference1.u
2021-08-24 11:33:27 -07:00

13 lines
332 B
Plaintext

structural ability Abort where
Abort : forall a . () -> {Abort} a
foo n = if n >= 1000 then n else !Abort.Abort
bar : (Nat -> {} Nat) -> Nat -> Nat
bar f i = f i
bar foo 3
-- as of 3935b366383fe8184f96cfe714c31ca04234cf27, this typechecks (unexpected)
-- and then bombs in the runtime because the Abort ability isn't handled.