[NI] Don't stop on a candidate with unstable smartcast error
#KT-36847 Fixed
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ class Cls {
|
||||
|
||||
fun test(s: String) {
|
||||
if (s.ext is B)
|
||||
take(<!NI;SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>s.ext<!>)
|
||||
take(<!OI;SMARTCAST_IMPOSSIBLE!>s.ext<!>)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ fun foo(list: StringList, arg: Unstable) {
|
||||
list.remove(arg.first)
|
||||
if (arg.first?.isEmpty() ?: false) {
|
||||
// Should be still resolved to extension, without smart cast or smart cast impossible
|
||||
list.remove(<!NI;SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>arg.first<!>)
|
||||
list.remove(<!OI;SMARTCAST_IMPOSSIBLE!>arg.first<!>)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,6 @@ fun bar(list: BooleanList, arg: UnstableBoolean) {
|
||||
list.remove(arg.first)
|
||||
if (arg.first ?: false) {
|
||||
// Should be still resolved to extension, without smart cast or smart cast impossible
|
||||
list.remove(<!NI;SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>arg.first<!>)
|
||||
list.remove(<!OI;SMARTCAST_IMPOSSIBLE!>arg.first<!>)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,5 +9,5 @@ fun main() {
|
||||
var y: Number? = null
|
||||
y = 2
|
||||
{ y = 1 }
|
||||
Test.foo(<!SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>y<!>)
|
||||
Test.foo(y)
|
||||
}
|
||||
Reference in New Issue
Block a user