Move: Fix warning on companion used as implicit dispatch receiver

Do not report conflict if target class is a sublcass of
companion object's containing class
This commit is contained in:
Alexey Sedunov
2017-04-06 16:14:46 +03:00
parent 5c35061afa
commit c1066b98f0
7 changed files with 77 additions and 4 deletions
@@ -0,0 +1,19 @@
package test
open class A {
companion object {
fun Int.extFoo(n: Int) {}
val Int.extBar: Int get() = 1
}
}
class C : A() {
class B {
fun test() {
1.extFoo(1.extBar)
}
}
}
@@ -0,0 +1,19 @@
package test
open class A {
companion object {
fun Int.extFoo(n: Int) {}
val Int.extBar: Int get() = 1
}
class <caret>B {
fun test() {
1.extFoo(1.extBar)
}
}
}
class C : A() {
}
@@ -0,0 +1,6 @@
{
"mainFile": "test.kt",
"type": "MOVE_KOTLIN_NESTED_CLASS",
"targetClass": "test.C",
"withRuntime": "true"
}