Files
kotlin-fork/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

24 lines
463 B
Kotlin
Vendored

// !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{OI}!>y<!>(<!NULL_FOR_NONNULL_TYPE{NI}!>null<!>)
}