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
The type test is polymorphic in one universe (the universe of the type argument to field. As a result, the declaration val foo is also polymorphic in that universe. However, the let binding is not -- it instantiates that universe explicitly with u#0, the universe of unit. And so, F* gives an error. This happens because F* generalizes the universe of val independently of the let (see #604).
A workaround is to just work with let bindings:
noeq type test = {
field : a:Type -> a -> a
}
let foo (t:test) = t.field unit ()
But if that's not possible (e.g. when you are writing val foo in an .fsti file), you can instantiate the universe for test explicitly, like:
noeq type test = {
field : a:Type -> a -> a
}
val foo : test u#0 -> unit
let foo t = t.field unit ()
I am closing this issue since #604 covers it already, please let us know if you face more issues. Thanks!
Here is the code snippet
I got
Expected expression of type "Type"; got expression [...] of type "Prims.eqtype"
The text was updated successfully, but these errors were encountered: