JVM: Only produce inline SAM wrappers in public inline scope
This commit is contained in:
committed by
Alexander Udalov
parent
50bbf4f269
commit
c9b0cc5b32
@@ -38,8 +38,7 @@ class SamWrapperClasses(private val state: GenerationState) {
|
||||
contextDescriptor: CallableMemberDescriptor
|
||||
): Type {
|
||||
val parentContext = expressionCodegen.context
|
||||
val isInsideInline = InlineUtil.isInlineOrContainingInline(parentContext.contextDescriptor) ||
|
||||
isInsideInlineLambdaContext(parentContext, state)
|
||||
val isInsideInline = InlineUtil.isInPublicInlineScope(parentContext.contextDescriptor)
|
||||
return samInterfaceToWrapperClass.getOrPut(WrapperKey(samType, file, isInsideInline)) {
|
||||
SamWrapperCodegen(state, samType, expressionCodegen.parentCodegen, parentContext, isInsideInline)
|
||||
.genWrapper(file, contextDescriptor)
|
||||
|
||||
@@ -224,7 +224,7 @@ internal fun isSamWrapperConstructorCall(internalName: String, methodName: Strin
|
||||
isConstructor(methodName) && isSamWrapper(internalName)
|
||||
|
||||
internal fun isAnonymousClass(internalName: String) =
|
||||
!isSamWrapper(internalName) &&
|
||||
!internalName.contains("\$sam\$") &&
|
||||
internalName.substringAfterLast('/').substringAfterLast("$", "").isInteger()
|
||||
|
||||
fun wrapWithMaxLocalCalc(methodNode: MethodNode) =
|
||||
|
||||
Reference in New Issue
Block a user