[NI] Fix not-null smartcast on intersection of nullable types
#KT-28670 Fixed
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
// !LANGUAGE: +NewInference
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
interface A
|
||||
interface B {
|
||||
fun test() {}
|
||||
}
|
||||
|
||||
fun <K> select(a: K, b: K): K = a
|
||||
|
||||
fun test(a: A?, b: B?) {
|
||||
b as A?
|
||||
a as B?
|
||||
val c = select(a, b)
|
||||
if (c != null) {
|
||||
<!DEBUG_INFO_SMARTCAST!>c<!>.test()
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ K> select(/*0*/ a: K, /*1*/ b: K): K
|
||||
public fun test(/*0*/ a: A?, /*1*/ b: B?): kotlin.Unit
|
||||
|
||||
public interface A {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface B {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open fun test(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Reference in New Issue
Block a user