Skip to content

Commit

Permalink
fix: auto/option params should not break sorry (#4132)
Browse files Browse the repository at this point in the history
closes #2649
  • Loading branch information
leodemoura committed May 11, 2024
1 parent 147aeae commit 7db8e64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Lean/Elab/BuiltinNotation.lean
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private def elabTParserMacroAux (prec lhsPrec e : Term) : TermElabM Syntax := do
| _ => Macro.throwUnsupported

@[builtin_term_elab «sorry»] def elabSorry : TermElab := fun stx expectedType? => do
let stxNew ← `(sorryAx _ false)
let stxNew ← `(@sorryAx _ false) -- Remark: we use `@` to ensure `sorryAx` will not consume auot params
withMacroExpansion stx stxNew <| elabTerm stxNew expectedType?

/-- Return syntax `Prod.mk elems[0] (Prod.mk elems[1] ... (Prod.mk elems[elems.size - 2] elems[elems.size - 1])))` -/
Expand Down
3 changes: 3 additions & 0 deletions tests/lean/run/2649.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def foo1 : (_ : Nat := 0) → Nat := sorry

def foo2 : (_ : Nat := by exact 0) → Nat := sorry

0 comments on commit 7db8e64

Please sign in to comment.