Fix loading Java type arguments

Type arguments with use variance in java contradicting to Kotlin declaration-site variance should be loaded as star-projections

 #KT-11492 Fixed
This commit is contained in:
Denis Zharkov
2016-03-18 14:53:25 +03:00
parent 838fcf9a57
commit c3e44ec199
4 changed files with 67 additions and 2 deletions
@@ -0,0 +1,23 @@
// !CHECK_TYPE
// !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: A.java
public class A {
public static Out<? super CharSequence> foo() { return null; }
public static In<? extends CharSequence> bar() { return null; }
}
// FILE: main.kt
class Out<out E> {
fun x(): E = null!!
}
class In<in F> {
fun y(f: F) {}
}
fun test() {
A.foo().x() checkType { _<Any?>() }
A.bar().<!MEMBER_PROJECTED_OUT!>y<!>(null)
}