compiletime.testing.typeCheckErrors
doesn't report macro errors
#11825
Labels
compiletime.testing.typeCheckErrors
doesn't report macro errors
#11825
Compiler version
3.0.0-RC1
Minimized code
a.scala
:b.scala
:Output
typeCheckErrors
line printsList()
X.f
line fails to compile (as expected)Expectation
typeCheckErrors
should returnList("nope")
because that's the compilation error emitted byX.f
.Context
I came across this because I'm adding Scala 3 support to a Scala 2 library with macros. There are unit tests and ensure that the macros fail in certain cases and with Scala 2, it was enough to wrap the code in uTest's
compileError()
. It works fine for Scala 2 but when I try to run the shared tests against the Scala 3 code, uTest'scompileError()
reports failed-macro-calls as having no errors.Looking at how
compileError
in implemented in uTest 0.7.7 / Scala 3.0.0-RC1, it usestypeCheckErrors
. IftypeCheckErrors
isn't supposed to catch macro algorithms, then is there an alternative? There needs to be some kind of way because metaprogramming needs to be tested for all the same reasons that direct programming needs testing.The text was updated successfully, but these errors were encountered: