[TD] Update diagnostics test data due to new test runners
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
This commit is contained in:
@@ -11,4 +11,4 @@ class B {
|
||||
fun test(a: A, b: B?) {
|
||||
a foo b!!
|
||||
<!DEBUG_INFO_SMARTCAST!>b<!>.bar()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,4 +20,4 @@ fun bar(s: String?) {
|
||||
s as? String
|
||||
s as String?
|
||||
s as String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,12 +3,12 @@ fun foo(): String {
|
||||
var s: String?
|
||||
s = null
|
||||
<!DEBUG_INFO_CONSTANT!>s<!>?.length
|
||||
<!OI;DEBUG_INFO_CONSTANT!>s<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>s<!><!UNSAFE_CALL!>.<!>length
|
||||
if (<!SENSELESS_COMPARISON!><!DEBUG_INFO_CONSTANT!>s<!> == null<!>) return <!ALWAYS_NULL!>s<!>!!
|
||||
var t: String? = "y"
|
||||
if (t == null) t = "x"
|
||||
var x: Int? = null
|
||||
if (x == null) <!TYPE_MISMATCH!><!OI;DEBUG_INFO_CONSTANT!>x<!> += null<!>
|
||||
if (x == null) <!TYPE_MISMATCH!><!DEBUG_INFO_CONSTANT{OI}!>x<!> += null<!>
|
||||
return <!DEBUG_INFO_SMARTCAST!>t<!> + s
|
||||
}
|
||||
|
||||
@@ -16,8 +16,8 @@ fun String?.gav() {}
|
||||
|
||||
fun bar(s: String?) {
|
||||
if (s != null) return
|
||||
<!OI;DEBUG_INFO_CONSTANT!>s<!>.gav()
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>s<!>.gav()
|
||||
<!DEBUG_INFO_CONSTANT!>s<!> <!USELESS_CAST!>as? String<!>
|
||||
<!DEBUG_INFO_CONSTANT!>s<!> <!USELESS_CAST!>as String?<!>
|
||||
<!ALWAYS_NULL!>s<!> as String
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public class My {
|
||||
fun test() {
|
||||
val my = My.create()
|
||||
if (my == null) {
|
||||
<!OI;DEBUG_INFO_CONSTANT!>my<!><!UNSAFE_CALL!>.<!>foo()
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>my<!><!UNSAFE_CALL!>.<!>foo()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,4 +65,4 @@ fun f(a: SomeClass?) {
|
||||
c.hashCode()
|
||||
c.foo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ fun f(a: SomeClass?) {
|
||||
if (aa as? SomeSubClass != null) {
|
||||
aa = null
|
||||
// 'aa' cannot be cast to SomeSubClass
|
||||
<!OI;DEBUG_INFO_CONSTANT!>aa<!><!UNSAFE_CALL!>.<!>hashCode()
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>aa<!><!UNSAFE_CALL!>.<!>hashCode()
|
||||
aa.<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
(<!DEBUG_INFO_CONSTANT!>aa<!> as? SomeSubClass)<!UNSAFE_CALL!>.<!>foo
|
||||
(<!ALWAYS_NULL!>aa<!> as SomeSubClass).foo
|
||||
@@ -50,7 +50,7 @@ fun f(a: SomeClass?) {
|
||||
aa = null
|
||||
if (b != null) {
|
||||
// 'aa' cannot be cast to SomeSubClass
|
||||
<!OI;DEBUG_INFO_CONSTANT!>aa<!><!UNSAFE_CALL!>.<!>hashCode()
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>aa<!><!UNSAFE_CALL!>.<!>hashCode()
|
||||
aa.<!UNRESOLVED_REFERENCE!>foo<!>
|
||||
(<!DEBUG_INFO_CONSTANT!>aa<!> as? SomeSubClass)<!UNSAFE_CALL!>.<!>foo
|
||||
(<!ALWAYS_NULL!>aa<!> as SomeSubClass).foo
|
||||
@@ -65,4 +65,4 @@ fun f(a: SomeClass?) {
|
||||
<!DEBUG_INFO_SMARTCAST!>c<!>.hashCode()
|
||||
<!DEBUG_INFO_SMARTCAST!>c<!>.foo
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,4 +36,4 @@ fun foo(x : String?, y : String?) {
|
||||
x.length
|
||||
y.length
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,12 +16,12 @@ fun foo(x : String?, y : String?) {
|
||||
else {
|
||||
// y == null but x != y
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
<!OI;DEBUG_INFO_CONSTANT!>y<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>y<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
if (y == null && x != <!DEBUG_INFO_CONSTANT!>y<!>) {
|
||||
// y == null but x != y
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
<!OI;DEBUG_INFO_CONSTANT!>y<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>y<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
else {
|
||||
x<!UNSAFE_CALL!>.<!>length
|
||||
@@ -36,4 +36,4 @@ fun foo(x : String?, y : String?) {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.length
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,4 +20,4 @@ fun foo(x: String?, y: String?, z: String?, w: String?) {
|
||||
y.length
|
||||
else
|
||||
y.<!INAPPLICABLE_CANDIDATE!>length<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ fun foo(x: String?, y: String?, z: String?, w: String?) {
|
||||
if (x != null || y != null || (<!DEBUG_INFO_CONSTANT!>x<!> != z && <!DEBUG_INFO_CONSTANT!>y<!> != z))
|
||||
z<!UNSAFE_CALL!>.<!>length
|
||||
else
|
||||
<!OI;DEBUG_INFO_CONSTANT!>z<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>z<!><!UNSAFE_CALL!>.<!>length
|
||||
if (x == null || y == null || (x != z && y != z))
|
||||
z<!UNSAFE_CALL!>.<!>length
|
||||
else
|
||||
@@ -20,4 +20,4 @@ fun foo(x: String?, y: String?, z: String?, w: String?) {
|
||||
<!DEBUG_INFO_SMARTCAST!>y<!>.length
|
||||
else
|
||||
y<!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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(<!OI;SMARTCAST_IMPOSSIBLE!>arg.first<!>)
|
||||
list.remove(<!SMARTCAST_IMPOSSIBLE{OI}!>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(<!OI;SMARTCAST_IMPOSSIBLE!>arg.first<!>)
|
||||
list.remove(<!SMARTCAST_IMPOSSIBLE{OI}!>arg.first<!>)
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -17,7 +17,7 @@ interface C: A
|
||||
|
||||
fun test(a: A, b: B, c: C) {
|
||||
if (a is B && a is C) {
|
||||
val d: C = id(<!OI;DEBUG_INFO_SMARTCAST!>a<!>)
|
||||
val d: C = id(<!DEBUG_INFO_SMARTCAST{OI}!>a<!>)
|
||||
val e: Any = id(a)
|
||||
val f = id(a)
|
||||
checkSubtype<A>(f)
|
||||
@@ -31,7 +31,7 @@ fun test(a: A, b: B, c: C) {
|
||||
val k = three(a, b, c)
|
||||
checkSubtype<A>(k)
|
||||
checkSubtype<B>(<!TYPE_MISMATCH!>k<!>)
|
||||
val l: Int = <!NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, NI;TYPE_MISMATCH, OI;TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH!>three(a, b, c)<!>
|
||||
val l: Int = <!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH{OI}, TYPE_MISMATCH{NI}, TYPE_MISMATCH{NI}, TYPE_MISMATCH{NI}, TYPE_MISMATCH{NI}!>three(a, b, c)<!>
|
||||
|
||||
use(d, e, f, g, h, k, l)
|
||||
}
|
||||
@@ -41,11 +41,11 @@ fun <T> foo(t: T, <!UNUSED_PARAMETER!>l<!>: MutableList<T>): T = t
|
||||
|
||||
fun testErrorMessages(a: A, ml: MutableList<String>) {
|
||||
if (a is B && a is C) {
|
||||
<!OI;TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>foo<!>(a, <!NI;TYPE_MISMATCH!>ml<!>)
|
||||
<!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS{OI}!>foo<!>(a, <!TYPE_MISMATCH{NI}!>ml<!>)
|
||||
}
|
||||
|
||||
if(a is C) {
|
||||
<!OI;TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>foo<!>(a, <!NI;TYPE_MISMATCH!>ml<!>)
|
||||
<!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS{OI}!>foo<!>(a, <!TYPE_MISMATCH{NI}!>ml<!>)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,4 +8,4 @@ fun test(a: MutableList<out Int?>?) {
|
||||
b.inc()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
|
||||
fun test(a: MutableList<out Int?>?) {
|
||||
if (a != null) {
|
||||
val b = <!OI;DEBUG_INFO_SMARTCAST!>a<!>[0] // no SMARTCAST diagnostic
|
||||
val b = <!DEBUG_INFO_SMARTCAST{OI}!>a<!>[0] // no SMARTCAST diagnostic
|
||||
if (b != null) {
|
||||
<!DEBUG_INFO_SMARTCAST!>b<!>.inc()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ class B(var a: A<*>?) {
|
||||
<!SMARTCAST_IMPOSSIBLE!>a<!>.foo()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+7
-7
@@ -17,37 +17,37 @@ interface C {
|
||||
|
||||
fun foo(x: Any?) {
|
||||
if (x is A && x is B) {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER, OI;TYPE_MISMATCH!>_<!><String>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><String>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { _<String?>() }
|
||||
}
|
||||
|
||||
if (x is B && x is A) {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER, OI;TYPE_MISMATCH!>_<!><String>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><String>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { _<String?>() }
|
||||
}
|
||||
|
||||
if (x is A && x is C) {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { _<String>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER, OI;TYPE_MISMATCH!>_<!><String?>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><String?>() }
|
||||
}
|
||||
|
||||
if (x is C && x is A) {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { _<String>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER, OI;TYPE_MISMATCH!>_<!><String?>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><String?>() }
|
||||
}
|
||||
|
||||
if (x is A && x is B && x is C) {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { _<String>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER, OI;TYPE_MISMATCH!>_<!><String?>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><String?>() }
|
||||
}
|
||||
|
||||
if (x is B && x is A && x is C) {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { _<String>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER, OI;TYPE_MISMATCH!>_<!><String?>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><String?>() }
|
||||
}
|
||||
|
||||
if (x is B && x is C && x is A) {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { _<String>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER, OI;TYPE_MISMATCH!>_<!><String?>() }
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>.foo().checkType { <!TYPE_MISMATCH{OI}, UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><String?>() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ class Qwe<T : Any>(val a: T?) {
|
||||
|
||||
fun test1(obj: Qwe<*>) {
|
||||
obj <!UNCHECKED_CAST!>as Qwe<T><!>
|
||||
check(<!OI;DEBUG_INFO_SMARTCAST!>obj<!>.a)
|
||||
check(<!DEBUG_INFO_SMARTCAST{OI}!>obj<!>.a)
|
||||
}
|
||||
|
||||
fun check(a: T?) {
|
||||
|
||||
@@ -9,4 +9,4 @@ fun foo(a: MutableMap<String, String>, x: String?) {
|
||||
fun foo1(a: MutableMap<String, String>, x: String?) {
|
||||
<!INAPPLICABLE_CANDIDATE!>a[x] = x!!<!>
|
||||
a[x!!] = x
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,6 @@ fun foo(a: MutableMap<String, String>, x: String?) {
|
||||
}
|
||||
|
||||
fun foo1(a: MutableMap<String, String>, x: String?) {
|
||||
<!OI;TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>a[<!NI;TYPE_MISMATCH!>x<!>]<!> = x!!
|
||||
<!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS{OI}!>a[<!TYPE_MISMATCH{NI}!>x<!>]<!> = x!!
|
||||
a[x<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!>] = <!DEBUG_INFO_SMARTCAST!>x<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,4 +48,4 @@ fun case_3(z: Any?) {
|
||||
y checkType { <!INAPPLICABLE_CANDIDATE!>_<!><Any?>() }
|
||||
y checkType { _<kotlin.String>() }
|
||||
// y is inferred to String
|
||||
}
|
||||
}
|
||||
|
||||
+10
-10
@@ -6,22 +6,22 @@ fun case_0() {
|
||||
val z: Any? = 10
|
||||
val y = z.run {
|
||||
this as Int
|
||||
<!NI;DEBUG_INFO_SMARTCAST!>this<!> // error in NI: required Int, found Any?; just inferred to Any? in OI
|
||||
<!DEBUG_INFO_SMARTCAST{NI}!>this<!> // error in NI: required Int, found Any?; just inferred to Any? in OI
|
||||
}
|
||||
y checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Any?>() }
|
||||
y checkType { <!OI;TYPE_MISMATCH!>_<!><Int>() }
|
||||
y checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><Any?>() }
|
||||
y checkType { <!TYPE_MISMATCH{OI}!>_<!><Int>() }
|
||||
}
|
||||
|
||||
fun case_1(z: Any?) {
|
||||
val y = z.run {
|
||||
when (this) {
|
||||
is String -> return@run <!NI;DEBUG_INFO_SMARTCAST!>this<!> // type mismatch in the new inference (required String, found Any?)
|
||||
is String -> return@run <!DEBUG_INFO_SMARTCAST{NI}!>this<!> // type mismatch in the new inference (required String, found Any?)
|
||||
is Float -> ""
|
||||
else -> return@run ""
|
||||
}
|
||||
}
|
||||
y checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Any?>() }
|
||||
y checkType { <!OI;TYPE_MISMATCH!>_<!><kotlin.String>() }
|
||||
y checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><Any?>() }
|
||||
y checkType { <!TYPE_MISMATCH{OI}!>_<!><kotlin.String>() }
|
||||
// y is inferred to Any?
|
||||
}
|
||||
|
||||
@@ -40,12 +40,12 @@ fun case_2(z: Any?) {
|
||||
fun case_3(z: Any?) {
|
||||
val y = z.let {
|
||||
when (it) {
|
||||
is String -> return@let <!NI;DEBUG_INFO_SMARTCAST!>it<!>
|
||||
is String -> return@let <!DEBUG_INFO_SMARTCAST{NI}!>it<!>
|
||||
is Float -> ""
|
||||
else -> return@let ""
|
||||
}
|
||||
}
|
||||
y checkType { <!NI;UNRESOLVED_REFERENCE_WRONG_RECEIVER!>_<!><Any?>() }
|
||||
y checkType { <!OI;TYPE_MISMATCH!>_<!><kotlin.String>() }
|
||||
y checkType { <!UNRESOLVED_REFERENCE_WRONG_RECEIVER{NI}!>_<!><Any?>() }
|
||||
y checkType { <!TYPE_MISMATCH{OI}!>_<!><kotlin.String>() }
|
||||
// y is inferred to String
|
||||
}
|
||||
}
|
||||
|
||||
+4
-4
@@ -13,14 +13,14 @@ val foo: Foo = run {
|
||||
<!DEBUG_INFO_SMARTCAST!>x<!>
|
||||
}
|
||||
|
||||
val foofoo: Foo = <!OI;TYPE_INFERENCE_UPPER_BOUND_VIOLATED!>run<!> {
|
||||
val foofoo: Foo = <!TYPE_INFERENCE_UPPER_BOUND_VIOLATED{OI}!>run<!> {
|
||||
val x = foo()
|
||||
if (x == null) throw Exception()
|
||||
<!DEBUG_INFO_SMARTCAST, NI;TYPE_MISMATCH!>x<!>
|
||||
<!DEBUG_INFO_SMARTCAST, TYPE_MISMATCH{NI}!>x<!>
|
||||
}
|
||||
|
||||
val bar: Bar = <!NI;TYPE_MISMATCH!><!OI;TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS!>run<!> {
|
||||
val bar: Bar = <!TYPE_MISMATCH{NI}!><!TYPE_INFERENCE_CONFLICTING_SUBSTITUTIONS{OI}!>run<!> {
|
||||
val x = foo()
|
||||
if (x == null) throw Exception()
|
||||
<!NI;DEBUG_INFO_SMARTCAST, NI;TYPE_MISMATCH, TYPE_MISMATCH!>x<!>
|
||||
<!DEBUG_INFO_SMARTCAST{NI}, TYPE_MISMATCH{NI}, TYPE_MISMATCH!>x<!>
|
||||
}<!>
|
||||
|
||||
@@ -9,7 +9,7 @@ fun foo() {
|
||||
return true
|
||||
}
|
||||
<!SMARTCAST_IMPOSSIBLE!>i<!>.hashCode()
|
||||
trans(<!NI;SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>i<!>, ::can)
|
||||
trans(<!SMARTCAST_IMPOSSIBLE{NI}, SMARTCAST_IMPOSSIBLE!>i<!>, ::can)
|
||||
<!SMARTCAST_IMPOSSIBLE!>i<!>.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ fun foo(): Int {
|
||||
k.run()
|
||||
val d: Int = <!DEBUG_INFO_SMARTCAST!>c<!>
|
||||
// a is captured so smart cast is not possible
|
||||
return d + <!NI;SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>a<!>
|
||||
return d + <!SMARTCAST_IMPOSSIBLE{NI}, SMARTCAST_IMPOSSIBLE!>a<!>
|
||||
}
|
||||
else return -1
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ package a {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <m2> --
|
||||
package
|
||||
|
||||
@@ -23,3 +22,4 @@ package a {
|
||||
package b {
|
||||
public fun a.X.gav(): kotlin.Int
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ fun test(foo: Foo?) {
|
||||
// Correct
|
||||
foo?.bar?.length
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -132,4 +132,4 @@ fun checkInvokable(ip: InvokableProperty?) {
|
||||
if (ip?.<!UNSAFE_IMPLICIT_INVOKE_CALL!>i<!>() == "Hello") {
|
||||
<!DEBUG_INFO_SMARTCAST!>ip<!>.hashCode()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ class A(val x: String?) {
|
||||
x<!UNSAFE_CALL!>.<!>length > 0 -> "2"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -70,4 +70,4 @@ fun gau(flag: Boolean, arg: String?) {
|
||||
}
|
||||
|
||||
x.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -69,5 +69,5 @@ fun gau(flag: Boolean, arg: String?) {
|
||||
}
|
||||
}
|
||||
|
||||
<!NI;DEBUG_INFO_SMARTCAST!>x<!><!OI;UNSAFE_CALL!>.<!>hashCode()
|
||||
}
|
||||
<!DEBUG_INFO_SMARTCAST{NI}!>x<!><!UNSAFE_CALL{OI}!>.<!>hashCode()
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,4 +7,4 @@ fun bar() {
|
||||
var x: Int?
|
||||
x = 4
|
||||
foo(x, { x = null; x.<!INAPPLICABLE_CANDIDATE!>hashCode<!>() }, x)
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,5 +6,5 @@ fun foo(x: Int, f: () -> Unit, y: Int) {}
|
||||
fun bar() {
|
||||
var x: Int?
|
||||
x = 4
|
||||
foo(<!DEBUG_INFO_SMARTCAST!>x<!>, { x = null; x<!UNSAFE_CALL!>.<!>hashCode() }, <!NI;SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>x<!>)
|
||||
}
|
||||
foo(<!DEBUG_INFO_SMARTCAST!>x<!>, { x = null; x<!UNSAFE_CALL!>.<!>hashCode() }, <!SMARTCAST_IMPOSSIBLE{NI}, SMARTCAST_IMPOSSIBLE!>x<!>)
|
||||
}
|
||||
|
||||
@@ -8,4 +8,4 @@ fun bar(s: String): Int {
|
||||
fun foo(m: MyClass): Int {
|
||||
m.p = "xyz"
|
||||
return <!INAPPLICABLE_CANDIDATE!>bar<!>(m.p)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,5 +7,5 @@ fun bar(s: String): Int {
|
||||
|
||||
fun foo(m: MyClass): Int {
|
||||
m.p = "xyz"
|
||||
return bar(<!NI;SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>m.p<!>)
|
||||
}
|
||||
return bar(<!SMARTCAST_IMPOSSIBLE{NI}, SMARTCAST_IMPOSSIBLE!>m.p<!>)
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,4 +8,4 @@ fun foo() {
|
||||
v.<!INAPPLICABLE_CANDIDATE!>length<!>
|
||||
v = "abc"
|
||||
v.length
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ fun foo() {
|
||||
v = "abc"
|
||||
<!DEBUG_INFO_SMARTCAST!>v<!>.length
|
||||
v = null
|
||||
<!OI;DEBUG_INFO_CONSTANT!>v<!><!UNSAFE_CALL!>.<!>length
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>v<!><!UNSAFE_CALL!>.<!>length
|
||||
v = "abc"
|
||||
<!DEBUG_INFO_SMARTCAST!>v<!>.length
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ fun foo() {
|
||||
val y = x
|
||||
x = null
|
||||
if (y != null) {
|
||||
<!OI;DEBUG_INFO_CONSTANT!>x<!><!UNSAFE_CALL!>.<!>hashCode()
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>x<!><!UNSAFE_CALL!>.<!>hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ fun bar(s: String?) {
|
||||
val hashCode = ss?.hashCode()
|
||||
ss = null
|
||||
if (hashCode != null) {
|
||||
<!OI;DEBUG_INFO_CONSTANT!>ss<!><!UNSAFE_CALL!>.<!>hashCode()
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>ss<!><!UNSAFE_CALL!>.<!>hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -76,5 +76,5 @@ fun test6() {
|
||||
finally {
|
||||
a = null
|
||||
}
|
||||
<!OI;DEBUG_INFO_CONSTANT!>a<!><!UNSAFE_CALL!>.<!>hashCode() // a is null here
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>a<!><!UNSAFE_CALL!>.<!>hashCode() // a is null here
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ fun foo() {
|
||||
v.<!INAPPLICABLE_CANDIDATE!>length<!>
|
||||
v = null
|
||||
v.<!INAPPLICABLE_CANDIDATE!>length<!>
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -4,5 +4,5 @@ fun foo() {
|
||||
// It is possible in principle to provide smart cast here
|
||||
v<!UNSAFE_CALL!>.<!>length
|
||||
v = null
|
||||
<!OI;DEBUG_INFO_CONSTANT!>v<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
<!DEBUG_INFO_CONSTANT{OI}!>v<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
|
||||
+2
-2
@@ -12,10 +12,10 @@ operator fun Long?.inc() = this?.let { it + 1 }
|
||||
fun bar(arg: Long?): Long {
|
||||
var i = arg
|
||||
if (i++ == 5L) {
|
||||
return i<!UNSAFE_CALL!>--<!> <!NI;DEBUG_INFO_MISSING_UNRESOLVED, OI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>+<!> i
|
||||
return i<!UNSAFE_CALL!>--<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{OI}, DEBUG_INFO_MISSING_UNRESOLVED{NI}!>+<!> i
|
||||
}
|
||||
if (i++ == 7L) {
|
||||
return i++ <!UNSAFE_OPERATOR_CALL!>+<!> <!TYPE_MISMATCH!>i<!>
|
||||
}
|
||||
return 0L
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -10,4 +10,4 @@ public fun box() : MyClass? {
|
||||
var j = i++
|
||||
j.hashCode()
|
||||
return i
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
class MyClass
|
||||
|
||||
operator fun MyClass.inc(): MyClass { <!OI;UNREACHABLE_CODE!>return<!> null!! }
|
||||
operator fun MyClass.inc(): MyClass { <!UNREACHABLE_CODE{OI}!>return<!> null!! }
|
||||
|
||||
public fun box() : MyClass? {
|
||||
var i : MyClass?
|
||||
@@ -10,4 +10,4 @@ public fun box() : MyClass? {
|
||||
var j = <!DEBUG_INFO_SMARTCAST!>i<!>++
|
||||
<!DEBUG_INFO_SMARTCAST!>j<!>.hashCode()
|
||||
return i
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -10,4 +10,4 @@ public fun box() {
|
||||
var j = ++i
|
||||
// j is null so call is unsafe
|
||||
j.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
class MyClass
|
||||
|
||||
operator fun MyClass.inc(): MyClass { <!OI;UNREACHABLE_CODE!>return<!> null!! }
|
||||
operator fun MyClass.inc(): MyClass { <!UNREACHABLE_CODE{OI}!>return<!> null!! }
|
||||
|
||||
public fun box() {
|
||||
var i : MyClass?
|
||||
@@ -10,4 +10,4 @@ public fun box() {
|
||||
var j = ++<!DEBUG_INFO_SMARTCAST!>i<!>
|
||||
// j is null so call is unsafe
|
||||
j.hashCode()
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -15,7 +15,7 @@ class MyClass {
|
||||
m = create()
|
||||
// See KT-7428
|
||||
for ((k, v) in <!SMARTCAST_IMPOSSIBLE!>m<!>)
|
||||
res += (<!NI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>k<!>.<!NI;DEBUG_INFO_MISSING_UNRESOLVED!>length<!> <!NI;DEBUG_INFO_MISSING_UNRESOLVED!>+<!> <!NI;DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>v<!>.<!NI;DEBUG_INFO_MISSING_UNRESOLVED!>length<!>)
|
||||
res += (<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{NI}!>k<!>.<!DEBUG_INFO_MISSING_UNRESOLVED{NI}!>length<!> <!DEBUG_INFO_MISSING_UNRESOLVED{NI}!>+<!> <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE{NI}!>v<!>.<!DEBUG_INFO_MISSING_UNRESOLVED{NI}!>length<!>)
|
||||
return res
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -13,4 +13,4 @@ fun max(a: IntArray): Int? {
|
||||
maxI = i
|
||||
}
|
||||
return maxI
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ fun IntArray.forEachIndexed( op: (i: Int, value: Int) -> Unit) {
|
||||
fun max(a: IntArray): Int? {
|
||||
var maxI: Int? = null
|
||||
a.forEachIndexed { i, value ->
|
||||
if (maxI == null || value >= a[<!NI;SMARTCAST_IMPOSSIBLE, SMARTCAST_IMPOSSIBLE!>maxI<!>])
|
||||
if (maxI == null || value >= a[<!SMARTCAST_IMPOSSIBLE{NI}, SMARTCAST_IMPOSSIBLE!>maxI<!>])
|
||||
maxI = i
|
||||
}
|
||||
return maxI
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
fun foo(): Int {
|
||||
var i: Int? = <!VARIABLE_WITH_REDUNDANT_INITIALIZER!>42<!>
|
||||
i = null
|
||||
return <!TYPE_MISMATCH!><!OI;DEBUG_INFO_CONSTANT!>i<!> + 1<!>
|
||||
}
|
||||
return <!TYPE_MISMATCH!><!DEBUG_INFO_CONSTANT{OI}!>i<!> + 1<!>
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@ fun foo(): Int {
|
||||
var s: String? = "abc"
|
||||
s = null
|
||||
return s.<!INAPPLICABLE_CANDIDATE!>length<!>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@
|
||||
fun foo(): Int {
|
||||
var s: String? = <!VARIABLE_WITH_REDUNDANT_INITIALIZER!>"abc"<!>
|
||||
s = null
|
||||
return <!OI;DEBUG_INFO_CONSTANT!>s<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
return <!DEBUG_INFO_CONSTANT{OI}!>s<!><!UNSAFE_CALL!>.<!>length
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user