[NI] Discriminate Nothing? result type from nullability constraints
Nullability constraints should not be chosen when proper argument constraints for variables in contravariant position present. ^KT-32106 Fixed ^KT-33166 Fixed
This commit is contained in:
+15
@@ -0,0 +1,15 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
open class Cls
|
||||
|
||||
abstract class In<in I>
|
||||
class SubIn : In<Cls?>()
|
||||
|
||||
inline fun <reified T : Cls> materialize(): T? = TODO()
|
||||
|
||||
fun <D> transform(transformer: In<D>, data: D): Unit = TODO()
|
||||
|
||||
fun test(subIn: SubIn) {
|
||||
transform(subIn, materialize()) // D should be inferred to Cls?, not Nothing?
|
||||
}
|
||||
Reference in New Issue
Block a user