Rename: Qualify references to members of enum companions in case of conflict with enum entries

#KT-10033 Fixed
(cherry picked from commit 3373d54)
This commit is contained in:
Alexey Sedunov
2016-05-27 18:58:33 +03:00
parent 35aa3f7646
commit 5296b61ce9
10 changed files with 93 additions and 6 deletions
@@ -0,0 +1,8 @@
package test;
class Test {
{
E e = E.A;
int n = E.A;
}
}
@@ -0,0 +1,13 @@
package test
enum class E {
A;
companion object {
public const val A: Int = 1
}
}
fun main(args: Array<String>) {
val a = E.Companion.A + 2
}
@@ -0,0 +1,8 @@
package test;
class Test {
{
E e = E.A;
int n = E.B;
}
}
@@ -0,0 +1,13 @@
package test
enum class E {
A;
companion object {
public const val /*rename*/B : Int = 1
}
}
fun main(args: Array<String>) {
val a = E.B + 2
}
@@ -0,0 +1,6 @@
{
"type": "MARKED_ELEMENT",
"mainFile": "test/test.kt",
"newName": "A",
"withRuntime": "true"
}