unison icon indicating copy to clipboard operation
unison copied to clipboard

fails to typecheck with inferred type

Open stew opened this issue 1 year ago • 0 comments

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.

stew avatar Jun 11 '24 20:06 stew