unison/unison-src/errors/effect-inference1.u
2018-09-24 13:15:40 -04:00

13 lines
319 B
Plaintext

effect 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 effect isn't handled.