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
moduleBugopenFStar.Tactics.Typeclasses[@@fundeps[1]]classpts_to(ab:Type)={foo:a->b->bool;}typeboxa=|Bofx:ainstancepts_to_box(a:Type):pts_to(boxa)a={foo=(fun__->true);}lettest1(x:boxnat)=foox1lettest2(x:boxnat)=foo#_#_#(pts_to_box_)x1// forces the right instantiations
Above, test1 fails, since the unifier elaborated the body to foo #(box nat) #int #?d x 1, given the types of x and 1. However, the instance we want (and the only valid one) for ?d is pts_to_box nat, which means that the second implicit should be nat.
Given that that implicit is a functional dependency of the first, it would make sense to delay instantiating until we have solved the first one and ran a round of typeclass resolution. But, currently, the typechecker knows nothing at all about functional dependencies, it is just a check performed by tcresolve. Maybe we can add a tag to fundep set to prevent this, but probably the right thing is a closer interoperation between the typechecker/unifier and tactics like tcresolve.
Above,
test1
fails, since the unifier elaborated the body tofoo #(box nat) #int #?d x 1
, given the types ofx
and1
. However, the instance we want (and the only valid one) for?d
ispts_to_box nat
, which means that the second implicit should benat
.Given that that implicit is a functional dependency of the first, it would make sense to delay instantiating until we have solved the first one and ran a round of typeclass resolution. But, currently, the typechecker knows nothing at all about functional dependencies, it is just a check performed by tcresolve. Maybe we can add a tag to fundep set to prevent this, but probably the right thing is a closer interoperation between the typechecker/unifier and tactics like tcresolve.
Note that
@@unrefine
(#3406) does not help.The text was updated successfully, but these errors were encountered: