Commit 1279738
committed
fix(grind): handle dot notation on local variables in parameters
When a grind parameter like `n.triv` is given, where `n` is a local
variable and `triv` is a theorem that takes `n` as an argument (so
`n.triv` means `Nat.triv n`), grind was incorrectly rejecting it with
"redundant parameter" because it detected that the identifier resolved
to a local variable via `resolveLocalName`.
The fix checks if `resolveLocalName` returns field projections (non-empty
list), indicating dot notation. In that case, we process the parameter
as a term expression to let elaboration resolve the dot notation properly,
rather than trying to resolve it as a global constant name.
Fixes the issue where `grind [x.exp_pos]` was rejected even though
`x.exp_pos` elaborates to `Real.exp_pos x`, a valid theorem application.
🤖 Prepared with Claude Code1 parent 19e1fe5 commit 1279738
File tree
2 files changed
+17
-2
lines changed- src/Lean/Elab/Tactic/Grind
- tests/lean/run
2 files changed
+17
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
232 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
233 | 238 | | |
234 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
235 | 243 | | |
236 | 244 | | |
237 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
0 commit comments