FStar icon indicating copy to clipboard operation
FStar copied to clipboard

`tcresolve`: cannot infer in presence of universe variables

Open W95Psp opened this issue 1 year ago • 0 comments

In the presence of universe variables, tcresolve doesn't work. Consider the following module:

module Bug

class foo (t: Type0): Type = { u: Type }
// or this explicit version, same issue:
// class foo (t: Type0): Type u#(max 1 (n+1)) = { u: Type u#n }

let works {| foo u#m 't |}: foo u#m 't = _ by (FStar.Tactics.Typeclasses.tcresolve ())
[@expect_failure]
let fails {| foo 't |}: foo 't = _ by (FStar.Tactics.Typeclasses.tcresolve ())

The uvars of the top-level fails are basically infered as:

let fails {| foo u#n 't |}: foo u#m 't = _ by (FStar.Tactics.Typeclasses.tcresolve ())

Thus the goal is impossible to fill.

W95Psp avatar Apr 24 '24 10:04 W95Psp