Kapt: Do not add imports for overloaded callables (#KT-25071)

This commit is contained in:
Yan Zhulanow
2018-07-04 01:37:05 +03:00
parent 00edc007f8
commit 423bd573a3
4 changed files with 139 additions and 5 deletions
@@ -0,0 +1,43 @@
// CORRECT_ERROR_TYPES
// FILE: kapt/StaticMethod.java
package kapt;
public class StaticMethod<T> {
public static <T> StaticMethod<T> of(T t1) {
return new StaticMethod<T>(t1);
}
public static <T> StaticMethod<T> of(T t1, T t2) {
return new StaticMethod<T>(t1, t2);
}
public static <T> StaticMethod<T> of2(T t1) {
return new StaticMethod<T>(t1);
}
private final T[] ts;
private StaticMethod(T... ts) {
this.ts = ts;
}
}
// FILE: lib.kt
package my.lib
fun String.func(): Int = this.length
// FILE: test.kt
package kapt
import java.util.Collections.unmodifiableCollection
import kapt.StaticMethod.of
import kapt.StaticMethod.of2
import my.lib.func
class StaticImport {
val x = unmodifiableCollection(listOf(""))
val l = of("hello", "world")
val m = of2("hello")
val y = "1".func()
}