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, I’d expect { m with a := id } to work, but the elaboration falls over copying the other field over.
structureMethodswherea : Int → Int
b : Nat → (opt : Nat := 42) → Nat
/--error: type mismatch fun a => m.b ahas type Nat → Nat : Typebut is expected to have type Nat → optParam Nat 42 → Nat : Type-/
#guard_msgs indeff (m : Methods) : Methods := { m with a := id }
/--error: type mismatch fun a => m.b ahas type Nat → Nat : Typebut is expected to have type Nat → optParam Nat 42 → Nat : Type-/
#guard_msgs indefg (m : Methods) : Methods := { m with a := id, b := m.b }
defh (m : Methods) : Methods := { m with a := id, b := @Methods.b m }
Now one can write `@x.f`, `@(x).f`, `@x.1`, `@(x).1`, and so on.
This fixes an issue where structure instance update notation (like `{x with a := a'}`) could fail if the field `a` had a type with implicit, optional, or auto parameters.
Closesleanprover#5406.
Now one can write `@x.f`, `@(x).f`, `@x.1`, `@(x).1`, and so on.
This fixes an issue where structure instance update notation (like `{x
with a := a'}`) could fail if the field `a` had a type with implicit,
optional, or auto parameters.
Closes#5406
Description
In the following code, I’d expect
{ m with a := id }
to work, but the elaboration falls over copying the other field over.Maybe related to #5397?
Versions
4.12.0-nightly-2024-09-19
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: