KT-2836 Rename kotlin base function with overrides

#KT-2836 Fixed
This commit is contained in:
Nikolay Krasko
2013-09-18 19:55:00 +04:00
committed by Nikolay Krasko
parent 5350dc265a
commit 97c8e05984
10 changed files with 190 additions and 25 deletions
@@ -0,0 +1,27 @@
package testing.rename
trait A {
fun second() : Int
}
public open class B: A {
override fun second() = 1
fun first(a: Int) = 12
}
class C: B() {
override fun second() = 2
}
fun usages() {
val b = B()
val a: A = b
val c = C()
a.second()
b.second()
c.second()
}
@@ -0,0 +1,26 @@
package testing;
import testing.rename.*;
class JavaClient {
public void foo(A a) {
a.second();
new B().second();
new C().second();
new D().second();
}
public static class D implements A {
@Override
public int second() {
return 3;
}
}
public static class E extends D {
@Override
public int second() {
return 4;
}
}
}
@@ -0,0 +1,27 @@
package testing.rename
trait A {
fun first() : Int
}
public open class B: A {
override fun first() = 1
fun first(a: Int) = 12
}
class C: B() {
override fun first() = 2
}
fun usages() {
val b = B()
val a: A = b
val c = C()
a.first()
b.first()
c.first()
}
@@ -0,0 +1,26 @@
package testing;
import testing.rename.*;
class JavaClient {
public void foo(A a) {
a.first();
new B().first();
new C().first();
new D().first();
}
public static class D implements A {
@Override
public int first() {
return 3;
}
}
public static class E extends D {
@Override
public int first() {
return 4;
}
}
}
@@ -0,0 +1 @@
// RENAME: JAVA_METHOD->testing.rename.A->void first()->second
@@ -0,0 +1,3 @@
// RENAME: KOTLIN_FUNCTION->testing.rename.A.first->second
// KT-2836 Rename method with all its implementations