[JS IR] Do not copy interface method if base class inherits it

^KT-58599 Fixed
This commit is contained in:
Alexander Korepanov
2023-05-30 08:22:43 +00:00
committed by Space Team
parent 9ca9fc9c68
commit 8066f1b7d2
54 changed files with 886 additions and 8 deletions
@@ -0,0 +1,2 @@
open class B : A<Int> {
}
@@ -0,0 +1,3 @@
open class B : A<Int> {
override fun test() = 1
}
@@ -0,0 +1,5 @@
open class B : A<Int> {
override fun test() = 1
override val testProp: Int = 3
}
@@ -0,0 +1,7 @@
open class B : A<Int> {
override fun test() = 1
override val testProp: Int = 3
override fun testWithDefault(x: Int) = x + 1
}
@@ -0,0 +1,9 @@
open class B : A<Int> {
override fun test() = 1
override val testProp: Int = 3
override fun testWithDefault(x: Int) = x + 1
override fun testGeneric(x: Int) = x + 1
}
@@ -0,0 +1,12 @@
interface A<T> {
fun test() = 0
val testProp: Int
get() = 2
fun testWithDefault(x: Int = 1) = x
fun testGeneric(x: T) = 1
fun unused() = 1
}
@@ -0,0 +1,12 @@
interface A<T> {
fun test() = 0
val testProp: Int
get() = 2
fun testWithDefault(x: Int) = x + 1
fun testGeneric(x: T) = 1
fun unused() = 1
}
@@ -0,0 +1,33 @@
STEP 0:
modifications:
U : InterfaceA.0.kt -> InterfaceA.kt
U : ClassB.0.kt -> ClassB.kt
added file: InterfaceA.kt, ClassB.kt
STEP 1:
modifications:
U : ClassB.1.kt -> ClassB.kt
modified ir: ClassB.kt
STEP 2:
modifications:
U : ClassB.2.kt -> ClassB.kt
modified ir: ClassB.kt
updated exports: ClassB.kt
STEP 3:
modifications:
U : ClassB.3.kt -> ClassB.kt
modified ir: ClassB.kt
STEP 4:
STEP 5:
modifications:
U : InterfaceA.5.kt -> InterfaceA.kt
modified ir: InterfaceA.kt
updated imports: ClassB.kt
STEP 6:
modifications:
U : ClassB.6.kt -> ClassB.kt
modified ir: ClassB.kt
STEP 7:
modifications:
U : ClassB.0.kt -> ClassB.kt
modified ir: ClassB.kt
updated exports: ClassB.kt