Files
kotlin-fork/compiler/testData/diagnostics/tests/j+k/wrongVarianceInJava.kt
T
Dmitriy Novozhilov e6b5cb5216 [TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
2020-12-16 19:52:25 +03:00

25 lines
486 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
// !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<!>)
}