Open OndrejSpanel opened 7 months ago
Repro at https://github.com/OndrejSpanel/Scala3KeyNotFound
Uses airframe-surface library, crashes both with 3.3.1 and 3.4.1-RC1-bin-20240130-7a5cb6e-NIGHTLY
The code itself is:
import wvlet.airframe.surface.*
class InjectScript(x: Seq[MethodSurface])
class XParams[+T](params: Map[String, T])
object InjectScript {
trait Params {
def getParams: XParams[Unit]
}
class ScriptX extends InjectScript(Surface.methodsOf[Params])
}
When I add -Xcheck-macros
, an assertion is displayed:
java.lang.AssertionError: assertion failed: Tree had an unexpected owner for method $anonfun Expected: val s001 (InjectScript$.ScriptX.$$s001) |But was: val macro (InjectScript$.ScriptX._$macro)
Compiler version
3.4.1-RC1-bin-20240130-7a5cb6e-NIGHTLY
Minimized code
This came up when verifying fix for #19560 (#19567).
The code compiles and works with Scala 2.13.
I am unable to provide a minimized repro at least until Feb 5, having limited computer access until then.
This time there is a least some symbol listed, therefore I might be able to create a proper repro later. There are macros (airframe-surface) involved in the class code, but the error message is a crash, does not provide any pointers to any macros or source locations.
The code contains something like:
and
Output (click arrow to expand)