Rename: Fix processing of overriding methods with mangled names
#KT-24460 Fixed
This commit is contained in:
@@ -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)
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"type": "MARKED_ELEMENT",
|
||||
"mainFile": "test.kt",
|
||||
"newName": "newOverridableMethod"
|
||||
}
|
||||
Reference in New Issue
Block a user