[FIR2IR] Make all source sets friends for IrFakeOverrideBuilder
^KT-63644
This commit is contained in:
committed by
Space Team
parent
60d77fbb90
commit
8e047e6d8a
+6
@@ -35241,6 +35241,12 @@ public class LLFirBlackBoxCodegenBasedTestGenerated extends AbstractLLFirBlackBo
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaMethodWithTypeParameter.kt")
|
||||
public void testJavaMethodWithTypeParameter() throws Exception {
|
||||
|
||||
+6
@@ -35241,6 +35241,12 @@ public class LLFirReversedBlackBoxCodegenBasedTestGenerated extends AbstractLLFi
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaMethodWithTypeParameter.kt")
|
||||
public void testJavaMethodWithTypeParameter() throws Exception {
|
||||
|
||||
@@ -679,11 +679,21 @@ class Fir2IrConverter(
|
||||
}
|
||||
|
||||
// TODO: drop this function in favor of using [IrModuleDescriptor::shouldSeeInternalsOf] in FakeOverrideBuilder KT-61384
|
||||
private fun friendModulesMap(session: FirSession) = mapOf(
|
||||
session.moduleData.name.asStringStripSpecialMarkers() to session.moduleData.friendDependencies.map {
|
||||
it.name.asStringStripSpecialMarkers()
|
||||
private fun friendModulesMap(session: FirSession): Map<String, List<String>> {
|
||||
fun FirModuleData.friendsMapName() = name.asStringStripSpecialMarkers()
|
||||
fun FirModuleData.collectDependsOnRecursive(set: MutableSet<FirModuleData>) {
|
||||
if (!set.add(this)) return
|
||||
for (dep in dependsOnDependencies) {
|
||||
dep.collectDependsOnRecursive(set)
|
||||
}
|
||||
}
|
||||
)
|
||||
val moduleData = session.moduleData
|
||||
val dependsOnTransitive = buildSet {
|
||||
moduleData.collectDependsOnRecursive(this)
|
||||
}
|
||||
val friendNames = (moduleData.friendDependencies + dependsOnTransitive).map { it.friendsMapName() }
|
||||
return dependsOnTransitive.associate { it.friendsMapName() to friendNames }
|
||||
}
|
||||
|
||||
fun createIrModuleFragment(
|
||||
session: FirSession,
|
||||
|
||||
+6
@@ -34822,6 +34822,12 @@ public class FirLightTreeBlackBoxCodegenTestGenerated extends AbstractFirLightTr
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaMethodWithTypeParameter.kt")
|
||||
public void testJavaMethodWithTypeParameter() throws Exception {
|
||||
|
||||
+6
@@ -34822,6 +34822,12 @@ public class FirLightTreeBlackBoxCodegenWithIrFakeOverrideGeneratorTestGenerated
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaMethodWithTypeParameter.kt")
|
||||
public void testJavaMethodWithTypeParameter() throws Exception {
|
||||
|
||||
+6
@@ -34822,6 +34822,12 @@ public class FirPsiBlackBoxCodegenTestGenerated extends AbstractFirPsiBlackBoxCo
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("javaMethodWithTypeParameter.kt")
|
||||
public void testJavaMethodWithTypeParameter() throws Exception {
|
||||
|
||||
@@ -0,0 +1,198 @@
|
||||
FILE fqName:<root> fileName:/common.kt
|
||||
CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.A
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.A [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in kotlin.Any'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:A modality:OPEN visibility:public superTypes:[kotlin.Any]'
|
||||
FUN name:foo1 visibility:internal modality:OPEN <> ($this:<root>.A) returnType:kotlin.String
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='internal open fun foo1 (): kotlin.String declared in <root>.A'
|
||||
CONST String type=kotlin.String value="A::foo1"
|
||||
FUN name:foo2 visibility:internal modality:OPEN <> ($this:<root>.A) returnType:kotlin.String
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='internal open fun foo2 (): kotlin.String declared in <root>.A'
|
||||
CONST String type=kotlin.String value="A::foo2"
|
||||
FUN name:foo3 visibility:internal modality:OPEN <> ($this:<root>.A) returnType:kotlin.String
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='internal open fun foo3 (): kotlin.String declared in <root>.A'
|
||||
CONST String type=kotlin.String value="A::foo3"
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in kotlin.Any
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
CLASS CLASS name:C modality:OPEN visibility:public superTypes:[<root>.B]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.C
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.C [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.B'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:C modality:OPEN visibility:public superTypes:[<root>.B]'
|
||||
FUN name:foo1 visibility:internal modality:OPEN <> ($this:<root>.C) returnType:kotlin.String
|
||||
overridden:
|
||||
internal open fun foo1 (): kotlin.String declared in <root>.B
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.C
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='internal open fun foo1 (): kotlin.String declared in <root>.C'
|
||||
CONST String type=kotlin.String value="C::foo1"
|
||||
FUN FAKE_OVERRIDE name:foo2 visibility:internal modality:OPEN <> ($this:<root>.B) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
internal open fun foo2 (): kotlin.String declared in <root>.B
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.B
|
||||
FUN FAKE_OVERRIDE name:foo3 visibility:internal modality:OPEN <> ($this:<root>.A) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
internal open fun foo3 (): kotlin.String declared in <root>.B
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.B
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in <root>.B
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in <root>.B
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FILE fqName:<root> fileName:/main.kt
|
||||
CLASS CLASS name:B modality:OPEN visibility:public superTypes:[<root>.A]
|
||||
$this: VALUE_PARAMETER INSTANCE_RECEIVER name:<this> type:<root>.B
|
||||
CONSTRUCTOR visibility:public <> () returnType:<root>.B [primary]
|
||||
BLOCK_BODY
|
||||
DELEGATING_CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A'
|
||||
INSTANCE_INITIALIZER_CALL classDescriptor='CLASS CLASS name:B modality:OPEN visibility:public superTypes:[<root>.A]'
|
||||
FUN name:foo1 visibility:internal modality:OPEN <> ($this:<root>.B) returnType:kotlin.String
|
||||
overridden:
|
||||
internal open fun foo1 (): kotlin.String declared in <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.B
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='internal open fun foo1 (): kotlin.String declared in <root>.B'
|
||||
CONST String type=kotlin.String value="B::foo1"
|
||||
FUN name:foo2 visibility:internal modality:OPEN <> ($this:<root>.B) returnType:kotlin.String
|
||||
overridden:
|
||||
internal open fun foo2 (): kotlin.String declared in <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.B
|
||||
BLOCK_BODY
|
||||
RETURN type=kotlin.Nothing from='internal open fun foo2 (): kotlin.String declared in <root>.B'
|
||||
CONST String type=kotlin.String value="B::foo2"
|
||||
FUN FAKE_OVERRIDE name:foo3 visibility:internal modality:OPEN <> ($this:<root>.A) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
internal open fun foo3 (): kotlin.String declared in <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:<root>.A
|
||||
FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator]
|
||||
overridden:
|
||||
public open fun equals (other: kotlin.Any?): kotlin.Boolean declared in <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
VALUE_PARAMETER name:other index:0 type:kotlin.Any?
|
||||
FUN FAKE_OVERRIDE name:hashCode visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.Int [fake_override]
|
||||
overridden:
|
||||
public open fun hashCode (): kotlin.Int declared in <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN FAKE_OVERRIDE name:toString visibility:public modality:OPEN <> ($this:kotlin.Any) returnType:kotlin.String [fake_override]
|
||||
overridden:
|
||||
public open fun toString (): kotlin.String declared in <root>.A
|
||||
$this: VALUE_PARAMETER name:<this> type:kotlin.Any
|
||||
FUN name:box visibility:public modality:FINAL <> () returnType:kotlin.String
|
||||
BLOCK_BODY
|
||||
VAR name:a type:<root>.A [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.A' type=<root>.A origin=null
|
||||
VAR name:b type:<root>.A [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.B' type=<root>.B origin=null
|
||||
VAR name:c type:<root>.A [val]
|
||||
CONSTRUCTOR_CALL 'public constructor <init> () declared in <root>.C' type=<root>.C origin=null
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'internal open fun foo1 (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'val a: <root>.A declared in <root>.box' type=<root>.A origin=null
|
||||
arg1: CONST String type=kotlin.String value="A::foo1"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="Fail A.1"
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'internal open fun foo2 (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'val a: <root>.A declared in <root>.box' type=<root>.A origin=null
|
||||
arg1: CONST String type=kotlin.String value="A::foo2"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="Fail A.2"
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'internal open fun foo3 (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'val a: <root>.A declared in <root>.box' type=<root>.A origin=null
|
||||
arg1: CONST String type=kotlin.String value="A::foo3"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="Fail A.3"
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'internal open fun foo1 (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'val b: <root>.A declared in <root>.box' type=<root>.A origin=null
|
||||
arg1: CONST String type=kotlin.String value="B::foo1"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="Fail B.1"
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'internal open fun foo2 (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'val b: <root>.A declared in <root>.box' type=<root>.A origin=null
|
||||
arg1: CONST String type=kotlin.String value="B::foo2"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="Fail B.2"
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'internal open fun foo3 (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'val b: <root>.A declared in <root>.box' type=<root>.A origin=null
|
||||
arg1: CONST String type=kotlin.String value="A::foo3"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="Fail B.3"
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'internal open fun foo1 (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'val c: <root>.A declared in <root>.box' type=<root>.A origin=null
|
||||
arg1: CONST String type=kotlin.String value="C::foo1"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="Fail C.1"
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'internal open fun foo2 (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'val c: <root>.A declared in <root>.box' type=<root>.A origin=null
|
||||
arg1: CONST String type=kotlin.String value="B::foo2"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="Fail C.2"
|
||||
WHEN type=kotlin.Unit origin=IF
|
||||
BRANCH
|
||||
if: CALL 'public final fun not (): kotlin.Boolean declared in kotlin.Boolean' type=kotlin.Boolean origin=EXCLEQ
|
||||
$this: CALL 'public final fun EQEQ (arg0: kotlin.Any?, arg1: kotlin.Any?): kotlin.Boolean declared in kotlin.internal.ir' type=kotlin.Boolean origin=EXCLEQ
|
||||
arg0: CALL 'internal open fun foo3 (): kotlin.String declared in <root>.A' type=kotlin.String origin=null
|
||||
$this: GET_VAR 'val c: <root>.A declared in <root>.box' type=<root>.A origin=null
|
||||
arg1: CONST String type=kotlin.String value="A::foo3"
|
||||
then: RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="Fail C.3"
|
||||
RETURN type=kotlin.Nothing from='public final fun box (): kotlin.String declared in <root>'
|
||||
CONST String type=kotlin.String value="OK"
|
||||
@@ -0,0 +1,47 @@
|
||||
// LANGUAGE: +MultiPlatformProjects
|
||||
// IGNORE_BACKEND_K1: JVM, JVM_IR, JS, JS_IR, JS_IR_ES6, WASM
|
||||
// DUMP_IR
|
||||
|
||||
// MODULE: common
|
||||
// FILE: common.kt
|
||||
|
||||
open class A {
|
||||
internal open fun foo1() = "A::foo1"
|
||||
internal open fun foo2() = "A::foo2"
|
||||
internal open fun foo3() = "A::foo3"
|
||||
}
|
||||
|
||||
expect open class B() : A {
|
||||
internal override fun foo1(): String
|
||||
internal override fun foo2(): String
|
||||
}
|
||||
|
||||
open class C : B() {
|
||||
internal override fun foo1() = "C::foo1"
|
||||
}
|
||||
|
||||
|
||||
// MODULE: main()()(common)
|
||||
// FILE: main.kt
|
||||
|
||||
actual open class B actual constructor() : A() {
|
||||
internal actual override fun foo1() = "B::foo1"
|
||||
internal actual override fun foo2() = "B::foo2"
|
||||
}
|
||||
|
||||
|
||||
fun box() : String {
|
||||
val a: A = A()
|
||||
val b: A = B()
|
||||
val c: A = C()
|
||||
if (a.foo1() != "A::foo1") return "Fail A.1"
|
||||
if (a.foo2() != "A::foo2") return "Fail A.2"
|
||||
if (a.foo3() != "A::foo3") return "Fail A.3"
|
||||
if (b.foo1() != "B::foo1") return "Fail B.1"
|
||||
if (b.foo2() != "B::foo2") return "Fail B.2"
|
||||
if (b.foo3() != "A::foo3") return "Fail B.3"
|
||||
if (c.foo1() != "C::foo1") return "Fail C.1"
|
||||
if (c.foo2() != "B::foo2") return "Fail C.2"
|
||||
if (c.foo3() != "A::foo3") return "Fail C.3"
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -24436,6 +24436,12 @@ public class FirJsCodegenBoxTestGenerated extends AbstractFirJsCodegenBoxTest {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/multiplatform/k2/annotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
Generated
+6
@@ -24436,6 +24436,12 @@ public class FirJsES6CodegenBoxTestGenerated extends AbstractFirJsES6CodegenBoxT
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/multiplatform/k2/annotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -27690,6 +27690,12 @@ public class FirNativeCodegenBoxTestGenerated extends AbstractNativeCodegenBoxTe
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/multiplatform/k2/annotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
+6
@@ -28320,6 +28320,12 @@ public class FirNativeCodegenBoxTestNoPLGenerated extends AbstractNativeCodegenB
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/multiplatform/k2/annotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
Generated
+6
@@ -24406,6 +24406,12 @@ public class FirWasmCodegenBoxTestGenerated extends AbstractFirWasmCodegenBoxTes
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("internalOverride2.kt")
|
||||
public void testInternalOverride2() throws Exception {
|
||||
runTest("compiler/testData/codegen/box/multiplatform/k2/internalOverride2.kt");
|
||||
}
|
||||
|
||||
@Nested
|
||||
@TestMetadata("compiler/testData/codegen/box/multiplatform/k2/annotations")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
|
||||
Reference in New Issue
Block a user