From 1dc3c93efa8fe68e55ae7e0b22f36cd66183f881 Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Thu, 10 Sep 2020 15:47:02 +0300 Subject: [PATCH] [FIR] Don't assume types with not found symbol as error types --- .../resolveWithStdlib/getOrPutAmbiguity.kt | 5 ++ .../resolveWithStdlib/getOrPutAmbiguity.txt | 4 + ...FirDiagnosticsWithStdlibTestGenerated.java | 5 ++ .../kotlin/fir/types/ConeTypeContext.kt | 4 +- .../codegen/box/arrays/primitiveArrays.kt | 3 +- .../plusAssignWithComplexRHS.kt | 1 - .../codegen/box/regressions/kt3442.kt | 1 - .../smartcasts/intersectingInfo.fir.kt | 12 +-- .../smartcasts/intersectionTypes.fir.kt | 6 +- ...nullabilitySmartcastWhenNullability.fir.kt | 14 ++-- .../operatorsTests/andOperator.fir.kt | 14 ++-- .../operatorsTests/equalsOperator.fir.kt | 12 +-- .../operatorsTests/orOperator.fir.kt | 14 ++-- .../contracts/smartcasts/receiver.fir.kt | 6 +- .../hugeUnresolvedKotlinxHtml.fir.kt | 46 +++++------ .../callableReferenceOnParameter.fir.kt | 4 +- .../testsWithStdLib/regression/kt37706.fir.kt | 5 -- .../testsWithStdLib/regression/kt37706.kt | 1 + .../tryCatch/boundedSmartcasts.fir.kt | 20 ++--- .../typeAliasSamAdapterConstructors2.fir.kt | 2 +- .../p-4/neg/1.1.fir.kt | 2 +- .../p-4/neg/1.1.fir.kt | 2 +- .../contracts/analysis/common/neg/1.fir.kt | 8 +- .../contracts/analysis/common/pos/1.fir.kt | 2 +- .../analysis/smartcasts/neg/1.fir.kt | 6 +- .../analysis/smartcasts/neg/10.fir.kt | 76 +++++++++---------- .../analysis/smartcasts/neg/2.fir.kt | 32 ++++---- .../analysis/smartcasts/neg/3.fir.kt | 20 ++--- .../analysis/smartcasts/neg/4.fir.kt | 10 +-- .../analysis/smartcasts/neg/5.fir.kt | 20 ++--- .../analysis/smartcasts/neg/6.fir.kt | 38 +++++----- .../analysis/smartcasts/neg/7.fir.kt | 30 ++++---- .../analysis/smartcasts/neg/8.fir.kt | 8 +- .../analysis/smartcasts/neg/9.fir.kt | 4 +- .../analysis/smartcasts/pos/11.fir.kt | 8 +- .../analysis/smartcasts/pos/12.fir.kt | 2 +- .../analysis/smartcasts/pos/14.fir.kt | 6 +- .../analysis/smartcasts/pos/3.fir.kt | 20 ++--- .../analysis/smartcasts/pos/5.fir.kt | 20 ++--- .../analysis/smartcasts/pos/6.fir.kt | 40 +++++----- .../analysis/smartcasts/pos/8.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/10.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/14.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/16.fir.kt | 16 ++-- .../diagnostics/notLinked/dfa/neg/21.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/39.fir.kt | 16 ++-- .../diagnostics/notLinked/dfa/neg/4.fir.kt | 18 ++--- .../diagnostics/notLinked/dfa/neg/42.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/43.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/6.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/7.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/16.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/17.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/18.fir.kt | 12 +-- .../diagnostics/notLinked/dfa/pos/20.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/33.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/39.fir.kt | 6 +- .../diagnostics/notLinked/dfa/pos/46.fir.kt | 12 +-- .../diagnostics/notLinked/dfa/pos/68.fir.kt | 8 +- 59 files changed, 330 insertions(+), 323 deletions(-) create mode 100644 compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.kt create mode 100644 compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.txt delete mode 100644 compiler/testData/diagnostics/testsWithStdLib/regression/kt37706.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.kt new file mode 100644 index 00000000000..f9f4c20ac4c --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.kt @@ -0,0 +1,5 @@ +// !FULL_JDK + +fun test(map: MutableMap>) { + map.getOrPut(1, ::mutableMapOf) +} diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.txt new file mode 100644 index 00000000000..a09f844b6c9 --- /dev/null +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.txt @@ -0,0 +1,4 @@ +FILE: getOrPutAmbiguity.kt + public final fun test(map: R|kotlin/collections/MutableMap>|): R|kotlin/Unit| { + R|/map|.R|kotlin/collections/getOrPut||>(Int(1), ::R|kotlin/collections/mutableMapOf|) + } diff --git a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java index dc707afc699..c2a69273d2e 100644 --- a/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java +++ b/compiler/fir/analysis-tests/tests/org/jetbrains/kotlin/fir/FirDiagnosticsWithStdlibTestGenerated.java @@ -128,6 +128,11 @@ public class FirDiagnosticsWithStdlibTestGenerated extends AbstractFirDiagnostic runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/getOnKProperty.kt"); } + @TestMetadata("getOrPutAmbiguity.kt") + public void testGetOrPutAmbiguity() throws Exception { + runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/getOrPutAmbiguity.kt"); + } + @TestMetadata("hashMapTypeAlias.kt") public void testHashMapTypeAlias() throws Exception { runTest("compiler/fir/analysis-tests/testData/resolveWithStdlib/hashMapTypeAlias.kt"); diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt index dedcd975ab3..94f7add7ab0 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/types/ConeTypeContext.kt @@ -236,7 +236,7 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty when (val symbol = toClassLikeSymbol().also { it?.ensureResolved(FirResolvePhase.TYPES, session) }) { is FirClassSymbol<*> -> symbol.fir.superConeTypes is FirTypeAliasSymbol -> listOfNotNull(symbol.fir.expandedConeType) - else -> emptyList() + else -> listOf(session.builtinTypes.anyType.type) } } is ConeCapturedTypeConstructor -> supertypes!! @@ -518,7 +518,7 @@ interface ConeTypeContext : TypeSystemContext, TypeSystemOptimizationContext, Ty } override fun TypeConstructorMarker.isError(): Boolean { - return this is ErrorTypeConstructor || (this is ConeClassLikeLookupTag && this.toSymbol(session) == null) + return this is ErrorTypeConstructor } } diff --git a/compiler/testData/codegen/box/arrays/primitiveArrays.kt b/compiler/testData/codegen/box/arrays/primitiveArrays.kt index 4f6831bbea2..cd2a5f23cf9 100644 --- a/compiler/testData/codegen/box/arrays/primitiveArrays.kt +++ b/compiler/testData/codegen/box/arrays/primitiveArrays.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME @@ -192,4 +191,4 @@ fun checkExactArrayType( a is FloatArray == floatArray && a is DoubleArray == doubleArray && a is Array<*> == array -} \ No newline at end of file +} diff --git a/compiler/testData/codegen/box/operatorConventions/plusAssignWithComplexRHS.kt b/compiler/testData/codegen/box/operatorConventions/plusAssignWithComplexRHS.kt index 67f0ea70f8d..090deebc2fb 100644 --- a/compiler/testData/codegen/box/operatorConventions/plusAssignWithComplexRHS.kt +++ b/compiler/testData/codegen/box/operatorConventions/plusAssignWithComplexRHS.kt @@ -1,6 +1,5 @@ // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME -// IGNORE_BACKEND_FIR: JVM_IR var map: Map> = emptyMap() diff --git a/compiler/testData/codegen/box/regressions/kt3442.kt b/compiler/testData/codegen/box/regressions/kt3442.kt index 69109a8bb31..19c49d33516 100644 --- a/compiler/testData/codegen/box/regressions/kt3442.kt +++ b/compiler/testData/codegen/box/regressions/kt3442.kt @@ -1,4 +1,3 @@ -// IGNORE_BACKEND_FIR: JVM_IR // KJS_WITH_FULL_RUNTIME // WITH_RUNTIME diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/intersectingInfo.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/intersectingInfo.fir.kt index 189609f3467..989afc2c66e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/intersectingInfo.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/intersectingInfo.fir.kt @@ -31,12 +31,12 @@ fun intersectingInfo(x: Any?, y: Any?) { if ((isString(x) && y is String) || (!notIsString(x) && !notIsInt(y))) { x.length y.length - y.inc() + y.inc() } else { x.length y.length - y.inc() + y.inc() } } @@ -49,13 +49,13 @@ fun intersectingInfo2(x: Any?, y: Any?) { (!notIsString(x) && isString(y) && y is Int) || (x is String && !notIsInt(y) && x is Int)) { x.length - x.inc() + x.inc() y.length - y.inc() + y.inc() } x.length - x.inc() + x.inc() y.length - y.inc() + y.inc() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/intersectionTypes.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/intersectionTypes.fir.kt index 4eb2c5dc30a..7f17a0cdb27 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/intersectionTypes.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/intersectionTypes.fir.kt @@ -28,7 +28,7 @@ fun testDeMorgan(x: Any?) { } else { x.length - x.inc() + x.inc() } } @@ -36,10 +36,10 @@ fun testDeMorgan2(x: Any?) { // x !is String || x !is Int if (notIsString(x) || notIsInt(x)) { x.length - x.inc() + x.inc() } else { x.length x.inc() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt index e7b261a5bfa..1942a197c38 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt @@ -14,7 +14,7 @@ fun nullWhenNull(x: Int?): Int? { fun testNullWhenNull(x: Int?) { if (nullWhenNull(x) == null) { - x.dec() + x.dec() } else { x.dec() @@ -24,10 +24,10 @@ fun testNullWhenNull(x: Int?) { x.dec() } else { - x.dec() + x.dec() } - x.dec() + x.dec() } // NB. it is the same function as `nullWhenNull`, but annotations specifies other facet of the function behaviour @@ -43,15 +43,15 @@ fun testNotNullWhenNotNull (x: Int?) { x == null } else { - x.dec() + x.dec() } if (notNullWhenNotNull(x) != null) { - x.dec() + x.dec() } else { x == null } - x.dec() -} \ No newline at end of file + x.dec() +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/andOperator.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/andOperator.fir.kt index 0de0dbe72a4..e6851cbd1d1 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/andOperator.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/andOperator.fir.kt @@ -42,17 +42,17 @@ fun truetrue(x: Any?) { x.inc() } x.length - x.inc() + x.inc() } fun truefalse(x: Any?) { if (trueWhenString(x) && falseWhenInt(x)) { x.length - x.inc() + x.inc() } else { x.length - x.inc() + x.inc() } } @@ -63,19 +63,19 @@ fun falsetrue(x: Any?) { } else { x.length - x.inc() + x.inc() } } fun falsefalse(x: Any?) { if (falseWhenString(x) && falseWhenInt(x)) { x.length - x.inc() + x.inc() } else { // Note that we can't argue that we have any of smartcasts here, // because we don't know which one of both arguments was 'false' to bring us here x.length - x.inc() + x.inc() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt index b9b869596c4..56fd68cd5e6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/equalsOperator.fir.kt @@ -20,28 +20,28 @@ fun myEqualsNotNull(x: Int?): Boolean { } fun testBasicEquals(x: Int?) { - x.inc() + x.inc() if (myEqualsNull(x)) { - x.inc() + x.inc() } else { x.inc() } - x.inc() + x.inc() } fun testBasicNotEquals(x: Int?) { - x.inc() + x.inc() if (myEqualsNotNull(x)) { x.inc() } else { - x.inc() + x.inc() } - x.inc() + x.inc() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/orOperator.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/orOperator.fir.kt index c95b39eebdd..efcabeeb5ee 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/orOperator.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/operatorsTests/orOperator.fir.kt @@ -36,18 +36,18 @@ fun falseWhenInt(x: Any?): Boolean { fun truetrue(x: Any?) { if (trueWhenString(x) || trueWhenInt(x)) { x.length - x.inc() + x.inc() } else { x.length - x.inc() + x.inc() } } fun truefalse(x: Any?) { if (trueWhenString(x) || falseWhenInt(x)) { x.length - x.inc() + x.inc() } else { x.length @@ -58,21 +58,21 @@ fun truefalse(x: Any?) { fun falsetrue(x: Any?) { if (falseWhenString(x) || trueWhenInt(x)) { x.length - x.inc() + x.inc() } else { x.length - x.inc() + x.inc() } } fun falsefalse(x: Any?) { if (falseWhenString(x) || falseWhenInt(x)) { x.length - x.inc() + x.inc() } else { x.length x.inc() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt index 474ba3a6482..de76d236c58 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/receiver.fir.kt @@ -14,7 +14,7 @@ fun Any?.isNull(): Boolean { fun smartcastOnReceiver(x: Int?) { if (x.isNull()) { - x.inc() + x.inc() } else { x.dec() @@ -26,10 +26,10 @@ class UnstableReceiver { fun smartcastOnUnstableReceiver() { if (x.isNull()) { - x.inc() + x.inc() } else { - x.dec() + x.dec() } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/hugeUnresolvedKotlinxHtml.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/hugeUnresolvedKotlinxHtml.fir.kt index 3ee51c17e15..24a3f534fb0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/hugeUnresolvedKotlinxHtml.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/hugeUnresolvedKotlinxHtml.fir.kt @@ -1,28 +1,28 @@ class A { fun bar() { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { - div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { + div { +(foo ?: "") +(foo ?: "") +(foo ?: "") diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.fir.kt index 7c6252e64c1..3c88ff3809b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/callableReferenceOnParameter.fir.kt @@ -3,6 +3,6 @@ internal class Z { val map = HashMap() inline fun compute(key: String, producer: () -> String): String { - return map.getOrPut(key, ::producer) + return map.getOrPut(key, ::producer) } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt37706.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt37706.fir.kt deleted file mode 100644 index b34886365db..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt37706.fir.kt +++ /dev/null @@ -1,5 +0,0 @@ -fun test(): Int { - val sets = (1..100).associateWith { (it..10 * it).mapTo(java.util.TreeSet()) { i -> i } } - val set = sets[50] ?: emptySet() - return set.size -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/regression/kt37706.kt b/compiler/testData/diagnostics/testsWithStdLib/regression/kt37706.kt index 060beb07851..6477d65f7e6 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/regression/kt37706.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/regression/kt37706.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun test(): Int { val sets = (1..100).associateWith { (it..10 * it).mapTo(java.util.TreeSet()) { i -> i } } val set = sets[50] ?: emptySet() diff --git a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt index ea8f2aab7a3..d7030617a16 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.fir.kt @@ -13,11 +13,11 @@ fun test0(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -32,11 +32,11 @@ fun test1(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -51,11 +51,11 @@ fun test2(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -69,11 +69,11 @@ fun test3(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } @@ -91,11 +91,11 @@ fun test5(x: Int?) { if (x != null) { x.inc() - y.inc() + y.inc() } if (y != null) { - x.inc() + x.inc() y.inc() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt index a0a54e305f8..8738d71769e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt @@ -24,4 +24,4 @@ val test1 = R { } val test2 = C { s -> println(s.length) } val test3 = CStr { s -> println(s.length) } val test4 = CStrList { ss -> for (s in ss) { println(s.length) } } -val test5 = C2 { a, b -> val x: Int = a + b; println(x)} +val test5 = C2 { a, b -> val x: Int = a + b; println(x)} diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.fir.kt index f0e8d2ddb2e..3babe3d0231 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-decrement-expression/p-4/neg/1.1.fir.kt @@ -15,7 +15,7 @@ class A() { fun case1() { var b: Case1? = Case1() - --b?.a + --b?.a } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.fir.kt index 27fd8f59ca4..3f904e182b0 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/prefix-expressions/prefix-increment-expression/p-4/neg/1.1.fir.kt @@ -15,7 +15,7 @@ class A() { fun case1() { var b: Case1? = Case1() - ++b?.a + ++b?.a } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt index d781d5be1ac..ce3f5513e8d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt @@ -46,7 +46,7 @@ fun case_1(value_1: Int?) { if (contracts.case_1(value_1) { value_2 = 10 }) { println(value_2) } else { - value_1.inv() + value_1.inv() println(value_2) } } @@ -56,10 +56,10 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) { val value_4: Int when (value_1.case_2(value_2, value_3) { value_4 = 10 }) { true -> { - println(value_3?.xor(true)) + println(value_3?.xor(true)) println(value_4) - println(value_1.inv()) - println(value_2.inv()) + println(value_1.inv()) + println(value_2.inv()) } false -> { println(value_4) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/1.fir.kt index a53a73e5a08..c77ac5af174 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/1.fir.kt @@ -61,7 +61,7 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) { println(value_2) } null -> { - println(value_3?.xor(true)) + println(value_3?.xor(true)) println(value_4) println(value_1) println(value_2) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt index de3278d3f10..a22b50b0e3f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt @@ -11,13 +11,13 @@ fun case_1(value_1: Any?) { // TESTCASE NUMBER: 2 fun case_2(value_1: Int?) { funWithReturnsAndInvertCondition(value_1 != null) - println(value_1.inc()) + println(value_1.inc()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Int?) { funWithReturns(value_1 == null) - println(value_1.inc()) + println(value_1.inc()) } // TESTCASE NUMBER: 4 @@ -44,7 +44,7 @@ object case_7_object { } fun case_7() { funWithReturns(case_7_object.prop_1 == null) - case_7_object.prop_1.inc() + case_7_object.prop_1.inc() } // TESTCASE NUMBER: 8 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt index 8083bb66060..3e7cde4f5d6 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/10.fir.kt @@ -213,7 +213,7 @@ fun case_2(value_1: Any?) { // TESTCASE NUMBER: 3 fun case_3(number: Int?) { - if (!funWithReturnsTrueAndNullCheck(number)) number.inc() + if (!funWithReturnsTrueAndNullCheck(number)) number.inc() } // TESTCASE NUMBER: 4 @@ -284,7 +284,7 @@ fun case_12(value_1: Any?, value_2: Any?) { println(value_2?.toByte()) } if (funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsNotNull(value_1 !is String || value_2 !is Number) == null) { @@ -300,7 +300,7 @@ fun case_12(value_1: Any?, value_2: Any?) { // TESTCASE NUMBER: 13 fun case_13(value_1: Any?, value_2: Any?) { if (!funWithReturnsTrueAndInvertCondition(value_1 is Float? && value_1 != null && value_2 != null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsFalseAndInvertCondition(value_1 is String && value_2 is Number)) { @@ -320,7 +320,7 @@ fun case_13(value_1: Any?, value_2: Any?) { println(value_2?.toByte()) } if (funWithReturnsNotNull(value_1 is Float? && value_1 != null && value_2 != null) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsNullAndInvertCondition(value_1 is String && value_2 is Number) != null) { @@ -332,7 +332,7 @@ fun case_13(value_1: Any?, value_2: Any?) { println(value_2?.toByte()) } if (funWithReturnsNull(value_1 is Float? && value_1 != null && value_2 != null) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } } @@ -344,24 +344,24 @@ class case_14_class { fun case_14(value_1: Any?, value_2: Number?) { val o = case_14_class() if (!funWithReturnsTrueAndInvertCondition(value_1 is Float? && value_1 != null && value_2 != null && o.prop_1 != null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsNotNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } } @@ -413,28 +413,28 @@ class case_17_class { fun case_17(value_1: Any?, value_2: Number?) { val o = case_17_class() if (contracts.case_17_1(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } if (contracts.case_17_2(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } if (contracts.case_17_3(value_1, value_2, o.prop_1, this.prop_1) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } if (contracts.case_17_4(value_1, value_2, o.prop_1, this.prop_1) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } } } @@ -449,10 +449,10 @@ fun case_18(value_1: Any?) { // TESTCASE NUMBER: 19 fun case_19(value_1: Number) { - when { !value_1.case_19_1() -> println(value_1.inv()) } - when { value_1.case_19_2() -> println(value_1.inv()) } - when { value_1.case_19_3() == null -> println(value_1.inv()) } - when { value_1.case_19_4() != null -> println(value_1.inv()) } + when { !value_1.case_19_1() -> println(value_1.inv()) } + when { value_1.case_19_2() -> println(value_1.inv()) } + when { value_1.case_19_3() == null -> println(value_1.inv()) } + when { value_1.case_19_4() != null -> println(value_1.inv()) } } // TESTCASE NUMBER: 20 @@ -488,16 +488,16 @@ fun case_22(value_1: Any?, value_2: Any?) { // TESTCASE NUMBER: 23 fun case_23(value_1: Number?, value_2: Number?) { - if (value_1.case_23_1()) println(value_1.inv()) - if (value_2.case_23_2() == null) println(value_2.inv()) - if (value_2.case_23_3() != null) println(value_2.inv()) + if (value_1.case_23_1()) println(value_1.inv()) + if (value_2.case_23_2() == null) println(value_2.inv()) + if (value_2.case_23_3() != null) println(value_2.inv()) } // TESTCASE NUMBER: 24 fun case_24(value_1: Any?, value_2: Any?) { - if (value_1.case_24_1()) println(value_1.inv()) - if (value_2.case_24_2() != null) println(value_2.inv()) - if (value_2.case_24_3() == null) println(value_2.inv()) + if (value_1.case_24_1()) println(value_1.inv()) + if (value_2.case_24_2() != null) println(value_2.inv()) + if (value_2.case_24_3() == null) println(value_2.inv()) } // TESTCASE NUMBER: 25 @@ -505,19 +505,19 @@ fun case_25(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?) { when { value_1.case_25_1(value_2) -> { println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } } when { value_3.case_25_2(value_4) == null -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } when { value_3.case_25_3(value_4) != null -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt index bace9c5bf8f..71b1dfe97cc 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt @@ -26,7 +26,7 @@ fun case_3(value_1: Any?, value_2: Any?) { // TESTCASE NUMBER: 4 fun case_4(value_1: Any?, value_2: Number?) { funWithReturns(value_1 !is Float? || value_1 == null || value_2 == null) - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } @@ -36,9 +36,9 @@ class case_5_class { fun case_5(value_1: Any?, value_2: Number?) { val o = case_5_class() funWithReturns(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null) - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } @@ -105,19 +105,19 @@ fun case_8(value_1: Any?, value_2: Any?) { // TESTCASE NUMBER: 9 fun case_9(value_1: Any?, value_2: Number?) { if (funWithReturnsTrue(value_1 !is Float? || value_1 == null || value_2 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (!funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsNotNull(value_1 is Float? && value_1 != null && value_2 != null) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } if (funWithReturnsNull(value_1 is Float? && value_1 != null && value_2 != null) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) } } @@ -129,24 +129,24 @@ class case_10_class { fun case_10(value_1: Any?, value_2: Number?) { val o = case_10_class() if (funWithReturnsTrue(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (!funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsNotNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } } @@ -156,5 +156,5 @@ fun case_11(value_1: Any?, value_2: Any?, value_3: Any?) { funWithReturnsAndInvertCondition(value_1 !is String? || value_2 !is Number && value_3 !is Float) println(value_1!!.length) println(value_2.toByte()) - println(value_3.dec()) + println(value_3.dec()) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt index bd46e3b167c..8601a996205 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt @@ -103,9 +103,9 @@ class case_3_class { fun case_3(value_1: Any?, value_2: Number?) { val o = case_3_class() contracts.case_3(value_1, value_2, o.prop_1, this.prop_1) - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } @@ -156,24 +156,24 @@ class case_6_class { fun case_6(value_1: Any?, value_2: Number?) { val o = case_6_class() if (contracts.case_6_1(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (!contracts.case_6_2(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (contracts.case_6_3(value_1, value_2, o.prop_1, this.prop_1) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (contracts.case_6_4(value_1, value_2, o.prop_1, this.prop_1) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt index c6701562edf..736fd934e09 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt @@ -146,7 +146,7 @@ fun case_1(value_1: Any?) { // TESTCASE NUMBER: 2 fun case_2(value_1: Number) { value_1.case_2() - println(value_1.inv()) + println(value_1.inv()) } // TESTCASE NUMBER: 3 @@ -175,10 +175,10 @@ fun case_5(value_1: Any?) { // TESTCASE NUMBER: 6 fun case_6(value_1: Number) { - when { value_1.case_6_1() -> println(value_1.inv()) } - when { !value_1.case_6_2() -> println(value_1.inv()) } - when { value_1.case_6_3() != null -> println(value_1.inv()) } - when { value_1.case_6_4() != null -> println(value_1.inv()) } + when { value_1.case_6_1() -> println(value_1.inv()) } + when { !value_1.case_6_2() -> println(value_1.inv()) } + when { value_1.case_6_3() != null -> println(value_1.inv()) } + when { value_1.case_6_4() != null -> println(value_1.inv()) } } // TESTCASE NUMBER: 7 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/5.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/5.fir.kt index 0cf1a2a7376..a35f95eb265 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/5.fir.kt @@ -92,13 +92,13 @@ fun case_1(value_1: Any?) { // TESTCASE NUMBER: 2 fun case_2(value_1: Number?) { value_1.case_2() - println(value_1.inv()) + println(value_1.inv()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Any?) { value_1.case_3() - println(value_1.inv()) + println(value_1.inv()) } // TESTCASE NUMBER: 4 @@ -111,16 +111,16 @@ fun case_4(value_1: Any?, value_2: Any?, value_3: Any?) { // TESTCASE NUMBER: 5 fun case_5(value_1: Number?, value_2: Number?, value_3: Number?) { - if (value_1.case_5_1()) println(value_1.inv()) - if (!value_2.case_5_2()) println(value_2.inv()) - if (value_3.case_5_3() != null) println(value_3.inv()) - if (value_3.case_5_4() == null) println(value_3.inv()) + if (value_1.case_5_1()) println(value_1.inv()) + if (!value_2.case_5_2()) println(value_2.inv()) + if (value_3.case_5_3() != null) println(value_3.inv()) + if (value_3.case_5_4() == null) println(value_3.inv()) } // TESTCASE NUMBER: 6 fun case_6(value_1: Any?, value_2: Any?, value_3: Any?) { - if (value_1.case_6_1()) println(value_1.inv()) - if (!value_2.case_6_2()) println(value_2.inv()) - if (value_3.case_6_3() == null) println(value_3.inv()) - if (value_3.case_6_4() != null) println(value_3.inv()) + if (value_1.case_6_1()) println(value_1.inv()) + if (!value_2.case_6_2()) println(value_2.inv()) + if (value_3.case_6_3() == null) println(value_3.inv()) + if (value_3.case_6_4() != null) println(value_3.inv()) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt index 3465ff56e1a..1812171498d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt @@ -111,27 +111,27 @@ import contracts.* fun case_1(value_1: Any?, value_2: Int?) { value_1.case_1(value_2) println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } // TESTCASE NUMBER: 2 fun case_2(value_1: Number?, value_2: Any?) { value_1.case_2(value_2) - println(value_1.inv()) + println(value_1.inv()) println(value_2.toByte()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Any?, value_2: String?) { value_1.case_3(value_2) - println(value_1.inv()) + println(value_1.inv()) println(value_2.length) } // TESTCASE NUMBER: 4 fun case_4(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { value_1.case_4(value_2, value_3, value_4) - println(value_2.inv()) + println(value_2.inv()) println(value_3.toByte()) println(value_4.length) } @@ -141,19 +141,19 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: when { value_1.case_5_1(value_2) -> { println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } } when { !value_3.case_5_2(value_4) -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } when { value_5.case_5_3(value_6) != null -> { println(value_5.length) - println(value_6.inv()) + println(value_6.inv()) } } } @@ -161,19 +161,19 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: // TESTCASE NUMBER: 6 fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, value_5: Number?, value_6: Any?) { if (value_1.case_6_1(value_2)) { - println(value_1.inv()) + println(value_1.inv()) println(value_2.toByte()) } if (!value_3.case_6_2(value_4)) { - println(value_3.inv()) + println(value_3.inv()) println(value_4.toByte()) } if (value_5.case_6_3(value_6) != null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.toByte()) } if (value_5.case_6_4(value_6) == null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.toByte()) } } @@ -181,35 +181,35 @@ fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, val // TESTCASE NUMBER: 7 fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, value_5: Any?, value_6: String?) { if (value_1.case_7_1(value_2)) { - println(value_1.inv()) + println(value_1.inv()) println(value_2.length) } if (value_3.case_7_2(value_4)) { - println(value_3.inv()) + println(value_3.inv()) println(value_4.length) } if (value_5.case_7_3(value_6) != null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.length) } if (value_5.case_7_4(value_6) == null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.length) } } // TESTCASE NUMBER: 8 fun case_8(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { - when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } + when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } - when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_2.inv()) } + when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_2.inv()) } when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_3.toByte()) } when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_4.length) } - when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_2.inv()) } + when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_2.inv()) } when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_3.toByte()) } when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_4.length) } - when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_2.inv()) } + when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_2.inv()) } when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_3.toByte()) } when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_4.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt index 8320c4dda3d..79d069fc03e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt @@ -210,7 +210,7 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Int?) { case_1_1(value_1) - value_1.inv() + value_1.inv() case_1_2(value_1) value_1.inv() case_1_1(value_1) @@ -222,7 +222,7 @@ fun case_2(value_1: Number?) { case_2_1(value_1) value_1.toByte() case_2_2(value_1) - value_1.inv() + value_1.inv() } // TESTCASE NUMBER: 3 @@ -240,13 +240,13 @@ fun case_4(value_1: Any?) { case_4_2(value_1) value_1.toByte() case_4_3(value_1) - value_1.inv() + value_1.inv() } // TESTCASE NUMBER: 5 fun case_5(value_1: Int?) { if (case_5_1(value_1)) { - value_1.inv() + value_1.inv() if (case_5_2(value_1)) { value_1.inv() case_5_1(value_1) @@ -254,7 +254,7 @@ fun case_5(value_1: Int?) { } } if (!case_5_3(value_1)) { - value_1.inv() + value_1.inv() if (!case_5_4(value_1)) { value_1.inv() case_5_1(value_1) @@ -262,7 +262,7 @@ fun case_5(value_1: Int?) { } } if (case_5_5(value_1) != null) { - value_1.inv() + value_1.inv() if (case_5_6(value_1) != null) { value_1.inv() case_5_1(value_1) @@ -270,7 +270,7 @@ fun case_5(value_1: Int?) { } } if (case_5_7(value_1) == null) { - value_1.inv() + value_1.inv() if (case_5_8(value_1) == null) { value_1.inv() case_5_1(value_1) @@ -284,25 +284,25 @@ fun case_6(value_1: Number?) { when { case_6_1(value_1) -> { value_1.toByte() - when { case_6_2(value_1) -> value_1.inv() } + when { case_6_2(value_1) -> value_1.inv() } } } when { !case_6_3(value_1) -> { value_1.toByte() - when { !case_6_4(value_1) -> value_1.inv() } + when { !case_6_4(value_1) -> value_1.inv() } } } when { case_6_5(value_1) != null -> { value_1.toByte() - when { case_6_6(value_1) != null -> value_1.inv() } + when { case_6_6(value_1) != null -> value_1.inv() } } } when { case_6_7(value_1) == null -> { value_1.toByte() - when { case_6_8(value_1) == null -> value_1.inv() } + when { case_6_8(value_1) == null -> value_1.inv() } } } } @@ -333,28 +333,28 @@ fun case_8(value_1: Any?) { value_1?.toByte() if (case_8_2(value_1)) { value_1.toByte() - if (case_8_3(value_1)) value_1.inv() + if (case_8_3(value_1)) value_1.inv() } } if (!case_8_4(value_1)) { value_1?.toByte() if (!case_8_5(value_1)) { value_1.toByte() - if (!case_8_6(value_1)) value_1.inv() + if (!case_8_6(value_1)) value_1.inv() } } if (case_8_7(value_1) == null) { value_1?.toByte() if (case_8_8(value_1) != null) { value_1.toByte() - if (case_8_9(value_1) != null) value_1.inv() + if (case_8_9(value_1) != null) value_1.inv() } } if (case_8_10(value_1) != null) { value_1?.toByte() if (case_8_11(value_1) == null) { value_1.toByte() - if (case_8_12(value_1) == null) value_1.inv() + if (case_8_12(value_1) == null) value_1.inv() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt index 765f349152c..4d10799794e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt @@ -62,7 +62,7 @@ fun case_1(value_1: Any?) { println(value_1?.toByte()) if (funWithReturnsTrue(value_1 !is Number)) { println(value_1.toByte()) - if (funWithReturnsNotNull(value_1 is Int) == null) println(value_1.inv()) + if (funWithReturnsNotNull(value_1 is Int) == null) println(value_1.inv()) } } @@ -72,7 +72,7 @@ fun case_2(value_1: Any?) { println(value_1?.toByte()) funWithReturns(value_1 !is Number) println(value_1.toByte()) - if (funWithReturnsNull(value_1 !is Int) == null) println(value_1.inv()) + if (funWithReturnsNull(value_1 !is Int) == null) println(value_1.inv()) } } @@ -91,7 +91,7 @@ fun case_3(value_1: Int?, value_2: Any?) { // TESTCASE NUMBER: 4 fun case_4(value_1: Number, value_2: (() -> Unit)?) { if (contracts.case_4(value_1, value_2) == true) { - value_1.inv() + value_1.inv() } else if (contracts.case_4(value_1, value_2) == false) { println(value_2) } else if (contracts.case_4(value_1, value_2) == null) { @@ -108,7 +108,7 @@ fun case_5(value_1: Number?, value_2: String?) { } false -> { println(value_2.length) - println(value_1.inv()) + println(value_1.inv()) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt index 45a783c5d47..046cfcad176 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/9.fir.kt @@ -4,13 +4,13 @@ // TESTCASE NUMBER: 1 fun case_1(arg: Int?) { funWithAtMostOnceCallsInPlace { arg!! } - arg.inc() + arg.inc() } // TESTCASE NUMBER: 2 fun case_2(arg: Int?) { funWithUnknownCallsInPlace { arg!! } - arg.inc() + arg.inc() } // TESTCASE NUMBER: 3 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/11.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/11.fir.kt index 7abadc1aa78..0a357e3fa9f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/11.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/11.fir.kt @@ -51,8 +51,8 @@ class case_3 { fun case_3(value_1: Any?, value_2: Number?) { val o = case_3() contracts.case_3(value_1, value_2, o.prop_1, this.prop_1) - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } } @@ -62,8 +62,8 @@ class case_4 { fun case_4(value_1: Any?, value_2: Number?) { val o = case_4() if (contracts.case_4(value_1, value_2, o.prop_1, this.prop_1)) { - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt index e9bc87d4118..2aea8c40632 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/12.fir.kt @@ -10,7 +10,7 @@ fun case_1(arg: Int?) { // TESTCASE NUMBER: 2 fun case_2(arg: Int?) { funWithAtLeastOnceCallsInPlace { arg!! } - arg.inc() + arg.inc() } // TESTCASE NUMBER: 3 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt index 253e058210e..5a5433d6c87 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/14.fir.kt @@ -49,21 +49,21 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Int?) { if (contracts.case_1(value_1)!!) { - value_1.inv() + value_1.inv() } } // TESTCASE NUMBER: 2 fun case_2(value_1: Int?) { if (!contracts.case_2(value_1)!!) { - value_1.inv() + value_1.inv() } } // TESTCASE NUMBER: 3 fun case_3(value_1: Int?) { if (contracts.case_3(value_1)!!) { - value_1.inv() + value_1.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt index 86f0e8a3afe..a043ccc1007 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt @@ -102,9 +102,9 @@ class case_3_class { fun case_3(value_1: Any?, value_2: Number?) { val o = case_3_class() contracts.case_3(value_1, value_2, o.prop_1, this.prop_1) - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } @@ -154,24 +154,24 @@ class case_6_class { fun case_6(value_1: Any?, value_2: Number?) { val o = case_6_class() if (contracts.case_6_1(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (!contracts.case_6_2(value_1, value_2, o.prop_1, this.prop_1)) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (contracts.case_6_3(value_1, value_2, o.prop_1, this.prop_1) != null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (contracts.case_6_4(value_1, value_2, o.prop_1, this.prop_1) == null) { - println(value_1.dec()) + println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/5.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/5.fir.kt index d0d11d30110..22f5efe5c2f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/5.fir.kt @@ -91,13 +91,13 @@ fun case_1(value_1: Any?) { // TESTCASE NUMBER: 2 fun case_2(value_1: Number?) { value_1.case_2() - println(value_1.inv()) + println(value_1.inv()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Any?) { value_1.case_3() - println(value_1.inv()) + println(value_1.inv()) } // TESTCASE NUMBER: 4 @@ -110,16 +110,16 @@ fun case_4(value_1: Any?, value_2: Any?, value_3: Any?) { // TESTCASE NUMBER: 5 fun case_5(value_1: Number?, value_2: Number?, value_3: Number?) { - if (value_1.case_5_1()) println(value_1.inv()) - if (!value_2.case_5_2()) println(value_2.inv()) - if (value_3.case_5_3() != null) println(value_3.inv()) - if (value_3.case_5_4() == null) println(value_3.inv()) + if (value_1.case_5_1()) println(value_1.inv()) + if (!value_2.case_5_2()) println(value_2.inv()) + if (value_3.case_5_3() != null) println(value_3.inv()) + if (value_3.case_5_4() == null) println(value_3.inv()) } // TESTCASE NUMBER: 6 fun case_6(value_1: Any?, value_2: Any?, value_3: Any?) { - if (value_1.case_6_1()) println(value_1.inv()) - if (!value_2.case_6_2()) println(value_2.inv()) - if (value_3.case_6_3() != null) println(value_3.inv()) - if (value_3.case_6_4() == null) println(value_3.inv()) + if (value_1.case_6_1()) println(value_1.inv()) + if (!value_2.case_6_2()) println(value_2.inv()) + if (value_3.case_6_3() != null) println(value_3.inv()) + if (value_3.case_6_4() == null) println(value_3.inv()) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt index 2f93a5d0fd7..13d619d9e85 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt @@ -110,27 +110,27 @@ import contracts.* fun case_1(value_1: Any?, value_2: Int?) { value_1.case_1(value_2) println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } // TESTCASE NUMBER: 2 fun case_2(value_1: Number?, value_2: Any?) { value_1.case_2(value_2) - println(value_1.inv()) + println(value_1.inv()) println(value_2.toByte()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Any?, value_2: String?) { value_1.case_3(value_2) - println(value_1.inv()) + println(value_1.inv()) println(value_2.length) } // TESTCASE NUMBER: 4 fun case_4(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { value_1.case_4(value_2, value_3, value_4) - println(value_2.inv()) + println(value_2.inv()) println(value_3.toByte()) println(value_4.length) } @@ -140,25 +140,25 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: when { value_1.case_5_1(value_2) -> { println(value_1.length) - println(value_2.inv()) + println(value_2.inv()) } } when { !value_3.case_5_2(value_4) -> { println(value_3.length) - println(value_4.inv()) + println(value_4.inv()) } } when { value_5.case_5_3(value_6) != null -> { println(value_5.length) - println(value_6.inv()) + println(value_6.inv()) } } when { value_5.case_5_4(value_6) == null -> { println(value_5.length) - println(value_6.inv()) + println(value_6.inv()) } } } @@ -166,19 +166,19 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: // TESTCASE NUMBER: 6 fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, value_5: Number?, value_6: Any?) { if (value_1.case_6_1(value_2)) { - println(value_1.inv()) + println(value_1.inv()) println(value_2.toByte()) } if (!value_3.case_6_2(value_4)) { - println(value_3.inv()) + println(value_3.inv()) println(value_4.toByte()) } if (value_5.case_6_3(value_6) != null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.toByte()) } if (value_5.case_6_4(value_6) == null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.toByte()) } } @@ -186,35 +186,35 @@ fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, val // TESTCASE NUMBER: 7 fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, value_5: Any?, value_6: String?) { if (value_1.case_7_1(value_2)) { - println(value_1.inv()) + println(value_1.inv()) println(value_2.length) } if (value_3.case_7_2(value_4)) { - println(value_3.inv()) + println(value_3.inv()) println(value_4.length) } if (value_5.case_7_3(value_6) != null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.length) } if (value_5.case_7_4(value_6) == null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.length) } } // TESTCASE NUMBER: 8 fun case_8(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?, value_5: Any?, value_6: Number, value_7: Any?, value_8: String?) { - when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } + when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } - when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_6.inv()) } + when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_6.inv()) } when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_7.toByte()) } when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_8.length) } - when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_6.inv()) } + when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_6.inv()) } when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_7.toByte()) } when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_8.length) } - when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_6.inv()) } + when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_6.inv()) } when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_7.toByte()) } when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_8.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt index 0c0626c5249..b0c617dee4e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt @@ -133,7 +133,7 @@ fun case_6(value_1: Number, value_2: String?, value_3: Any?) { println(value_2.length) } null -> { - println(value_1.inv()) + println(value_1.inv()) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/10.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/10.fir.kt index 3f297bd5f2f..0cd6498ffd3 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/10.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/10.fir.kt @@ -13,5 +13,5 @@ fun case_1() { } x - x.inv() + x.inv() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt index cbc21b4a375..9d0d22d7566 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/14.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Int?) { if ((x is Int) ?: (x is Int)) { x - x.inv() + x.inv() } } @@ -14,7 +14,7 @@ fun case_1(x: Int?) { fun case_2(x: Int?) { if (x?.equals(1) ?: x is Int) { x - x.inv() + x.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/16.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/16.fir.kt index 8deb55bc0cb..532a51a30e5 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/16.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/16.fir.kt @@ -11,7 +11,7 @@ fun case_1(x: ClassWithCustomEquals) { val y = null if (x == y) { x - x.inv() + x.inv() } } @@ -19,7 +19,7 @@ fun case_1(x: ClassWithCustomEquals) { fun case_2(x: ClassWithCustomEquals) { if (x == null) { x - x.inv() + x.inv() } } @@ -31,7 +31,7 @@ fun case_2(x: ClassWithCustomEquals) { fun case_3(x: ClassWithCustomEquals, y: Nothing?) { if (x == y) { x - x.inv() + x.inv() } } @@ -44,7 +44,7 @@ fun case_4(x: ClassWithCustomEquals) { val y = null if (y == x) { x - x.inv() + x.inv() } } @@ -56,7 +56,7 @@ fun case_4(x: ClassWithCustomEquals) { fun case_5(x: ClassWithCustomEquals, y: Nothing?) { if (y == x) { x - x.inv() + x.inv() } } @@ -69,7 +69,7 @@ fun case_6(x: ClassWithCustomEquals) { val y = null if (x == y == true) { x - x.inv() + x.inv() } } @@ -77,7 +77,7 @@ fun case_6(x: ClassWithCustomEquals) { fun case_7(x: ClassWithCustomEquals) { if ((x != null) == false) { x - x.inv() + x.inv() } } @@ -89,7 +89,7 @@ fun case_7(x: ClassWithCustomEquals) { fun case_8(x: ClassWithCustomEquals, y: Nothing?) { if (!(y == x) == false) { x - x.inv() + x.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt index 8009fe58de3..c52f76a3c8e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/21.fir.kt @@ -16,7 +16,7 @@ class Case1 { x this.x y.x - y.x.inv() + y.x.inv() } else { x = 10 } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt index 36033e1ff15..1e10a3bfed2 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/39.fir.kt @@ -27,7 +27,7 @@ fun case_2(y: MutableList) { y[x ?: break] = 10 } x - x.inv() + x.inv() } /* @@ -41,7 +41,7 @@ fun case_3(y: MutableList) { y[0] = x ?: break } x - x.inv() + x.inv() } // TESTCASE NUMBER: 4 @@ -51,7 +51,7 @@ fun case_4() { x ?: break } x - x.inv() + x.inv() } // TESTCASE NUMBER: 5 @@ -96,7 +96,7 @@ fun case_8() { y += x ?: break } x - x.inv() + x.inv() } /* @@ -111,7 +111,7 @@ fun case_9() { y -= x ?: break } x - x.inv() + x.inv() } /* @@ -126,7 +126,7 @@ fun case_10() { val z = y - (x ?: break) } x - x.inv() + x.inv() } /* @@ -141,7 +141,7 @@ fun case_11() { val z = y * (x ?: break) } x - x.inv() + x.inv() } // TESTCASE NUMBER: 12 @@ -152,7 +152,7 @@ fun case_12() { y += if (x == null) break else 10 } x - x.inv() + x.inv() } // TESTCASE NUMBER: 13 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt index e98bc0aa807..79edaa0df14 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/4.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Any?) { if (x is Int is Boolean) { x - x.inv() + x.inv() x.not() x.propAny x.funAny() @@ -17,7 +17,7 @@ fun case_1(x: Any?) { fun case_2(x: Any?) { if (x is Int is Any? is Boolean) { x - x.inv() + x.inv() x.not() x.propAny x.funAny() @@ -28,7 +28,7 @@ fun case_2(x: Any?) { inline fun case_3(x: Any?) { if (x is Int is T) { x - x.inv() + x.inv() x.propAny x.funAny() } @@ -38,7 +38,7 @@ inline fun case_3(x: Any?) { inline fun case_4(x: Any?) { if (x is Int is T == null) { x - x.inv() + x.inv() x.propAny x.funAny() } @@ -48,7 +48,7 @@ inline fun case_4(x: Any?) { fun case_5(x: Any?) { if (x is Int != null) { x - x.inv() + x.inv() x.propAny x.funAny() } @@ -58,7 +58,7 @@ fun case_5(x: Any?) { fun case_6(x: Any?) { if (x is Int == null) { x - x.inv() + x.inv() x.propAny x.funAny() } @@ -68,7 +68,7 @@ fun case_6(x: Any?) { fun case_7(x: Any?) { if (!(x !is Int) == false) { x - x.inv() + x.inv() x.propAny x.funAny() } @@ -78,7 +78,7 @@ fun case_7(x: Any?) { fun case_8(x: Any?) { if (!(x !is Int) == true) else { x - x.inv() + x.inv() x.propAny x.funAny() } @@ -88,7 +88,7 @@ fun case_8(x: Any?) { fun case_9(x: Any?) { if (x !is Int !is Any?) { x - x.inv() + x.inv() x.propAny x.funAny() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/42.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/42.fir.kt index 0c72619c0fd..f54f3479e0c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/42.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/42.fir.kt @@ -153,7 +153,7 @@ fun case_14(x: Any) { x.NaN } else { & kotlin.Any")!>x - & kotlin.Any")!>x.inv() + & kotlin.Any")!>x.inv() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt index 3496ae3ce95..ccd654a62e8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/43.fir.kt @@ -14,7 +14,7 @@ fun case_1(x: Double?, y: Double?) : Double { } else if (x == null && y != null) { y } else { - x + y + x + y } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt index 9dbdfe62cdc..fc2fd14f197 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/6.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Any?) { if (x is Int || x !is Int) { x - x.inv() + x.inv() } } @@ -64,7 +64,7 @@ fun case_7(x: Any) { fun case_8(x: Any?) { if (x is Int? == x is Int?) else { x - x?.inv() + x?.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt index cbc21b4a375..9d0d22d7566 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/7.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Int?) { if ((x is Int) ?: (x is Int)) { x - x.inv() + x.inv() } } @@ -14,7 +14,7 @@ fun case_1(x: Int?) { fun case_2(x: Int?) { if (x?.equals(1) ?: x is Int) { x - x.inv() + x.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt index 4dc19be105a..0a0564a5320 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/16.fir.kt @@ -95,7 +95,7 @@ fun case_7(x: Class?) { fun case_8(x: Int?) { if (false || false || false || x == nullableNothingProperty) return x - x.inv() + x.inv() } // TESTCASE NUMBER: 9 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt index 56cb0608ba5..3fd920f67d1 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/17.fir.kt @@ -94,7 +94,7 @@ fun case_7(x: Class?) { fun case_8(x: Int?) { if (false || false || false || x == nullableNothingProperty) throw Exception() x - x.inv() + x.inv() } // TESTCASE NUMBER: 9 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt index a2fbd43ab29..707ddf6652d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/18.fir.kt @@ -109,7 +109,7 @@ fun case_8(x: Int?) { for (i in 0..10) { if (false || false || false || x == nullableNothingProperty) continue x - x.inv() + x.inv() } } @@ -118,7 +118,7 @@ fun case_9(list: List) { for (element in list) { if (element != implicitNullableNothingProperty && true && true && true) else { break } element - element.inv() + element.inv() } } @@ -205,9 +205,9 @@ fun case_15(map: MutableMap, y: Nothing?) { if (k != y) else break if (v != y) else continue k - k.inv() + k.inv() v - v.inv() + v.inv() } } @@ -216,9 +216,9 @@ fun case_16(map: Map) { for ((k, v) in map) { if (k !== implicitNullableNothingProperty && v !== implicitNullableNothingProperty) else { continue } k - k.inv() + k.inv() v - v.inv() + v.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/20.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/20.fir.kt index 123b3f2aaab..cb180f380c0 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/20.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/20.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Any?) { if (x is Int || false) { x - x.inv() + x.inv() } } @@ -70,7 +70,7 @@ fun case_7(x: Any) { fun case_8(x: Any?) { if (!(x is Int?) && true) else { x - x?.inv() + x?.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.fir.kt index 25246657bb7..8695a0ed03e 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/33.fir.kt @@ -86,5 +86,5 @@ fun case_6() { } x - x.minus(10.0) + x.minus(10.0) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/39.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/39.fir.kt index 63b8f6abfe2..3f005ff06ce 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/39.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/39.fir.kt @@ -12,7 +12,7 @@ fun case_1(x: Number?) { if (x == y) { x - x.inv() + x.inv() } } @@ -47,7 +47,7 @@ fun case_4() { if (x == y) { x - x?.inv() + x?.inv() } } @@ -59,6 +59,6 @@ fun case_4() { fun case_5(x: Class, y: Class) { if (x.prop_14 == y.prop_15) { x.prop_14 - x.prop_14.inv() + x.prop_14.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt index c599d636ae2..8a474faaf97 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/46.fir.kt @@ -13,7 +13,7 @@ import kotlin.reflect.* fun case_1(x: Int?) { if (x != funNothingQuest() == true) { x - x.inv() + x.inv() } } @@ -26,7 +26,7 @@ fun case_2(x: Int?) { operator fun Nothing?.not() = null if (x != !null != false) { x - x.inv() + x.inv() } } @@ -50,7 +50,7 @@ fun case_3(x: Int?) { fun case_4(x: Int?, y: List) { if (x == y[0] == true) { x - x.inv() + x.inv() } } @@ -66,7 +66,7 @@ fun case_5(x: Int?) { if (x == y.z == true) { x - x.inv() + x.inv() } } @@ -80,7 +80,7 @@ fun case_6(x: Int?) { if (x == y == true) { x - x.inv() + x.inv() } } @@ -97,7 +97,7 @@ fun case_7(x: Int?) { if (x == y.z == true) { x - x.inv() + x.inv() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt index fad2523d818..9d2a68bc07b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/68.fir.kt @@ -6,7 +6,7 @@ fun case_1(x: Any?) { if (x!! is Int) { x - x.inv() + x.inv() } } @@ -14,14 +14,14 @@ fun case_1(x: Any?) { fun case_2(x: Any?) { (x as Nothing?)!! x - x.inv() + x.inv() } // TESTCASE NUMBER: 3 fun case_3(x: Any?) { if (x as Number? is Int) { x - x.inv() + x.inv() } } @@ -37,7 +37,7 @@ fun case_4(x: Any?) { fun case_5(x: Any?) { if (x as Nothing? is Nothing) { x - x.inv() + x.inv() } }