[NI] Consider type non-nullable only if it has non-null supertype

Fixes #KT-12684 for NI
This commit is contained in:
Mikhail Zarechenskiy
2018-10-23 17:00:25 +03:00
parent 20ff74a726
commit 021732f74a
5 changed files with 27 additions and 1 deletions
@@ -0,0 +1,6 @@
// !LANGUAGE: +NewInference
inline fun <T, reified S> foo(x: T?, y: T): T {
if (x is S) return <!TYPE_MISMATCH, TYPE_MISMATCH!>x<!>
return y
}
@@ -0,0 +1,3 @@
package
public inline fun </*0*/ T, /*1*/ reified S> foo(/*0*/ x: T?, /*1*/ y: T): T