Rename: Fix processing of overriding methods with mangled names

#KT-24460 Fixed
This commit is contained in:
Alexey Sedunov
2018-05-30 13:47:40 +03:00
parent eea9113d1c
commit 862dc76ed9
21 changed files with 320 additions and 25 deletions
@@ -0,0 +1,6 @@
class J extends X.Y {
@Override
public int newOverridableMethod$production_sources_for_module_light_idea_test_case(int x) {
return super.newOverridableMethod$production_sources_for_module_light_idea_test_case(x);
}
}
@@ -0,0 +1,21 @@
sealed class X {
internal abstract fun newOverridableMethod(x: Int): Int
abstract class Y : X() {
override fun newOverridableMethod(x: Int): Int = 1
}
class Z : Y() {
override fun newOverridableMethod(x: Int): Int =
if (x > 0) x
else super.newOverridableMethod(x)
}
}
fun get() : X? {
return X.Z()
}
fun test() {
get()?.newOverridableMethod(2)
}
@@ -0,0 +1,6 @@
class J extends X.Y {
@Override
public int overridableMethod$production_sources_for_module_light_idea_test_case(int x) {
return super.overridableMethod$production_sources_for_module_light_idea_test_case(x);
}
}
@@ -0,0 +1,21 @@
sealed class X {
internal abstract fun /*rename*/overridableMethod(x: Int): Int
abstract class Y : X() {
override fun overridableMethod(x: Int): Int = 1
}
class Z : Y() {
override fun overridableMethod(x: Int): Int =
if (x > 0) x
else super.overridableMethod(x)
}
}
fun get() : X? {
return X.Z()
}
fun test() {
get()?.overridableMethod(2)
}
@@ -0,0 +1,5 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test.kt",
"newName": "newOverridableMethod"
}