bcc8802014
Expression will be checked against expected type later. Theoretically, this is not very good, but it aligns with the old inference, plus it helps avoiding multiple type mismatch diagnostics.
18 lines
488 B
Kotlin
Vendored
18 lines
488 B
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
// FILE: KotlinFile.kt
|
|
fun foo(javaClass: JavaClass<Int>): Int {
|
|
val inner = javaClass.createInner<String>()
|
|
return <!TYPE_MISMATCH!>inner.doSomething(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>, "") <!OI;TYPE_MISMATCH!>{ }<!><!>
|
|
}
|
|
|
|
// FILE: JavaClass.java
|
|
public class JavaClass<T> {
|
|
public <X> Inner<X> createInner() {
|
|
return new Inner<X>();
|
|
}
|
|
|
|
public interface Inner<X>{
|
|
public T doSomething(T t, X x, Runnable runnable);
|
|
}
|
|
}
|