Closed
Description
Prerequisites
- Put an X between the brackets on this line if you have done all of the following:
- Checked that your issue isn't already filed.
- Reduced the issue to a self-contained, reproducible test case.
Description
autoParam
s defined for fields of a structure A
are sometimes lost in structures B
extending them (as far as I can tell, when A
is not the first structure B
inherits from).
Steps to Reproduce
class magma (α) where op : α → α → α
infix:70 " ⋆ " => magma.op (self := inferInstance)
class leftIdMagma (α) extends magma α where
identity : α
id_op (a : α) : identity ⋆ a = a := by intro; rfl
class rightIdMagma (α) extends magma α where
identity : α
op_id (a : α) : a ⋆ identity = a := by intro; rfl
class semigroup (α) extends magma α where
assoc (a b c : α) : (a ⋆ b) ⋆ c = a ⋆ (b ⋆ c) := by intro _ _ _; rfl
class idMagma (α) extends leftIdMagma α, rightIdMagma α
class monoid (α) extends idMagma α, semigroup α
def fnCompMonoid {base : Sort _} : monoid (base → base) :=
{ op := Function.comp, identity := id
-- , op_id := by intro; rfl
-- , assoc := by intros; rfl
}
Expected behavior: fnCompMonoid
is successfully defined with the op_id
and assoc
fields produced using the tactics specified for those fields.
Actual behavior: The op_id
and assoc
fields need to be specified as in the commented-out lines.
Reproduces how often: Only for fields inherited from a parent structure other than the first parent of a structure (as far as I can tell).
Versions
- 4th milestone release
- d13fac6
Additional Information
The above example worked in a nightly version from October 2021.
Metadata
Metadata
Assignees
Labels
No labels
Activity