Do not map this when remapping parameters of static function inside
inline lambda. #KT-23543 Fixed
This commit is contained in:
+5
-1
@@ -380,7 +380,11 @@ class AnonymousObjectTransformer(
|
||||
}
|
||||
|
||||
private fun getMethodParametersWithCaptured(capturedBuilder: ParametersBuilder, sourceNode: MethodNode): Parameters {
|
||||
val builder = ParametersBuilder.initializeBuilderFrom(oldObjectType, sourceNode.desc)
|
||||
val builder = ParametersBuilder.initializeBuilderFrom(
|
||||
oldObjectType,
|
||||
sourceNode.desc,
|
||||
isStatic = sourceNode.access and Opcodes.ACC_STATIC != 0
|
||||
)
|
||||
for (param in capturedBuilder.listCaptured()) {
|
||||
builder.addCapturedParamCopy(param)
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@@ -110,10 +110,10 @@ class ParametersBuilder private constructor() {
|
||||
@JvmOverloads
|
||||
@JvmStatic
|
||||
fun initializeBuilderFrom(
|
||||
objectType: Type, descriptor: String, inlineLambda: LambdaInfo? = null
|
||||
objectType: Type, descriptor: String, inlineLambda: LambdaInfo? = null, isStatic: Boolean = false
|
||||
): ParametersBuilder {
|
||||
val builder = newBuilder()
|
||||
if (inlineLambda?.hasDispatchReceiver != false) {
|
||||
if (inlineLambda?.hasDispatchReceiver != false && !isStatic) {
|
||||
//skipped this for inlined lambda cause it will be removed
|
||||
builder.addThis(objectType, inlineLambda != null).lambda = inlineLambda
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user