You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt
+9-5Lines changed: 9 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -3709,7 +3709,7 @@ open class KotlinFileExtractor(
3709
3709
constructorBlock = tw.getFreshIdLabel()
3710
3710
)
3711
3711
3712
-
val declarationParent = declarationStack.peekAsDeclarationParent()
3712
+
val declarationParent = declarationStack.peekAsDeclarationParent(propertyReferenceExpr) ?:return
3713
3713
val prefix =if (kPropertyClass.owner.name.asString().startsWith("KMutableProperty")) "Mutable"else""
3714
3714
val baseClass = pluginContext.referenceClass(FqName("kotlin.jvm.internal.${prefix}PropertyReference${kPropertyType.arguments.size -1}"))?.owner?.typeWith()
3715
3715
?: pluginContext.irBuiltIns.anyType
@@ -3916,7 +3916,7 @@ open class KotlinFileExtractor(
3916
3916
if (fnInterfaceType ==null) {
3917
3917
logger.warnElement("Cannot find functional interface type for function reference", functionReferenceExpr)
3918
3918
} else {
3919
-
val declarationParent = declarationStack.peekAsDeclarationParent()
3919
+
val declarationParent = declarationStack.peekAsDeclarationParent(functionReferenceExpr) ?:return
3920
3920
// `FunctionReference` base class is required, because that's implementing `KFunction`.
3921
3921
val baseClass = pluginContext.referenceClass(FqName("kotlin.jvm.internal.FunctionReference"))?.owner?.typeWith()
3922
3922
?: pluginContext.irBuiltIns.anyType
@@ -4525,7 +4525,7 @@ open class KotlinFileExtractor(
4525
4525
val locId = tw.getLocation(e)
4526
4526
val helper =GeneratedClassHelper(locId, ids)
4527
4527
4528
-
val declarationParent = declarationStack.peekAsDeclarationParent()
4528
+
val declarationParent = declarationStack.peekAsDeclarationParent(e) ?:return
4529
4529
val classId = extractGeneratedClass(ids, listOf(pluginContext.irBuiltIns.anyType, e.typeOperand), locId, e, declarationParent)
4530
4530
4531
4531
// add field
@@ -4747,14 +4747,18 @@ open class KotlinFileExtractor(
0 commit comments