Illegal Array type in inline macros can cause crashes with -Ycheck #22034
Labels
area:metaprogramming:other
Issues tied to metaprogramming/macros not covered by the other labels.
itype:bug
Compiler version
any
Minimized code
Macro_1.scala:
Test_2.scala
Output
Expectation
No crash. Instead, an error message from -Xcheck-macros or -Ycheck:all. The issue here lies with an incorrect macro implementation causing the generated code to have a parameterless Array in an illegal spot. If this was a transparent inline macro, this would be caught and reported by a
PostTyper
check. Perhaps the best fix here is implementing a similar -Xcheck-macros check, however it in my opinion should be limited to just checking a correct Array construction. Otherwise it could cause regressions in the ecosystem (as far I could see, other parameterless type constructors will not cause crashes like this anyway).The text was updated successfully, but these errors were encountered: