@@ -1568,7 +1568,7 @@ open class KotlinFileExtractor(
1568
1568
}
1569
1569
}
1570
1570
1571
- private fun findFunction (cls : IrClass , name : String ): IrFunction ? = cls.declarations.findSubType<IrDeclaration , IrFunction > { it.name.asString() == name }
1571
+ private fun findFunction (cls : IrClass , name : String ): IrFunction ? = cls.declarations.findSubType<IrFunction > { it.name.asString() == name }
1572
1572
1573
1573
val jvmIntrinsicsClass by lazy {
1574
1574
val result = pluginContext.referenceClass(FqName (" kotlin.jvm.internal.Intrinsics" ))?.owner
@@ -1625,7 +1625,7 @@ open class KotlinFileExtractor(
1625
1625
}
1626
1626
1627
1627
val stringValueOfObjectMethod by lazy {
1628
- val result = javaLangString?.declarations?.findSubType<IrDeclaration , IrFunction > {
1628
+ val result = javaLangString?.declarations?.findSubType<IrFunction > {
1629
1629
it.name.asString() == " valueOf" &&
1630
1630
it.valueParameters.size == 1 &&
1631
1631
it.valueParameters[0 ].type == pluginContext.irBuiltIns.anyNType
@@ -1637,7 +1637,7 @@ open class KotlinFileExtractor(
1637
1637
}
1638
1638
1639
1639
val objectCloneMethod by lazy {
1640
- val result = javaLangObject?.declarations?.findSubType<IrDeclaration , IrFunction > {
1640
+ val result = javaLangObject?.declarations?.findSubType<IrFunction > {
1641
1641
it.name.asString() == " clone"
1642
1642
}
1643
1643
if (result == null ) {
@@ -1653,7 +1653,7 @@ open class KotlinFileExtractor(
1653
1653
}
1654
1654
1655
1655
val kotlinNoWhenBranchMatchedConstructor by lazy {
1656
- val result = kotlinNoWhenBranchMatchedExn?.declarations?.findSubType<IrDeclaration , IrConstructor > {
1656
+ val result = kotlinNoWhenBranchMatchedExn?.declarations?.findSubType<IrConstructor > {
1657
1657
it.valueParameters.isEmpty()
1658
1658
}
1659
1659
if (result == null ) {
@@ -1775,7 +1775,7 @@ open class KotlinFileExtractor(
1775
1775
return
1776
1776
}
1777
1777
1778
- val func = ((c.getTypeArgument(0 ) as ? IrSimpleType )?.classifier?.owner as ? IrClass )?.declarations?.findSubType<IrDeclaration , IrFunction > { it.name.asString() == fnName }
1778
+ val func = ((c.getTypeArgument(0 ) as ? IrSimpleType )?.classifier?.owner as ? IrClass )?.declarations?.findSubType<IrFunction > { it.name.asString() == fnName }
1779
1779
if (func == null ) {
1780
1780
logger.errorElement(" Couldn't find function $fnName on enum type" , c)
1781
1781
return
@@ -2225,7 +2225,7 @@ open class KotlinFileExtractor(
2225
2225
logger.errorElement(" Argument to dataClassArrayMemberToString not a class" , c)
2226
2226
return
2227
2227
}
2228
- val realCallee = javaUtilArrays?.declarations?.findSubType<IrDeclaration , IrFunction > { decl ->
2228
+ val realCallee = javaUtilArrays?.declarations?.findSubType<IrFunction > { decl ->
2229
2229
decl.name.asString() == " toString" && decl.valueParameters.size == 1 &&
2230
2230
decl.valueParameters[0 ].type.classOrNull?.let { it == realArrayClass } == true
2231
2231
}
@@ -2252,7 +2252,7 @@ open class KotlinFileExtractor(
2252
2252
logger.errorElement(" Argument to dataClassArrayMemberHashCode not a class" , c)
2253
2253
return
2254
2254
}
2255
- val realCallee = javaUtilArrays?.declarations?.findSubType<IrDeclaration , IrFunction > { decl ->
2255
+ val realCallee = javaUtilArrays?.declarations?.findSubType<IrFunction > { decl ->
2256
2256
decl.name.asString() == " hashCode" && decl.valueParameters.size == 1 &&
2257
2257
decl.valueParameters[0 ].type.classOrNull?.let { it == realArrayClass } == true
2258
2258
}
@@ -4363,7 +4363,7 @@ open class KotlinFileExtractor(
4363
4363
return
4364
4364
}
4365
4365
4366
- val invokeMethod = functionType.classOrNull?.owner?.declarations?.findSubType<IrDeclaration , IrFunction > { it.name.asString() == OperatorNameConventions .INVOKE .asString()}
4366
+ val invokeMethod = functionType.classOrNull?.owner?.declarations?.findSubType<IrFunction > { it.name.asString() == OperatorNameConventions .INVOKE .asString()}
4367
4367
if (invokeMethod == null ) {
4368
4368
logger.errorElement(" Couldn't find `invoke` method on functional interface." , e)
4369
4369
return
@@ -4374,7 +4374,7 @@ open class KotlinFileExtractor(
4374
4374
logger.errorElement(" Expected to find SAM conversion to IrClass. Found '${typeOwner.javaClass} ' instead. Can't implement SAM interface." , e)
4375
4375
return
4376
4376
}
4377
- val samMember = typeOwner.declarations.findSubType<IrDeclaration , IrFunction > { it is IrOverridableMember && it.modality == Modality .ABSTRACT }
4377
+ val samMember = typeOwner.declarations.findSubType<IrFunction > { it is IrOverridableMember && it.modality == Modality .ABSTRACT }
4378
4378
if (samMember == null ) {
4379
4379
logger.errorElement(" Couldn't find SAM member in type '${typeOwner.kotlinFqName.asString()} '. Can't implement SAM interface." , e)
4380
4380
return
@@ -4563,7 +4563,7 @@ open class KotlinFileExtractor(
4563
4563
val superCallId = tw.getFreshIdLabel<DbSuperconstructorinvocationstmt >()
4564
4564
tw.writeStmts_superconstructorinvocationstmt(superCallId, constructorBlockId, 0 , ids.constructor )
4565
4565
4566
- val baseConstructor = baseClass.owner.declarations.findSubType<IrDeclaration , IrFunction > { it.symbol is IrConstructorSymbol }
4566
+ val baseConstructor = baseClass.owner.declarations.findSubType<IrFunction > { it.symbol is IrConstructorSymbol }
4567
4567
val baseConstructorId = useFunction<DbConstructor >(baseConstructor as IrFunction )
4568
4568
4569
4569
tw.writeHasLocation(superCallId, locId)
0 commit comments