This PR changes the elaboration of the `structure`/`class` commands so that default values have later fields in context as well. This allows field defaults to depend on fields that come both before and after them. While this was already the case for inherited fields to some degree, it now applies uniformly to all fields. Additionally, when elaborating the default value for a field, all fields that depend on it are cleared from the context to avoid situations where the default value depends on itself. This addresses an issue reported by Aaron Liu [on Zulip](https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/default.20structure.20values.20can.20depend.20on.20themselves/near/578014370).
4 lines
182 B
Text
4 lines
182 B
Text
mvarAtDefaultValue.lean:5:7-5:8: error: Failed to infer default value for field `x`
|
|
mvarAtDefaultValue.lean:8:7-8:8: error: don't know how to synthesize placeholder
|
|
context:
|
|
⊢ Nat
|