Open msprotz opened 4 years ago
This is because we generate roughly the following for the footprint
method:
let footprint' = fun (index:Type0) (#[tcresolve ()] d : block index) -> d.footprint
And it seems F* attempts to instantiate the implicit for d.footprint
(the #i:index
) eagerly. Adding an annotation would fix this, but the dependency makes it awkward. The underlying issue is this, I think:
assume val f : unit -> #i:int -> int
let g = f
let h () = f ()
g
succeeds but h
fails with Failed to resolve implicit argument ?3 of type int introduced for Instantiation of implicit argument
. Possibly related to #1965.
EDIT: nevermind, that was stupid since then your typeclass is useless. I'm looking at fixing the instantiation code for this.
This should now be fixed in master, I did add the annotation for the methods since it wasn't as hard as I thought. Keeping this open since I think the instantiation behaviour is wrong (and I have some work on that too, but it'll probably take a while).
Trying to use typeclasses a little... here is my minimal repro:
trying to process this in the interactive mode gives me:
am I misusing the type class feature?
Thanks,
Jonathan