Skip to content

[CameLIGO] Error when type variable is bound in both `let` & `fun`

For a file like

let foo (type a) : a list -> a list = 
   fun (type b) (xs : b list) : b list -> xs   

AST core

$ ligo.60 print ast-core x.mligo 
const foo : ∀ a : * . list (a) -> list (a) =
  Λ a ->  fun ( xs : list (b)) : list (b) -> xs

Alistair messages in slack that the abstraction should be

let foo = /\ a -> (/\ b -> fun (xs : b list) : b list -> xs : a list -> a list)