[FIR-TEST] Update testdata of old frontend tests

This commit is contained in:
Dmitriy Novozhilov
2020-01-20 14:48:01 +03:00
parent 19e0b8039b
commit 5f639dd2ae
40 changed files with 59 additions and 59 deletions
@@ -7,5 +7,5 @@ fun foo() {
v = null
v.<!UNRESOLVED_REFERENCE!>length<!>
v = "abc"
v.<!UNRESOLVED_REFERENCE!>length<!>
v.length
}
@@ -15,6 +15,6 @@ fun foo(arg: Int?) {
var z = arg
z = z?.let { 42 }
if (z != null) {
arg.hashCode()
arg.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
}
}
@@ -23,7 +23,7 @@ fun bar(s: String?) {
val hashCode = ss?.hashCode()
ss = null
if (hashCode != null) {
ss.<!UNRESOLVED_REFERENCE!>hashCode<!>()
ss.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
}
}
@@ -31,7 +31,7 @@ fun bar2(s: String?) {
var ss = s
val hashCode = ss?.hashCode()
if (hashCode != null) {
ss.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
ss.hashCode()
}
}
@@ -40,7 +40,7 @@ class Some(var s: String?)
fun baz(arg: Some?) {
val ss = arg?.s
if (ss != null) {
arg.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
arg.<!INAPPLICABLE_CANDIDATE!>s<!>.<!UNRESOLVED_REFERENCE!>hashCode<!>()
arg.hashCode()
arg.s.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
}
}
@@ -44,7 +44,7 @@ fun gaz(s: String?) {
x = null
}
run {
x.hashCode()
x.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
}
}
}
@@ -11,11 +11,11 @@ fun list(start: SomeObject) {
// In theory smart cast is possible here
// But in practice we have a loop with changing e
// ?: should we "or" entrance type info with condition type info?
if (!e.doSomething())
if (<!UNRESOLVED_REFERENCE!>!<!>e.<!INAPPLICABLE_CANDIDATE!>doSomething<!>())
break
// Smart cast here is still not possible
e = e.next()
e = e.<!INAPPLICABLE_CANDIDATE!>next<!>()
} while (e != null)
// e can be null because of next()
e.doSomething()
e.<!INAPPLICABLE_CANDIDATE!>doSomething<!>()
}
@@ -8,5 +8,5 @@ public fun foo(pp: String?): Int {
p = null
} while (!x())
// Smart cast is NOT possible here
return p.length
return p.<!INAPPLICABLE_CANDIDATE!>length<!>
}
@@ -16,5 +16,5 @@ fun list(start: SomeObject) {
e = e.next()
}
// e can be null because of next()
e.doSomething()
e.<!INAPPLICABLE_CANDIDATE!>doSomething<!>()
}
@@ -9,5 +9,5 @@ public fun box() {
// type of j should be MyClass?
var j = ++i
// j is null so call should be unsafe
j.hashCode()
j.<!INAPPLICABLE_CANDIDATE!>hashCode<!>()
}
@@ -10,5 +10,5 @@ fun foo() {
} catch (ex: Exception) {}
bar(s)
if (s != null) { }
s.<!UNRESOLVED_REFERENCE!>hashCode<!>()
s.hashCode()
}
@@ -13,8 +13,8 @@ class MyClass {
var res = 0
m = create()
// See KT-7428
for ((k, v) in m)
res += (k.length + v.length)
<!INAPPLICABLE_CANDIDATE, UNRESOLVED_REFERENCE, UNRESOLVED_REFERENCE!>for ((k, v) in m)
<!UNRESOLVED_REFERENCE!>res += (k.<!UNRESOLVED_REFERENCE!>length<!> + v.<!UNRESOLVED_REFERENCE!>length<!>)<!><!>
return res
}
}
@@ -9,5 +9,5 @@ public fun foo(pp: String?): Int {
}
// Smart cast is NOT possible here
// (we could provide it but p = null makes it much harder)
return p.length
return p.<!INAPPLICABLE_CANDIDATE!>length<!>
}
@@ -9,5 +9,5 @@ public fun foo(pp: String?): Int {
}
// Smart cast is NOT possible here
// (we could provide it but p = null makes it much harder)
return p.length
return p.<!INAPPLICABLE_CANDIDATE!>length<!>
}
@@ -9,5 +9,5 @@ public fun foo(pp: String?): Int {
}
// Smart cast is NOT possible here
// (we could provide it but p = null makes it much harder)
return p.length
return p.<!INAPPLICABLE_CANDIDATE!>length<!>
}
@@ -13,5 +13,5 @@ fun list(start: SomeObject) {
e = e.next()
}
// e can be null because of next()
e.doSomething()
e.<!INAPPLICABLE_CANDIDATE!>doSomething<!>()
}