@@ -332,7 +332,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
332
332
}
333
333
334
334
genLoadArguments(env, fun.symbol.info.paramTypes map toTypeKind)
335
- genInvokeDynamicLambda(NoSymbol , fun.symbol, env.size, functionalInterface)
335
+ generatedType = genInvokeDynamicLambda(NoSymbol , fun.symbol, env.size, functionalInterface)
336
336
337
337
case app @ Apply (_, _) =>
338
338
generatedType = genApply(app, expectedType)
@@ -1379,8 +1379,9 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
1379
1379
def genSynchronized (tree : Apply , expectedType : BType ): BType
1380
1380
def genLoadTry (tree : Try ): BType
1381
1381
1382
- def genInvokeDynamicLambda (ctor : Symbol , lambdaTarget : Symbol , environmentSize : Int , functionalInterface : Symbol ) {
1382
+ def genInvokeDynamicLambda (ctor : Symbol , lambdaTarget : Symbol , environmentSize : Int , functionalInterface : Symbol ): BType = {
1383
1383
debuglog(s " Using invokedynamic rather than `new ${ctor.owner}` " )
1384
+ val generatedType = classBTypeFromSymbol(functionalInterface)
1384
1385
val invokeStyle =
1385
1386
if (lambdaTarget.isStaticMember) asm.Opcodes .H_INVOKESTATIC
1386
1387
else if (lambdaTarget.isPrivate || lambdaTarget.isClassConstructor) asm.Opcodes .H_INVOKESPECIAL
@@ -1400,7 +1401,7 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
1400
1401
1401
1402
// Requires https://github.com/scala/scala-java8-compat on the runtime classpath
1402
1403
val returnUnit = lambdaTarget.info.resultType.typeSymbol == UnitClass
1403
- val functionalInterfaceDesc : String = classBTypeFromSymbol(functionalInterface) .descriptor
1404
+ val functionalInterfaceDesc : String = generatedType .descriptor
1404
1405
val desc = capturedParamsTypes.map(tpe => toTypeKind(tpe)).mkString((" (" ), " " , " )" ) + functionalInterfaceDesc
1405
1406
// TODO specialization
1406
1407
val constrainedType = new MethodBType (lambdaParamTypes.map(p => toTypeKind(p)), toTypeKind(lambdaTarget.tpe.resultType)).toASMType
@@ -1414,6 +1415,8 @@ trait BCodeBodyBuilder extends BCodeSkelBuilder {
1414
1415
// boostrap args
1415
1416
applyN, targetHandle, constrainedType
1416
1417
)
1418
+
1419
+ generatedType
1417
1420
}
1418
1421
}
1419
1422
val lambdaMetaFactoryBootstrapHandle =
0 commit comments