This PR implements the main logic for inheriting and overriding autoParam fields in the `structure`/`class` commands, pending being enabled in the structure instance notation elaborator. Adds term info to overridden fields, so they now can be hovered over, and "go to definition" goes to the structure the field is originally defined in. Implementation notes: - The inherited autoParams are all recorded in the flat constructor. Defined/overridden autoParam auxiliary tactic declarations now have names of the form `StructName.fieldName._autoParam` - The field `StructureFieldInfo.autoParam?` is soon to be deprecated. The elaborator is still setting it for now, since the structure instance notation elaborator is still using it.
25 lines
539 B
Text
25 lines
539 B
Text
structure FooS where
|
|
x : Nat
|
|
y : Nat
|
|
h : x = y := by rfl
|
|
|
|
/-- info: constructor FooS.mk : (x y : Nat) → autoParam (x = y) FooS.h._autoParam → FooS -/
|
|
#guard_msgs in
|
|
#print FooS.mk
|
|
|
|
def f1 (x : Nat) : FooS :=
|
|
{ x := x, y := x }
|
|
|
|
structure BooS where
|
|
x : Nat
|
|
y : Nat
|
|
h (aux1 : True) (aux2 : x > 2) : x = y := by { intros; rfl }
|
|
|
|
/--
|
|
info: constructor BooS.mk : (x y : Nat) → autoParam (True → x > 2 → x = y) BooS.h._autoParam → BooS
|
|
-/
|
|
#guard_msgs in
|
|
#print BooS.mk
|
|
|
|
def f2 (x : Nat) : BooS :=
|
|
{ x := x, y := x }
|