K2: add test for KT-57649
This commit is contained in:
committed by
Space Team
parent
0dbf218f0b
commit
2e69c643cb
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// ISSUE: KT-57649
|
||||
|
||||
open class A
|
||||
abstract class B {
|
||||
fun test(current: A): A? =
|
||||
// K2 reports empty intersection here due to the smart cast from A to B, where A & B aren't compatible
|
||||
<!INFERRED_TYPE_VARIABLE_INTO_EMPTY_INTERSECTION_WARNING("K; B?, A?; multiple incompatible classes; : B, A")!>if (current === this) current else null<!>
|
||||
}
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
// ISSUE: KT-57649
|
||||
|
||||
open class A
|
||||
abstract class B {
|
||||
fun test(current: A): A? =
|
||||
// K2 reports empty intersection here due to the smart cast from A to B, where A & B aren't compatible
|
||||
if (current === this) current else null
|
||||
}
|
||||
Reference in New Issue
Block a user