Kapt: Do not add imports for overloaded callables (#KT-25071)
This commit is contained in:
@@ -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()
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package kapt;
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class StaticImport {
|
||||
private final java.util.Collection<java.lang.String> x = null;
|
||||
private final kapt.StaticMethod<java.lang.String> l = null;
|
||||
private final kapt.StaticMethod<java.lang.String> m = null;
|
||||
private final int y = 0;
|
||||
|
||||
public final java.util.Collection<java.lang.String> getX() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final kapt.StaticMethod<java.lang.String> getL() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final kapt.StaticMethod<java.lang.String> getM() {
|
||||
return null;
|
||||
}
|
||||
|
||||
public final int getY() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public StaticImport() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////
|
||||
|
||||
package my.lib;
|
||||
|
||||
import java.lang.System;
|
||||
|
||||
@kotlin.Metadata()
|
||||
public final class LibKt {
|
||||
|
||||
public LibKt() {
|
||||
super();
|
||||
}
|
||||
|
||||
public static final int func(@org.jetbrains.annotations.NotNull()
|
||||
java.lang.String $receiver) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user