[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:
Mikhail Zarechenskiy
2017-07-03 13:44:01 +03:00
parent 39349abd39
commit 0d464f06d1
6 changed files with 42 additions and 7 deletions
@@ -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"
}