From 4d11fac3656fb428dfe217de9cfca7e46624a42e Mon Sep 17 00:00:00 2001 From: Pavel Kirpichenkov Date: Fri, 27 Dec 2019 16:39:38 +0300 Subject: [PATCH] [NI] Add restored smart casts to spec tests KT-35668 Fixed --- .../testData/diagnostics/notLinked/dfa/neg/32.kt | 8 ++++---- .../testData/diagnostics/notLinked/dfa/pos/32.kt | 2 +- .../testData/diagnostics/notLinked/dfa/pos/40.kt | 4 ++-- .../testData/diagnostics/notLinked/dfa/pos/5.kt | 4 ++-- .../testData/diagnostics/notLinked/dfa/pos/55.kt | 4 ++-- .../testData/diagnostics/notLinked/dfa/pos/6.kt | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/32.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/32.kt index 70ac0b8d0f3..ec63f6c10cc 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/32.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/32.kt @@ -46,8 +46,8 @@ fun case_2(x: Int?, y: Nothing?) { fun case_3(x: Int?) { if (x == null) { x as Int - stringArg(x) - x + stringArg(x) + x } } @@ -59,7 +59,7 @@ fun case_3(x: Int?) { fun case_4(x: Int?) { if (x == null) { x!! - stringArg(x) + stringArg(x) x } } @@ -73,7 +73,7 @@ fun case_5(x: Int?) { if (x == null) { var y = x y!! - stringArg(y) + stringArg(y) y } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/32.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/32.kt index 22537de04d1..37d2a387e67 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/32.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/32.kt @@ -15,7 +15,7 @@ fun case_1(x: T?, y: K?) { x as T y as K - val z = x ?: y + val z = x ?: y x.equals(10) z diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.kt index 4b54103bae4..95e56d16b99 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.kt @@ -62,8 +62,8 @@ fun case_5(x: Any?) { */ fun case_6(x: Any?) { if (x is Boolean? && x!!) { - x.not() - select(x).not() + x.not() + select(x).not() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/5.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/5.kt index 70945af5c2f..418abfe7b11 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/5.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/5.kt @@ -361,7 +361,7 @@ fun case_15(x: Any?) { } // TESTCASE NUMBER: 16 -fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) a else 0) { +fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) a else 0) { a b b.equals(null) @@ -376,7 +376,7 @@ fun case_16(a: Any?, b: Int = if (a is Number? && a is Int? && a !== null) a) { +fun case_17(a: Any?, b: Int = if (a !is Number? || a !is Int? || a == null) 0 else a) { a b b.equals(null) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/55.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/55.kt index e1e7b522508..e613ddbaffb 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/55.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/55.kt @@ -29,7 +29,7 @@ fun case_1(x: Any) { fun case_2(x: Any?) { if (x is String?) { x!!.length - x + x } } @@ -51,6 +51,6 @@ fun case_3(x: Any) { fun case_4(x: Any?) { if (x is Map.Entry<*, *>?) { ")!>x!!.value - ?")!>x + ")!>x } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.kt index e8274287da1..2afd19582b8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.kt @@ -1405,14 +1405,14 @@ fun case_75(t: Any?, z: Nothing?) { t.itest() t.test1() t.test2() - t + t } } } } // TESTCASE NUMBER: 76 -fun case_76(a: Any?, b: Int = if (a !is Number? === true || a !is Int? == true || a != null == false == true) 0 else a) { +fun case_76(a: Any?, b: Int = if (a !is Number? === true || a !is Int? == true || a != null == false == true) 0 else a) { a b b.equals(null)