Skip to content

Commit 802a93b

Browse files
committed
Force loading LambdaMetaFactory.
Common interface with scalac tries not to load it it wasn't loaded already. We need it.
1 parent 0c1797a commit 802a93b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/dotty/tools/backend/jvm/DottyBackendInterface.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ class DottyBackendInterface()(implicit ctx: Context) extends BackendInterface{
103103
val BoxesRunTimeModule = ctx.requiredModule("scala.runtime.BoxesRunTime")
104104
val BoxesRunTimeClass = toDenot(BoxesRunTimeModule).moduleClass.asClass
105105

106+
// require LambdaMetafactory: scalac uses getClassIfDefined, but we need those always.
107+
override lazy val LambdaMetaFactory = ctx.requiredClass("java.lang.invoke.LambdaMetafactory")
108+
override lazy val MethodHandle = ctx.requiredClass("java.lang.invoke.MethodHandle")
109+
106110
val nme_valueOf: Name = StdNames.nme.valueOf
107111
val nme_apply = StdNames.nme.apply
108112
val NothingClass: Symbol = defn.NothingClass

0 commit comments

Comments
 (0)