Closed ceedubs closed 3 days ago
This might ultimately be the same issues as #3513.
Took a quick look. I think this is what's going on:
When you do foreach forkThread
, the type checker solves a = '{IO} ()
. When it does this, it adds a slack variable, so actually a = '{g, IO} ()
. which unifies with '{Exception, IO} ()
. So, adding the slack variable in this situation doesn't actually make sense.
I'll have to take a look at what's actually introducing the variable in this situation.
I think this might actually be simple to fix. Fixes #3513, too.
Describe and demonstrate the bug
Below I have a
forkThread
function that takes a thunk that is only allowed to use theIO
ability. But when I call into it viaList.foreach
, I am able to pass in a thunk that requires another ability (in this caseException
, but I can add arbitrary abilities to the same effect). The type checker should catch that this is not allowed.Input:
Environment (please complete the following information):
ucm --version
7172bb8e4Additional context
I ran into both this and #5128 in the same definition for a confusing double whammy.