CT exceptions are swallowed in typed macro argument
alaviss opened this issue · comments
Example
import macros
macro bar(x: typed): untyped =
x
bar:
static:
raise newException(CatchableError, "hi")
Actual Output
This is the only error in the chain, a higher errorMax
did not unveil any other errors.
test.nim(6, 1) Error: type mismatch: got <void>
but expected one of:
macro bar(x: typed): untyped
first type mismatch at position: 1
required type for x: typed
but expression '
static :
raise
(ref CatchableError)(name: "CatchableError", msg: "hi", parent: nil)' is of type:
expression: bar do:
static :
raise
(ref CatchableError)(name: "CatchableError", msg: "hi", parent: nil)
Expected Output
We want to see the exception to aid with debugging
stack trace: (most recent call last)
test.nim(8, 5) test
test.nim(8, 5) Error: unhandled exception: hi [CatchableError]
I tried to reproduce this locally, but wasn't able to anymore -- I believe #1124 also fixed this.