fix: term macro errors should be fatal
This commit is contained in:
parent
a000ee4249
commit
64971a1e3c
3 changed files with 6 additions and 1 deletions
|
|
@ -1216,7 +1216,8 @@ private partial def elabTermAux (expectedType? : Option Expr) (catchExPostpone :
|
|||
withNestedTraces do
|
||||
let env ← getEnv
|
||||
match (← liftMacroM (expandMacroImpl? env stx)) with
|
||||
| some (decl, Except.ok stxNew) =>
|
||||
| some (decl, stxNew?) =>
|
||||
let stxNew ← liftMacroM <| liftExcept stxNew?
|
||||
withInfoContext' (mkInfo := mkTermInfo decl (expectedType? := expectedType?) stx) <|
|
||||
withMacroExpansion stx stxNew <|
|
||||
withRef stxNew <|
|
||||
|
|
|
|||
3
tests/lean/macroError.lean
Normal file
3
tests/lean/macroError.lean
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
macro "foo" : term => Lean.Macro.throwError "Test Error"
|
||||
|
||||
#check foo
|
||||
1
tests/lean/macroError.lean.expected.out
Normal file
1
tests/lean/macroError.lean.expected.out
Normal file
|
|
@ -0,0 +1 @@
|
|||
macroError.lean:3:7-3:10: error: Test Error
|
||||
Loading…
Add table
Reference in a new issue