JS: fix Long inlining (private, companion) (KT-24189 fixed).
This commit is contained in:
@@ -26,13 +26,25 @@ fun testLongVal() {
|
||||
assertEquals(46L, twiceLongValue)
|
||||
}
|
||||
|
||||
private const val privateLongConst = 10 * 10L
|
||||
|
||||
internal const val internalLongConst = 10 * 100L
|
||||
|
||||
const val longConst = 42L
|
||||
|
||||
// PROPERTY_READ_COUNT: name=privateLongConst count=1 scope=testLongConst
|
||||
// PROPERTY_READ_COUNT: name=L100 count=1 scope=testLongConst
|
||||
// PROPERTY_READ_COUNT: name=internalLongConst count=1 scope=testLongConst
|
||||
// PROPERTY_READ_COUNT: name=L1000 count=1 scope=testLongConst
|
||||
// PROPERTY_READ_COUNT: name=longConst count=1 scope=testLongConst
|
||||
// PROPERTY_READ_COUNT: name=L42 count=1 scope=testLongConst
|
||||
// PROPERTY_READ_COUNT: name=L_42 count=4 scope=testLongConst
|
||||
// PROPERTY_READ_COUNT: name=L84 count=2 scope=testLongConst
|
||||
fun testLongConst() {
|
||||
assertEquals(100L, privateLongConst)
|
||||
|
||||
assertEquals(1000L, internalLongConst)
|
||||
|
||||
val longConstCopy = longConst
|
||||
assertEquals(42L, longConstCopy)
|
||||
|
||||
@@ -144,6 +156,23 @@ private fun testImportedLongConstInlinedLocally() {
|
||||
testImportedLongConstInlineFunLib1()
|
||||
}
|
||||
|
||||
class A {
|
||||
companion object {
|
||||
private const val a = 10L
|
||||
|
||||
const val b = 20L
|
||||
}
|
||||
|
||||
fun testCompanion() {
|
||||
assertEquals(10L, a)
|
||||
assertEquals(20L, b)
|
||||
}
|
||||
}
|
||||
|
||||
fun testCompanionVal() {
|
||||
A().testCompanion()
|
||||
}
|
||||
|
||||
fun testLib1() {
|
||||
testLongVal()
|
||||
testLongConst()
|
||||
@@ -154,6 +183,8 @@ fun testLib1() {
|
||||
testIntMaxMinValue()
|
||||
|
||||
testImportedLongConstInlinedLocally()
|
||||
|
||||
testCompanionVal()
|
||||
}
|
||||
|
||||
// MODULE: lib2(lib1)
|
||||
@@ -230,6 +261,8 @@ fun testLib2() {
|
||||
|
||||
testImportedLongConst()
|
||||
testImportedLongConstInlinedLocallyFromOtherModule()
|
||||
|
||||
assertEquals(20L, A.b)
|
||||
}
|
||||
|
||||
// MODULE: main(lib2)
|
||||
|
||||
Reference in New Issue
Block a user