FIR2IR: Fix inheritance case from built-in interface with default methods
This commit is contained in:
@@ -447,6 +447,12 @@ class Fir2IrDeclarationStorage(
|
||||
isLambda -> IrDeclarationOrigin.LOCAL_FUNCTION_FOR_LAMBDA
|
||||
function.symbol.callableId.isKFunctionInvoke() -> IrDeclarationOrigin.FAKE_OVERRIDE
|
||||
simpleFunction?.isStatic == true && simpleFunction.name in ENUM_SYNTHETIC_NAMES -> IrDeclarationOrigin.ENUM_CLASS_SPECIAL_MEMBER
|
||||
|
||||
// Kotlin built-in class and Java originated method (Collection.forEach, etc.)
|
||||
// It's necessary to understand that such methods do not belong to DefaultImpls but actually generated as default
|
||||
// See org.jetbrains.kotlin.backend.jvm.lower.InheritedDefaultMethodsOnClassesLoweringKt.isDefinitelyNotDefaultImplsMethod
|
||||
(irParent as? IrClass)?.origin == IrDeclarationOrigin.IR_EXTERNAL_DECLARATION_STUB &&
|
||||
function.origin == FirDeclarationOrigin.Enhancement -> IrDeclarationOrigin.IR_EXTERNAL_JAVA_DECLARATION_STUB
|
||||
else -> origin
|
||||
}
|
||||
classifierStorage.preCacheTypeParameters(function)
|
||||
|
||||
+6
@@ -22137,6 +22137,12 @@ public class FirBlackBoxCodegenTestGenerated extends AbstractFirBlackBoxCodegenT
|
||||
runTest("compiler/testData/codegen/box/jvm8/defaults/bridgeWithJava.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("builtInsInherited.kt")
|
||||
public void testBuiltInsInherited() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/jvm8/defaults/builtInsInherited.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("callableReference.kt")
|
||||
public void testCallableReference() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user