KT-9638 Optimize imports: don't create import for static methods from superclasses

#KT-9638 Fixed
This commit is contained in:
Valentin Kipyatkov
2015-10-18 20:44:27 +03:00
parent edd2d853b1
commit 27228c2fcc
9 changed files with 139 additions and 19 deletions
@@ -0,0 +1,16 @@
import java.util.ArrayList
class B {
companion object {
fun foo(){}
val property = 0
class Nested
}
fun f(): Nested {
foo()
property
}
}
@@ -0,0 +1,14 @@
class B {
companion object {
fun foo(){}
val property = 0
class Nested
}
fun f(): Nested {
foo()
property
}
}
@@ -0,0 +1,18 @@
import A.Companion.run
interface Action<T> {
fun run(t: T)
}
open class A {
companion object : Action<String> {
override fun run(t: String) {
}
}
}
class B : A() {
fun foo() {
run("")
}
}
@@ -0,0 +1,16 @@
interface Action<T> {
fun run(t: T)
}
open class A {
companion object : Action<String> {
override fun run(t: String) {
}
}
}
class B : A() {
fun foo() {
run("")
}
}
@@ -0,0 +1,7 @@
import java.util.ArrayList
class B : Thread() {
init {
currentThread()
}
}
@@ -0,0 +1,5 @@
class B : Thread() {
init {
currentThread()
}
}