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
{{ message }}
Repository navigation
Nested dot notation results in a type error with type class instances #6400
In the following code, c.foo.x will result in an error like function expected at Class.foo term has type S. While adding a paren like (c.foo).x passes. To reproduce the issue, using instance variables like [c : Class] seems necessary, i.e., taking an instance as a regular argument (c : Class) works.
structureSwherex : Nat
classClasswheres : S
defClass.foo [c : Class] : S := c.s
-- Single dot worksexample [c : Class] : S := c.foo
-- Works with parenexample [c : Class] : Nat := (c.foo).x
/-function expected at Class.footerm has type S-/example [c : Class] : Nat := c.foo.x
Just for completeness, the issue also occurs with implicits:
inductiveXtheoremX.thm {x : X} : x = x ↔ x = x := sorry/--error: function expected at X.thmterm has type ?m.34 = ?m.34 ↔ ?m.34 = ?m.34-/
#guard_msgs inexample (x : X) :=
x.thm.mp
Activity
datokrat commentedon Mar 15, 2025
Just for completeness, the issue also occurs with implicits:
fix: nested field notation uses same rules
fix: have nested field notation use consistent rules (#7816)