Files
kotlin-fork/compiler/testData/diagnostics/tests/inference/upperBounds/inferringVariableByMaterializeAndUpperBound.kt
T
Victor Petukhov 0857b9c9e7 Rethink constraints incorporation
Namely, remove incorporation “otherInsideMyConstraint” to eliminate
constraint system redundancy and produce a potentially very large number
 of constructs.
Instead, introduce not so “spreadable” incorporation during variable
fixation (equality constraint with result type into other constraints).
^KT-41644 Fixed
^KT-42195 Fixed
^KT-42920 Fixed
^KT-42791 Fixed
^KT-41741 Fixed
2020-11-25 11:15:20 +03:00

14 lines
318 B
Kotlin
Vendored

// !DIAGNOSTICS: -CAST_NEVER_SUCCEEDS
interface I
interface Inv<P>
interface Out<out T>
class Bar<U : I>(val x: Inv<Out<U>>)
fun <T> materializeFoo(): Inv<T> = null as Inv<T>
fun main() {
<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>Bar<!>(<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>materializeFoo<!>())
}