Closed
Description
The typeCheckErrors
when used inside another definition does not trap the error messages.
Affects munit.
Compiler version
v3.0.0 (also tested on nightly)
Minimized code
transparent inline def expectCompileError(
inline code: String,
expectedMsg: String
) =
val errors = compiletime.testing.typeCheckErrors(code)
assert(errors.head.message == expectedMsg)
expectCompileError("""compiletime.error("some error")""", "some error")
Output
error: some error
Expectation
No compilation error (the error should be trapped)