Skip to content

Commit

Permalink
fix: declareSimpLikeTactic macro to use mkSynthetic (#5838)
Browse files Browse the repository at this point in the history
this fixes #5597
  • Loading branch information
nomeata authored Oct 30, 2024
1 parent ac80e26 commit 0d12618
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Init/Meta.lean
Original file line number Diff line number Diff line change
Expand Up @@ -1435,8 +1435,9 @@ macro (name := declareSimpLikeTactic) doc?:(docComment)?
| _ => `(config| (config := $updateCfg {}))
let s := s.setKind $kind
let s := s.setArg 0 (mkAtomFrom s[0] $tkn (canonical := true))
let r := s.setArg 1 (mkNullNode #[c])
return r)
let s := s.setArg 1 (mkNullNode #[c])
let s := s.mkSynthetic
return s)

/-- `simp!` is shorthand for `simp` with `autoUnfold := true`.
This will rewrite with all equation lemmas, which can be used to
Expand Down
3 changes: 3 additions & 0 deletions tests/lean/interactive/issue5597.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
example : True := by
simp!
--^ textDocument/hover
8 changes: 8 additions & 0 deletions tests/lean/interactive/issue5597.lean.expected.out
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{"textDocument": {"uri": "file:///issue5597.lean"},
"position": {"line": 1, "character": 3}}
{"range":
{"start": {"line": 1, "character": 2}, "end": {"line": 1, "character": 7}},
"contents":
{"value":
"`simp!` is shorthand for `simp` with `autoUnfold := true`.\nThis will rewrite with all equation lemmas, which can be used to\npartially evaluate many definitions. ",
"kind": "markdown"}}

0 comments on commit 0d12618

Please sign in to comment.