[FIR] Properly support smartcasts on stable when subjects in when conditions
^KT-49860 Fixed
This commit is contained in:
committed by
teamcityserver
parent
20425fb458
commit
330574cab6
@@ -40,7 +40,7 @@ fun third(arg: Any?): Int {
|
||||
is String -> return 0
|
||||
is Double -> return 1
|
||||
is <!DUPLICATE_LABEL_IN_WHEN!>Double<!> -> return 2
|
||||
<!DUPLICATE_LABEL_IN_WHEN!>null<!> -> return 3
|
||||
<!DUPLICATE_LABEL_IN_WHEN, SENSELESS_NULL_IN_WHEN!>null<!> -> return 3
|
||||
!is String -> return 4
|
||||
else -> return 5
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
fun main(x1: Double?, range: ClosedRange<Double>) {
|
||||
when (x1) {
|
||||
null -> throw Exception()
|
||||
<!ARGUMENT_TYPE_MISMATCH!>in range<!> -> {} // error, no smartcast from previous branch, OK in OI
|
||||
in range -> {} // error, no smartcast from previous branch, OK in OI
|
||||
}
|
||||
|
||||
when {
|
||||
|
||||
Reference in New Issue
Block a user