[FIR] Implement new bound smartcast algorithm
#KT-36055 Fixed
This commit is contained in:
+3
-3
@@ -8,7 +8,7 @@ fun test1() {
|
||||
if (newC != null) {
|
||||
c = newC
|
||||
}
|
||||
<!INAPPLICABLE_CANDIDATE!>foo<!>(c)
|
||||
foo(c)
|
||||
}
|
||||
|
||||
fun test2() {
|
||||
@@ -19,7 +19,7 @@ fun test2() {
|
||||
if (newC is String) {
|
||||
c = newC
|
||||
}
|
||||
<!INAPPLICABLE_CANDIDATE!>foo<!>(c)
|
||||
foo(c)
|
||||
}
|
||||
|
||||
fun test3() {
|
||||
@@ -30,6 +30,6 @@ fun test3() {
|
||||
if (newC == null) return
|
||||
c = newC
|
||||
|
||||
<!INAPPLICABLE_CANDIDATE!>foo<!>(c)
|
||||
foo(c)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@ fun foo(x: Int, f: () -> Unit, y: Int) {}
|
||||
fun bar() {
|
||||
var x: Int?
|
||||
x = 4
|
||||
foo(x, { x = null; x.<!UNRESOLVED_REFERENCE!>hashCode<!>() }, x)
|
||||
foo(x, { x = null; x.<!INAPPLICABLE_CANDIDATE!>hashCode<!>() }, x)
|
||||
}
|
||||
+1
-1
@@ -13,5 +13,5 @@ fun list(start: String) {
|
||||
e = e.next()
|
||||
}
|
||||
// e can never be null but we do not know it
|
||||
e.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
|
||||
e.hashCode()
|
||||
}
|
||||
Reference in New Issue
Block a user