[NI] Consider CS as nullable if one of the types isn't subtype of Any
Note that this isn't fully correct, consider the following situation: S : T, T : Any? => CS(S, T) = T, but for now it will be T?, which is reliable but not so specific as just T
This commit is contained in:
+14
@@ -0,0 +1,14 @@
|
||||
val targetArgument = id2(star(), star()) // error
|
||||
|
||||
fun <T> id2(x: T, y: T): T = x
|
||||
|
||||
fun star(): Sample<*> {
|
||||
return Sample<Int>()
|
||||
}
|
||||
|
||||
class Sample<out T>
|
||||
|
||||
fun box(): String {
|
||||
targetArgument
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user