Skip to content

Commit

Permalink
fix: handle AttributeKinds in LabelAttributes correctly (#3698)
Browse files Browse the repository at this point in the history
This PR propagates the `AttributeKind` to `SimpleScopedEnvExtension.add`
in attributes created with `register_label_attr`.

This also fixes a nearby stale docstring which referenced `Std`.

---

Closes #3697
  • Loading branch information
thorimur authored Aug 29, 2024
1 parent bdbadbd commit 869e42b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Lean/LabelAttribute.lean
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ registerBuiltinAttribute {
name := attrName
descr := attrDescr
applicationTime := AttributeApplicationTime.afterCompilation
add := fun declName _ _ =>
ext.add declName
add := fun declName _ kind =>
ext.add declName kind
erase := fun declName => do
let s := ext.getState (← getEnv)
modifyEnv fun env => ext.modifyState env fun _ => s.erase declName
Expand All @@ -74,7 +74,7 @@ def registerLabelAttr (attrName : Name) (attrDescr : String)

/--
Initialize a new "label" attribute.
Declarations tagged with the attribute can be retrieved using `Std.Tactic.LabelAttr.labelled`.
Declarations tagged with the attribute can be retrieved using `Lean.labelled`.
-/
macro (name := _root_.Lean.Parser.Command.registerLabelAttr)
doc:(docComment)? "register_label_attr " id:ident : command => do
Expand Down

0 comments on commit 869e42b

Please sign in to comment.