mirror of
https://github.com/unisonweb/unison.git
synced 2024-10-26 11:07:48 +03:00
881 B
881 B
This tests a case where a function was somehow discarding abilities.
structural ability Trivial where
trivial : ()
-- This handler SHOULD leave any additional effects alone and unhandled
handleTrivial : '{e, Trivial} a -> {e} a
handleTrivial action =
h : Request {Trivial} a -> a
h = cases
{trivial -> resume} -> handle !resume with h
{a} -> a
handle !action with h
testAction : '{Exception, IO, Trivial} ()
testAction = do
printLine "hi!"
trivial
wat : ()
wat = handleTrivial testAction -- Somehow this completely forgets about Exception and IO
> handleTrivial testAction
Loading changes detected in scratch.u.
The expression in red needs the {IO} ability, but this location does not have access to any abilities.
19 | wat = handleTrivial testAction -- Somehow this completely forgets about Exception and IO