[FE] Check types in canHaveCommonSubtype for intersection emptiness with erasing nullability

It doesn't affect having common subtypes check but may lead to false positives

^KT-52364 Fixed
This commit is contained in:
Victor Petukhov
2022-05-12 14:57:21 +02:00
committed by teamcity
parent ba158de848
commit 11eb5ce39c
7 changed files with 68 additions and 4 deletions
@@ -0,0 +1,16 @@
// FIR_IDENTICAL
// WITH_STDLIB
import kotlin.reflect.KProperty
class FieldStyle2(val index: Int? = 0)
interface Foo {
fun <Type : Comparable<*>> getProperty(): Type? = null
}
class A<T : Foo> {
fun foo(thisRef: T, property: KProperty<*>): FieldStyle2 {
return FieldStyle2(thisRef.getProperty())
}
}
@@ -0,0 +1,24 @@
package
public final class A</*0*/ T : Foo> {
public constructor A</*0*/ T : Foo>()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public final fun foo(/*0*/ thisRef: T, /*1*/ property: kotlin.reflect.KProperty<*>): FieldStyle2
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
public final class FieldStyle2 {
public constructor FieldStyle2(/*0*/ index: kotlin.Int? = ...)
public final val index: kotlin.Int?
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 Foo {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open fun </*0*/ Type : kotlin.Comparable<*>> getProperty(): Type?
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}