9891f562cc
During subtyping/incorporation we transform types (e.g. changing nullability, form of the type) and, basically, we're doing this to some FIXPOINT. It's important that we use `KotlinType.hashCode()` to compare types, but for error types hashCode is a hashCode of its supertype and, for example, `makeNullableAsSpecified` method recreate type every time. So, we continue to generate new constraints and we'll never stop incorporation algorithm
26 lines
462 B
Kotlin
Vendored
26 lines
462 B
Kotlin
Vendored
// !LANGUAGE: +NewInference
|
|
|
|
// FILE: Sam.java
|
|
|
|
public interface Sam<K> {
|
|
Sam.Result<K> compute();
|
|
|
|
public static class Result<V> {
|
|
public static <V> Sam.Result<V> create(V value) {}
|
|
}
|
|
}
|
|
|
|
// FILE: Foo.java
|
|
|
|
public class Foo {
|
|
public static <T> void foo(Sam<T> var1) {
|
|
}
|
|
}
|
|
|
|
// FILE: test.kt
|
|
|
|
fun test(e: <!UNRESOLVED_REFERENCE!>ErrorType<!>) {
|
|
Foo.foo {
|
|
Sam.Result.create(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>e<!>)
|
|
}
|
|
} |