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
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
Prerequisites
Please put an X between the brackets as you perform the following steps:
https://github.com/leanprover/lean4/issues
Avoid dependencies to Mathlib or Batteries.
https://live.lean-lang.org/#project=lean-nightly
(You can also use the settings there to switch to “Lean nightly”)
Description
In the following code,
c.foo.x
will result in an error likefunction 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.Context
This issue is also discussed in Zulip.
Steps to Reproduce
Expected behavior: All examples should pass type check.
Actual behavior:
c.foo.x
fails with a type error.Versions
Lean 4.16.0-nightly-2024-12-16
Impact
Add 👍 to issues you consider important. If others are impacted by this issue, please ask them to add 👍 to it.
The text was updated successfully, but these errors were encountered: