[JS IR] Don't check an interface method default impl during JS translation

We do not need to check a default implementation of the interface during
 the translation to JS because it must be checked before.

 Moreover, this check breaks the produced JS code
 if IR is partial loaded, e.g. during the incremental rebuild.

^KT-55716 Fixed
This commit is contained in:
Alexander Korepanov
2023-01-02 16:47:07 +01:00
committed by Space Team
parent 155777e3fa
commit 5f10e605a9
20 changed files with 281 additions and 2 deletions
@@ -0,0 +1,7 @@
class ClassA : Interface {
override var someVar: Int?
get() = super.someVar
set(value) {
super.someVar = value
}
}
@@ -0,0 +1,12 @@
class ClassA : Interface {
override var someVar: Int?
get() = 1
set(value) {
super.someVar = value
}
override val someValue: Int
get() = super.someValue
override fun someFunction(): Int = super.someFunction()
}
@@ -0,0 +1,9 @@
class ClassB : Interface {
override var someVar: Int?
get() = super.someVar
set(value) {
super.someVar = value
}
val x = 1
}
@@ -0,0 +1,3 @@
class ClassB : Interface {
val x = 3
}
@@ -0,0 +1,6 @@
class ClassB : Interface {
val x = 3
override val someValue: Int
get() = super.someValue + 1
}
@@ -0,0 +1,8 @@
class ClassB : Interface {
val x = 3
override val someValue: Int
get() = super.someValue + 1
override fun someFunction(): Int = super.someFunction() + 1
}
@@ -0,0 +1,9 @@
private var myProperty: Int? = null
interface Interface {
var someVar: Int?
get() = myProperty
set(value) {
myProperty = value
}
}
@@ -0,0 +1,15 @@
private var myProperty: Int? = null
interface Interface {
var someVar: Int?
get() = myProperty?.let {
if (it == 1) {
it + 1
} else {
it
}
}
set(value) {
myProperty = value
}
}
@@ -0,0 +1,20 @@
private var myProperty: Int? = null
interface Interface {
var someVar: Int?
get() = myProperty?.let {
if (it == 1 || it == 3) {
it + 1
} else {
it
}
}
set(value) {
myProperty = value
}
val someValue: Int
get() = 1
fun someFunction(): Int = someValue
}
@@ -0,0 +1,38 @@
STEP 0:
modifications:
U : ClassA.0.kt -> ClassA.kt
U : ClassB.0.kt -> ClassB.kt
U : Interface.0.kt -> Interface.kt
added file: ClassA.kt, ClassB.kt, Interface.kt
STEP 1:
updated exports: ClassB.kt
STEP 2:
modifications:
U : Interface.2.kt -> Interface.kt
modified ir: Interface.kt
STEP 3:
modifications:
U : ClassB.3.kt -> ClassB.kt
modified ir: ClassB.kt
updated exports: ClassB.kt
STEP 4:
modifications:
U : Interface.4.kt -> Interface.kt
modified ir: Interface.kt
STEP 5:
updated exports: Interface.kt, ClassB.kt
STEP 6:
modifications:
U : ClassB.6.kt -> ClassB.kt
modified ir: ClassB.kt
updated exports: Interface.kt
STEP 7:
modifications:
U : ClassB.7.kt -> ClassB.kt
modified ir: ClassB.kt
STEP 8:
modifications:
U : ClassA.8.kt -> ClassA.kt
modified ir: ClassA.kt
STEP 9..10:
updated exports: ClassA.kt