unison
unison copied to clipboard
fails to typecheck with inferred type
Input:
```unison:hide
structural type Holder g
= Holder ('{g} () ->{g} ())
Holder.wrap : ('{g} () ->{g} ()) -> Holder g
Holder.wrap = Holder
```
```
The expression in red
needs the abilities: {g5}
but was assumed to only require: {}
This is likely a result of using an un-annotated function as an argument with concrete abilities. Try adding an annotation to the function definition whose body is red.
7 | Holder.wrap = Holder
```
Holder.wrap in the above fails to typecheck if you include the type signature, it works without, The type signature given is the one inferred, however.