Internal error: `ligo compile storage`
Currently ligo compile storage infers the type t of storage expression e and then checks t is equal to the storage type of the selected entrypoint.
However, the typechecker can infer a type that is too general.
(* wat.mligo *)
type storage = (int, int) map
type parameter = unit
let main ((), s) : operation list * storage =
([], s)
ligo compile storage ./wat.mligo 'Map.empty'
File "src/passes/14-spilling/compiler.ml", line 179, characters 36-43
corner case: For all type uncaught
Sorry, we don't have a proper error message for this error. Please report this use case so we can improve on this.
This infers the type forall 'a 'b. ('a, 'b) map for the storage Map.empty resulting in the above internal error.
Solution: Before type-checking the storage expression e, fetch the expected storage type t and infer the type of the expression (e : t).