fix(KT-50270): inline properties accessor for child classes too.
This commit is contained in:
+2
-2
@@ -95,11 +95,11 @@ open class PropertyAccessorInlineLowering(
|
||||
|
||||
|
||||
|
||||
if (property.getter === callee) {
|
||||
if (property.getter === analyzedCallee) {
|
||||
return tryInlineSimpleGetter(expression, analyzedCallee, backingField) ?: expression
|
||||
}
|
||||
|
||||
if (property.setter === callee) {
|
||||
if (property.setter === analyzedCallee) {
|
||||
return tryInlineSimpleSetter(expression, analyzedCallee, backingField) ?: expression
|
||||
}
|
||||
|
||||
|
||||
+5
@@ -85,6 +85,11 @@ public class InvalidationTestGenerated extends AbstractInvalidationTest {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/genericInlineFunctions/");
|
||||
}
|
||||
|
||||
@TestMetadata("gettersAndSettersInlining")
|
||||
public void testGettersAndSettersInlining() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/gettersAndSettersInlining/");
|
||||
}
|
||||
|
||||
@TestMetadata("inlineBecomeNonInline")
|
||||
public void testInlineBecomeNonInline() throws Exception {
|
||||
runTest("js/js.translator/testData/incremental/invalidation/inlineBecomeNonInline/");
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// EXPECTED_REACHABLE_NODES: 1323
|
||||
fun <T> checkThrown(x: T, block: (T) -> Any?): Unit? {
|
||||
return try {
|
||||
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
open class Parent(var name: String) {
|
||||
val isValid = true
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
open class Parent(open var name: String) {
|
||||
val isValid = true
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
open class Parent(name: String) {
|
||||
var name: String
|
||||
get() = _name
|
||||
set(name) {
|
||||
isValid = true
|
||||
_name = name
|
||||
}
|
||||
|
||||
var isValid = false
|
||||
private set
|
||||
|
||||
private var _name: String = name;
|
||||
}
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
open class Parent(open var name: String) {
|
||||
open val isValid = true
|
||||
}
|
||||
Vendored
+21
@@ -0,0 +1,21 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib
|
||||
dirty: l1.kt
|
||||
STEP 1:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.1.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
STEP 2:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.2.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
STEP 3:
|
||||
dependencies: stdlib
|
||||
modifications:
|
||||
U : l1.kt.3.txt -> l1.kt
|
||||
dirty: l1.kt
|
||||
STEP 4:
|
||||
dependencies: stdlib
|
||||
flags: FP
|
||||
+1
@@ -0,0 +1 @@
|
||||
class Child(name: String) : Parent(name)
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
class Child(name: String) : Parent(name) {
|
||||
override var name: String
|
||||
get() = _name
|
||||
set(name) {
|
||||
_name = name
|
||||
isValid = true
|
||||
}
|
||||
|
||||
private var _name: String = name
|
||||
|
||||
override var isValid = false
|
||||
private set
|
||||
}
|
||||
Vendored
+10
@@ -0,0 +1,10 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1
|
||||
dirty: l2.kt
|
||||
STEP 1..3:
|
||||
dependencies: stdlib, lib1
|
||||
STEP 4:
|
||||
dependencies: stdlib, lib1
|
||||
modifications:
|
||||
U : l2.kt.4.txt -> l2.kt
|
||||
dirty: l2.kt
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
fun box(stepId: Int): String {
|
||||
val parent = Parent("parent")
|
||||
val child = Child("child")
|
||||
|
||||
if (parent.name != "parent") return "fail: initial parent name at step $stepId"
|
||||
if (child.name != "child") return "fail: initial child name at step $stepId"
|
||||
|
||||
parent.name = "updated parent"
|
||||
|
||||
if (parent.name != "updated parent") return "fail: updated parent name at step $stepId"
|
||||
|
||||
child.name = "updated child"
|
||||
|
||||
if (child.name != "updated child") return "fail: updated child name at step $stepId"
|
||||
|
||||
if (!parent.isValid) return "fail: parent is invalid at step $stepId"
|
||||
if (!child.isValid) return "fail: child is invalid at step $stepId"
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
STEP 0:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
dirty: m.kt
|
||||
STEP 1..4:
|
||||
dependencies: stdlib, lib1, lib2
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
MODULES: lib1, lib2, main
|
||||
|
||||
STEP 0:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: stdlib, lib1, lib2, main
|
||||
STEP 1..3:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: lib1
|
||||
STEP 4:
|
||||
libs: lib1, lib2, main
|
||||
dirty js: lib2
|
||||
Reference in New Issue
Block a user