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:
Pavel V. Talanov
2016-05-25 18:12:58 +03:00
parent e1a21abd72
commit 3a3e145de2
10 changed files with 89 additions and 2 deletions
@@ -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);
}
}
@@ -0,0 +1,10 @@
@file: JvmName("Util")
package a
interface I
class C : I
class B : I
fun <T : I> T.helper(): T = this
@@ -0,0 +1 @@
// LANGUAGE_LEVEL 1.6
@@ -0,0 +1,5 @@
class InferenceReturnType_1_8 {
public static void test() {
a.A<a.A<String>> ll = a.ValueManager.Companion.reject();
}
}
@@ -0,0 +1,11 @@
@file: JvmName("Util")
package a
class A<T>()
class ValueManager() {
companion object {
fun <Z> reject() = null as A<Z>
}
}
@@ -0,0 +1 @@
// LANGUAGE_LEVEL 1.8