KtLightMethod: Wrap return type so it resolves to light method's type parameter as opposed to delegate's
Affects java type inference in IDEA #KT-12090 Fixed #KT-11095 Fixed
This commit is contained in:
+7
@@ -0,0 +1,7 @@
|
||||
class InferenceReturnType_1_6 {
|
||||
public static void test(a.C c, a.I i, a.B b) {
|
||||
a.C cc = a.Util.helper(c);
|
||||
a.I ii = a.Util.helper(i);
|
||||
a.B bb = a.Util.helper(b);
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
@file: JvmName("Util")
|
||||
|
||||
package a
|
||||
|
||||
interface I
|
||||
|
||||
class C : I
|
||||
class B : I
|
||||
|
||||
fun <T : I> T.helper(): T = this
|
||||
+1
@@ -0,0 +1 @@
|
||||
// LANGUAGE_LEVEL 1.6
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class InferenceReturnType_1_8 {
|
||||
public static void test() {
|
||||
a.A<a.A<String>> ll = a.ValueManager.Companion.reject();
|
||||
}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
@file: JvmName("Util")
|
||||
|
||||
package a
|
||||
|
||||
class A<T>()
|
||||
|
||||
class ValueManager() {
|
||||
companion object {
|
||||
fun <Z> reject() = null as A<Z>
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
// LANGUAGE_LEVEL 1.8
|
||||
Reference in New Issue
Block a user