-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JS IR] Don't check an interface method default impl during JS transl…
…ation 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
- Loading branch information
1 parent
eaa61d2
commit c8a4ba1
Showing
20 changed files
with
281 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
js/js.tests/tests-gen/org/jetbrains/kotlin/incremental/InvalidationTestGenerated.java
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
7 changes: 7 additions & 0 deletions
7
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/ClassA.0.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
class ClassA : Interface { | ||
override var someVar: Int? | ||
get() = super.someVar | ||
set(value) { | ||
super.someVar = value | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/ClassA.8.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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() | ||
} |
9 changes: 9 additions & 0 deletions
9
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/ClassB.0.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class ClassB : Interface { | ||
override var someVar: Int? | ||
get() = super.someVar | ||
set(value) { | ||
super.someVar = value | ||
} | ||
|
||
val x = 1 | ||
} |
3 changes: 3 additions & 0 deletions
3
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/ClassB.3.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class ClassB : Interface { | ||
val x = 3 | ||
} |
6 changes: 6 additions & 0 deletions
6
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/ClassB.6.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
class ClassB : Interface { | ||
val x = 3 | ||
|
||
override val someValue: Int | ||
get() = super.someValue + 1 | ||
} |
8 changes: 8 additions & 0 deletions
8
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/ClassB.7.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
9 changes: 9 additions & 0 deletions
9
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/Interface.0.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
private var myProperty: Int? = null | ||
|
||
interface Interface { | ||
var someVar: Int? | ||
get() = myProperty | ||
set(value) { | ||
myProperty = value | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/Interface.2.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/Interface.4.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
38 changes: 38 additions & 0 deletions
38
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/lib1/module.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
7 changes: 7 additions & 0 deletions
7
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/main/m.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
fun box(stepId: Int): String { | ||
val x = test() | ||
if (x != stepId) { | ||
return "Fail: $x != $stepId" | ||
} | ||
return "OK" | ||
} |
39 changes: 39 additions & 0 deletions
39
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/main/module.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
STEP 0: | ||
dependencies: lib1 | ||
modifications: | ||
U : test.0.kt -> test.kt | ||
added file: m.kt, test.kt | ||
STEP 1: | ||
dependencies: lib1 | ||
modifications: | ||
U : test.1.kt -> test.kt | ||
modified ir: test.kt | ||
STEP 2: | ||
dependencies: lib1 | ||
STEP 3: | ||
dependencies: lib1 | ||
updated imports: test.kt | ||
STEP 4: | ||
dependencies: lib1 | ||
STEP 5: | ||
dependencies: lib1 | ||
modifications: | ||
U : test.5.kt -> test.kt | ||
modified ir: test.kt | ||
STEP 6: | ||
dependencies: lib1 | ||
STEP 7: | ||
dependencies: lib1 | ||
updated imports: test.kt | ||
STEP 8: | ||
dependencies: lib1 | ||
STEP 9: | ||
dependencies: lib1 | ||
modifications: | ||
U : test.9.kt -> test.kt | ||
modified ir: test.kt | ||
STEP 10: | ||
dependencies: lib1 | ||
modifications: | ||
U : test.10.kt -> test.kt | ||
modified ir: test.kt |
9 changes: 9 additions & 0 deletions
9
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/main/test.0.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
private fun testClassA(): Int { | ||
val a = ClassA() | ||
a.someVar = 0 | ||
return a.someVar!! | ||
} | ||
|
||
fun test(): Int { | ||
return testClassA() | ||
} |
17 changes: 17 additions & 0 deletions
17
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/main/test.1.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
private fun testClassA(): Int { | ||
val a = ClassA() | ||
a.someVar = 0 | ||
return a.someVar!! | ||
} | ||
|
||
private fun testClassB(): Int { | ||
val b = ClassB() | ||
b.someVar = b.x | ||
return b.someVar!! | ||
} | ||
|
||
fun test(): Int { | ||
val b = testClassB() | ||
val a = testClassA() | ||
return b + a | ||
} |
17 changes: 17 additions & 0 deletions
17
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/main/test.10.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
private fun testClassA(): Int { | ||
val a = ClassA() | ||
a.someVar = 0 | ||
return a.someVar!! + a.someFunction() + a.someValue | ||
} | ||
|
||
private fun testClassB(): Int { | ||
val b = ClassB() | ||
b.someVar = b.x | ||
return b.someVar!! + b.someFunction() | ||
} | ||
|
||
fun test(): Int { | ||
val b = testClassB() | ||
val a = testClassA() | ||
return b + a | ||
} |
17 changes: 17 additions & 0 deletions
17
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/main/test.5.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
private fun testClassA(): Int { | ||
val a = ClassA() | ||
a.someVar = 0 | ||
return a.someVar!! | ||
} | ||
|
||
private fun testClassB(): Int { | ||
val b = ClassB() | ||
b.someVar = b.x | ||
return b.someVar!! + b.someFunction() | ||
} | ||
|
||
fun test(): Int { | ||
val b = testClassB() | ||
val a = testClassA() | ||
return b + a | ||
} |
17 changes: 17 additions & 0 deletions
17
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/main/test.9.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
private fun testClassA(): Int { | ||
val a = ClassA() | ||
a.someVar = 0 | ||
return a.someVar!! + a.someFunction() | ||
} | ||
|
||
private fun testClassB(): Int { | ||
val b = ClassB() | ||
b.someVar = b.x | ||
return b.someVar!! + b.someFunction() | ||
} | ||
|
||
fun test(): Int { | ||
val b = testClassB() | ||
val a = testClassA() | ||
return b + a | ||
} |
23 changes: 23 additions & 0 deletions
23
js/js.translator/testData/incremental/invalidation/interfaceSuperUsage/project.info
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
MODULES: lib1, main | ||
|
||
STEP 0..3: | ||
libs: lib1, main | ||
dirty js: lib1, main | ||
STEP 4: | ||
libs: lib1, main | ||
dirty js: lib1 | ||
STEP 5: | ||
libs: lib1, main | ||
dirty js: lib1, main | ||
STEP 6: | ||
libs: lib1, main | ||
dirty js: lib1 | ||
STEP 7: | ||
libs: lib1, main | ||
dirty js: lib1, main | ||
STEP 8: | ||
libs: lib1, main | ||
dirty js: lib1 | ||
STEP 9..10: | ||
libs: lib1, main | ||
dirty js: lib1, main |