[JS IR] Support a module friendship in IC infrastructure

^KT-55097 Fixed
This commit is contained in:
Alexander Korepanov
2022-11-22 14:23:28 +01:00
committed by Space Team
parent 76e629340f
commit c31705240a
22 changed files with 240 additions and 12 deletions
@@ -0,0 +1,5 @@
open class PublicClass {
internal fun foo(): Int = 0
internal val bar: Int = 1
open internal fun baz(): Int = 2
}
@@ -0,0 +1,5 @@
open class PublicClass {
internal fun foo(): Int = 1
internal val bar: Int = 1
open internal fun baz(): Int = 3
}
@@ -0,0 +1,8 @@
open class PublicClass {
internal fun foo(): Int = 2
internal val bar: Int = 1
open internal fun baz(): Int = 3
inline internal fun foo_inline(): Int = 1
inline internal val bar_inline: Int get() = 1
}
@@ -0,0 +1,8 @@
open class PublicClass {
internal fun foo(): Int = 2
internal val bar: Int = 1
open internal fun baz(): Int = 3
inline internal fun foo_inline(): Int = 1
inline internal val bar_inline: Int get() = 2
}
@@ -0,0 +1,8 @@
open class PublicClass {
internal fun foo(): Int = 2
internal val bar: Int = 1
open internal fun baz(): Int = 3
inline internal fun foo_inline(): Int = 2
inline internal val bar_inline: Int get() = 2
}
@@ -0,0 +1,8 @@
open class PublicClass {
internal fun foo(): Int = 2
internal val bar: Int = 2
open internal fun baz(): Int = 3
inline internal fun foo_inline(): Int = 3
inline internal val bar_inline: Int get() = 2
}
@@ -0,0 +1,8 @@
open class PublicClass {
internal fun foo(): Int = 3
internal val bar: Int = 2
open internal fun baz(): Int = 3
inline internal fun foo_inline(): Int = 3
inline internal val bar_inline: Int get() = 3
}
@@ -0,0 +1,32 @@
STEP 0:
modifications:
U : l1.0.kt -> l1.kt
added file: l1.kt
STEP 1:
modifications:
U : l1.1.kt -> l1.kt
modified ir: l1.kt
STEP 2:
modifications:
U : l1.2.kt -> l1.kt
modified ir: l1.kt
STEP 3:
updated exports: l1.kt
STEP 4:
STEP 5:
modifications:
U : l1.5.kt -> l1.kt
modified ir: l1.kt
STEP 6:
modifications:
U : l1.6.kt -> l1.kt
modified ir: l1.kt
STEP 7:
STEP 8:
modifications:
U : l1.8.kt -> l1.kt
modified ir: l1.kt
STEP 9:
modifications:
U : l1.9.kt -> l1.kt
modified ir: l1.kt
@@ -0,0 +1,7 @@
fun box(stepId: Int): String {
val x = test()
if (x != stepId) {
return "Fail: $x != $stepId"
}
return "OK"
}
@@ -0,0 +1,42 @@
STEP 0:
dependencies: lib1
friends: lib1
modifications:
U : publicClass.0.kt -> publicClass.kt
U : test.0.kt -> test.kt
added file: m.kt, test.kt, publicClass.kt
STEP 1:
dependencies: lib1
friends: lib1
STEP 2:
dependencies: lib1
friends: lib1
STEP 3:
dependencies: lib1
friends: lib1
modifications:
U : test.3.kt -> test.kt
modified ir: test.kt
updated exports: publicClass.kt
STEP 4:
dependencies: lib1
friends: lib1
modifications:
U : test.4.kt -> test.kt
modified ir: test.kt
updated exports: publicClass.kt
STEP 5..6:
dependencies: lib1
friends: lib1
updated imports: test.kt, publicClass.kt
STEP 7:
dependencies: lib1
friends: lib1
modifications:
U : test.7.kt -> test.kt
modified ir: test.kt
updated exports: publicClass.kt
STEP 8..9:
dependencies: lib1
friends: lib1
updated imports: publicClass.kt
@@ -0,0 +1,3 @@
class PublicClassHeir : PublicClass() {
override internal fun baz(): Int = 4
}
@@ -0,0 +1,4 @@
fun test(): Int {
val v = PublicClassHeir()
return v.foo() + v.bar + v.baz() - 5
}
@@ -0,0 +1,4 @@
fun test(): Int {
val v = PublicClassHeir()
return v.foo() + v.bar + v.baz() + v.foo_inline() - 5
}
@@ -0,0 +1,4 @@
fun test(): Int {
val v = PublicClassHeir()
return v.foo() + v.bar + v.baz() + v.foo_inline() + v.bar_inline - 5
}
@@ -0,0 +1,4 @@
fun test(): Int {
val v = PublicClassHeir()
return v.foo() + v.bar + v.baz()
}
@@ -0,0 +1,17 @@
MODULES: lib1, main
STEP 0:
libs: lib1, main
dirty js: lib1, main
STEP 1..2:
libs: lib1, main
dirty js: lib1
STEP 3:
libs: lib1, main
dirty js: lib1, main
STEP 4:
libs: lib1, main
dirty js: main
STEP 5..9:
libs: lib1, main
dirty js: lib1, main