You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This fails, the typer tries to unify t_int and undefined:
module n
type opt 'a = Some 'a | None
type u = U opt int
let f () = U Some 1
This also fails with the same basic unification error:
module m
export_type t
type t 'a = T 'a
module n
type u 'a = U m.t 'a
let f () = U m.T 1
I haven't dug in too deeply yet but I expect what's happening is that when we do:
type option 'a = Some 'a | None
type something_else = option int
The parser has no idea that int is supposed to be assigned to a variable 'a (or any variable, for that matter) and so trying to get that variable from the vars proplist in an #adt{} yields undefined.
I think the fix might be pretty simple: when we look through the parameters given for a type that's a member of another type, we just manufacture a new type variable for each type expression that isn't already a type var.
The text was updated successfully, but these errors were encountered:
This fails, the typer tries to unify
t_int
andundefined
:This also fails with the same basic unification error:
I haven't dug in too deeply yet but I expect what's happening is that when we do:
The parser has no idea that
int
is supposed to be assigned to a variable'a
(or any variable, for that matter) and so trying to get that variable from the vars proplist in an#adt{}
yieldsundefined
.I think the fix might be pretty simple: when we look through the parameters given for a type that's a member of another type, we just manufacture a new type variable for each type expression that isn't already a type var.
The text was updated successfully, but these errors were encountered: