From c7272f6986ceaff9448a017a55f074b9ebe8a269 Mon Sep 17 00:00:00 2001 From: Tianyu Geng Date: Tue, 20 Jul 2021 09:46:18 -0700 Subject: [PATCH] FIR checker: SENSELESS_(COMPARISON|NULL_IN_WHEN) Currently DFA does not set "definitely equal to null" for access to variables that got assigned `null`. For example, FIR should mark the following line as SENSELESS_COMPARISON due to `s = null` above. https://github.com/JetBrains/kotlin/blob/d1531f9cdd5852352c0133198706125dc63b6007/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt#L6 The problem is at https://github.com/JetBrains/kotlin/blob/7e9f27436a77de1c76e3705da7aa1fbe8938336b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/dfa/FirDataFlowAnalyzer.kt#L1104 For null assignment, ideally the type should be `Nothing?`. This is addressed in a followup commit instead. --- .../extendedCheckers/CanBeValChecker.kt | 2 +- .../boundSmartcastsInBranches.kt | 2 +- .../good/returnsImplies/propertyAccessors.kt | 2 +- .../diagnostics/FirDiagnosticsList.kt | 6 +- .../fir/analysis/diagnostics/FirErrors.kt | 2 + .../FirEqualityCompatibilityChecker.kt | 52 +- .../diagnostics/FirDefaultErrorMessages.kt | 4 + .../diagnostics/FirDiagnosticRenderers.kt | 1 + .../tests/dataFlowInfoTraversal/DeepIf.fir.kt | 16 +- .../tests/dataFlowInfoTraversal/For.fir.kt | 2 +- .../dataFlowInfoTraversal/IfThenElse.fir.kt | 2 +- .../IfThenElseBothInvalid.fir.kt | 2 +- .../tests/dataFlowInfoTraversal/Return.fir.kt | 4 +- .../tests/dataFlowInfoTraversal/When.fir.kt | 2 +- .../tests/enum/incompatibleEnums.fir.kt | 12 +- .../tests/enum/incompatibleEnums_1_4.fir.kt | 12 +- .../generics/nullability/smartCasts.fir.kt | 2 +- .../nullability/smartCastsOnThis.fir.kt | 2 +- .../smartCastsValueArgument.fir.kt | 2 +- .../SenselessNullInWhen.fir.kt | 10 - .../SenselessNullInWhen.kt | 1 + .../nullabilityAndSmartCasts/kt1680.fir.kt | 14 - .../tests/nullabilityAndSmartCasts/kt1680.kt | 1 + .../nullabilityAndSmartCasts/kt2109.fir.kt | 2 +- .../nullabilityAndSmartCasts/kt2223.fir.kt | 8 - .../tests/nullabilityAndSmartCasts/kt2223.kt | 1 + ...sComparisonWithNullOnTypeParameters.fir.kt | 16 - ...slessComparisonWithNullOnTypeParameters.kt | 1 + .../definitelyNotNullWithNullableBound.fir.kt | 17 - .../definitelyNotNullWithNullableBound.kt | 1 + ...ullTypeMarkedWithNullableAnnotation.fir.kt | 22 - ...notNullTypeMarkedWithNullableAnnotation.kt | 1 + .../senselessComparisonEquals.fir.kt | 8 +- .../senselessComparisonIdentityEquals.fir.kt | 8 +- .../senselessComparison/noExplicitType.fir.kt | 15 - .../senselessComparison/noExplicitType.kt | 1 + .../senselessComparison/parenthesized.fir.kt | 26 +- .../tests/smartCasts/alwaysNull.fir.kt | 2 +- .../smartCasts/castchecks/variables.fir.kt | 4 +- .../tests/smartCasts/notNullorNotNull.fir.kt | 4 +- .../ownerDeclaresBothModifies.fir.kt | 2 +- .../variables/whileWithBreak.fir.kt | 2 +- .../smartCasts/varnotnull/inference.fir.kt | 4 +- .../smartCasts/varnotnull/nestedLoops.fir.kt | 4 +- .../KotlinOverridesJava2.fir.kt | 2 +- .../KotlinOverridesJava3.fir.kt | 25 - .../javaProperties/KotlinOverridesJava3.kt | 1 + .../KotlinOverridesJava4.fir.kt | 28 - .../javaProperties/KotlinOverridesJava4.kt | 1 + .../KotlinOverridesJava5.fir.kt | 29 - .../javaProperties/KotlinOverridesJava5.kt | 1 + .../tests/when/whenOnNothing.fir.kt | 2 +- .../dsl/errors/illegalEqualsCondition.fir.kt | 4 +- .../dsl/errors/unlabeledReceiver.fir.kt | 4 +- ...nullabilitySmartcastWhenNullability.fir.kt | 4 +- .../contracts/smartcasts/throwsEffect.fir.kt | 2 +- .../contracts/smartcasts/when/kt36818.fir.kt | 2 +- .../when-expression/p-6/pos/5.2.fir.kt | 2 +- .../analysis/smartcasts/neg/10.fir.kt | 12 +- .../analysis/smartcasts/neg/5.fir.kt | 20 +- .../analysis/smartcasts/neg/6.fir.kt | 20 +- .../analysis/smartcasts/neg/8.fir.kt | 4 +- .../analysis/smartcasts/pos/14.fir.kt | 2 +- .../analysis/smartcasts/pos/5.fir.kt | 20 +- .../analysis/smartcasts/pos/6.fir.kt | 20 +- .../analysis/smartcasts/pos/8.fir.kt | 4 +- .../contractBuilder/common/neg/3.fir.kt | 4 +- .../effects/returns/neg/2.fir.kt | 4 +- .../effects/returns/pos/1.fir.kt | 2 +- .../contractFunction/neg/2.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/1.fir.kt | 72 +- .../diagnostics/notLinked/dfa/neg/14.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/16.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/21.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/38.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/4.fir.kt | 6 +- .../diagnostics/notLinked/dfa/neg/7.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/1.fir.kt | 1878 ++++++++--------- .../diagnostics/notLinked/dfa/pos/11.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/12.fir.kt | 12 +- .../diagnostics/notLinked/dfa/pos/13.fir.kt | 8 +- .../diagnostics/notLinked/dfa/pos/14.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/16.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/17.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/18.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/2.fir.kt | 60 +- .../diagnostics/notLinked/dfa/pos/3.fir.kt | 50 +- .../diagnostics/notLinked/dfa/pos/37.fir.kt | 4 +- .../diagnostics/notLinked/dfa/pos/4.fir.kt | 94 +- .../diagnostics/notLinked/dfa/pos/45.fir.kt | 8 +- .../diagnostics/notLinked/dfa/pos/53.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/59.fir.kt | 22 +- .../diagnostics/notLinked/dfa/pos/6.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/60.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/62.fir.kt | 24 +- .../diagnostics/notLinked/dfa/pos/7.fir.kt | 30 +- .../diagnostics/notLinked/dfa/pos/8.fir.kt | 2 +- .../diagnostics/notLinked/dfa/pos/9.fir.kt | 8 +- .../objects/inheritance/neg/1.fir.kt | 2 +- .../objects/inheritance/neg/2.fir.kt | 2 +- .../objects/inheritance/neg/3.fir.kt | 2 +- .../objects/inheritance/neg/4.fir.kt | 2 +- .../objects/inheritance/neg/5.fir.kt | 2 +- .../objects/inheritance/neg/6.fir.kt | 2 +- .../objects/inheritance/neg/7.fir.kt | 2 +- .../diagnostics/KtFirDataClassConverters.kt | 14 + .../api/fir/diagnostics/KtFirDiagnostics.kt | 10 + .../fir/diagnostics/KtFirDiagnosticsImpl.kt | 16 + 108 files changed, 1410 insertions(+), 1485 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/SenselessNullInWhen.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1680.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2223.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/senslessComparisonWithNullOnTypeParameters.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/nullableTypes/definitelyNotNullWithNullableBound.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullTypeMarkedWithNullableAnnotation.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/senselessComparison/noExplicitType.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.kt b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.kt index 5beb1944437..15ec81c3ed8 100644 --- a/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.kt +++ b/compiler/fir/analysis-tests/testData/resolve/extendedCheckers/CanBeValChecker.kt @@ -137,7 +137,7 @@ fun main(args: Array) { a = args[0] } else { a = args.toString() - if (a != null && a.equals("cde")) return + if (a != null && a.equals("cde")) return } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt index 2914d63d78d..3f6f10b70a8 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.kt @@ -107,7 +107,7 @@ fun test_7() { y.length // Bad z.length // OK } - if (y != null) { + if (y != null) { x.length // Bad y.length // OK z.length // Bad diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/propertyAccessors.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/propertyAccessors.kt index d8bfd41e02f..c4b2164ce96 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/propertyAccessors.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/propertyAccessors.kt @@ -14,7 +14,7 @@ var Any?.isNotNull: Boolean set(value) { contract { returns() implies (this@isNotNull != null) - require(this != null) + require(this != null) } } diff --git a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt index 73a6786070a..492d40c8829 100644 --- a/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt +++ b/compiler/fir/checkers/checkers-component-generator/src/org/jetbrains/kotlin/fir/checkers/generator/diagnostics/FirDiagnosticsList.kt @@ -944,11 +944,15 @@ object DIAGNOSTICS_LIST : DiagnosticList("FirErrors") { val INITIALIZATION_BEFORE_DECLARATION by error() { parameter("property") } - val UNREACHABLE_CODE by warning(PositioningStrategy.UNREACHABLE_CODE) { parameter>("reachable") parameter>("unreachable") } + val SENSELESS_COMPARISON by warning { + parameter("expression") + parameter("compareResult") + } + val SENSELESS_NULL_IN_WHEN by warning() } val NULLABILITY by object : DiagnosticGroup("Nullability") { diff --git a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 8c1fef3c52b..183a6e06a6c 100644 --- a/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/gen/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -507,6 +507,8 @@ object FirErrors { val VARIABLE_WITH_NO_TYPE_NO_INITIALIZER by error0(SourceElementPositioningStrategies.DECLARATION_NAME) val INITIALIZATION_BEFORE_DECLARATION by error1>() val UNREACHABLE_CODE by warning2, Set>(SourceElementPositioningStrategies.UNREACHABLE_CODE) + val SENSELESS_COMPARISON by warning2() + val SENSELESS_NULL_IN_WHEN by warning0() // Nullability val UNSAFE_CALL by error2(SourceElementPositioningStrategies.DOT_BY_QUALIFIED) diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirEqualityCompatibilityChecker.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirEqualityCompatibilityChecker.kt index 54bcef7d384..200b106612b 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirEqualityCompatibilityChecker.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/checkers/expression/FirEqualityCompatibilityChecker.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.fir.analysis.checkers.expression +import org.jetbrains.kotlin.KtNodeTypes import org.jetbrains.kotlin.fir.FirRealSourceElementKind import org.jetbrains.kotlin.fir.analysis.checkers.ConeTypeCompatibilityChecker import org.jetbrains.kotlin.fir.analysis.checkers.ConeTypeCompatibilityChecker.isCompatible @@ -15,17 +16,34 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.reportOn import org.jetbrains.kotlin.fir.declarations.FirFile import org.jetbrains.kotlin.fir.declarations.utils.isEnumClass import org.jetbrains.kotlin.fir.expressions.FirEqualityOperatorCall +import org.jetbrains.kotlin.fir.expressions.FirExpression +import org.jetbrains.kotlin.fir.expressions.FirExpressionWithSmartcastToNull +import org.jetbrains.kotlin.fir.expressions.FirOperation import org.jetbrains.kotlin.fir.render import org.jetbrains.kotlin.fir.resolve.inference.inferenceComponents import org.jetbrains.kotlin.fir.resolve.toFirRegularClass +import org.jetbrains.kotlin.fir.typeContext import org.jetbrains.kotlin.fir.types.* object FirEqualityCompatibilityChecker : FirEqualityOperatorCallChecker() { override fun check(expression: FirEqualityOperatorCall, context: CheckerContext, reporter: DiagnosticReporter) { val arguments = expression.argumentList.arguments if (arguments.size != 2) return - val lType = arguments[0].typeRef.coneType - val rType = arguments[1].typeRef.coneType + val lExpr = arguments[0] + val rExpr = arguments[1] + checkCompatibility(lExpr, rExpr, context, expression, reporter) + checkSensibleness(lExpr, rExpr, context, expression, reporter) + } + + private fun checkCompatibility( + lExpr: FirExpression, + rExpr: FirExpression, + context: CheckerContext, + expression: FirEqualityOperatorCall, + reporter: DiagnosticReporter + ) { + val lType = lExpr.typeRef.coneType + val rType = rExpr.typeRef.coneType // If one of the type is already `Nothing?`, we skip reporting further comparison. This is to allow comparing with `null`, which has // type `Nothing?` if (lType.isNullableNothing || rType.isNullableNothing) return @@ -95,4 +113,34 @@ object FirEqualityCompatibilityChecker : FirEqualityOperatorCallChecker() { val firRegularClass = (this as? ConeClassLikeType)?.lookupTag?.toFirRegularClass(context.session) ?: return false return firRegularClass.isEnumClass } + + private fun checkSensibleness( + lExpr: FirExpression, + rExpr: FirExpression, + context: CheckerContext, + expression: FirEqualityOperatorCall, + reporter: DiagnosticReporter + ) { + val expressionComparedWithNull = when { + lExpr.isNullLiteral -> rExpr + rExpr.isNullLiteral -> lExpr + else -> return + } + val type = expressionComparedWithNull.typeRef.coneType + if (type is ConeKotlinErrorType) return + val isPositiveCompare = expression.operation == FirOperation.EQ || expression.operation == FirOperation.IDENTITY + val compareResult = with(context.session.typeContext) { + when { + // `null` literal has type `Nothing?` + type.isNullableNothing || (expressionComparedWithNull is FirExpressionWithSmartcastToNull && expressionComparedWithNull.isStable) -> isPositiveCompare + !type.isNullableType() -> !isPositiveCompare + else -> return + } + } + if (expression.source?.elementType == KtNodeTypes.BINARY_EXPRESSION) { + reporter.reportOn(expression.source, FirErrors.SENSELESS_COMPARISON, expression, compareResult, context) + } else { + reporter.reportOn(expression.source, FirErrors.SENSELESS_NULL_IN_WHEN, context) + } + } } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt index 4a414e47ca7..1bea1a19341 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDefaultErrorMessages.kt @@ -363,6 +363,8 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SEALED_CLASS_CONS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SEALED_SUPERTYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SEALED_SUPERTYPE_IN_LOCAL_CLASS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SECONDARY_CONSTRUCTOR_WITH_BODY_INSIDE_INLINE_CLASS +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SENSELESS_COMPARISON +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SENSELESS_NULL_IN_WHEN import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SETTER_PROJECTED_OUT import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SETTER_VISIBILITY_INCONSISTENT_WITH_PROPERTY_VISIBILITY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.SINGLETON_IN_SUPERTYPE @@ -1308,6 +1310,8 @@ class FirDefaultErrorMessages { map.put(LEAKED_IN_PLACE_LAMBDA, "Leaked in-place lambda: {2}", SYMBOL) map.put(FirErrors.WRONG_IMPLIES_CONDITION, "Wrong implies condition") map.put(UNREACHABLE_CODE, "Unreachable code", NOT_RENDERED, NOT_RENDERED) + map.put(SENSELESS_COMPARISON, "Condition ''{0}'' is always ''{1}''", FIR, TO_STRING) + map.put(SENSELESS_NULL_IN_WHEN, "Expression under 'when' is never equal to null") // Nullability map.put( diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt index 6a95fc363bd..56bb170d0eb 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt @@ -5,6 +5,7 @@ package org.jetbrains.kotlin.fir.analysis.diagnostics +import com.intellij.psi.PsiElement import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.descriptors.Visibility import org.jetbrains.kotlin.diagnostics.WhenMissingCase diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DeepIf.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DeepIf.fir.kt index 088ac49ad83..2ae8eb7d4d6 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DeepIf.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/DeepIf.fir.kt @@ -6,24 +6,24 @@ fun foo() { if (x != null) { bar(x) - if (x != null) { + if (x != null) { bar(x) if (1 < 2) bar(x) if (1 > 2) bar(x) } - if (x == null) { + if (x == null) { bar(x) } - if (x == null) bar(x) else bar(x) + if (x == null) bar(x) else bar(x) bar(bar(x)) - } else if (x == null) { + } else if (x == null) { bar(x) - if (x != null) { + if (x != null) { bar(x) - if (x == null) bar(x) - if (x == null) bar(x) else bar(x) + if (x == null) bar(x) + if (x == null) bar(x) else bar(x) bar(bar(x) + bar(x)) - } else if (x == null) { + } else if (x == null) { bar(x) } } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/For.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/For.fir.kt index a952d89a860..5786b53a6c0 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/For.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/For.fir.kt @@ -10,7 +10,7 @@ fun foo() { bar(x) for (q in a) { bar(x) - if (x == null) bar(x) + if (x == null) bar(x) } } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElse.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElse.fir.kt index ba5755eb913..74b3f071e6c 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElse.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElse.fir.kt @@ -26,5 +26,5 @@ fun foo() { if (z != null) bar(z) bar(z) bar(z!!) - if (z != null) bar(z!!) + if (z != null) bar(z!!) } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt index 74f13d8954f..22b0da05407 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt @@ -9,7 +9,7 @@ fun foo() { 2+ } else { - if (x == null) return + if (x == null) return 2+ } bar(x) diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.fir.kt index 23aec1820f0..5f16de1549e 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/Return.fir.kt @@ -8,10 +8,10 @@ fun foo(): Int { if (x != null) return x val y: Int? = null - if (y == null) return if (y != null) y else y + if (y == null) return if (y != null) y else y val z: Int? = null - if (z != null) return if (z == null) z else z + if (z != null) return if (z == null) z else z return z } diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/When.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/When.fir.kt index 5582e7b2346..06b49dbf4d5 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/When.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/When.fir.kt @@ -11,7 +11,7 @@ fun foo() { } when (x) { - 0 -> { if (x == null) return } + 0 -> { if (x == null) return } else -> { if (x == null) return } } bar(x) diff --git a/compiler/testData/diagnostics/tests/enum/incompatibleEnums.fir.kt b/compiler/testData/diagnostics/tests/enum/incompatibleEnums.fir.kt index a9c36a0b2ab..45498c3a99f 100644 --- a/compiler/testData/diagnostics/tests/enum/incompatibleEnums.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/incompatibleEnums.fir.kt @@ -85,8 +85,8 @@ fun foo5(i: MyInterface, a: Any) { } fun foo6(e1: E1?, e2: E2) { - E1.A == null - null == E1.A + E1.A == null + null == E1.A e1 == null null == e1 @@ -95,10 +95,10 @@ fun foo6(e1: E1?, e2: E2) { e1 == e2 e2 == e1 - e2 == null - null == e2 - E1.A == null - null == E1.A + e2 == null + null == e2 + E1.A == null + null == E1.A } fun foo7(e1: E1?, e2: E2?) { diff --git a/compiler/testData/diagnostics/tests/enum/incompatibleEnums_1_4.fir.kt b/compiler/testData/diagnostics/tests/enum/incompatibleEnums_1_4.fir.kt index 9cea7b10a93..0062873d753 100644 --- a/compiler/testData/diagnostics/tests/enum/incompatibleEnums_1_4.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/incompatibleEnums_1_4.fir.kt @@ -85,8 +85,8 @@ fun foo5(i: MyInterface, a: Any) { } fun foo6(e1: E1?, e2: E2) { - E1.A == null - null == E1.A + E1.A == null + null == E1.A e1 == null null == e1 @@ -95,10 +95,10 @@ fun foo6(e1: E1?, e2: E2) { e1 == e2 e2 == e1 - e2 == null - null == e2 - E1.A == null - null == E1.A + e2 == null + null == e2 + E1.A == null + null == E1.A } fun foo7(e1: E1?, e2: E2?) { diff --git a/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.fir.kt index dfec1c57287..8416ac4ba83 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/smartCasts.fir.kt @@ -9,7 +9,7 @@ fun CharSequence.bar4() {} fun foo(x: T) { if (x != null) { - if (x != null) {} + if (x != null) {} x.length x?.length diff --git a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.fir.kt index 5cc65394618..991c8abe51c 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsOnThis.fir.kt @@ -8,7 +8,7 @@ fun CharSequence.bar4() {} fun T.foo() { if (this != null) { - if (this != null) {} + if (this != null) {} length this?.length diff --git a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.fir.kt b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.fir.kt index 27d83b75346..e6f68eb6a61 100644 --- a/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/nullability/smartCastsValueArgument.fir.kt @@ -8,7 +8,7 @@ fun foo(x: T) { var y1: CharSequence = "" var y2: String = "" if (x != null) { - if (x != null) {} + if (x != null) {} y1 = x y2 = x diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/SenselessNullInWhen.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/SenselessNullInWhen.fir.kt deleted file mode 100644 index 665a439ed25..00000000000 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/SenselessNullInWhen.fir.kt +++ /dev/null @@ -1,10 +0,0 @@ -//KT-2457 Verify error when comparing not null value with null in when - -package kt2457 - -fun foo(i: Int) : Int = - when (i) { - 1 -> 1 - null -> 1 - else -> 1 - } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/SenselessNullInWhen.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/SenselessNullInWhen.kt index 8e48d129c13..61018a7ec4e 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/SenselessNullInWhen.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/SenselessNullInWhen.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2457 Verify error when comparing not null value with null in when package kt2457 diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1680.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1680.fir.kt deleted file mode 100644 index 85967016431..00000000000 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1680.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -//KT-1680 Warn if non-null variable is compared to null -package kt1680 - -fun foo() { - val x = 1 - if (x != null) {} // <-- need a warning here! - if (x == null) {} - if (null != x) {} - if (null == x) {} - - val y : Int? = 1 - if (y != null) {} - if (y == null) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1680.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1680.kt index 8b1a7a42ebc..222847b1c89 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1680.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt1680.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-1680 Warn if non-null variable is compared to null package kt1680 diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2109.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2109.fir.kt index e8677780cce..290fbb84fe4 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2109.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2109.fir.kt @@ -13,7 +13,7 @@ fun A?.bar() { } fun A.baz() { - if (this == null) { + if (this == null) { return } foo() diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2223.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2223.fir.kt deleted file mode 100644 index 2817ee45012..00000000000 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2223.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -//KT-2223 Comparing non-null value with null might produce helpful warning -package kt2223 - -fun foo() { - val x: Int? = null - if (x == null) return - if (x == null) return -} diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2223.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2223.kt index a3cfda37e59..0f69ee91654 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2223.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2223.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL //KT-2223 Comparing non-null value with null might produce helpful warning package kt2223 diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/senslessComparisonWithNullOnTypeParameters.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/senslessComparisonWithNullOnTypeParameters.fir.kt deleted file mode 100644 index 2f1d0404768..00000000000 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/senslessComparisonWithNullOnTypeParameters.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// The type checker used to think that T is not null no matter what the upper bound - -fun nullableUpperBound(t: T, ind: INDIRECT) { - if (t == null) {} // was a warning - if (t != null) {} // was a warning - if (ind == null) {} // was a warning - if (ind != null) {} // was a warning -} - -fun notNullUpperBound(t: T, ind: INDIRECT) { - if (t == null) {} // still a warning - if (t != null) {} // still a warning - if (ind == null) {} // still a warning - if (ind != null) {} // still a warning -} - diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/senslessComparisonWithNullOnTypeParameters.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/senslessComparisonWithNullOnTypeParameters.kt index 73ea154b9ef..c74a64d6eef 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/senslessComparisonWithNullOnTypeParameters.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/senslessComparisonWithNullOnTypeParameters.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // The type checker used to think that T is not null no matter what the upper bound fun nullableUpperBound(t: T, ind: INDIRECT) { diff --git a/compiler/testData/diagnostics/tests/nullableTypes/definitelyNotNullWithNullableBound.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/definitelyNotNullWithNullableBound.fir.kt deleted file mode 100644 index 9aaeae8962c..00000000000 --- a/compiler/testData/diagnostics/tests/nullableTypes/definitelyNotNullWithNullableBound.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_EXPRESSION - -fun makeDefinitelyNotNull(arg: D?): D = TODO() - -fun test(arg: N) { - makeDefinitelyNotNull(arg) ?: 1 - - makeDefinitelyNotNull(arg)!! - - makeDefinitelyNotNull(arg)?.toInt() - - val nullImposible = when (val dnn = makeDefinitelyNotNull(arg)) { - null -> false - else -> true - } -} diff --git a/compiler/testData/diagnostics/tests/nullableTypes/definitelyNotNullWithNullableBound.kt b/compiler/testData/diagnostics/tests/nullableTypes/definitelyNotNullWithNullableBound.kt index 6fa620a97af..4509c2417cd 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/definitelyNotNullWithNullableBound.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/definitelyNotNullWithNullableBound.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -UNUSED_EXPRESSION diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullTypeMarkedWithNullableAnnotation.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullTypeMarkedWithNullableAnnotation.fir.kt deleted file mode 100644 index bd05e0fb7f7..00000000000 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullTypeMarkedWithNullableAnnotation.fir.kt +++ /dev/null @@ -1,22 +0,0 @@ -// FILE: J.java - -import org.jetbrains.annotations.*; -import java.util.*; - -public class J { - @Nullable - public List n() { return null; } -} - -// FILE: k.kt - -fun list(j: J): Any { - val a = j.n()!! - - a?.get(0) - if (a == null) {} - a!! - - a.get(0) - return a -} diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullTypeMarkedWithNullableAnnotation.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullTypeMarkedWithNullableAnnotation.kt index 40515b7c858..1151d252d14 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullTypeMarkedWithNullableAnnotation.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/notNullTypeMarkedWithNullableAnnotation.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: J.java import org.jetbrains.annotations.*; diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/senselessComparisonEquals.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/senselessComparisonEquals.fir.kt index fff0b3bf8a8..3e16583b802 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/senselessComparisonEquals.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/senselessComparisonEquals.fir.kt @@ -24,10 +24,10 @@ fun test() { val a: Any? = null - if (platformNN != null) {} - if (null != platformNN) {} - if (platformNN == null) {} - if (null == platformNN) {} + if (platformNN != null) {} + if (null != platformNN) {} + if (platformNN == null) {} + if (null == platformNN) {} if (a != null && platformNN != a) {} diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/senselessComparisonIdentityEquals.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/senselessComparisonIdentityEquals.fir.kt index 971328e16a4..ee64b8d261e 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/senselessComparisonIdentityEquals.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/senselessComparisonIdentityEquals.fir.kt @@ -24,10 +24,10 @@ fun test() { val a: Any? = null - if (platformNN !== null) {} - if (null !== platformNN) {} - if (platformNN === null) {} - if (null === platformNN) {} + if (platformNN !== null) {} + if (null !== platformNN) {} + if (platformNN === null) {} + if (null === platformNN) {} if (platformN !== null) {} if (platformN === null) {} diff --git a/compiler/testData/diagnostics/tests/senselessComparison/noExplicitType.fir.kt b/compiler/testData/diagnostics/tests/senselessComparison/noExplicitType.fir.kt deleted file mode 100644 index db1e3857bcb..00000000000 --- a/compiler/testData/diagnostics/tests/senselessComparison/noExplicitType.fir.kt +++ /dev/null @@ -1,15 +0,0 @@ -fun readLine() = "x" - -fun foo() { - var line = "" - - while (line != null) { - line = readLine() - - if (line != null) { - bar() - } - } -} - -fun bar() {} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/senselessComparison/noExplicitType.kt b/compiler/testData/diagnostics/tests/senselessComparison/noExplicitType.kt index a094a2e60e8..80c3fd4743b 100644 --- a/compiler/testData/diagnostics/tests/senselessComparison/noExplicitType.kt +++ b/compiler/testData/diagnostics/tests/senselessComparison/noExplicitType.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL fun readLine() = "x" fun foo() { diff --git a/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.fir.kt b/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.fir.kt index df6def7435a..15c100df48d 100644 --- a/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.fir.kt +++ b/compiler/testData/diagnostics/tests/senselessComparison/parenthesized.fir.kt @@ -1,23 +1,23 @@ fun testEquals(x: Int) { - if (x == null) {} - if (x == (null)) {} - if (x == foo@ null) {} + if (x == null) {} + if (x == (null)) {} + if (x == foo@ null) {} } fun testEqualsFlipped(x: Int) { - if (null == x) {} - if ((null) == x) {} - if (foo@ null == x) {} + if (null == x) {} + if ((null) == x) {} + if (foo@ null == x) {} } fun testNotEquals(x: Int) { - if (x != null) {} - if (x != (null)) {} - if (x != foo@ null) {} + if (x != null) {} + if (x != (null)) {} + if (x != foo@ null) {} } fun testNotEqualsFlipped(x: Int) { - if (null != x) {} - if ((null) != x) {} - if (foo@ null != x) {} -} \ No newline at end of file + if (null != x) {} + if ((null) != x) {} + if (foo@ null != x) {} +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt index 7e67073c110..fd9c94d4ff4 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/alwaysNull.fir.kt @@ -3,7 +3,7 @@ fun foo(): String { s = null s?.length s.length - if (s == null) return s!! + if (s == null) return s!! var t: String? = "y" if (t == null) t = "x" var x: Int? = null diff --git a/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt index cb1d9c85e32..c0c4a2e291a 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/castchecks/variables.fir.kt @@ -15,7 +15,7 @@ object Impl : SomeSubClass { fun g(a: SomeClass?) { var b = (a as? SomeSubClass)?.foo b = "Hello" - if (b != null) { + if (b != null) { // 'a' cannot be cast to SomeSubClass! a.hashCode() a.foo @@ -24,7 +24,7 @@ fun g(a: SomeClass?) { } var c = a as? SomeSubClass c = Impl - if (c != null) { + if (c != null) { // 'a' cannot be cast to SomeSubClass a.hashCode() a.foo diff --git a/compiler/testData/diagnostics/tests/smartCasts/notNullorNotNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/notNullorNotNull.fir.kt index 5fc238ca174..8246291af46 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/notNullorNotNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/notNullorNotNull.fir.kt @@ -1,6 +1,6 @@ fun bar(x: Int?): Int { if (x != null) return -1 - if (x == null) return -2 + if (x == null) return -2 // Should be unreachable return 2 + 2 -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt index 7dff0d653f8..9ae5656cade 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/ownerDeclaresBothModifies.fir.kt @@ -7,7 +7,7 @@ fun foo(arg: Int?) { x.hashCode() x = null } - if (x != null) x = 42 + if (x != null) x = 42 // Unsafe because of lambda x.hashCode() } diff --git a/compiler/testData/diagnostics/tests/smartCasts/variables/whileWithBreak.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/variables/whileWithBreak.fir.kt index 05f04ba2fba..55663623f71 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/variables/whileWithBreak.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/variables/whileWithBreak.fir.kt @@ -4,7 +4,7 @@ fun String.next(): String { fun list(start: String) { var e: Any? = start - if (e==null) return + if (e==null) return while (e is String) { // Smart cast due to the loop condition if (e.length == 0) diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/inference.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/inference.fir.kt index e371be59aee..cbac19076f0 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/inference.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/inference.fir.kt @@ -3,7 +3,7 @@ fun f() { var s: String? s = "a" var s1 = "" // String � ? - if (s != null) { // Redundant + if (s != null) { // Redundant s1.length // We can do smartcast here and below s1 = s.toString() // return String? @@ -18,4 +18,4 @@ fun f() { val s3 = s.toString() s3.length } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedLoops.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedLoops.fir.kt index 076b4f3bced..1706496d4e9 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedLoops.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/nestedLoops.fir.kt @@ -11,9 +11,9 @@ public fun foo(qq: String?): Int { // p = r, r = q and q is not null p.length } while (!x()) - } while (r == null) // r = q and q is not null + } while (r == null) // r = q and q is not null if (!x()) break } // Smart cast is possible return q.length -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava2.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava2.fir.kt index 69c22016a2a..b96014575d9 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava2.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava2.fir.kt @@ -6,7 +6,7 @@ abstract class KotlinClass : JavaInterface1, JavaInterface2 { fun foo(k: KotlinClass) { useString(k.getSomething()) useString(k.something) - if (k.something == null) return + if (k.something == null) return k.setSomething(1) k.something = 1 diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.fir.kt deleted file mode 100644 index 94a68b1f39e..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// FILE: KotlinFile.kt -abstract class KotlinClass : JavaInterface1, JavaInterface2 { - override fun getSomething(): String = "" -} - -fun foo(k: KotlinClass) { - useString(k.getSomething()) - useString(k.something) - if (k.something == null) return - - k.setSomething("") - k.something = "" -} - -fun useString(i: String) {} - -// FILE: JavaInterface1.java -public interface JavaInterface1 { - String getSomething(); -} - -// FILE: JavaInterface2.java -public interface JavaInterface2 { - void setSomething(String value); -} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.kt index 13ee9e915a2..874e56f2519 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava3.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt abstract class KotlinClass : JavaInterface1, JavaInterface2 { override fun getSomething(): String = "" diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.fir.kt deleted file mode 100644 index 86376249db7..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.fir.kt +++ /dev/null @@ -1,28 +0,0 @@ -// FILE: KotlinFile.kt -abstract class KotlinClass : JavaInterface3 { - override fun getSomething(): String = "" -} - -fun foo(k: KotlinClass) { - useString(k.getSomething()) - useString(k.something) - if (k.something == null) return - - k.setSomething("") - k.something = "" -} - -fun useString(i: String) {} - -// FILE: JavaInterface1.java -public interface JavaInterface1 { - String getSomething(); -} - -// FILE: JavaInterface2.java -public interface JavaInterface2 { - void setSomething(String value); -} - -// FILE: JavaInterface3.java -public interface JavaInterface3 extends JavaInterface1, JavaInterface2 {} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.kt index 186687c66f1..b1c0ad06930 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava4.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt abstract class KotlinClass : JavaInterface3 { override fun getSomething(): String = "" diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.fir.kt deleted file mode 100644 index 0c1ffd3f4bc..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.fir.kt +++ /dev/null @@ -1,29 +0,0 @@ -// FILE: KotlinFile.kt -abstract class KotlinClass : JavaInterface3 { - override fun getSomething(): String = "" -} - -fun foo(k: KotlinClass) { - useString(k.getSomething()) - useString(k.something) - if (k.something == null) return - - k.setSomething("") - k.something = "" -} - -fun useString(i: String) {} - -// FILE: JavaInterface1.java -public interface JavaInterface1 { - String getSomething(); -} - -// FILE: JavaInterface2.java -public interface JavaInterface2 { - String getSomething(); - void setSomething(String value); -} - -// FILE: JavaInterface3.java -public interface JavaInterface3 extends JavaInterface1, JavaInterface2 {} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.kt index 6222d8d0687..a10624bd7c8 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/KotlinOverridesJava5.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: KotlinFile.kt abstract class KotlinClass : JavaInterface3 { override fun getSomething(): String = "" diff --git a/compiler/testData/diagnostics/tests/when/whenOnNothing.fir.kt b/compiler/testData/diagnostics/tests/when/whenOnNothing.fir.kt index 1eefde92022..2dcf15888c9 100644 --- a/compiler/testData/diagnostics/tests/when/whenOnNothing.fir.kt +++ b/compiler/testData/diagnostics/tests/when/whenOnNothing.fir.kt @@ -3,7 +3,7 @@ // exhaustive fun test1(n: Nothing) = when (n) { } fun test2(n: Nothing?) = when (n) { - null -> {} + null -> {} } // not exhaustive diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalEqualsCondition.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalEqualsCondition.fir.kt index 7b977263d48..105885f010e 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalEqualsCondition.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/illegalEqualsCondition.fir.kt @@ -18,7 +18,7 @@ fun identityEqualsWithVariables(x: Any?, y: Any?) { fun equalConstants() { contract { - returns() implies (null == null) + returns() implies (null == null) } } @@ -27,4 +27,4 @@ fun equalNullWithCall() { contract { returns() implies (get() == null) } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/unlabeledReceiver.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/unlabeledReceiver.fir.kt index 554bf1a62ba..71547211313 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/unlabeledReceiver.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/errors/unlabeledReceiver.fir.kt @@ -6,7 +6,7 @@ import kotlin.contracts.* fun Any?.foo(): Boolean { contract { - returns(true) implies (this != null) + returns(true) implies (this != null) } return this != null -} \ 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 eb2f895dda9..980a4027df3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/nullabilitySmartcastWhenNullability.fir.kt @@ -39,7 +39,7 @@ fun notNullWhenNotNull (x: Int?): Int? { fun testNotNullWhenNotNull (x: Int?) { if (notNullWhenNotNull(x) == null) { - x == null + x == null } else { x.dec() @@ -49,7 +49,7 @@ fun testNotNullWhenNotNull (x: Int?) { x.dec() } else { - x == null + x == null } x.dec() diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/throwsEffect.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/throwsEffect.fir.kt index 745a7da6705..96e9dd74516 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/throwsEffect.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/throwsEffect.fir.kt @@ -60,7 +60,7 @@ fun testAtLeastOnceFlow(x: Any?) { do { myAssert(x is String) x.length - } while (x != null) + } while (x != null) x.length } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/when/kt36818.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/when/kt36818.fir.kt index 669438916b9..16986b18951 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/when/kt36818.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/smartcasts/when/kt36818.fir.kt @@ -5,7 +5,7 @@ fun main(x1: Double?, range: ClosedRange) { } when { - x1 == null -> throw Exception() + x1 == null -> throw Exception() x1 in range -> {} } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.2.fir.kt index 78e7dd7fc9d..b56bd3c7c46 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/pos/5.2.fir.kt @@ -226,7 +226,7 @@ fun case_23(value_1: Nothing) { // TESTCASE NUMBER: 24 fun case_24(value_1: Nothing?) = when (value_1) { throw Exception(), return "" -> "" - null, return return return "", throw throw throw Exception() -> "" + null, return return return "", throw throw throw Exception() -> "" else -> "" } 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 5677436a9fc..37292c00415 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 @@ -157,29 +157,29 @@ fun T?.case_22_3(): Boolean? { // TESTCASE NUMBER: 23 fun T.case_23_1(): Boolean { contract { returns(false) implies (this@case_23_1 !is Int || this@case_23_1 == null) } - return !(this@case_23_1 !is Int || this@case_23_1 == null) + return !(this@case_23_1 !is Int || this@case_23_1 == null) } fun T.case_23_2(): Boolean? { contract { returnsNotNull() implies (this@case_23_2 !is Int || this@case_23_2 == null) } - return if (this@case_23_2 !is Int || this@case_23_2 == null) true else null + return if (this@case_23_2 !is Int || this@case_23_2 == null) true else null } fun T.case_23_3(): Boolean? { contract { returns(null) implies (this@case_23_3 !is Int || this@case_23_3 == null) } - return if (this@case_23_3 !is Int || this@case_23_3 == null) null else true + return if (this@case_23_3 !is Int || this@case_23_3 == null) null else true } // TESTCASE NUMBER: 24 inline fun T?.case_24_1(): Boolean { contract { returns(false) implies (this@case_24_1 !is Number || this@case_24_1 !is Int || this@case_24_1 == null) } - return !(this@case_24_1 !is Number || this@case_24_1 !is Int || this@case_24_1 == null) + return !(this@case_24_1 !is Number || this@case_24_1 !is Int || this@case_24_1 == null) } inline fun T?.case_24_2(): Boolean? { contract { returnsNotNull() implies (this@case_24_2 !is Number || this@case_24_2 !is Int || this@case_24_2 == null) } - return if (this@case_24_2 !is Number || this@case_24_2 !is Int || this@case_24_2 == null) true else null + return if (this@case_24_2 !is Number || this@case_24_2 !is Int || this@case_24_2 == null) true else null } inline fun T?.case_24_3(): Boolean? { contract { returns(null) implies (this@case_24_3 !is Number || this@case_24_3 !is Int || this@case_24_3 == null) } - return if (this@case_24_3 !is Number || this@case_24_3 !is Int || this@case_24_3 == null) null else true + return if (this@case_24_3 !is Number || this@case_24_3 !is Int || this@case_24_3 == null) null else true } // TESTCASE NUMBER: 25 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 c89d5019168..b915657dadb 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 @@ -15,13 +15,13 @@ fun T?.case_1() { // TESTCASE NUMBER: 2 fun T.case_2() { contract { returns() implies (this@case_2 !is Int || this@case_2 == null) } - if (!(this@case_2 !is Int || this@case_2 == null)) throw Exception() + if (!(this@case_2 !is Int || this@case_2 == null)) throw Exception() } // TESTCASE NUMBER: 3 inline fun T?.case_3() { contract { returns() implies (this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null) } - if (!(this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null)) throw Exception() + if (!(this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null)) throw Exception() } // TESTCASE NUMBER: 4 @@ -45,37 +45,37 @@ fun T?.case_4_4(): Boolean? { // TESTCASE NUMBER: 5 fun T.case_5_1(): Boolean { contract { returns(true) implies (this@case_5_1 !is Int || this@case_5_1 == null) } - return this@case_5_1 !is Int || this@case_5_1 == null + return this@case_5_1 !is Int || this@case_5_1 == null } fun T.case_5_2(): Boolean { contract { returns(false) implies (this@case_5_2 !is Int || this@case_5_2 == null) } - return !(this@case_5_2 !is Int || this@case_5_2 == null) + return !(this@case_5_2 !is Int || this@case_5_2 == null) } fun T.case_5_3(): Boolean? { contract { returnsNotNull() implies (this@case_5_3 !is Int || this@case_5_3 == null) } - return if (this@case_5_3 !is Int || this@case_5_3 == null) true else null + return if (this@case_5_3 !is Int || this@case_5_3 == null) true else null } fun T.case_5_4(): Boolean? { contract { returns(null) implies (this@case_5_4 !is Int || this@case_5_4 == null) } - return if (this@case_5_4 !is Int || this@case_5_4 == null) null else true + return if (this@case_5_4 !is Int || this@case_5_4 == null) null else true } // TESTCASE NUMBER: 6 inline fun T?.case_6_1(): Boolean { contract { returns(true) implies (this@case_6_1 !is Number || this@case_6_1 !is Int || this@case_6_1 == null) } - return this@case_6_1 !is Number || this@case_6_1 !is Int || this@case_6_1 == null + return this@case_6_1 !is Number || this@case_6_1 !is Int || this@case_6_1 == null } inline fun T?.case_6_2(): Boolean { contract { returns(false) implies (this@case_6_2 !is Number || this@case_6_2 !is Int || this@case_6_2 == null) } - return !(this@case_6_2 !is Number || this@case_6_2 !is Int || this@case_6_2 == null) + return !(this@case_6_2 !is Number || this@case_6_2 !is Int || this@case_6_2 == null) } inline fun T?.case_6_3(): Boolean? { contract { returnsNotNull() implies (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) } - return if (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) true else null + return if (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) true else null } inline fun T?.case_6_4(): Boolean? { contract { returns(null) implies (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) } - return if (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) null else true + return if (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) null else true } // FILE: main.kt 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 b63ebf9e6f2..01c01691e59 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 @@ -15,13 +15,13 @@ fun T?.case_1(value_1: Int?) { // TESTCASE NUMBER: 2 fun T.case_2(value_2: Any?) { contract { returns() implies (this@case_2 !is Int || this@case_2 == null || value_2 !is Number || value_2 == null) } - if (!(this@case_2 !is Int || this@case_2 == null || value_2 !is Number || value_2 == null)) throw Exception() + if (!(this@case_2 !is Int || this@case_2 == null || value_2 !is Number || value_2 == null)) throw Exception() } // TESTCASE NUMBER: 3 fun T?.case_3(value_2: Any?) { contract { returns() implies (this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null || value_2 == null) } - if (!(this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null || value_2 == null)) throw Exception() + if (!(this@case_3 !is Number || this@case_3 !is Int || this@case_3 == null || value_2 == null)) throw Exception() } // TESTCASE NUMBER: 4 @@ -51,37 +51,37 @@ fun T?.case_5_4(value_1: Int?): Boolean? { // TESTCASE NUMBER: 6 fun T.case_6_1(value_2: Any?): Boolean { contract { returns(true) implies (this@case_6_1 !is Int || this@case_6_1 == null || value_2 !is Number || value_2 == null) } - return this@case_6_1 !is Int || this@case_6_1 == null || value_2 !is Number || value_2 == null + return this@case_6_1 !is Int || this@case_6_1 == null || value_2 !is Number || value_2 == null } fun T.case_6_2(value_2: Any?): Boolean { contract { returns(false) implies (this@case_6_2 !is Int || this@case_6_2 == null || value_2 !is Number || value_2 == null) } - return !(this@case_6_2 !is Int || this@case_6_2 == null || value_2 !is Number || value_2 == null) + return !(this@case_6_2 !is Int || this@case_6_2 == null || value_2 !is Number || value_2 == null) } fun T.case_6_3(value_2: Any?): Boolean? { contract { returnsNotNull() implies (this@case_6_3 !is Int || this@case_6_3 == null || value_2 !is Number || value_2 == null) } - return if (this@case_6_3 !is Int || this@case_6_3 == null || value_2 !is Number || value_2 == null) true else null + return if (this@case_6_3 !is Int || this@case_6_3 == null || value_2 !is Number || value_2 == null) true else null } fun T.case_6_4(value_2: Any?): Boolean? { contract { returns(null) implies (this@case_6_4 !is Int || this@case_6_4 == null || value_2 !is Number || value_2 == null) } - return if (this@case_6_4 !is Int || this@case_6_4 == null || value_2 !is Number || value_2 == null) null else true + return if (this@case_6_4 !is Int || this@case_6_4 == null || value_2 !is Number || value_2 == null) null else true } // TESTCASE NUMBER: 7 fun T?.case_7_1(value_2: Any?): Boolean { contract { returns(true) implies (this@case_7_1 !is Number || this@case_7_1 !is Int || this@case_7_1 == null || value_2 == null) } - return this@case_7_1 !is Number || this@case_7_1 !is Int || this@case_7_1 == null || value_2 == null + return this@case_7_1 !is Number || this@case_7_1 !is Int || this@case_7_1 == null || value_2 == null } fun T?.case_7_2(value_2: Any?): Boolean { contract { returns(false) implies (this@case_7_2 !is Number || this@case_7_2 !is Int || this@case_7_2 == null || value_2 == null) } - return !(this@case_7_2 !is Number || this@case_7_2 !is Int || this@case_7_2 == null || value_2 == null) + return !(this@case_7_2 !is Number || this@case_7_2 !is Int || this@case_7_2 == null || value_2 == null) } fun T?.case_7_3(value_2: Any?): Boolean? { contract { returnsNotNull() implies (this@case_7_3 !is Number || this@case_7_3 !is Int || this@case_7_3 == null || value_2 == null) } - return if (this@case_7_3 !is Number || this@case_7_3 !is Int || this@case_7_3 == null || value_2 == null) true else null + return if (this@case_7_3 !is Number || this@case_7_3 !is Int || this@case_7_3 == null || value_2 == null) true else null } fun T?.case_7_4(value_2: Any?): Boolean? { contract { returns(null) implies (this@case_7_4 !is Number || this@case_7_4 !is Int || this@case_7_4 == null || value_2 == null) } - return if (this@case_7_4 !is Number || this@case_7_4 !is Int || this@case_7_4 == null || value_2 == null) null else true + return if (this@case_7_4 !is Number || this@case_7_4 !is Int || this@case_7_4 == null || value_2 == null) null else true } // TESTCASE NUMBER: 8 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 365eac57bed..d723c5bdab7 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 @@ -25,7 +25,7 @@ fun case_4(value_1: Number, block: (() -> Unit)?): Boolean? { returns(null) implies (block == null) } - return value_1 == null + return value_1 == null } // TESTCASE NUMBER: 5 @@ -48,7 +48,7 @@ fun T?.case_6(value_1: Number, value_2: String?): Boolean? { returnsNotNull() implies (value_2 == null) } - return value_1 == null + return value_1 == null } // FILE: main.kt 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 041d5ba4639..5b1053c5931 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 @@ -69,7 +69,7 @@ fun case_3(value_1: Int?) { // TESTCASE NUMBER: 4 fun case_4(value_1: Any?) { - if (contracts.case_4(value_1) != null) { + if (contracts.case_4(value_1) != null) { value_1.toByte() } } 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 c33ea8bc085..3cd297ba98d 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 @@ -15,13 +15,13 @@ fun T?.case_1() { // TESTCASE NUMBER: 2 fun T.case_2() { contract { returns() implies (this@case_2 is Int && this@case_2 != null) } - if (!(this@case_2 is Int && this@case_2 != null)) throw Exception() + if (!(this@case_2 is Int && this@case_2 != null)) throw Exception() } // TESTCASE NUMBER: 3 inline fun T?.case_3() { contract { returns() implies (this@case_3 is Number && this@case_3 is Int && this@case_3 != null) } - if (!(this@case_3 is Number && this@case_3 is Int && this@case_3 != null)) throw Exception() + if (!(this@case_3 is Number && this@case_3 is Int && this@case_3 != null)) throw Exception() } // TESTCASE NUMBER: 4 @@ -45,37 +45,37 @@ fun T?.case_4_4(): Boolean? { // TESTCASE NUMBER: 5 fun T.case_5_1(): Boolean { contract { returns(true) implies (this@case_5_1 is Int && this@case_5_1 != null) } - return this@case_5_1 is Int && this@case_5_1 != null + return this@case_5_1 is Int && this@case_5_1 != null } fun T.case_5_2(): Boolean { contract { returns(false) implies (this@case_5_2 is Int && this@case_5_2 != null) } - return !(this@case_5_2 is Int && this@case_5_2 != null) + return !(this@case_5_2 is Int && this@case_5_2 != null) } fun T.case_5_3(): Boolean? { contract { returnsNotNull() implies (this@case_5_3 is Int && this@case_5_3 != null) } - return if (this@case_5_3 is Int && this@case_5_3 != null) true else null + return if (this@case_5_3 is Int && this@case_5_3 != null) true else null } fun T.case_5_4(): Boolean? { contract { returns(null) implies (this@case_5_4 is Int && this@case_5_4 != null) } - return if (this@case_5_4 is Int && this@case_5_4 != null) null else true + return if (this@case_5_4 is Int && this@case_5_4 != null) null else true } // TESTCASE NUMBER: 6 inline fun T?.case_6_1(): Boolean { contract { returns(true) implies (this@case_6_1 is Number && this@case_6_1 is Int && this@case_6_1 != null) } - return this@case_6_1 is Number && this@case_6_1 is Int && this@case_6_1 != null + return this@case_6_1 is Number && this@case_6_1 is Int && this@case_6_1 != null } inline fun T?.case_6_2(): Boolean { contract { returns(false) implies (this@case_6_2 is Number && this@case_6_2 is Int && this@case_6_2 != null) } - return !(this@case_6_2 is Number && this@case_6_2 is Int && this@case_6_2 != null) + return !(this@case_6_2 is Number && this@case_6_2 is Int && this@case_6_2 != null) } inline fun T?.case_6_3(): Boolean? { contract { returnsNotNull() implies (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) } - return if (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) true else null + return if (this@case_6_3 is Number && this@case_6_3 is Int && this@case_6_3 != null) true else null } inline fun T?.case_6_4(): Boolean? { contract { returns(null) implies (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) } - return if (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) null else true + return if (this@case_6_4 is Number && this@case_6_4 is Int && this@case_6_4 != null) null else true } // FILE: main.kt 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 3a15f23cfe1..a9fde9c645a 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 @@ -15,13 +15,13 @@ fun T?.case_1(value_1: Int?) { // TESTCASE NUMBER: 2 fun T.case_2(value_2: Any?) { contract { returns() implies (this@case_2 is Int && this@case_2 != null && value_2 is Number && value_2 != null) } - if (!(this@case_2 is Int && this@case_2 != null && value_2 is Number && value_2 != null)) throw Exception() + if (!(this@case_2 is Int && this@case_2 != null && value_2 is Number && value_2 != null)) throw Exception() } // TESTCASE NUMBER: 3 fun T?.case_3(value_2: Any?) { contract { returns() implies (this@case_3 is Number && this@case_3 is Int && this@case_3 != null && value_2 != null) } - if (!(this@case_3 is Number && this@case_3 is Int && this@case_3 != null && value_2 != null)) throw Exception() + if (!(this@case_3 is Number && this@case_3 is Int && this@case_3 != null && value_2 != null)) throw Exception() } // TESTCASE NUMBER: 4 @@ -51,37 +51,37 @@ fun T?.case_5_4(value_1: Int?): Boolean? { // TESTCASE NUMBER: 6 fun T.case_6_1(value_2: Any?): Boolean { contract { returns(true) implies (this@case_6_1 is Int && this@case_6_1 != null && value_2 is Number && value_2 != null) } - return this@case_6_1 is Int && this@case_6_1 != null && value_2 is Number && value_2 != null + return this@case_6_1 is Int && this@case_6_1 != null && value_2 is Number && value_2 != null } fun T.case_6_2(value_2: Any?): Boolean { contract { returns(false) implies (this@case_6_2 is Int && this@case_6_2 != null && value_2 is Number && value_2 != null) } - return !(this@case_6_2 is Int && this@case_6_2 != null && value_2 is Number && value_2 != null) + return !(this@case_6_2 is Int && this@case_6_2 != null && value_2 is Number && value_2 != null) } fun T.case_6_3(value_2: Any?): Boolean? { contract { returnsNotNull() implies (this@case_6_3 is Int && this@case_6_3 != null && value_2 is Number && value_2 != null) } - return if (this@case_6_3 is Int && this@case_6_3 != null && value_2 is Number && value_2 != null) true else null + return if (this@case_6_3 is Int && this@case_6_3 != null && value_2 is Number && value_2 != null) true else null } fun T.case_6_4(value_2: Any?): Boolean? { contract { returns(null) implies (this@case_6_4 is Int && this@case_6_4 != null && value_2 is Number && value_2 != null) } - return if (this@case_6_4 is Int && this@case_6_4 != null && value_2 is Number && value_2 != null) null else true + return if (this@case_6_4 is Int && this@case_6_4 != null && value_2 is Number && value_2 != null) null else true } // TESTCASE NUMBER: 7 fun T?.case_7_1(value_2: Any?): Boolean { contract { returns(true) implies (this@case_7_1 is Number && this@case_7_1 is Int && this@case_7_1 != null && value_2 != null) } - return this@case_7_1 is Number && this@case_7_1 is Int && this@case_7_1 != null && value_2 != null + return this@case_7_1 is Number && this@case_7_1 is Int && this@case_7_1 != null && value_2 != null } fun T?.case_7_2(value_2: Any?): Boolean { contract { returns(true) implies (this@case_7_2 is Number && this@case_7_2 is Int && this@case_7_2 != null && value_2 != null) } - return this@case_7_2 is Number && this@case_7_2 is Int && this@case_7_2 != null && value_2 != null + return this@case_7_2 is Number && this@case_7_2 is Int && this@case_7_2 != null && value_2 != null } fun T?.case_7_3(value_2: Any?): Boolean? { contract { returnsNotNull() implies (this@case_7_3 is Number && this@case_7_3 is Int && this@case_7_3 != null && value_2 != null) } - return if (this@case_7_3 is Number && this@case_7_3 is Int && this@case_7_3 != null && value_2 != null) true else null + return if (this@case_7_3 is Number && this@case_7_3 is Int && this@case_7_3 != null && value_2 != null) true else null } fun T?.case_7_4(value_2: Any?): Boolean? { contract { returns(null) implies (this@case_7_4 is Number && this@case_7_4 is Int && this@case_7_4 != null && value_2 != null) } - return if (this@case_7_4 is Number && this@case_7_4 is Int && this@case_7_4 != null && value_2 != null) null else true + return if (this@case_7_4 is Number && this@case_7_4 is Int && this@case_7_4 != null && value_2 != null) null else true } // TESTCASE NUMBER: 8 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 cdd422ac0ef..513422730e5 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 @@ -26,7 +26,7 @@ fun case_4(value_1: Number, block: (() -> Unit)?): Boolean? { returns(null) implies (block != null) } - return value_1 == null + return value_1 == null } // TESTCASE NUMBER: 5 @@ -49,7 +49,7 @@ fun T?.case_6(value_1: Number, value_2: String?): Boolean? { returnsNotNull() implies (value_2 != null) } - return value_1 == null + return value_1 == null } // FILE: main.kt diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/3.fir.kt index 051a6ccc3fc..f9988a01f6b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/common/neg/3.fir.kt @@ -23,8 +23,8 @@ fun case_3(value_1: String?, value_2: Boolean): Boolean { // TESTCASE NUMBER: 4 fun case_4(value_1: Nothing?, value_2: Boolean?): Boolean? { - contract { returns(null) implies (value_1 == null || value_2 != null || value_2 == false) } - return if (value_1 == null || value_2 != null || value_2 == false) null else true + contract { returns(null) implies (value_1 == null || value_2 != null || value_2 == false) } + return if (value_1 == null || value_2 != null || value_2 == false) null else true } // TESTCASE NUMBER: 5 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/2.fir.kt index 38ceea84e7f..f201d99026d 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/neg/2.fir.kt @@ -5,7 +5,7 @@ import kotlin.contracts.* // TESTCASE NUMBER: 1 fun Any?.case_1(): Boolean { contract { - returns(true) implies (this != null) + returns(true) implies (this != null) } return this != null } @@ -21,7 +21,7 @@ fun Any?.case_2(): Boolean { // TESTCASE NUMBER: 3 fun T?.case_3(): Boolean { contract { - returnsNotNull() implies (this != null) + returnsNotNull() implies (this != null) } return this != null } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos/1.fir.kt index 8f5277c2cd1..b352b160f97 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractBuilder/effects/returns/pos/1.fir.kt @@ -66,7 +66,7 @@ fun case_11(value_1: Any?): Boolean? { // TESTCASE NUMBER: 12 fun Char.case_12() { contract { returns() implies (this@case_12 == null) } - if (this@case_12 != null) throw Exception() + if (this@case_12 != null) throw Exception() } // TESTCASE NUMBER: 13 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg/2.fir.kt index 3030c239818..620d224608b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/declarations/contractFunction/neg/2.fir.kt @@ -61,12 +61,12 @@ class case_5 : ClassLevel5() { inner class case_5_1 { fun K.case_5_1_1() { contract { returns() implies (this@case_5_1 !is ClassLevel1 && this@case_5_1 != null || this@case_5 is ClassLevel1 && this@case_5_1_1 is Float) } - if (!(this@case_5_1 !is ClassLevel1 && this@case_5_1 != null || this@case_5 is ClassLevel1 && this is Float)) throw Exception() + if (!(this@case_5_1 !is ClassLevel1 && this@case_5_1 != null || this@case_5 is ClassLevel1 && this is Float)) throw Exception() } fun case_5_1_2() { contract { returns() implies (this@case_5_1 !is ClassLevel1 || this@case_5 is ClassLevel1 || this@case_5_1 == null) } - if (!(this@case_5_1 !is ClassLevel1 || this@case_5 is ClassLevel1 || this@case_5_1 == null)) throw Exception() + if (!(this@case_5_1 !is ClassLevel1 || this@case_5 is ClassLevel1 || this@case_5_1 == null)) throw Exception() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt index 80cbe68278d..fda4d8fd56b 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt @@ -20,7 +20,7 @@ fun case_1(x: Any?) { // TESTCASE NUMBER: 3 fun case_3() { - if (Object.prop_1 == null !== null) + if (Object.prop_1 == null !== null) else { Object.prop_1 Object.prop_1.equals(null) @@ -56,15 +56,15 @@ fun case_5() { val x: Unit? = null if (x !== null is Boolean?) x - if (x !== null == null) x.equals(null) - if (x !== null == null) x.propT - if (x !== null == null) x.propAny - if (x !== null == null) x.propNullableT - if (x !== null == null) x.propNullableAny - if (x !== null == null) x.funT() - if (x !== null == null) x.funAny() - if (x !== null == null) x.funNullableT() - if (x !== null == null) x.funNullableAny() + if (x !== null == null) x.equals(null) + if (x !== null == null) x.propT + if (x !== null == null) x.propAny + if (x !== null == null) x.propNullableT + if (x !== null == null) x.propNullableAny + if (x !== null == null) x.funT() + if (x !== null == null) x.funAny() + if (x !== null == null) x.funNullableT() + if (x !== null == null) x.funNullableAny() } // TESTCASE NUMBER: 6 @@ -103,13 +103,13 @@ fun case_7() { // TESTCASE NUMBER: 8 fun case_8(x: TypealiasNullableString) { - if (x !== null === null && x != null != null) x.get(0) - if (x !== null != null && x != null === null) x.get(0) + if (x !== null === null && x != null != null) x.get(0) + if (x !== null != null && x != null === null) x.get(0) } // TESTCASE NUMBER: 9 fun case_9(x: TypealiasNullableString?) { - if (x === null === null) { + if (x === null === null) { } else if (false is Boolean) { x @@ -122,7 +122,7 @@ fun case_10() { val a = Class() if (a.prop_4 === null || true is Boolean) { - if (a.prop_4 != null !== null) { + if (a.prop_4 != null !== null) { a.prop_4 a.prop_4.equals(null) a.prop_4.propT @@ -165,17 +165,17 @@ fun case_11(x: TypealiasNullableStringIndirect?, y: TypealiasNullableStringIndir // TESTCASE NUMBER: 12 fun case_12(x: TypealiasNullableStringIndirect, y: TypealiasNullableStringIndirect) = - if ((x == null) !is Boolean === false) "1" - else if ((y === null !== null) is Boolean) x - else if (y === null != null) x.equals(null) - else if (y === null != null) x.propT - else if (y === null != null) x.propAny - else if (y === null != null) x.propNullableT - else if (y === null != null) x.propNullableAny - else if (y === null != null) x.funT() - else if (y === null != null) x.funAny() - else if (y === null != null) x.funNullableT() - else if (y === null != null) x.funNullableAny() + if ((x == null) !is Boolean === false) "1" + else if ((y === null !== null) is Boolean) x + else if (y === null != null) x.equals(null) + else if (y === null != null) x.propT + else if (y === null != null) x.propAny + else if (y === null != null) x.propNullableT + else if (y === null != null) x.propNullableAny + else if (y === null != null) x.funT() + else if (y === null != null) x.funAny() + else if (y === null != null) x.funNullableT() + else if (y === null != null) x.funNullableAny() else "-1" // TESTCASE NUMBER: 13 @@ -200,15 +200,15 @@ fun case_14() { if (a.x != null !is Boolean !is Boolean) { if (a.x != null == true) { - if (a.x !== null == false) { - if (a.x != null == null) { - if (a.x != null !== null) { - if (a.x != null === true) { - if (a.x !== null === true !is Boolean == true) { - if (a.x != null !== false) { - if (a.x != null === false) { - if (a.x !== null === true) { - if ((a.x != null != true) !is Boolean) { + if (a.x !== null == false) { + if (a.x != null == null) { + if (a.x != null !== null) { + if (a.x != null === true) { + if (a.x !== null === true !is Boolean == true) { + if (a.x != null !== false) { + if (a.x != null === false) { + if (a.x !== null === true) { + if ((a.x != null != true) !is Boolean) { if (a.x != null is Boolean) { if (a.x != null is Boolean is Boolean) { if (a.x !== null is Boolean) { @@ -268,7 +268,7 @@ val case_17 = if (nullableIntProperty == null == true == false) 0 else { //TESTCASE NUMBER: 18 fun case_18(a: DeepObject.A.B.C.D.E.F.G.J?) { - if (a != null !== null) { + if (a != null !== null) { a a.equals(null) a.propT @@ -302,7 +302,7 @@ fun case_19(b: Boolean) { } } else null - if (a != null !is Boolean && a.B19 != null is Boolean && a.B19.C19 != null is Boolean && a.B19.C19.D19 != null == null && a.B19.C19.D19.x != null !== null) { + if (a != null !is Boolean && a.B19 != null is Boolean && a.B19.C19 != null is Boolean && a.B19.C19.D19 != null == null && a.B19.C19.D19.x != null !== null) { a.B19.C19.D19.x a.B19.C19.D19.x.equals(null) a.B19.C19.D19.x.propT 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 e6133da0f6e..b28805e7c6b 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 @@ -28,7 +28,7 @@ fun case_3(x: Boolean?) { // TESTCASE NUMBER: 4 fun case_4(x: Boolean?) { - if (if (x != null) x else x != null) { + if (if (x != null) x else x != null) { x x.not() } 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 04cddb7b248..90998c0e058 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 @@ -17,7 +17,7 @@ fun case_1(x: ClassWithCustomEquals) { // TESTCASE NUMBER: 2 fun case_2(x: ClassWithCustomEquals) { - if (x == null) { + if (x == null) { x x.inv() } @@ -75,7 +75,7 @@ fun case_6(x: ClassWithCustomEquals) { // TESTCASE NUMBER: 7 fun case_7(x: ClassWithCustomEquals) { - if ((x != null) == false) { + if ((x != null) == false) { x 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 69066976d1a..310aa016536 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 @@ -32,7 +32,7 @@ class Case2 { val x: Int init { val y = this - if (y.x == null) { + if (y.x == null) { x = 11 x this.x diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt index 3aa69a52639..65b730e1f90 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/38.fir.kt @@ -144,7 +144,7 @@ fun case_9() { outer@ while (x != null) { inner@ do { x = null - } while (x != null) + } while (x != null) x x.length } @@ -171,7 +171,7 @@ fun case_11() { inner@ do { x = null break - } while (x == null) + } while (x == null) x x.length } 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 7707610932d..2bf0f6187a1 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 @@ -36,7 +36,7 @@ inline fun case_3(x: Any?) { // TESTCASE NUMBER: 4 inline fun Boolean>case_4(x: Any?) { - if (x is Int is T == null) { + if (x is Int is T == null) { x x.inv() x.propAny @@ -46,7 +46,7 @@ inline fun Boolean>case_4(x: Any?) { // TESTCASE NUMBER: 5 fun case_5(x: Any?) { - if (x is Int != null) { + if (x is Int != null) { x x.inv() x.propAny @@ -56,7 +56,7 @@ fun case_5(x: Any?) { // TESTCASE NUMBER: 6 fun case_6(x: Any?) { - if (x is Int == null) { + if (x is Int == null) { x x.inv() x.propAny 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 e6133da0f6e..b28805e7c6b 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 @@ -28,7 +28,7 @@ fun case_3(x: Boolean?) { // TESTCASE NUMBER: 4 fun case_4(x: Boolean?) { - if (if (x != null) x else x != null) { + if (if (x != null) x else x != null) { x x.not() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt index 7140a8c0e2a..56daadcf095 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/1.fir.kt @@ -47,7 +47,7 @@ fun case_1(x: Any?) { * ISSUES: KT-28159 */ fun case_2(x: Nothing?) { - if (x !== null) { + if (x !== null) { x x.hashCode() } @@ -56,18 +56,18 @@ fun case_2(x: Nothing?) { // TESTCASE NUMBER: 3 fun case_3() { if (Object.prop_1 == null) - else { - Object.prop_1 - Object.prop_1.equals(null) - Object.prop_1.propT - Object.prop_1.propAny - Object.prop_1.propNullableT - Object.prop_1.propNullableAny - Object.prop_1.funT() - Object.prop_1.funAny() - Object.prop_1.funNullableT() - Object.prop_1.funNullableAny() - } + else { + Object.prop_1 + Object.prop_1.equals(null) + Object.prop_1.propT + Object.prop_1.propAny + Object.prop_1.propNullableT + Object.prop_1.propNullableAny + Object.prop_1.funT() + Object.prop_1.funAny() + Object.prop_1.funNullableT() + Object.prop_1.funNullableAny() + } } // TESTCASE NUMBER: 4 @@ -122,7 +122,7 @@ fun case_6(x: EmptyClass?) { // TESTCASE NUMBER: 7 fun case_7() { - if (nullableNumberProperty != null || nullableNumberProperty != null) { + if (nullableNumberProperty != null || nullableNumberProperty != null) { nullableNumberProperty nullableNumberProperty.equals(null) nullableNumberProperty.propT @@ -138,16 +138,16 @@ fun case_7() { // TESTCASE NUMBER: 8 fun case_8(x: TypealiasNullableString) { - if (x !== null && x != null) x - if (x !== null && x != null) x.equals(null) - if (x !== null && x != null) x.propT - if (x !== null && x != null) x.propAny - if (x !== null && x != null) x.propNullableT - if (x !== null && x != null) x.propNullableAny - if (x !== null && x != null) x.funT() - if (x !== null && x != null) x.funAny() - if (x !== null && x != null) x.funNullableT() - if (x !== null && x != null) x.funNullableAny() + if (x !== null && x != null) x + if (x !== null && x != null) x.equals(null) + if (x !== null && x != null) x.propT + if (x !== null && x != null) x.propAny + if (x !== null && x != null) x.propNullableT + if (x !== null && x != null) x.propNullableAny + if (x !== null && x != null) x.funT() + if (x !== null && x != null) x.funAny() + if (x !== null && x != null) x.funNullableT() + if (x !== null && x != null) x.funNullableAny() } // TESTCASE NUMBER: 9 @@ -195,9 +195,9 @@ fun case_11(x: TypealiasNullableStringIndirect?, y: TypealiasNullableStringIndir if (x == null) { } else { - if (y != null) { + if (y != null) { if (nullableStringProperty == null) { - if (t != null) { + if (t != null) { x x.equals(null) x.propT @@ -216,18 +216,18 @@ fun case_11(x: TypealiasNullableStringIndirect?, y: TypealiasNullableStringIndir // TESTCASE NUMBER: 12 fun case_12(x: TypealiasNullableStringIndirect, y: TypealiasNullableStringIndirect) = - if (x == null) "1" - else if (y === null) x - else if (y === null) x.equals(null) - else if (y === null) x.propT - else if (y === null) x.propAny - else if (y === null) x.propNullableT - else if (y === null) x.propNullableAny - else if (y === null) x.funT() - else if (y === null) x.funAny() - else if (y === null) x.funNullableT() - else if (y === null) x.funNullableAny() - else "-1" + if (x == null) "1" +else if (y === null) x +else if (y === null) x.equals(null) +else if (y === null) x.propT +else if (y === null) x.propAny +else if (y === null) x.propNullableT +else if (y === null) x.propNullableAny +else if (y === null) x.funT() +else if (y === null) x.funAny() +else if (y === null) x.funNullableT() +else if (y === null) x.funNullableAny() +else "-1" // TESTCASE NUMBER: 13 fun case_13(x: otherpackage.Case13?) = @@ -258,52 +258,52 @@ fun case_14() { val a = Case14() if (a.x != null) { - if (a.x != null) { - if (a.x !== null) { - if (a.x != null) { - if (a.x != null) { - if (a.x != null) { - if (a.x !== null) { - if (a.x != null) { - if (a.x != null) { - if (a.x !== null) { - if (a.x != null) { - if (a.x != null) { - if (a.x != null) { - if (a.x !== null) { - if (a.x != null) { - if (a.x !== null) { - a.x - a.x.equals(null) - a.x.propT - a.x.propAny - a.x.propNullableT - a.x.propNullableAny - a.x.funT() - a.x.funAny() - a.x.funNullableT() - a.x.funNullableAny() - } - } - } - } - } - } - } - } - } - } - } - } - } - } + if (a.x != null) { + if (a.x !== null) { + if (a.x != null) { + if (a.x != null) { + if (a.x != null) { + if (a.x !== null) { + if (a.x != null) { + if (a.x != null) { + if (a.x !== null) { + if (a.x != null) { + if (a.x != null) { + if (a.x != null) { + if (a.x !== null) { + if (a.x != null) { + if (a.x !== null) { + a.x + a.x.equals(null) + a.x.propT + a.x.propAny + a.x.propNullableT + a.x.propNullableAny + a.x.funT() + a.x.funAny() + a.x.funNullableT() + a.x.funNullableAny() + } + } + } + } + } + } + } + } + } + } + } + } + } + } } } } // TESTCASE NUMBER: 15 fun case_15(x: EmptyObject) { - val t = if (x === null) "" else { + val t = if (x === null) "" else { x x.equals(null) x.propT @@ -321,7 +321,7 @@ fun case_15(x: EmptyObject) { fun case_16() { val x: TypealiasNullableNothing = null - if (x != null) { + if (x != null) { x } } @@ -633,26 +633,26 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (b != null) this.b.funAny() if (b != null) this.b.funNullableT() if (b != null) this.b.funNullableAny() - if (b != null || this.b != null) b.equals(null) - if (b != null || this.b != null) b.propT - if (b != null || this.b != null) b.propAny - if (b != null || this.b != null) b.propNullableT - if (b != null || this.b != null) b.propNullableAny - if (b != null || this.b != null) b.funT() - if (b != null || this.b != null) b.funAny() - if (b != null || this.b != null) b.funNullableT() - if (b != null || this.b != null) b.funNullableAny() - if (b != null || this.b != null) b - if (b != null || this.b != null) this.b.equals(null) - if (b != null || this.b != null) this.b.propT - if (b != null || this.b != null) this.b.propAny - if (b != null || this.b != null) this.b.propNullableT - if (b != null || this.b != null) this.b.propNullableAny - if (b != null || this.b != null) this.b.funT() - if (b != null || this.b != null) this.b.funAny() - if (b != null || this.b != null) this.b.funNullableT() - if (b != null || this.b != null) this.b.funNullableAny() - if (b != null || this.b != null) this.b + if (b != null || this.b != null) b.equals(null) + if (b != null || this.b != null) b.propT + if (b != null || this.b != null) b.propAny + if (b != null || this.b != null) b.propNullableT + if (b != null || this.b != null) b.propNullableAny + if (b != null || this.b != null) b.funT() + if (b != null || this.b != null) b.funAny() + if (b != null || this.b != null) b.funNullableT() + if (b != null || this.b != null) b.funNullableAny() + if (b != null || this.b != null) b + if (b != null || this.b != null) this.b.equals(null) + if (b != null || this.b != null) this.b.propT + if (b != null || this.b != null) this.b.propAny + if (b != null || this.b != null) this.b.propNullableT + if (b != null || this.b != null) this.b.propNullableAny + if (b != null || this.b != null) this.b.funT() + if (b != null || this.b != null) this.b.funAny() + if (b != null || this.b != null) this.b.funNullableT() + if (b != null || this.b != null) this.b.funNullableAny() + if (b != null || this.b != null) this.b if (c != null) c.equals(null) @@ -702,26 +702,26 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.c != null) c.funNullableT() if (this.c != null) c.funNullableAny() if (this.c != null) c - if (c != null || this.c != null) c.equals(null) - if (c != null || this.c != null) c.propT - if (c != null || this.c != null) c.propAny - if (c != null || this.c != null) c.propNullableT - if (c != null || this.c != null) c.propNullableAny - if (c != null || this.c != null) c.funT() - if (c != null || this.c != null) c.funAny() - if (c != null || this.c != null) c.funNullableT() - if (c != null || this.c != null) c.funNullableAny() - if (c != null || this.c != null) c - if (c != null || this.c != null) this.c.equals(null) - if (c != null || this.c != null) this.c.propT - if (c != null || this.c != null) this.c.propAny - if (c != null || this.c != null) this.c.propNullableT - if (c != null || this.c != null) this.c.propNullableAny - if (c != null || this.c != null) this.c.funT() - if (c != null || this.c != null) this.c.funAny() - if (c != null || this.c != null) this.c.funNullableT() - if (c != null || this.c != null) this.c.funNullableAny() - if (c != null || this.c != null) this.c + if (c != null || this.c != null) c.equals(null) + if (c != null || this.c != null) c.propT + if (c != null || this.c != null) c.propAny + if (c != null || this.c != null) c.propNullableT + if (c != null || this.c != null) c.propNullableAny + if (c != null || this.c != null) c.funT() + if (c != null || this.c != null) c.funAny() + if (c != null || this.c != null) c.funNullableT() + if (c != null || this.c != null) c.funNullableAny() + if (c != null || this.c != null) c + if (c != null || this.c != null) this.c.equals(null) + if (c != null || this.c != null) this.c.propT + if (c != null || this.c != null) this.c.propAny + if (c != null || this.c != null) this.c.propNullableT + if (c != null || this.c != null) this.c.propNullableAny + if (c != null || this.c != null) this.c.funT() + if (c != null || this.c != null) this.c.funAny() + if (c != null || this.c != null) this.c.funNullableT() + if (c != null || this.c != null) this.c.funNullableAny() + if (c != null || this.c != null) this.c if (d != null) d.equals(null) @@ -771,26 +771,26 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.d != null) d.funNullableT() if (this.d != null) d.funNullableAny() if (this.d != null) d - if (d != null || this.d != null) d.equals(null) - if (d != null || this.d != null) d.propT - if (d != null || this.d != null) d.propAny - if (d != null || this.d != null) d.propNullableT - if (d != null || this.d != null) d.propNullableAny - if (d != null || this.d != null) d.funT() - if (d != null || this.d != null) d.funAny() - if (d != null || this.d != null) d.funNullableT() - if (d != null || this.d != null) d.funNullableAny() - if (d != null || this.d != null) d - if (d != null || this.d != null) this.d.equals(null) - if (d != null || this.d != null) this.d.propT - if (d != null || this.d != null) this.d.propAny - if (d != null || this.d != null) this.d.propNullableT - if (d != null || this.d != null) this.d.propNullableAny - if (d != null || this.d != null) this.d.funT() - if (d != null || this.d != null) this.d.funAny() - if (d != null || this.d != null) this.d.funNullableT() - if (d != null || this.d != null) this.d.funNullableAny() - if (d != null || this.d != null) this.d + if (d != null || this.d != null) d.equals(null) + if (d != null || this.d != null) d.propT + if (d != null || this.d != null) d.propAny + if (d != null || this.d != null) d.propNullableT + if (d != null || this.d != null) d.propNullableAny + if (d != null || this.d != null) d.funT() + if (d != null || this.d != null) d.funAny() + if (d != null || this.d != null) d.funNullableT() + if (d != null || this.d != null) d.funNullableAny() + if (d != null || this.d != null) d + if (d != null || this.d != null) this.d.equals(null) + if (d != null || this.d != null) this.d.propT + if (d != null || this.d != null) this.d.propAny + if (d != null || this.d != null) this.d.propNullableT + if (d != null || this.d != null) this.d.propNullableAny + if (d != null || this.d != null) this.d.funT() + if (d != null || this.d != null) this.d.funAny() + if (d != null || this.d != null) this.d.funNullableT() + if (d != null || this.d != null) this.d.funNullableAny() + if (d != null || this.d != null) this.d if (e != null) e.equals(null) @@ -840,26 +840,26 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (e != null) this.e.funNullableT() if (e != null) this.e.funNullableAny() if (e != null) this.e - if (e != null || this.e != null) e.equals(null) - if (e != null || this.e != null) e.propT - if (e != null || this.e != null) e.propAny - if (e != null || this.e != null) e.propNullableT - if (e != null || this.e != null) e.propNullableAny - if (e != null || this.e != null) e.funT() - if (e != null || this.e != null) e.funAny() - if (e != null || this.e != null) e.funNullableT() - if (e != null || this.e != null) e.funNullableAny() - if (e != null || this.e != null) e - if (e != null || this.e != null) this.e.equals(null) - if (e != null || this.e != null) this.e.propT - if (e != null || this.e != null) this.e.propAny - if (e != null || this.e != null) this.e.propNullableT - if (e != null || this.e != null) this.e.propNullableAny - if (e != null || this.e != null) this.e.funT() - if (e != null || this.e != null) this.e.funAny() - if (e != null || this.e != null) this.e.funNullableT() - if (e != null || this.e != null) this.e.funNullableAny() - if (e != null || this.e != null) this.e + if (e != null || this.e != null) e.equals(null) + if (e != null || this.e != null) e.propT + if (e != null || this.e != null) e.propAny + if (e != null || this.e != null) e.propNullableT + if (e != null || this.e != null) e.propNullableAny + if (e != null || this.e != null) e.funT() + if (e != null || this.e != null) e.funAny() + if (e != null || this.e != null) e.funNullableT() + if (e != null || this.e != null) e.funNullableAny() + if (e != null || this.e != null) e + if (e != null || this.e != null) this.e.equals(null) + if (e != null || this.e != null) this.e.propT + if (e != null || this.e != null) this.e.propAny + if (e != null || this.e != null) this.e.propNullableT + if (e != null || this.e != null) this.e.propNullableAny + if (e != null || this.e != null) this.e.funT() + if (e != null || this.e != null) this.e.funAny() + if (e != null || this.e != null) this.e.funNullableT() + if (e != null || this.e != null) this.e.funNullableAny() + if (e != null || this.e != null) this.e if (f != null) f.equals(null) @@ -909,26 +909,26 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (f != null) this.f.funNullableT() if (f != null) this.f.funNullableAny() if (f != null) this.f - if (f != null || this.f != null) f.equals(null) - if (f != null || this.f != null) f.propT - if (f != null || this.f != null) f.propAny - if (f != null || this.f != null) f.propNullableT - if (f != null || this.f != null) f.propNullableAny - if (f != null || this.f != null) f.funT() - if (f != null || this.f != null) f.funAny() - if (f != null || this.f != null) f.funNullableT() - if (f != null || this.f != null) f.funNullableAny() - if (f != null || this.f != null) f - if (f != null || this.f != null) this.f.equals(null) - if (f != null || this.f != null) this.f.propT - if (f != null || this.f != null) this.f.propAny - if (f != null || this.f != null) this.f.propNullableT - if (f != null || this.f != null) this.f.propNullableAny - if (f != null || this.f != null) this.f.funT() - if (f != null || this.f != null) this.f.funAny() - if (f != null || this.f != null) this.f.funNullableT() - if (f != null || this.f != null) this.f.funNullableAny() - if (f != null || this.f != null) this.f + if (f != null || this.f != null) f.equals(null) + if (f != null || this.f != null) f.propT + if (f != null || this.f != null) f.propAny + if (f != null || this.f != null) f.propNullableT + if (f != null || this.f != null) f.propNullableAny + if (f != null || this.f != null) f.funT() + if (f != null || this.f != null) f.funAny() + if (f != null || this.f != null) f.funNullableT() + if (f != null || this.f != null) f.funNullableAny() + if (f != null || this.f != null) f + if (f != null || this.f != null) this.f.equals(null) + if (f != null || this.f != null) this.f.propT + if (f != null || this.f != null) this.f.propAny + if (f != null || this.f != null) this.f.propNullableT + if (f != null || this.f != null) this.f.propNullableAny + if (f != null || this.f != null) this.f.funT() + if (f != null || this.f != null) this.f.funAny() + if (f != null || this.f != null) this.f.funNullableT() + if (f != null || this.f != null) this.f.funNullableAny() + if (f != null || this.f != null) this.f if (x != null) x.equals(null) @@ -978,26 +978,26 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.x != null) x.funNullableT() if (this.x != null) x.funNullableAny() if (this.x != null) x - if (x != null || this.x != null) x.equals(null) - if (x != null || this.x != null) x.propT - if (x != null || this.x != null) x.propAny - if (x != null || this.x != null) x.propNullableT - if (x != null || this.x != null) x.propNullableAny - if (x != null || this.x != null) x.funT() - if (x != null || this.x != null) x.funAny() - if (x != null || this.x != null) x.funNullableT() - if (x != null || this.x != null) x.funNullableAny() - if (x != null || this.x != null) x - if (x != null || this.x != null) this.x.equals(null) - if (x != null || this.x != null) this.x.propT - if (x != null || this.x != null) this.x.propAny - if (x != null || this.x != null) this.x.propNullableT - if (x != null || this.x != null) this.x.propNullableAny - if (x != null || this.x != null) this.x.funT() - if (x != null || this.x != null) this.x.funAny() - if (x != null || this.x != null) this.x.funNullableT() - if (x != null || this.x != null) this.x.funNullableAny() - if (x != null || this.x != null) this.x + if (x != null || this.x != null) x.equals(null) + if (x != null || this.x != null) x.propT + if (x != null || this.x != null) x.propAny + if (x != null || this.x != null) x.propNullableT + if (x != null || this.x != null) x.propNullableAny + if (x != null || this.x != null) x.funT() + if (x != null || this.x != null) x.funAny() + if (x != null || this.x != null) x.funNullableT() + if (x != null || this.x != null) x.funNullableAny() + if (x != null || this.x != null) x + if (x != null || this.x != null) this.x.equals(null) + if (x != null || this.x != null) this.x.propT + if (x != null || this.x != null) this.x.propAny + if (x != null || this.x != null) this.x.propNullableT + if (x != null || this.x != null) this.x.propNullableAny + if (x != null || this.x != null) this.x.funT() + if (x != null || this.x != null) this.x.funAny() + if (x != null || this.x != null) this.x.funNullableT() + if (x != null || this.x != null) this.x.funNullableAny() + if (x != null || this.x != null) this.x if (y != null) y.equals(null) @@ -1047,26 +1047,26 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (y != null) this.y.funNullableT() if (y != null) this.y.funNullableAny() if (y != null) this.y - if (y != null || this.y != null) y.equals(null) - if (y != null || this.y != null) y.propT - if (y != null || this.y != null) y.propAny - if (y != null || this.y != null) y.propNullableT - if (y != null || this.y != null) y.propNullableAny - if (y != null || this.y != null) y.funT() - if (y != null || this.y != null) y.funAny() - if (y != null || this.y != null) y.funNullableT() - if (y != null || this.y != null) y.funNullableAny() - if (y != null || this.y != null) y - if (y != null || this.y != null) this.y.equals(null) - if (y != null || this.y != null) this.y.propT - if (y != null || this.y != null) this.y.propAny - if (y != null || this.y != null) this.y.propNullableT - if (y != null || this.y != null) this.y.propNullableAny - if (y != null || this.y != null) this.y.funT() - if (y != null || this.y != null) this.y.funAny() - if (y != null || this.y != null) this.y.funNullableT() - if (y != null || this.y != null) this.y.funNullableAny() - if (y != null || this.y != null) this.y + if (y != null || this.y != null) y.equals(null) + if (y != null || this.y != null) y.propT + if (y != null || this.y != null) y.propAny + if (y != null || this.y != null) y.propNullableT + if (y != null || this.y != null) y.propNullableAny + if (y != null || this.y != null) y.funT() + if (y != null || this.y != null) y.funAny() + if (y != null || this.y != null) y.funNullableT() + if (y != null || this.y != null) y.funNullableAny() + if (y != null || this.y != null) y + if (y != null || this.y != null) this.y.equals(null) + if (y != null || this.y != null) this.y.propT + if (y != null || this.y != null) this.y.propAny + if (y != null || this.y != null) this.y.propNullableT + if (y != null || this.y != null) this.y.propNullableAny + if (y != null || this.y != null) this.y.funT() + if (y != null || this.y != null) this.y.funAny() + if (y != null || this.y != null) this.y.funNullableT() + if (y != null || this.y != null) this.y.funNullableAny() + if (y != null || this.y != null) this.y if (z != null) z.equals(null) @@ -1116,26 +1116,26 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.z != null) z.funNullableT() if (this.z != null) z.funNullableAny() if (this.z != null) z - if (z != null || this.z != null) z - if (z != null || this.z != null) z.equals(null) - if (z != null || this.z != null) z.propT - if (z != null || this.z != null) z.propAny - if (z != null || this.z != null) z.propNullableT - if (z != null || this.z != null) z.propNullableAny - if (z != null || this.z != null) z.funT() - if (z != null || this.z != null) z.funAny() - if (z != null || this.z != null) z.funNullableT() - if (z != null || this.z != null) z.funNullableAny() - if (z != null || this.z != null) this.z - if (z != null || this.z != null) this.z.equals(null) - if (z != null || this.z != null) this.z.propT - if (z != null || this.z != null) this.z.propAny - if (z != null || this.z != null) this.z.propNullableT - if (z != null || this.z != null) this.z.propNullableAny - if (z != null || this.z != null) this.z.funT() - if (z != null || this.z != null) this.z.funAny() - if (z != null || this.z != null) this.z.funNullableT() - if (z != null || this.z != null) this.z.funNullableAny() + if (z != null || this.z != null) z + if (z != null || this.z != null) z.equals(null) + if (z != null || this.z != null) z.propT + if (z != null || this.z != null) z.propAny + if (z != null || this.z != null) z.propNullableT + if (z != null || this.z != null) z.propNullableAny + if (z != null || this.z != null) z.funT() + if (z != null || this.z != null) z.funAny() + if (z != null || this.z != null) z.funNullableT() + if (z != null || this.z != null) z.funNullableAny() + if (z != null || this.z != null) this.z + if (z != null || this.z != null) this.z.equals(null) + if (z != null || this.z != null) this.z.propT + if (z != null || this.z != null) this.z.propAny + if (z != null || this.z != null) this.z.propNullableT + if (z != null || this.z != null) this.z.propNullableAny + if (z != null || this.z != null) this.z.funT() + if (z != null || this.z != null) this.z.funAny() + if (z != null || this.z != null) this.z.funNullableT() + if (z != null || this.z != null) this.z.funNullableAny() if (u != null) u.equals(null) @@ -1185,26 +1185,26 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (u != null) this.u.funNullableT() if (u != null) this.u.funNullableAny() if (u != null) this.u - if (u != null || this.u != null) u.equals(null) - if (u != null || this.u != null) u.propT - if (u != null || this.u != null) u.propAny - if (u != null || this.u != null) u.propNullableT - if (u != null || this.u != null) u.propNullableAny - if (u != null || this.u != null) u.funT() - if (u != null || this.u != null) u.funAny() - if (u != null || this.u != null) u.funNullableT() - if (u != null || this.u != null) u.funNullableAny() - if (u != null || this.u != null) u - if (u != null || this.u != null) this.u.equals(null) - if (u != null || this.u != null) this.u.propT - if (u != null || this.u != null) this.u.propAny - if (u != null || this.u != null) this.u.propNullableT - if (u != null || this.u != null) this.u.propNullableAny - if (u != null || this.u != null) this.u.funT() - if (u != null || this.u != null) this.u.funAny() - if (u != null || this.u != null) this.u.funNullableT() - if (u != null || this.u != null) this.u.funNullableAny() - if (u != null || this.u != null) this.u + if (u != null || this.u != null) u.equals(null) + if (u != null || this.u != null) u.propT + if (u != null || this.u != null) u.propAny + if (u != null || this.u != null) u.propNullableT + if (u != null || this.u != null) u.propNullableAny + if (u != null || this.u != null) u.funT() + if (u != null || this.u != null) u.funAny() + if (u != null || this.u != null) u.funNullableT() + if (u != null || this.u != null) u.funNullableAny() + if (u != null || this.u != null) u + if (u != null || this.u != null) this.u.equals(null) + if (u != null || this.u != null) this.u.propT + if (u != null || this.u != null) this.u.propAny + if (u != null || this.u != null) this.u.propNullableT + if (u != null || this.u != null) this.u.propNullableAny + if (u != null || this.u != null) this.u.funT() + if (u != null || this.u != null) this.u.funAny() + if (u != null || this.u != null) this.u.funNullableT() + if (u != null || this.u != null) this.u.funNullableAny() + if (u != null || this.u != null) this.u v = 0 v.equals(null) @@ -1217,48 +1217,48 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: v.funNullableT() v.funNullableAny() v - if (v != null) v.equals(null) - if (v != null) v.propT - if (v != null) v.propAny - if (v != null) v.propNullableT - if (v != null) v.propNullableAny - if (v != null) v.funT() - if (v != null) v.funAny() - if (v != null) v.funNullableT() - if (v != null) v.funNullableAny() - if (v != null) v - if (this.v != null) v.equals(null) - if (this.v != null) v.propT - if (this.v != null) v.propAny - if (this.v != null) v.propNullableT - if (this.v != null) v.propNullableAny - if (this.v != null) v.funT() - if (this.v != null) v.funAny() - if (this.v != null) v.funNullableT() - if (this.v != null) v.funNullableAny() - if (this.v != null) v - if (v != null || this.v != null) v.equals(null) - if (v != null || this.v != null) v.propT - if (v != null || this.v != null) v.propAny - if (v != null || this.v != null) v.propNullableT - if (v != null || this.v != null) v.propNullableAny - if (v != null || this.v != null) v.funT() - if (v != null || this.v != null) v.funAny() - if (v != null || this.v != null) v.funNullableT() - if (v != null || this.v != null) v.funNullableAny() - if (v != null || this.v != null) v - if (v != null || this.v != null) this.v.equals(null) - if (v != null || this.v != null) this.v.propT - if (v != null || this.v != null) this.v.propAny - if (v != null || this.v != null) this.v.propNullableT - if (v != null || this.v != null) this.v.propNullableAny - if (v != null || this.v != null) this.v.funT() - if (v != null || this.v != null) this.v.funAny() - if (v != null || this.v != null) this.v.funNullableT() - if (v != null || this.v != null) this.v.funNullableAny() - if (v != null || this.v != null) this.v + if (v != null) v.equals(null) + if (v != null) v.propT + if (v != null) v.propAny + if (v != null) v.propNullableT + if (v != null) v.propNullableAny + if (v != null) v.funT() + if (v != null) v.funAny() + if (v != null) v.funNullableT() + if (v != null) v.funNullableAny() + if (v != null) v + if (this.v != null) v.equals(null) + if (this.v != null) v.propT + if (this.v != null) v.propAny + if (this.v != null) v.propNullableT + if (this.v != null) v.propNullableAny + if (this.v != null) v.funT() + if (this.v != null) v.funAny() + if (this.v != null) v.funNullableT() + if (this.v != null) v.funNullableAny() + if (this.v != null) v + if (v != null || this.v != null) v.equals(null) + if (v != null || this.v != null) v.propT + if (v != null || this.v != null) v.propAny + if (v != null || this.v != null) v.propNullableT + if (v != null || this.v != null) v.propNullableAny + if (v != null || this.v != null) v.funT() + if (v != null || this.v != null) v.funAny() + if (v != null || this.v != null) v.funNullableT() + if (v != null || this.v != null) v.funNullableAny() + if (v != null || this.v != null) v + if (v != null || this.v != null) this.v.equals(null) + if (v != null || this.v != null) this.v.propT + if (v != null || this.v != null) this.v.propAny + if (v != null || this.v != null) this.v.propNullableT + if (v != null || this.v != null) this.v.propNullableAny + if (v != null || this.v != null) this.v.funT() + if (v != null || this.v != null) this.v.funAny() + if (v != null || this.v != null) this.v.funNullableT() + if (v != null || this.v != null) this.v.funNullableAny() + if (v != null || this.v != null) this.v - w = if (null != null) 10 else null + w = if (null != null) 10 else null w if (w != null) w.equals(null) if (w != null) w.propT @@ -1280,34 +1280,34 @@ open class Case29(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.w != null) w.funNullableT() if (this.w != null) w.funNullableAny() if (this.w != null) w - if (w != null || this.w != null) w.equals(null) - if (w != null || this.w != null) w.propT - if (w != null || this.w != null) w.propAny - if (w != null || this.w != null) w.propNullableT - if (w != null || this.w != null) w.propNullableAny - if (w != null || this.w != null) w.funT() - if (w != null || this.w != null) w.funAny() - if (w != null || this.w != null) w.funNullableT() - if (w != null || this.w != null) w.funNullableAny() - if (w != null || this.w != null) w - if (w != null || this.w != null) this.w.equals(null) - if (w != null || this.w != null) this.w.propT - if (w != null || this.w != null) this.w.propAny - if (w != null || this.w != null) this.w.propNullableT - if (w != null || this.w != null) this.w.propNullableAny - if (w != null || this.w != null) this.w.funT() - if (w != null || this.w != null) this.w.funAny() - if (w != null || this.w != null) this.w.funNullableT() - if (w != null || this.w != null) this.w.funNullableAny() - if (w != null || this.w != null) this.w + if (w != null || this.w != null) w.equals(null) + if (w != null || this.w != null) w.propT + if (w != null || this.w != null) w.propAny + if (w != null || this.w != null) w.propNullableT + if (w != null || this.w != null) w.propNullableAny + if (w != null || this.w != null) w.funT() + if (w != null || this.w != null) w.funAny() + if (w != null || this.w != null) w.funNullableT() + if (w != null || this.w != null) w.funNullableAny() + if (w != null || this.w != null) w + if (w != null || this.w != null) this.w.equals(null) + if (w != null || this.w != null) this.w.propT + if (w != null || this.w != null) this.w.propAny + if (w != null || this.w != null) this.w.propNullableT + if (w != null || this.w != null) this.w.propNullableAny + if (w != null || this.w != null) this.w.funT() + if (w != null || this.w != null) this.w.funAny() + if (w != null || this.w != null) this.w.funNullableT() + if (w != null || this.w != null) this.w.funNullableAny() + if (w != null || this.w != null) this.w s = null s.hashCode() s - if (s != null) s - if (this.s != null) s - if (s != null || this.s != null) s - if (s != null || this.s != null) this.s + if (s != null) s + if (this.s != null) s + if (s != null || this.s != null) s + if (s != null || this.s != null) this.s } fun test() { @@ -1677,26 +1677,26 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (b != null) this.b.funNullableT() if (b != null) this.b.funNullableAny() if (b != null) this.b - if (b != null || this.b != null) b.equals(null) - if (b != null || this.b != null) b.propT - if (b != null || this.b != null) b.propAny - if (b != null || this.b != null) b.propNullableT - if (b != null || this.b != null) b.propNullableAny - if (b != null || this.b != null) b.funT() - if (b != null || this.b != null) b.funAny() - if (b != null || this.b != null) b.funNullableT() - if (b != null || this.b != null) b.funNullableAny() - if (b != null || this.b != null) b - if (b != null || this.b != null) this.b.equals(null) - if (b != null || this.b != null) this.b.propT - if (b != null || this.b != null) this.b.propAny - if (b != null || this.b != null) this.b.propNullableT - if (b != null || this.b != null) this.b.propNullableAny - if (b != null || this.b != null) this.b.funT() - if (b != null || this.b != null) this.b.funAny() - if (b != null || this.b != null) this.b.funNullableT() - if (b != null || this.b != null) this.b.funNullableAny() - if (b != null || this.b != null) this.b + if (b != null || this.b != null) b.equals(null) + if (b != null || this.b != null) b.propT + if (b != null || this.b != null) b.propAny + if (b != null || this.b != null) b.propNullableT + if (b != null || this.b != null) b.propNullableAny + if (b != null || this.b != null) b.funT() + if (b != null || this.b != null) b.funAny() + if (b != null || this.b != null) b.funNullableT() + if (b != null || this.b != null) b.funNullableAny() + if (b != null || this.b != null) b + if (b != null || this.b != null) this.b.equals(null) + if (b != null || this.b != null) this.b.propT + if (b != null || this.b != null) this.b.propAny + if (b != null || this.b != null) this.b.propNullableT + if (b != null || this.b != null) this.b.propNullableAny + if (b != null || this.b != null) this.b.funT() + if (b != null || this.b != null) this.b.funAny() + if (b != null || this.b != null) this.b.funNullableT() + if (b != null || this.b != null) this.b.funNullableAny() + if (b != null || this.b != null) this.b if (c != null) c.equals(null) @@ -1746,26 +1746,26 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.c != null) c.funNullableT() if (this.c != null) c.funNullableAny() if (this.c != null) c - if (c != null || this.c != null) c.equals(null) - if (c != null || this.c != null) c.propT - if (c != null || this.c != null) c.propAny - if (c != null || this.c != null) c.propNullableT - if (c != null || this.c != null) c.propNullableAny - if (c != null || this.c != null) c.funT() - if (c != null || this.c != null) c.funAny() - if (c != null || this.c != null) c.funNullableT() - if (c != null || this.c != null) c.funNullableAny() - if (c != null || this.c != null) c - if (c != null || this.c != null) this.c.equals(null) - if (c != null || this.c != null) this.c.propT - if (c != null || this.c != null) this.c.propAny - if (c != null || this.c != null) this.c.propNullableT - if (c != null || this.c != null) this.c.propNullableAny - if (c != null || this.c != null) this.c.funT() - if (c != null || this.c != null) this.c.funAny() - if (c != null || this.c != null) this.c.funNullableT() - if (c != null || this.c != null) this.c.funNullableAny() - if (c != null || this.c != null) this.c + if (c != null || this.c != null) c.equals(null) + if (c != null || this.c != null) c.propT + if (c != null || this.c != null) c.propAny + if (c != null || this.c != null) c.propNullableT + if (c != null || this.c != null) c.propNullableAny + if (c != null || this.c != null) c.funT() + if (c != null || this.c != null) c.funAny() + if (c != null || this.c != null) c.funNullableT() + if (c != null || this.c != null) c.funNullableAny() + if (c != null || this.c != null) c + if (c != null || this.c != null) this.c.equals(null) + if (c != null || this.c != null) this.c.propT + if (c != null || this.c != null) this.c.propAny + if (c != null || this.c != null) this.c.propNullableT + if (c != null || this.c != null) this.c.propNullableAny + if (c != null || this.c != null) this.c.funT() + if (c != null || this.c != null) this.c.funAny() + if (c != null || this.c != null) this.c.funNullableT() + if (c != null || this.c != null) this.c.funNullableAny() + if (c != null || this.c != null) this.c if (d != null) d.equals(null) @@ -1815,26 +1815,26 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.d != null) d.funNullableT() if (this.d != null) d.funNullableAny() if (this.d != null) d - if (d != null || this.d != null) d.equals(null) - if (d != null || this.d != null) d.propT - if (d != null || this.d != null) d.propAny - if (d != null || this.d != null) d.propNullableT - if (d != null || this.d != null) d.propNullableAny - if (d != null || this.d != null) d.funT() - if (d != null || this.d != null) d.funAny() - if (d != null || this.d != null) d.funNullableT() - if (d != null || this.d != null) d.funNullableAny() - if (d != null || this.d != null) d - if (d != null || this.d != null) this.d.equals(null) - if (d != null || this.d != null) this.d.propT - if (d != null || this.d != null) this.d.propAny - if (d != null || this.d != null) this.d.propNullableT - if (d != null || this.d != null) this.d.propNullableAny - if (d != null || this.d != null) this.d.funT() - if (d != null || this.d != null) this.d.funAny() - if (d != null || this.d != null) this.d.funNullableT() - if (d != null || this.d != null) this.d.funNullableAny() - if (d != null || this.d != null) this.d + if (d != null || this.d != null) d.equals(null) + if (d != null || this.d != null) d.propT + if (d != null || this.d != null) d.propAny + if (d != null || this.d != null) d.propNullableT + if (d != null || this.d != null) d.propNullableAny + if (d != null || this.d != null) d.funT() + if (d != null || this.d != null) d.funAny() + if (d != null || this.d != null) d.funNullableT() + if (d != null || this.d != null) d.funNullableAny() + if (d != null || this.d != null) d + if (d != null || this.d != null) this.d.equals(null) + if (d != null || this.d != null) this.d.propT + if (d != null || this.d != null) this.d.propAny + if (d != null || this.d != null) this.d.propNullableT + if (d != null || this.d != null) this.d.propNullableAny + if (d != null || this.d != null) this.d.funT() + if (d != null || this.d != null) this.d.funAny() + if (d != null || this.d != null) this.d.funNullableT() + if (d != null || this.d != null) this.d.funNullableAny() + if (d != null || this.d != null) this.d if (e != null) e.equals(null) @@ -1884,26 +1884,26 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (e != null) this.e.funNullableT() if (e != null) this.e.funNullableAny() if (e != null) this.e - if (e != null || this.e != null) e.equals(null) - if (e != null || this.e != null) e.propT - if (e != null || this.e != null) e.propAny - if (e != null || this.e != null) e.propNullableT - if (e != null || this.e != null) e.propNullableAny - if (e != null || this.e != null) e.funT() - if (e != null || this.e != null) e.funAny() - if (e != null || this.e != null) e.funNullableT() - if (e != null || this.e != null) e.funNullableAny() - if (e != null || this.e != null) e - if (e != null || this.e != null) this.e.equals(null) - if (e != null || this.e != null) this.e.propT - if (e != null || this.e != null) this.e.propAny - if (e != null || this.e != null) this.e.propNullableT - if (e != null || this.e != null) this.e.propNullableAny - if (e != null || this.e != null) this.e.funT() - if (e != null || this.e != null) this.e.funAny() - if (e != null || this.e != null) this.e.funNullableT() - if (e != null || this.e != null) this.e.funNullableAny() - if (e != null || this.e != null) this.e + if (e != null || this.e != null) e.equals(null) + if (e != null || this.e != null) e.propT + if (e != null || this.e != null) e.propAny + if (e != null || this.e != null) e.propNullableT + if (e != null || this.e != null) e.propNullableAny + if (e != null || this.e != null) e.funT() + if (e != null || this.e != null) e.funAny() + if (e != null || this.e != null) e.funNullableT() + if (e != null || this.e != null) e.funNullableAny() + if (e != null || this.e != null) e + if (e != null || this.e != null) this.e.equals(null) + if (e != null || this.e != null) this.e.propT + if (e != null || this.e != null) this.e.propAny + if (e != null || this.e != null) this.e.propNullableT + if (e != null || this.e != null) this.e.propNullableAny + if (e != null || this.e != null) this.e.funT() + if (e != null || this.e != null) this.e.funAny() + if (e != null || this.e != null) this.e.funNullableT() + if (e != null || this.e != null) this.e.funNullableAny() + if (e != null || this.e != null) this.e if (f != null) f.equals(null) @@ -1953,26 +1953,26 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (f != null) this.f.funNullableT() if (f != null) this.f.funNullableAny() if (f != null) this.f - if (f != null || this.f != null) f.equals(null) - if (f != null || this.f != null) f.propT - if (f != null || this.f != null) f.propAny - if (f != null || this.f != null) f.propNullableT - if (f != null || this.f != null) f.propNullableAny - if (f != null || this.f != null) f.funT() - if (f != null || this.f != null) f.funAny() - if (f != null || this.f != null) f.funNullableT() - if (f != null || this.f != null) f.funNullableAny() - if (f != null || this.f != null) f - if (f != null || this.f != null) this.f.equals(null) - if (f != null || this.f != null) this.f.propT - if (f != null || this.f != null) this.f.propAny - if (f != null || this.f != null) this.f.propNullableT - if (f != null || this.f != null) this.f.propNullableAny - if (f != null || this.f != null) this.f.funT() - if (f != null || this.f != null) this.f.funAny() - if (f != null || this.f != null) this.f.funNullableT() - if (f != null || this.f != null) this.f.funNullableAny() - if (f != null || this.f != null) this.f + if (f != null || this.f != null) f.equals(null) + if (f != null || this.f != null) f.propT + if (f != null || this.f != null) f.propAny + if (f != null || this.f != null) f.propNullableT + if (f != null || this.f != null) f.propNullableAny + if (f != null || this.f != null) f.funT() + if (f != null || this.f != null) f.funAny() + if (f != null || this.f != null) f.funNullableT() + if (f != null || this.f != null) f.funNullableAny() + if (f != null || this.f != null) f + if (f != null || this.f != null) this.f.equals(null) + if (f != null || this.f != null) this.f.propT + if (f != null || this.f != null) this.f.propAny + if (f != null || this.f != null) this.f.propNullableT + if (f != null || this.f != null) this.f.propNullableAny + if (f != null || this.f != null) this.f.funT() + if (f != null || this.f != null) this.f.funAny() + if (f != null || this.f != null) this.f.funNullableT() + if (f != null || this.f != null) this.f.funNullableAny() + if (f != null || this.f != null) this.f if (x != null) x.equals(null) @@ -2022,26 +2022,26 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.x != null) x.funNullableT() if (this.x != null) x.funNullableAny() if (this.x != null) x - if (x != null || this.x != null) x.equals(null) - if (x != null || this.x != null) x.propT - if (x != null || this.x != null) x.propAny - if (x != null || this.x != null) x.propNullableT - if (x != null || this.x != null) x.propNullableAny - if (x != null || this.x != null) x.funT() - if (x != null || this.x != null) x.funAny() - if (x != null || this.x != null) x.funNullableT() - if (x != null || this.x != null) x.funNullableAny() - if (x != null || this.x != null) x - if (x != null || this.x != null) this.x.equals(null) - if (x != null || this.x != null) this.x.propT - if (x != null || this.x != null) this.x.propAny - if (x != null || this.x != null) this.x.propNullableT - if (x != null || this.x != null) this.x.propNullableAny - if (x != null || this.x != null) this.x.funT() - if (x != null || this.x != null) this.x.funAny() - if (x != null || this.x != null) this.x.funNullableT() - if (x != null || this.x != null) this.x.funNullableAny() - if (x != null || this.x != null) this.x + if (x != null || this.x != null) x.equals(null) + if (x != null || this.x != null) x.propT + if (x != null || this.x != null) x.propAny + if (x != null || this.x != null) x.propNullableT + if (x != null || this.x != null) x.propNullableAny + if (x != null || this.x != null) x.funT() + if (x != null || this.x != null) x.funAny() + if (x != null || this.x != null) x.funNullableT() + if (x != null || this.x != null) x.funNullableAny() + if (x != null || this.x != null) x + if (x != null || this.x != null) this.x.equals(null) + if (x != null || this.x != null) this.x.propT + if (x != null || this.x != null) this.x.propAny + if (x != null || this.x != null) this.x.propNullableT + if (x != null || this.x != null) this.x.propNullableAny + if (x != null || this.x != null) this.x.funT() + if (x != null || this.x != null) this.x.funAny() + if (x != null || this.x != null) this.x.funNullableT() + if (x != null || this.x != null) this.x.funNullableAny() + if (x != null || this.x != null) this.x if (y != null) y.equals(null) @@ -2091,26 +2091,26 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (y != null) this.y.funNullableT() if (y != null) this.y.funNullableAny() if (y != null) this.y - if (y != null || this.y != null) y.equals(null) - if (y != null || this.y != null) y.propT - if (y != null || this.y != null) y.propAny - if (y != null || this.y != null) y.propNullableT - if (y != null || this.y != null) y.propNullableAny - if (y != null || this.y != null) y.funT() - if (y != null || this.y != null) y.funAny() - if (y != null || this.y != null) y.funNullableT() - if (y != null || this.y != null) y.funNullableAny() - if (y != null || this.y != null) y - if (y != null || this.y != null) this.y.equals(null) - if (y != null || this.y != null) this.y.propT - if (y != null || this.y != null) this.y.propAny - if (y != null || this.y != null) this.y.propNullableT - if (y != null || this.y != null) this.y.propNullableAny - if (y != null || this.y != null) this.y.funT() - if (y != null || this.y != null) this.y.funAny() - if (y != null || this.y != null) this.y.funNullableT() - if (y != null || this.y != null) this.y.funNullableAny() - if (y != null || this.y != null) this.y + if (y != null || this.y != null) y.equals(null) + if (y != null || this.y != null) y.propT + if (y != null || this.y != null) y.propAny + if (y != null || this.y != null) y.propNullableT + if (y != null || this.y != null) y.propNullableAny + if (y != null || this.y != null) y.funT() + if (y != null || this.y != null) y.funAny() + if (y != null || this.y != null) y.funNullableT() + if (y != null || this.y != null) y.funNullableAny() + if (y != null || this.y != null) y + if (y != null || this.y != null) this.y.equals(null) + if (y != null || this.y != null) this.y.propT + if (y != null || this.y != null) this.y.propAny + if (y != null || this.y != null) this.y.propNullableT + if (y != null || this.y != null) this.y.propNullableAny + if (y != null || this.y != null) this.y.funT() + if (y != null || this.y != null) this.y.funAny() + if (y != null || this.y != null) this.y.funNullableT() + if (y != null || this.y != null) this.y.funNullableAny() + if (y != null || this.y != null) this.y if (z != null) z.equals(null) @@ -2160,26 +2160,26 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.z != null) z.funNullableT() if (this.z != null) z.funNullableAny() if (this.z != null) z - if (z != null || this.z != null) z.equals(null) - if (z != null || this.z != null) z.propT - if (z != null || this.z != null) z.propAny - if (z != null || this.z != null) z.propNullableT - if (z != null || this.z != null) z.propNullableAny - if (z != null || this.z != null) z.funT() - if (z != null || this.z != null) z.funAny() - if (z != null || this.z != null) z.funNullableT() - if (z != null || this.z != null) z.funNullableAny() - if (z != null || this.z != null) z - if (z != null || this.z != null) this.z.equals(null) - if (z != null || this.z != null) this.z.propT - if (z != null || this.z != null) this.z.propAny - if (z != null || this.z != null) this.z.propNullableT - if (z != null || this.z != null) this.z.propNullableAny - if (z != null || this.z != null) this.z.funT() - if (z != null || this.z != null) this.z.funAny() - if (z != null || this.z != null) this.z.funNullableT() - if (z != null || this.z != null) this.z.funNullableAny() - if (z != null || this.z != null) this.z + if (z != null || this.z != null) z.equals(null) + if (z != null || this.z != null) z.propT + if (z != null || this.z != null) z.propAny + if (z != null || this.z != null) z.propNullableT + if (z != null || this.z != null) z.propNullableAny + if (z != null || this.z != null) z.funT() + if (z != null || this.z != null) z.funAny() + if (z != null || this.z != null) z.funNullableT() + if (z != null || this.z != null) z.funNullableAny() + if (z != null || this.z != null) z + if (z != null || this.z != null) this.z.equals(null) + if (z != null || this.z != null) this.z.propT + if (z != null || this.z != null) this.z.propAny + if (z != null || this.z != null) this.z.propNullableT + if (z != null || this.z != null) this.z.propNullableAny + if (z != null || this.z != null) this.z.funT() + if (z != null || this.z != null) this.z.funAny() + if (z != null || this.z != null) this.z.funNullableT() + if (z != null || this.z != null) this.z.funNullableAny() + if (z != null || this.z != null) this.z if (u != null) u.equals(null) @@ -2229,26 +2229,26 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (u != null) this.u.funNullableT() if (u != null) this.u.funNullableAny() if (u != null) this.u - if (u != null || this.u != null) u.equals(null) - if (u != null || this.u != null) u.propT - if (u != null || this.u != null) u.propAny - if (u != null || this.u != null) u.propNullableT - if (u != null || this.u != null) u.propNullableAny - if (u != null || this.u != null) u.funT() - if (u != null || this.u != null) u.funAny() - if (u != null || this.u != null) u.funNullableT() - if (u != null || this.u != null) u.funNullableAny() - if (u != null || this.u != null) u - if (u != null || this.u != null) this.u.equals(null) - if (u != null || this.u != null) this.u.propT - if (u != null || this.u != null) this.u.propAny - if (u != null || this.u != null) this.u.propNullableT - if (u != null || this.u != null) this.u.propNullableAny - if (u != null || this.u != null) this.u.funT() - if (u != null || this.u != null) this.u.funAny() - if (u != null || this.u != null) this.u.funNullableT() - if (u != null || this.u != null) this.u.funNullableAny() - if (u != null || this.u != null) this.u + if (u != null || this.u != null) u.equals(null) + if (u != null || this.u != null) u.propT + if (u != null || this.u != null) u.propAny + if (u != null || this.u != null) u.propNullableT + if (u != null || this.u != null) u.propNullableAny + if (u != null || this.u != null) u.funT() + if (u != null || this.u != null) u.funAny() + if (u != null || this.u != null) u.funNullableT() + if (u != null || this.u != null) u.funNullableAny() + if (u != null || this.u != null) u + if (u != null || this.u != null) this.u.equals(null) + if (u != null || this.u != null) this.u.propT + if (u != null || this.u != null) this.u.propAny + if (u != null || this.u != null) this.u.propNullableT + if (u != null || this.u != null) this.u.propNullableAny + if (u != null || this.u != null) this.u.funT() + if (u != null || this.u != null) this.u.funAny() + if (u != null || this.u != null) this.u.funNullableT() + if (u != null || this.u != null) this.u.funNullableAny() + if (u != null || this.u != null) this.u v = 0 v.equals(null) @@ -2261,48 +2261,48 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val v.funNullableT() v.funNullableAny() v - if (v != null) v.equals(null) - if (v != null) v.propT - if (v != null) v.propAny - if (v != null) v.propNullableT - if (v != null) v.propNullableAny - if (v != null) v.funT() - if (v != null) v.funAny() - if (v != null) v.funNullableT() - if (v != null) v.funNullableAny() - if (v != null) v - if (this.v != null) v.equals(null) - if (this.v != null) v.propT - if (this.v != null) v.propAny - if (this.v != null) v.propNullableT - if (this.v != null) v.propNullableAny - if (this.v != null) v.funT() - if (this.v != null) v.funAny() - if (this.v != null) v.funNullableT() - if (this.v != null) v.funNullableAny() - if (this.v != null) v - if (v != null || this.v != null) v.equals(null) - if (v != null || this.v != null) v.propT - if (v != null || this.v != null) v.propAny - if (v != null || this.v != null) v.propNullableT - if (v != null || this.v != null) v.propNullableAny - if (v != null || this.v != null) v.funT() - if (v != null || this.v != null) v.funAny() - if (v != null || this.v != null) v.funNullableT() - if (v != null || this.v != null) v.funNullableAny() - if (v != null || this.v != null) v - if (v != null || this.v != null) this.v.equals(null) - if (v != null || this.v != null) this.v.propT - if (v != null || this.v != null) this.v.propAny - if (v != null || this.v != null) this.v.propNullableT - if (v != null || this.v != null) this.v.propNullableAny - if (v != null || this.v != null) this.v.funT() - if (v != null || this.v != null) this.v.funAny() - if (v != null || this.v != null) this.v.funNullableT() - if (v != null || this.v != null) this.v.funNullableAny() - if (v != null || this.v != null) this.v + if (v != null) v.equals(null) + if (v != null) v.propT + if (v != null) v.propAny + if (v != null) v.propNullableT + if (v != null) v.propNullableAny + if (v != null) v.funT() + if (v != null) v.funAny() + if (v != null) v.funNullableT() + if (v != null) v.funNullableAny() + if (v != null) v + if (this.v != null) v.equals(null) + if (this.v != null) v.propT + if (this.v != null) v.propAny + if (this.v != null) v.propNullableT + if (this.v != null) v.propNullableAny + if (this.v != null) v.funT() + if (this.v != null) v.funAny() + if (this.v != null) v.funNullableT() + if (this.v != null) v.funNullableAny() + if (this.v != null) v + if (v != null || this.v != null) v.equals(null) + if (v != null || this.v != null) v.propT + if (v != null || this.v != null) v.propAny + if (v != null || this.v != null) v.propNullableT + if (v != null || this.v != null) v.propNullableAny + if (v != null || this.v != null) v.funT() + if (v != null || this.v != null) v.funAny() + if (v != null || this.v != null) v.funNullableT() + if (v != null || this.v != null) v.funNullableAny() + if (v != null || this.v != null) v + if (v != null || this.v != null) this.v.equals(null) + if (v != null || this.v != null) this.v.propT + if (v != null || this.v != null) this.v.propAny + if (v != null || this.v != null) this.v.propNullableT + if (v != null || this.v != null) this.v.propNullableAny + if (v != null || this.v != null) this.v.funT() + if (v != null || this.v != null) this.v.funAny() + if (v != null || this.v != null) this.v.funNullableT() + if (v != null || this.v != null) this.v.funNullableAny() + if (v != null || this.v != null) this.v - w = if (null != null) 10 else null + w = if (null != null) 10 else null w if (w != null) w.equals(null) if (w != null) w.propT @@ -2324,34 +2324,34 @@ sealed class Case30(a: Int?, val b: Float?, private val c: Unit?, protected val if (this.w != null) w.funNullableT() if (this.w != null) w.funNullableAny() if (this.w != null) w - if (w != null || this.w != null) w.equals(null) - if (w != null || this.w != null) w.propT - if (w != null || this.w != null) w.propAny - if (w != null || this.w != null) w.propNullableT - if (w != null || this.w != null) w.propNullableAny - if (w != null || this.w != null) w.funT() - if (w != null || this.w != null) w.funAny() - if (w != null || this.w != null) w.funNullableT() - if (w != null || this.w != null) w.funNullableAny() - if (w != null || this.w != null) w - if (w != null || this.w != null) this.w.equals(null) - if (w != null || this.w != null) this.w.propT - if (w != null || this.w != null) this.w.propAny - if (w != null || this.w != null) this.w.propNullableT - if (w != null || this.w != null) this.w.propNullableAny - if (w != null || this.w != null) this.w.funT() - if (w != null || this.w != null) this.w.funAny() - if (w != null || this.w != null) this.w.funNullableT() - if (w != null || this.w != null) this.w.funNullableAny() - if (w != null || this.w != null) this.w + if (w != null || this.w != null) w.equals(null) + if (w != null || this.w != null) w.propT + if (w != null || this.w != null) w.propAny + if (w != null || this.w != null) w.propNullableT + if (w != null || this.w != null) w.propNullableAny + if (w != null || this.w != null) w.funT() + if (w != null || this.w != null) w.funAny() + if (w != null || this.w != null) w.funNullableT() + if (w != null || this.w != null) w.funNullableAny() + if (w != null || this.w != null) w + if (w != null || this.w != null) this.w.equals(null) + if (w != null || this.w != null) this.w.propT + if (w != null || this.w != null) this.w.propAny + if (w != null || this.w != null) this.w.propNullableT + if (w != null || this.w != null) this.w.propNullableAny + if (w != null || this.w != null) this.w.funT() + if (w != null || this.w != null) this.w.funAny() + if (w != null || this.w != null) this.w.funNullableT() + if (w != null || this.w != null) this.w.funNullableAny() + if (w != null || this.w != null) this.w s = null s.hashCode() s - if (s != null) s - if (this.s != null) s - if (s != null || this.s != null) s - if (s != null || this.s != null) this.s + if (s != null) s + if (this.s != null) s + if (s != null || this.s != null) s + if (s != null || this.s != null) this.s } fun test() { @@ -2723,26 +2723,26 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (b != null) this.b.funNullableT() if (b != null) this.b.funNullableAny() if (b != null) this.b - if (b != null || this.b != null) b.equals(null) - if (b != null || this.b != null) b.propT - if (b != null || this.b != null) b.propAny - if (b != null || this.b != null) b.propNullableT - if (b != null || this.b != null) b.propNullableAny - if (b != null || this.b != null) b.funT() - if (b != null || this.b != null) b.funAny() - if (b != null || this.b != null) b.funNullableT() - if (b != null || this.b != null) b.funNullableAny() - if (b != null || this.b != null) b - if (b != null || this.b != null) this.b.equals(null) - if (b != null || this.b != null) this.b.propT - if (b != null || this.b != null) this.b.propAny - if (b != null || this.b != null) this.b.propNullableT - if (b != null || this.b != null) this.b.propNullableAny - if (b != null || this.b != null) this.b.funT() - if (b != null || this.b != null) this.b.funAny() - if (b != null || this.b != null) this.b.funNullableT() - if (b != null || this.b != null) this.b.funNullableAny() - if (b != null || this.b != null) this.b + if (b != null || this.b != null) b.equals(null) + if (b != null || this.b != null) b.propT + if (b != null || this.b != null) b.propAny + if (b != null || this.b != null) b.propNullableT + if (b != null || this.b != null) b.propNullableAny + if (b != null || this.b != null) b.funT() + if (b != null || this.b != null) b.funAny() + if (b != null || this.b != null) b.funNullableT() + if (b != null || this.b != null) b.funNullableAny() + if (b != null || this.b != null) b + if (b != null || this.b != null) this.b.equals(null) + if (b != null || this.b != null) this.b.propT + if (b != null || this.b != null) this.b.propAny + if (b != null || this.b != null) this.b.propNullableT + if (b != null || this.b != null) this.b.propNullableAny + if (b != null || this.b != null) this.b.funT() + if (b != null || this.b != null) this.b.funAny() + if (b != null || this.b != null) this.b.funNullableT() + if (b != null || this.b != null) this.b.funNullableAny() + if (b != null || this.b != null) this.b if (c != null) c.equals(null) @@ -2792,26 +2792,26 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.c != null) c.funNullableT() if (this.c != null) c.funNullableAny() if (this.c != null) c - if (c != null || this.c != null) c.equals(null) - if (c != null || this.c != null) c.propT - if (c != null || this.c != null) c.propAny - if (c != null || this.c != null) c.propNullableT - if (c != null || this.c != null) c.propNullableAny - if (c != null || this.c != null) c.funT() - if (c != null || this.c != null) c.funAny() - if (c != null || this.c != null) c.funNullableT() - if (c != null || this.c != null) c.funNullableAny() - if (c != null || this.c != null) c - if (c != null || this.c != null) this.c.equals(null) - if (c != null || this.c != null) this.c.propT - if (c != null || this.c != null) this.c.propAny - if (c != null || this.c != null) this.c.propNullableT - if (c != null || this.c != null) this.c.propNullableAny - if (c != null || this.c != null) this.c.funT() - if (c != null || this.c != null) this.c.funAny() - if (c != null || this.c != null) this.c.funNullableT() - if (c != null || this.c != null) this.c.funNullableAny() - if (c != null || this.c != null) this.c + if (c != null || this.c != null) c.equals(null) + if (c != null || this.c != null) c.propT + if (c != null || this.c != null) c.propAny + if (c != null || this.c != null) c.propNullableT + if (c != null || this.c != null) c.propNullableAny + if (c != null || this.c != null) c.funT() + if (c != null || this.c != null) c.funAny() + if (c != null || this.c != null) c.funNullableT() + if (c != null || this.c != null) c.funNullableAny() + if (c != null || this.c != null) c + if (c != null || this.c != null) this.c.equals(null) + if (c != null || this.c != null) this.c.propT + if (c != null || this.c != null) this.c.propAny + if (c != null || this.c != null) this.c.propNullableT + if (c != null || this.c != null) this.c.propNullableAny + if (c != null || this.c != null) this.c.funT() + if (c != null || this.c != null) this.c.funAny() + if (c != null || this.c != null) this.c.funNullableT() + if (c != null || this.c != null) this.c.funNullableAny() + if (c != null || this.c != null) this.c if (d != null) d.equals(null) @@ -2861,26 +2861,26 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.d != null) d.funNullableT() if (this.d != null) d.funNullableAny() if (this.d != null) d - if (d != null || this.d != null) d.equals(null) - if (d != null || this.d != null) d.propT - if (d != null || this.d != null) d.propAny - if (d != null || this.d != null) d.propNullableT - if (d != null || this.d != null) d.propNullableAny - if (d != null || this.d != null) d.funT() - if (d != null || this.d != null) d.funAny() - if (d != null || this.d != null) d.funNullableT() - if (d != null || this.d != null) d.funNullableAny() - if (d != null || this.d != null) d - if (d != null || this.d != null) this.d.equals(null) - if (d != null || this.d != null) this.d.propT - if (d != null || this.d != null) this.d.propAny - if (d != null || this.d != null) this.d.propNullableT - if (d != null || this.d != null) this.d.propNullableAny - if (d != null || this.d != null) this.d.funT() - if (d != null || this.d != null) this.d.funAny() - if (d != null || this.d != null) this.d.funNullableT() - if (d != null || this.d != null) this.d.funNullableAny() - if (d != null || this.d != null) this.d + if (d != null || this.d != null) d.equals(null) + if (d != null || this.d != null) d.propT + if (d != null || this.d != null) d.propAny + if (d != null || this.d != null) d.propNullableT + if (d != null || this.d != null) d.propNullableAny + if (d != null || this.d != null) d.funT() + if (d != null || this.d != null) d.funAny() + if (d != null || this.d != null) d.funNullableT() + if (d != null || this.d != null) d.funNullableAny() + if (d != null || this.d != null) d + if (d != null || this.d != null) this.d.equals(null) + if (d != null || this.d != null) this.d.propT + if (d != null || this.d != null) this.d.propAny + if (d != null || this.d != null) this.d.propNullableT + if (d != null || this.d != null) this.d.propNullableAny + if (d != null || this.d != null) this.d.funT() + if (d != null || this.d != null) this.d.funAny() + if (d != null || this.d != null) this.d.funNullableT() + if (d != null || this.d != null) this.d.funNullableAny() + if (d != null || this.d != null) this.d if (e != null) e.equals(null) @@ -2930,26 +2930,26 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (e != null) this.e.funNullableT() if (e != null) this.e.funNullableAny() if (e != null) this.e - if (e != null || this.e != null) e.equals(null) - if (e != null || this.e != null) e.propT - if (e != null || this.e != null) e.propAny - if (e != null || this.e != null) e.propNullableT - if (e != null || this.e != null) e.propNullableAny - if (e != null || this.e != null) e.funT() - if (e != null || this.e != null) e.funAny() - if (e != null || this.e != null) e.funNullableT() - if (e != null || this.e != null) e.funNullableAny() - if (e != null || this.e != null) e - if (e != null || this.e != null) this.e.equals(null) - if (e != null || this.e != null) this.e.propT - if (e != null || this.e != null) this.e.propAny - if (e != null || this.e != null) this.e.propNullableT - if (e != null || this.e != null) this.e.propNullableAny - if (e != null || this.e != null) this.e.funT() - if (e != null || this.e != null) this.e.funAny() - if (e != null || this.e != null) this.e.funNullableT() - if (e != null || this.e != null) this.e.funNullableAny() - if (e != null || this.e != null) this.e + if (e != null || this.e != null) e.equals(null) + if (e != null || this.e != null) e.propT + if (e != null || this.e != null) e.propAny + if (e != null || this.e != null) e.propNullableT + if (e != null || this.e != null) e.propNullableAny + if (e != null || this.e != null) e.funT() + if (e != null || this.e != null) e.funAny() + if (e != null || this.e != null) e.funNullableT() + if (e != null || this.e != null) e.funNullableAny() + if (e != null || this.e != null) e + if (e != null || this.e != null) this.e.equals(null) + if (e != null || this.e != null) this.e.propT + if (e != null || this.e != null) this.e.propAny + if (e != null || this.e != null) this.e.propNullableT + if (e != null || this.e != null) this.e.propNullableAny + if (e != null || this.e != null) this.e.funT() + if (e != null || this.e != null) this.e.funAny() + if (e != null || this.e != null) this.e.funNullableT() + if (e != null || this.e != null) this.e.funNullableAny() + if (e != null || this.e != null) this.e if (f != null) f.equals(null) @@ -2999,26 +2999,26 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (f != null) this.f.funNullableT() if (f != null) this.f.funNullableAny() if (f != null) this.f - if (f != null || this.f != null) f.equals(null) - if (f != null || this.f != null) f.propT - if (f != null || this.f != null) f.propAny - if (f != null || this.f != null) f.propNullableT - if (f != null || this.f != null) f.propNullableAny - if (f != null || this.f != null) f.funT() - if (f != null || this.f != null) f.funAny() - if (f != null || this.f != null) f.funNullableT() - if (f != null || this.f != null) f.funNullableAny() - if (f != null || this.f != null) f - if (f != null || this.f != null) this.f.equals(null) - if (f != null || this.f != null) this.f.propT - if (f != null || this.f != null) this.f.propAny - if (f != null || this.f != null) this.f.propNullableT - if (f != null || this.f != null) this.f.propNullableAny - if (f != null || this.f != null) this.f.funT() - if (f != null || this.f != null) this.f.funAny() - if (f != null || this.f != null) this.f.funNullableT() - if (f != null || this.f != null) this.f.funNullableAny() - if (f != null || this.f != null) this.f + if (f != null || this.f != null) f.equals(null) + if (f != null || this.f != null) f.propT + if (f != null || this.f != null) f.propAny + if (f != null || this.f != null) f.propNullableT + if (f != null || this.f != null) f.propNullableAny + if (f != null || this.f != null) f.funT() + if (f != null || this.f != null) f.funAny() + if (f != null || this.f != null) f.funNullableT() + if (f != null || this.f != null) f.funNullableAny() + if (f != null || this.f != null) f + if (f != null || this.f != null) this.f.equals(null) + if (f != null || this.f != null) this.f.propT + if (f != null || this.f != null) this.f.propAny + if (f != null || this.f != null) this.f.propNullableT + if (f != null || this.f != null) this.f.propNullableAny + if (f != null || this.f != null) this.f.funT() + if (f != null || this.f != null) this.f.funAny() + if (f != null || this.f != null) this.f.funNullableT() + if (f != null || this.f != null) this.f.funNullableAny() + if (f != null || this.f != null) this.f if (x != null) x.equals(null) @@ -3068,26 +3068,26 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.x != null) x.funNullableT() if (this.x != null) x.funNullableAny() if (this.x != null) x - if (x != null || this.x != null) x.equals(null) - if (x != null || this.x != null) x.propT - if (x != null || this.x != null) x.propAny - if (x != null || this.x != null) x.propNullableT - if (x != null || this.x != null) x.propNullableAny - if (x != null || this.x != null) x.funT() - if (x != null || this.x != null) x.funAny() - if (x != null || this.x != null) x.funNullableT() - if (x != null || this.x != null) x.funNullableAny() - if (x != null || this.x != null) x - if (x != null || this.x != null) this.x.equals(null) - if (x != null || this.x != null) this.x.propT - if (x != null || this.x != null) this.x.propAny - if (x != null || this.x != null) this.x.propNullableT - if (x != null || this.x != null) this.x.propNullableAny - if (x != null || this.x != null) this.x.funT() - if (x != null || this.x != null) this.x.funAny() - if (x != null || this.x != null) this.x.funNullableT() - if (x != null || this.x != null) this.x.funNullableAny() - if (x != null || this.x != null) this.x + if (x != null || this.x != null) x.equals(null) + if (x != null || this.x != null) x.propT + if (x != null || this.x != null) x.propAny + if (x != null || this.x != null) x.propNullableT + if (x != null || this.x != null) x.propNullableAny + if (x != null || this.x != null) x.funT() + if (x != null || this.x != null) x.funAny() + if (x != null || this.x != null) x.funNullableT() + if (x != null || this.x != null) x.funNullableAny() + if (x != null || this.x != null) x + if (x != null || this.x != null) this.x.equals(null) + if (x != null || this.x != null) this.x.propT + if (x != null || this.x != null) this.x.propAny + if (x != null || this.x != null) this.x.propNullableT + if (x != null || this.x != null) this.x.propNullableAny + if (x != null || this.x != null) this.x.funT() + if (x != null || this.x != null) this.x.funAny() + if (x != null || this.x != null) this.x.funNullableT() + if (x != null || this.x != null) this.x.funNullableAny() + if (x != null || this.x != null) this.x if (y != null) y.equals(null) @@ -3137,26 +3137,26 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (y != null) this.y.funNullableT() if (y != null) this.y.funNullableAny() if (y != null) this.y - if (y != null || this.y != null) y.equals(null) - if (y != null || this.y != null) y.propT - if (y != null || this.y != null) y.propAny - if (y != null || this.y != null) y.propNullableT - if (y != null || this.y != null) y.propNullableAny - if (y != null || this.y != null) y.funT() - if (y != null || this.y != null) y.funAny() - if (y != null || this.y != null) y.funNullableT() - if (y != null || this.y != null) y.funNullableAny() - if (y != null || this.y != null) y - if (y != null || this.y != null) this.y.equals(null) - if (y != null || this.y != null) this.y.propT - if (y != null || this.y != null) this.y.propAny - if (y != null || this.y != null) this.y.propNullableT - if (y != null || this.y != null) this.y.propNullableAny - if (y != null || this.y != null) this.y.funT() - if (y != null || this.y != null) this.y.funAny() - if (y != null || this.y != null) this.y.funNullableT() - if (y != null || this.y != null) this.y.funNullableAny() - if (y != null || this.y != null) this.y + if (y != null || this.y != null) y.equals(null) + if (y != null || this.y != null) y.propT + if (y != null || this.y != null) y.propAny + if (y != null || this.y != null) y.propNullableT + if (y != null || this.y != null) y.propNullableAny + if (y != null || this.y != null) y.funT() + if (y != null || this.y != null) y.funAny() + if (y != null || this.y != null) y.funNullableT() + if (y != null || this.y != null) y.funNullableAny() + if (y != null || this.y != null) y + if (y != null || this.y != null) this.y.equals(null) + if (y != null || this.y != null) this.y.propT + if (y != null || this.y != null) this.y.propAny + if (y != null || this.y != null) this.y.propNullableT + if (y != null || this.y != null) this.y.propNullableAny + if (y != null || this.y != null) this.y.funT() + if (y != null || this.y != null) this.y.funAny() + if (y != null || this.y != null) this.y.funNullableT() + if (y != null || this.y != null) this.y.funNullableAny() + if (y != null || this.y != null) this.y if (z != null) z.equals(null) @@ -3206,26 +3206,26 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.z != null) z.funNullableT() if (this.z != null) z.funNullableAny() if (this.z != null) z - if (z != null || this.z != null) z.equals(null) - if (z != null || this.z != null) z.propT - if (z != null || this.z != null) z.propAny - if (z != null || this.z != null) z.propNullableT - if (z != null || this.z != null) z.propNullableAny - if (z != null || this.z != null) z.funT() - if (z != null || this.z != null) z.funAny() - if (z != null || this.z != null) z.funNullableT() - if (z != null || this.z != null) z.funNullableAny() - if (z != null || this.z != null) z - if (z != null || this.z != null) this.z.equals(null) - if (z != null || this.z != null) this.z.propT - if (z != null || this.z != null) this.z.propAny - if (z != null || this.z != null) this.z.propNullableT - if (z != null || this.z != null) this.z.propNullableAny - if (z != null || this.z != null) this.z.funT() - if (z != null || this.z != null) this.z.funAny() - if (z != null || this.z != null) this.z.funNullableT() - if (z != null || this.z != null) this.z.funNullableAny() - if (z != null || this.z != null) this.z + if (z != null || this.z != null) z.equals(null) + if (z != null || this.z != null) z.propT + if (z != null || this.z != null) z.propAny + if (z != null || this.z != null) z.propNullableT + if (z != null || this.z != null) z.propNullableAny + if (z != null || this.z != null) z.funT() + if (z != null || this.z != null) z.funAny() + if (z != null || this.z != null) z.funNullableT() + if (z != null || this.z != null) z.funNullableAny() + if (z != null || this.z != null) z + if (z != null || this.z != null) this.z.equals(null) + if (z != null || this.z != null) this.z.propT + if (z != null || this.z != null) this.z.propAny + if (z != null || this.z != null) this.z.propNullableT + if (z != null || this.z != null) this.z.propNullableAny + if (z != null || this.z != null) this.z.funT() + if (z != null || this.z != null) this.z.funAny() + if (z != null || this.z != null) this.z.funNullableT() + if (z != null || this.z != null) this.z.funNullableAny() + if (z != null || this.z != null) this.z if (u != null) u.equals(null) @@ -3275,26 +3275,26 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (u != null) this.u.funNullableT() if (u != null) this.u.funNullableAny() if (u != null) this.u - if (u != null || this.u != null) u.equals(null) - if (u != null || this.u != null) u.propT - if (u != null || this.u != null) u.propAny - if (u != null || this.u != null) u.propNullableT - if (u != null || this.u != null) u.propNullableAny - if (u != null || this.u != null) u.funT() - if (u != null || this.u != null) u.funAny() - if (u != null || this.u != null) u.funNullableT() - if (u != null || this.u != null) u.funNullableAny() - if (u != null || this.u != null) u - if (u != null || this.u != null) this.u.equals(null) - if (u != null || this.u != null) this.u.propT - if (u != null || this.u != null) this.u.propAny - if (u != null || this.u != null) this.u.propNullableT - if (u != null || this.u != null) this.u.propNullableAny - if (u != null || this.u != null) this.u.funT() - if (u != null || this.u != null) this.u.funAny() - if (u != null || this.u != null) this.u.funNullableT() - if (u != null || this.u != null) this.u.funNullableAny() - if (u != null || this.u != null) this.u + if (u != null || this.u != null) u.equals(null) + if (u != null || this.u != null) u.propT + if (u != null || this.u != null) u.propAny + if (u != null || this.u != null) u.propNullableT + if (u != null || this.u != null) u.propNullableAny + if (u != null || this.u != null) u.funT() + if (u != null || this.u != null) u.funAny() + if (u != null || this.u != null) u.funNullableT() + if (u != null || this.u != null) u.funNullableAny() + if (u != null || this.u != null) u + if (u != null || this.u != null) this.u.equals(null) + if (u != null || this.u != null) this.u.propT + if (u != null || this.u != null) this.u.propAny + if (u != null || this.u != null) this.u.propNullableT + if (u != null || this.u != null) this.u.propNullableAny + if (u != null || this.u != null) this.u.funT() + if (u != null || this.u != null) this.u.funAny() + if (u != null || this.u != null) this.u.funNullableT() + if (u != null || this.u != null) this.u.funNullableAny() + if (u != null || this.u != null) this.u v = 0 v.equals(null) @@ -3307,48 +3307,48 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: v.funNullableT() v.funNullableAny() v - if (v != null) v.equals(null) - if (v != null) v.propT - if (v != null) v.propAny - if (v != null) v.propNullableT - if (v != null) v.propNullableAny - if (v != null) v.funT() - if (v != null) v.funAny() - if (v != null) v.funNullableT() - if (v != null) v.funNullableAny() - if (v != null) v - if (this.v != null) v.equals(null) - if (this.v != null) v.propT - if (this.v != null) v.propAny - if (this.v != null) v.propNullableT - if (this.v != null) v.propNullableAny - if (this.v != null) v.funT() - if (this.v != null) v.funAny() - if (this.v != null) v.funNullableT() - if (this.v != null) v.funNullableAny() - if (this.v != null) v - if (v != null || this.v != null) v.equals(null) - if (v != null || this.v != null) v.propT - if (v != null || this.v != null) v.propAny - if (v != null || this.v != null) v.propNullableT - if (v != null || this.v != null) v.propNullableAny - if (v != null || this.v != null) v.funT() - if (v != null || this.v != null) v.funAny() - if (v != null || this.v != null) v.funNullableT() - if (v != null || this.v != null) v.funNullableAny() - if (v != null || this.v != null) v - if (v != null || this.v != null) this.v.equals(null) - if (v != null || this.v != null) this.v.propT - if (v != null || this.v != null) this.v.propAny - if (v != null || this.v != null) this.v.propNullableT - if (v != null || this.v != null) this.v.propNullableAny - if (v != null || this.v != null) this.v.funT() - if (v != null || this.v != null) this.v.funAny() - if (v != null || this.v != null) this.v.funNullableT() - if (v != null || this.v != null) this.v.funNullableAny() - if (v != null || this.v != null) this.v + if (v != null) v.equals(null) + if (v != null) v.propT + if (v != null) v.propAny + if (v != null) v.propNullableT + if (v != null) v.propNullableAny + if (v != null) v.funT() + if (v != null) v.funAny() + if (v != null) v.funNullableT() + if (v != null) v.funNullableAny() + if (v != null) v + if (this.v != null) v.equals(null) + if (this.v != null) v.propT + if (this.v != null) v.propAny + if (this.v != null) v.propNullableT + if (this.v != null) v.propNullableAny + if (this.v != null) v.funT() + if (this.v != null) v.funAny() + if (this.v != null) v.funNullableT() + if (this.v != null) v.funNullableAny() + if (this.v != null) v + if (v != null || this.v != null) v.equals(null) + if (v != null || this.v != null) v.propT + if (v != null || this.v != null) v.propAny + if (v != null || this.v != null) v.propNullableT + if (v != null || this.v != null) v.propNullableAny + if (v != null || this.v != null) v.funT() + if (v != null || this.v != null) v.funAny() + if (v != null || this.v != null) v.funNullableT() + if (v != null || this.v != null) v.funNullableAny() + if (v != null || this.v != null) v + if (v != null || this.v != null) this.v.equals(null) + if (v != null || this.v != null) this.v.propT + if (v != null || this.v != null) this.v.propAny + if (v != null || this.v != null) this.v.propNullableT + if (v != null || this.v != null) this.v.propNullableAny + if (v != null || this.v != null) this.v.funT() + if (v != null || this.v != null) this.v.funAny() + if (v != null || this.v != null) this.v.funNullableT() + if (v != null || this.v != null) this.v.funNullableAny() + if (v != null || this.v != null) this.v - w = if (null != null) 10 else null + w = if (null != null) 10 else null if (w != null) w.equals(null) if (w != null) w.propT if (w != null) w.propAny @@ -3369,34 +3369,34 @@ enum class Case31(a: Int?, val b: Float?, private val c: Unit?, protected val d: if (this.w != null) w.funNullableT() if (this.w != null) w.funNullableAny() if (this.w != null) w - if (w != null || this.w != null) w.equals(null) - if (w != null || this.w != null) w.propT - if (w != null || this.w != null) w.propAny - if (w != null || this.w != null) w.propNullableT - if (w != null || this.w != null) w.propNullableAny - if (w != null || this.w != null) w.funT() - if (w != null || this.w != null) w.funAny() - if (w != null || this.w != null) w.funNullableT() - if (w != null || this.w != null) w.funNullableAny() - if (w != null || this.w != null) w - if (w != null || this.w != null) this.w.equals(null) - if (w != null || this.w != null) this.w.propT - if (w != null || this.w != null) this.w.propAny - if (w != null || this.w != null) this.w.propNullableT - if (w != null || this.w != null) this.w.propNullableAny - if (w != null || this.w != null) this.w.funT() - if (w != null || this.w != null) this.w.funAny() - if (w != null || this.w != null) this.w.funNullableT() - if (w != null || this.w != null) this.w.funNullableAny() - if (w != null || this.w != null) this.w + if (w != null || this.w != null) w.equals(null) + if (w != null || this.w != null) w.propT + if (w != null || this.w != null) w.propAny + if (w != null || this.w != null) w.propNullableT + if (w != null || this.w != null) w.propNullableAny + if (w != null || this.w != null) w.funT() + if (w != null || this.w != null) w.funAny() + if (w != null || this.w != null) w.funNullableT() + if (w != null || this.w != null) w.funNullableAny() + if (w != null || this.w != null) w + if (w != null || this.w != null) this.w.equals(null) + if (w != null || this.w != null) this.w.propT + if (w != null || this.w != null) this.w.propAny + if (w != null || this.w != null) this.w.propNullableT + if (w != null || this.w != null) this.w.propNullableAny + if (w != null || this.w != null) this.w.funT() + if (w != null || this.w != null) this.w.funAny() + if (w != null || this.w != null) this.w.funNullableT() + if (w != null || this.w != null) this.w.funNullableAny() + if (w != null || this.w != null) this.w s = null s.hashCode() s - if (s != null) s - if (this.s != null) s - if (s != null || this.s != null) s - if (s != null || this.s != null) this.s + if (s != null) s + if (this.s != null) s + if (s != null || this.s != null) s + if (s != null || this.s != null) this.s } fun test() { @@ -3785,26 +3785,26 @@ object Case32 { if (this.x != null) x.funNullableT() if (this.x != null) x.funNullableAny() if (this.x != null) x - if (x != null || this.x != null) x.equals(null) - if (x != null || this.x != null) x.propT - if (x != null || this.x != null) x.propAny - if (x != null || this.x != null) x.propNullableT - if (x != null || this.x != null) x.propNullableAny - if (x != null || this.x != null) x.funT() - if (x != null || this.x != null) x.funAny() - if (x != null || this.x != null) x.funNullableT() - if (x != null || this.x != null) x.funNullableAny() - if (x != null || this.x != null) x - if (x != null || this.x != null) this.x.equals(null) - if (x != null || this.x != null) this.x.propT - if (x != null || this.x != null) this.x.propAny - if (x != null || this.x != null) this.x.propNullableT - if (x != null || this.x != null) this.x.propNullableAny - if (x != null || this.x != null) this.x.funT() - if (x != null || this.x != null) this.x.funAny() - if (x != null || this.x != null) this.x.funNullableT() - if (x != null || this.x != null) this.x.funNullableAny() - if (x != null || this.x != null) this.x + if (x != null || this.x != null) x.equals(null) + if (x != null || this.x != null) x.propT + if (x != null || this.x != null) x.propAny + if (x != null || this.x != null) x.propNullableT + if (x != null || this.x != null) x.propNullableAny + if (x != null || this.x != null) x.funT() + if (x != null || this.x != null) x.funAny() + if (x != null || this.x != null) x.funNullableT() + if (x != null || this.x != null) x.funNullableAny() + if (x != null || this.x != null) x + if (x != null || this.x != null) this.x.equals(null) + if (x != null || this.x != null) this.x.propT + if (x != null || this.x != null) this.x.propAny + if (x != null || this.x != null) this.x.propNullableT + if (x != null || this.x != null) this.x.propNullableAny + if (x != null || this.x != null) this.x.funT() + if (x != null || this.x != null) this.x.funAny() + if (x != null || this.x != null) this.x.funNullableT() + if (x != null || this.x != null) this.x.funNullableAny() + if (x != null || this.x != null) this.x if (y != null) y.equals(null) @@ -3854,26 +3854,26 @@ object Case32 { if (y != null) this.y.funNullableT() if (y != null) this.y.funNullableAny() if (y != null) this.y - if (y != null || this.y != null) y.equals(null) - if (y != null || this.y != null) y.propT - if (y != null || this.y != null) y.propAny - if (y != null || this.y != null) y.propNullableT - if (y != null || this.y != null) y.propNullableAny - if (y != null || this.y != null) y.funT() - if (y != null || this.y != null) y.funAny() - if (y != null || this.y != null) y.funNullableT() - if (y != null || this.y != null) y.funNullableAny() - if (y != null || this.y != null) y - if (y != null || this.y != null) this.y.equals(null) - if (y != null || this.y != null) this.y.propT - if (y != null || this.y != null) this.y.propAny - if (y != null || this.y != null) this.y.propNullableT - if (y != null || this.y != null) this.y.propNullableAny - if (y != null || this.y != null) this.y.funT() - if (y != null || this.y != null) this.y.funAny() - if (y != null || this.y != null) this.y.funNullableT() - if (y != null || this.y != null) this.y.funNullableAny() - if (y != null || this.y != null) this.y + if (y != null || this.y != null) y.equals(null) + if (y != null || this.y != null) y.propT + if (y != null || this.y != null) y.propAny + if (y != null || this.y != null) y.propNullableT + if (y != null || this.y != null) y.propNullableAny + if (y != null || this.y != null) y.funT() + if (y != null || this.y != null) y.funAny() + if (y != null || this.y != null) y.funNullableT() + if (y != null || this.y != null) y.funNullableAny() + if (y != null || this.y != null) y + if (y != null || this.y != null) this.y.equals(null) + if (y != null || this.y != null) this.y.propT + if (y != null || this.y != null) this.y.propAny + if (y != null || this.y != null) this.y.propNullableT + if (y != null || this.y != null) this.y.propNullableAny + if (y != null || this.y != null) this.y.funT() + if (y != null || this.y != null) this.y.funAny() + if (y != null || this.y != null) this.y.funNullableT() + if (y != null || this.y != null) this.y.funNullableAny() + if (y != null || this.y != null) this.y if (u != null) u.equals(null) @@ -3923,26 +3923,26 @@ object Case32 { if (u != null) this.u.funNullableT() if (u != null) this.u.funNullableAny() if (u != null) this.u - if (u != null || this.u != null) u.equals(null) - if (u != null || this.u != null) u.propT - if (u != null || this.u != null) u.propAny - if (u != null || this.u != null) u.propNullableT - if (u != null || this.u != null) u.propNullableAny - if (u != null || this.u != null) u.funT() - if (u != null || this.u != null) u.funAny() - if (u != null || this.u != null) u.funNullableT() - if (u != null || this.u != null) u.funNullableAny() - if (u != null || this.u != null) u - if (u != null || this.u != null) this.u.equals(null) - if (u != null || this.u != null) this.u.propT - if (u != null || this.u != null) this.u.propAny - if (u != null || this.u != null) this.u.propNullableT - if (u != null || this.u != null) this.u.propNullableAny - if (u != null || this.u != null) this.u.funT() - if (u != null || this.u != null) this.u.funAny() - if (u != null || this.u != null) this.u.funNullableT() - if (u != null || this.u != null) this.u.funNullableAny() - if (u != null || this.u != null) this.u + if (u != null || this.u != null) u.equals(null) + if (u != null || this.u != null) u.propT + if (u != null || this.u != null) u.propAny + if (u != null || this.u != null) u.propNullableT + if (u != null || this.u != null) u.propNullableAny + if (u != null || this.u != null) u.funT() + if (u != null || this.u != null) u.funAny() + if (u != null || this.u != null) u.funNullableT() + if (u != null || this.u != null) u.funNullableAny() + if (u != null || this.u != null) u + if (u != null || this.u != null) this.u.equals(null) + if (u != null || this.u != null) this.u.propT + if (u != null || this.u != null) this.u.propAny + if (u != null || this.u != null) this.u.propNullableT + if (u != null || this.u != null) this.u.propNullableAny + if (u != null || this.u != null) this.u.funT() + if (u != null || this.u != null) this.u.funAny() + if (u != null || this.u != null) this.u.funNullableT() + if (u != null || this.u != null) this.u.funNullableAny() + if (u != null || this.u != null) this.u v = 0 v.equals(null) @@ -3955,48 +3955,48 @@ object Case32 { v.funNullableT() v.funNullableAny() v - if (v != null) v.equals(null) - if (v != null) v.propT - if (v != null) v.propAny - if (v != null) v.propNullableT - if (v != null) v.propNullableAny - if (v != null) v.funT() - if (v != null) v.funAny() - if (v != null) v.funNullableT() - if (v != null) v.funNullableAny() - if (v != null) v - if (this.v != null) v.equals(null) - if (this.v != null) v.propT - if (this.v != null) v.propAny - if (this.v != null) v.propNullableT - if (this.v != null) v.propNullableAny - if (this.v != null) v.funT() - if (this.v != null) v.funAny() - if (this.v != null) v.funNullableT() - if (this.v != null) v.funNullableAny() - if (this.v != null) v - if (v != null || this.v != null) v.equals(null) - if (v != null || this.v != null) v.propT - if (v != null || this.v != null) v.propAny - if (v != null || this.v != null) v.propNullableT - if (v != null || this.v != null) v.propNullableAny - if (v != null || this.v != null) v.funT() - if (v != null || this.v != null) v.funAny() - if (v != null || this.v != null) v.funNullableT() - if (v != null || this.v != null) v.funNullableAny() - if (v != null || this.v != null) v - if (v != null || this.v != null) this.v.equals(null) - if (v != null || this.v != null) this.v.propT - if (v != null || this.v != null) this.v.propAny - if (v != null || this.v != null) this.v.propNullableT - if (v != null || this.v != null) this.v.propNullableAny - if (v != null || this.v != null) this.v.funT() - if (v != null || this.v != null) this.v.funAny() - if (v != null || this.v != null) this.v.funNullableT() - if (v != null || this.v != null) this.v.funNullableAny() - if (v != null || this.v != null) this.v + if (v != null) v.equals(null) + if (v != null) v.propT + if (v != null) v.propAny + if (v != null) v.propNullableT + if (v != null) v.propNullableAny + if (v != null) v.funT() + if (v != null) v.funAny() + if (v != null) v.funNullableT() + if (v != null) v.funNullableAny() + if (v != null) v + if (this.v != null) v.equals(null) + if (this.v != null) v.propT + if (this.v != null) v.propAny + if (this.v != null) v.propNullableT + if (this.v != null) v.propNullableAny + if (this.v != null) v.funT() + if (this.v != null) v.funAny() + if (this.v != null) v.funNullableT() + if (this.v != null) v.funNullableAny() + if (this.v != null) v + if (v != null || this.v != null) v.equals(null) + if (v != null || this.v != null) v.propT + if (v != null || this.v != null) v.propAny + if (v != null || this.v != null) v.propNullableT + if (v != null || this.v != null) v.propNullableAny + if (v != null || this.v != null) v.funT() + if (v != null || this.v != null) v.funAny() + if (v != null || this.v != null) v.funNullableT() + if (v != null || this.v != null) v.funNullableAny() + if (v != null || this.v != null) v + if (v != null || this.v != null) this.v.equals(null) + if (v != null || this.v != null) this.v.propT + if (v != null || this.v != null) this.v.propAny + if (v != null || this.v != null) this.v.propNullableT + if (v != null || this.v != null) this.v.propNullableAny + if (v != null || this.v != null) this.v.funT() + if (v != null || this.v != null) this.v.funAny() + if (v != null || this.v != null) this.v.funNullableT() + if (v != null || this.v != null) this.v.funNullableAny() + if (v != null || this.v != null) this.v - w = if (null != null) 10 else null + w = if (null != null) 10 else null if (w != null) w.equals(null) if (w != null) w.propT if (w != null) w.propAny @@ -4017,34 +4017,34 @@ object Case32 { if (this.w != null) w.funNullableT() if (this.w != null) w.funNullableAny() if (this.w != null) w - if (w != null || this.w != null) w.equals(null) - if (w != null || this.w != null) w.propT - if (w != null || this.w != null) w.propAny - if (w != null || this.w != null) w.propNullableT - if (w != null || this.w != null) w.propNullableAny - if (w != null || this.w != null) w.funT() - if (w != null || this.w != null) w.funAny() - if (w != null || this.w != null) w.funNullableT() - if (w != null || this.w != null) w.funNullableAny() - if (w != null || this.w != null) w - if (w != null || this.w != null) this.w.equals(null) - if (w != null || this.w != null) this.w.propT - if (w != null || this.w != null) this.w.propAny - if (w != null || this.w != null) this.w.propNullableT - if (w != null || this.w != null) this.w.propNullableAny - if (w != null || this.w != null) this.w.funT() - if (w != null || this.w != null) this.w.funAny() - if (w != null || this.w != null) this.w.funNullableT() - if (w != null || this.w != null) this.w.funNullableAny() - if (w != null || this.w != null) this.w + if (w != null || this.w != null) w.equals(null) + if (w != null || this.w != null) w.propT + if (w != null || this.w != null) w.propAny + if (w != null || this.w != null) w.propNullableT + if (w != null || this.w != null) w.propNullableAny + if (w != null || this.w != null) w.funT() + if (w != null || this.w != null) w.funAny() + if (w != null || this.w != null) w.funNullableT() + if (w != null || this.w != null) w.funNullableAny() + if (w != null || this.w != null) w + if (w != null || this.w != null) this.w.equals(null) + if (w != null || this.w != null) this.w.propT + if (w != null || this.w != null) this.w.propAny + if (w != null || this.w != null) this.w.propNullableT + if (w != null || this.w != null) this.w.propNullableAny + if (w != null || this.w != null) this.w.funT() + if (w != null || this.w != null) this.w.funAny() + if (w != null || this.w != null) this.w.funNullableT() + if (w != null || this.w != null) this.w.funNullableAny() + if (w != null || this.w != null) this.w s = null s.hashCode() s - if (s != null) s - if (this.s != null) s - if (s != null || this.s != null) s - if (s != null || this.s != null) this.s + if (s != null) s + if (this.s != null) s + if (s != null || this.s != null) s + if (s != null || this.s != null) this.s } fun test() { diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/11.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/11.fir.kt index 3fd9b27234c..22a2bf323b7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/11.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/11.fir.kt @@ -183,7 +183,7 @@ fun case_6(a: Interface1?, b: Interface2, d: Boolean) { x.apply { this as Interface3 this - if (this != null) { + if (this != null) { this this.equals(null) this.propT @@ -201,7 +201,7 @@ fun case_6(a: Interface1?, b: Interface2, d: Boolean) { x.let { it as Interface3 it - if (it != null) { + if (it != null) { it it.equals(null) it.propT diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt index cc3ba8d4e52..25108cfa8ce 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/12.fir.kt @@ -87,7 +87,7 @@ fun T?.case_4() { // TESTCASE NUMBER: 5 fun T?.case_5() { if (this is Interface1) { - if (this != null) { + if (this != null) { this this.equals(null) this.propT @@ -319,7 +319,7 @@ fun T.case_8() { // TESTCASE NUMBER: 9 fun T.case_9() { - if (this != null) { + if (this != null) { this this.equals(null) this.propT @@ -566,7 +566,7 @@ fun T.case_12() where T : Number?, T: Interface1? { * ISSUES: KT-28785 */ fun T.case_13() where T : Out<*>?, T: Comparable { - if (this != null) { + if (this != null) { this this.equals(null) this.propT @@ -3493,7 +3493,7 @@ fun T.case_56() where T : Number?, T: Interface1? { * ISSUES: KT-28785 */ fun T.case_57() where T : Out<*>?, T: Comparable { - if (this != null) { + if (this != null) { this this.equals(null) this.propT @@ -3798,7 +3798,7 @@ fun T.case_61() where T : InterfaceWithTypeParameter1?, T: Case61_3?, // TESTCASE NUMBER: 62 fun Nothing?.case_62() { - if (this != null) { + if (this != null) { this this.hashCode() @@ -3817,7 +3817,7 @@ fun Nothing?.case_62() { // TESTCASE NUMBER: 63 fun Nothing.case_63() { - if (this != null) { + if (this != null) { this this.hashCode() diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt index 4060ccbd849..c4e0920306c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/13.fir.kt @@ -107,7 +107,7 @@ fun case_4(x: T?) { // TESTCASE NUMBER: 5 fun case_5(x: T?) { if (x is Interface1) { - if (x != null) { + if (x != null) { x x.equals(null) x.propT @@ -387,7 +387,7 @@ fun case_8(x: T) { // TESTCASE NUMBER: 9 fun case_9(x: T) { - if (x != null) { + if (x != null) { x x.equals(null) x.propT @@ -682,7 +682,7 @@ fun case_12(x: T) where T : Number?, T: Interface1? { * ISSUES: KT-28785 */ fun case_13(x: T) where T : Out<*>?, T: Comparable { - if (x != null) { + if (x != null) { x x.equals(null) x.propT @@ -3986,7 +3986,7 @@ fun case_56(x: T) where T : Number?, T: Interface1? { * ISSUES: KT-28785 */ fun case_57(x: T) where T : Out<*>?, T: Comparable { - if (x != null) { + if (x != null) { x x.equals(null) x.propT diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/14.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/14.fir.kt index dfaf1aefbae..d3d0b076ab6 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/14.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/14.fir.kt @@ -4,7 +4,7 @@ // TESTCASE NUMBER: 1 fun case_1(vararg x: Int?) { - if (x != null) { + if (x != null) { ")!>x x[0] } @@ -29,7 +29,7 @@ fun case_2(vararg x: Int?) { // TESTCASE NUMBER: 3 fun case_3(vararg x: T?) { - if (x != null) { + if (x != null) { ")!>x x[0] } 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 22df4206a0d..f6170130cc3 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 @@ -26,7 +26,7 @@ fun case_2(x: Unit?) { // TESTCASE NUMBER: 3 fun case_3(x: Nothing?) { - if (x != null) else return + if (x != null) else return x x.hashCode() } @@ -358,7 +358,7 @@ fun case_26(x: Unit?, y: List<*>) { // TESTCASE NUMBER: 27 fun case_27(x: Nothing?) = (l@ { - if (x != null) else return@l + if (x != null) else return@l x x.hashCode() })() 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 c95a4d6dad6..f77c84d4ce1 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 @@ -26,7 +26,7 @@ fun case_2(x: Unit?) { // TESTCASE NUMBER: 3 fun case_3(x: Nothing?) { - if (x != null) else throw Exception() + if (x != null) else throw Exception() x } 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 4b2cdeb9831..16618bcf374 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 @@ -31,7 +31,7 @@ fun case_2(x: Unit?) { // TESTCASE NUMBER: 3 fun case_3(x: Nothing?, f: Boolean) { do { - if (x != null) else break + if (x != null) else break x.hashCode() } while (f) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt index 69a3d64e304..638694972bf 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt @@ -181,21 +181,21 @@ fun case_8(b: Boolean, c: Boolean?) { val a = Case8_16__2() if (a.x !== null && false) { - if (false || false || false || false || a.x != null || false || false || false) { - if (a.x !== null && true) { - if (a.x != null && b) { - if (a.x != null && b && !b) { - if (a.x != null && c != null && !c) { - if (a.x !== null && c) { - if (a.x != null && b && b && b && b && b && b && b && b && b && b && b) { - if (a.x != null && !b && !b && !b && !b && !b && !b && !b && !b && !b) { - if (a.x !== null && null == null) { - if (a.x != null && null!!) { - if (a.x != null) { - if (a.x != null) { - if (a.x !== null) { - if (a.x != null) { - if (a.x !== null) { + if (false || false || false || false || a.x != null || false || false || false) { + if (a.x !== null && true) { + if (a.x != null && b) { + if (a.x != null && b && !b) { + if (a.x != null && c != null && !c) { + if (a.x !== null && c) { + if (a.x != null && b && b && b && b && b && b && b && b && b && b && b) { + if (a.x != null && !b && !b && !b && !b && !b && !b && !b && !b && !b) { + if (a.x !== null && null == null) { + if (a.x != null && null!!) { + if (a.x != null) { + if (a.x != null) { + if (a.x !== null) { + if (a.x != null) { + if (a.x !== null) { a.x a.x.equals(null) a.x.propT @@ -408,35 +408,35 @@ fun case_16(b: Boolean, c: Boolean?) { val a = Case8_16__2() if (a.x != null && false && false && false && false && false && false) { - if ( a.x == null || false) { + if ( a.x == null || false) { } else { - if ( a.x === null && true) { + if ( a.x === null && true) { } else { - if (a.x == null || !b) { + if (a.x == null || !b) { } else { - if (a.x == null || b || !b) { + if (a.x == null || b || !b) { } else { - if (a.x == null || c == null || !c) { + if (a.x == null || c == null || !c) { } else { - if (a.x === null || c) { + if (a.x === null || c) { } else { - if (a.x == null || b || b || b || b || b || b || b || b || b || b || b) { + if (a.x == null || b || b || b || b || b || b || b || b || b || b || b) { } else { - if (a.x == null || !b || !b || !b || !b || !b || !b || !b || !b || !b) { + if (a.x == null || !b || !b || !b || !b || !b || !b || !b || !b || !b) { } else { - if (a.x === null || null == null) { + if (a.x === null || null == null) { } else { - if (a.x == null || null!!) { + if (a.x == null || null!!) { } else { - if (a.x == null) { + if (a.x == null) { } else { - if (a.x == null) { + if (a.x == null) { } else { - if (a.x === null) { + if (a.x === null) { } else { - if (a.x == null) { + if (a.x == null) { } else { - if (a.x === null) { + if (a.x === null) { } else { a.x a.x.equals(null) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/3.fir.kt index 6e7bf0fdb0e..5e34fbdb736 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/3.fir.kt @@ -22,7 +22,7 @@ fun case_1(x: Any?) { // TESTCASE NUMBER: 2 fun case_2(x: Nothing?) { - if (x == null) { + if (x == null) { x } } @@ -60,14 +60,14 @@ fun case_6(x: EmptyClass?) { // TESTCASE NUMBER: 7 fun case_7() { - if (nullableStringProperty == null || nullableStringProperty == null) { + if (nullableStringProperty == null || nullableStringProperty == null) { nullableStringProperty } } // TESTCASE NUMBER: 8 fun case_8(x: TypealiasNullableString) { - if (x == null && x == null) + if (x == null && x == null) x } @@ -102,9 +102,9 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) { if (x != null) { } else { - if (y == null) { + if (y == null) { if (nullableStringProperty != null) { - if (z == null) { + if (z == null) { x } } @@ -113,8 +113,8 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) { } // TESTCASE NUMBER: 12 -fun case_12(x: TypealiasNullableString, y: TypealiasNullableString) = if (x != null && true && true && true) "1" - else if (y != null) x +fun case_12(x: TypealiasNullableString, y: TypealiasNullableString) = if (x != null && true && true && true) "1" + else if (y != null) x else "-1" // TESTCASE NUMBER: 13 @@ -135,21 +135,21 @@ fun case_14() { val a = Case14() if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { a.x } } @@ -171,7 +171,7 @@ fun case_14() { // TESTCASE NUMBER: 15 fun case_15(x: TypealiasNullableString) { - val t = if (x != null) "" else { + val t = if (x != null) "" else { x } } @@ -180,7 +180,7 @@ fun case_15(x: TypealiasNullableString) { fun case_16() { val x: TypealiasNullableNothing = null - if (x == null || false || false || false) { + if (x == null || false || false || false) { x } } @@ -258,7 +258,7 @@ fun case_23(a: ((Float) -> Int?)?, b: Float?) { if (a == null && b == null) { ? & kotlin.Nothing?")!>a b - if (a != null) { + if (a != null) { ? & kotlin.Nothing")!>a } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt index 51af182ea16..e47c015aded 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/37.fir.kt @@ -96,7 +96,7 @@ fun case_8(x: Boolean?) { // TESTCASE NUMBER: 9 fun case_9(x: Boolean?) { while (x ?: return) - while (x == null) + while (x == null) x x.equals(10) @@ -200,7 +200,7 @@ fun case_17(x: Boolean?, y: Boolean?) { else -> if (true) if (true) if (true) if (true) if (true) x!! else x!! else x!! else x!! else x!! else x!! } false -> x!! - null -> if (true) if (true) if (true) if (true) if (true) x!! else x!! else x!! else x!! else x!! else x!! + null -> if (true) if (true) if (true) if (true) if (true) x!! else x!! else x!! else x!! else x!! else x!! } else x!! else x!! else x!! else x!! else x!! } break@loop diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/4.fir.kt index f515a60d163..fc0d4f33733 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/4.fir.kt @@ -18,21 +18,21 @@ import otherpackage.* // TESTCASE NUMBER: 1 fun case_1(x: Any) { - if (x === null) { + if (x === null) { x } } // TESTCASE NUMBER: 2 fun case_2(x: Nothing) { - if (x == null) { + if (x == null) { x } } // TESTCASE NUMBER: 3 fun case_3() { - if (Object.prop_2 != null) + if (Object.prop_2 != null) else { Object.prop_2 } @@ -40,7 +40,7 @@ fun case_3() { // TESTCASE NUMBER: 4 fun case_4(x: Char) { - if (x == null && true) { + if (x == null && true) { x } } @@ -49,33 +49,33 @@ fun case_4(x: Char) { fun case_5() { val x: Unit = kotlin.Unit - if (x == null) x + if (x == null) x } // TESTCASE NUMBER: 6 fun case_6(x: EmptyClass) { val y = true - if (x == null && !y) { + if (x == null && !y) { x } } // TESTCASE NUMBER: 7 fun case_7() { - if (anonymousTypeProperty == null || anonymousTypeProperty == null) { + if (anonymousTypeProperty == null || anonymousTypeProperty == null) { anonymousTypeProperty } } // TESTCASE NUMBER: 8 fun case_8(x: TypealiasString) { - if (x == null && x == null) x + if (x == null && x == null) x } // TESTCASE NUMBER: 9 fun case_9(x: TypealiasString) { - if (x != null) { + if (x != null) { } else if (false) { x @@ -86,8 +86,8 @@ fun case_9(x: TypealiasString) { fun case_10() { val a = Class() - if (a.prop_5 != null || true) { - if (a.prop_5 == null) { + if (a.prop_5 != null || true) { + if (a.prop_5 == null) { a.prop_5 } } @@ -97,12 +97,12 @@ fun case_10() { fun case_11(x: TypealiasString, y: TypealiasString) { val z: TypealiasString = TypealiasString() - if (x != null) { + if (x != null) { } else { - if (y == null) { - if (stringProperty != null) { - if (false || false || false || z == null || false) { + if (y == null) { + if (stringProperty != null) { + if (false || false || false || z == null || false) { x } } @@ -111,13 +111,13 @@ fun case_11(x: TypealiasString, y: TypealiasString) { } // TESTCASE NUMBER: 12 -fun case_12(x: TypealiasString, y: TypealiasString) = if (x != null) "1" - else if (y !== null) x +fun case_12(x: TypealiasString, y: TypealiasString) = if (x != null) "1" + else if (y !== null) x else "-1" // TESTCASE NUMBER: 13 fun case_13(x: otherpackage.EmptyClass13) = - if (x != null) { + if (x != null) { 1 } else x @@ -132,22 +132,22 @@ class A14 { fun case_14() { val a = A14() - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x === null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x === null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x == null) { - if (a.x === null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x === null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x === null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x == null) { + if (a.x === null) { a.x } } @@ -169,7 +169,7 @@ fun case_14() { // TESTCASE NUMBER: 15 fun case_15(x: TypealiasString) { - val t = if (true && x != null) "" else { + val t = if (true && x != null) "" else { x } } @@ -178,7 +178,7 @@ fun case_15(x: TypealiasString) { fun case_16() { val x: TypealiasNothing = return - if (x == null) { + if (x == null) { x } } @@ -188,13 +188,13 @@ fun case_16() { * UNEXPECTED BEHAVIOUR * ISSUES: KT-28329 */ -val case_17 = if (true && true && intProperty != null) 0 else { +val case_17 = if (true && true && intProperty != null) 0 else { intProperty } //TESTCASE NUMBER: 18 fun case_18(a: DeepObject.A.B.C.D.E.F.G.J) { - if (a == null) { + if (a == null) { a } } @@ -219,7 +219,7 @@ fun case_19(b: Boolean) { } } else null - if (a != null && a.B19 != null && a.B19.C19 != null && a.B19.C19.D19 != null && a.B19.C19.D19.x == null) { + if (a != null && a.B19 != null && a.B19.C19 != null && a.B19.C19.D19 != null && a.B19.C19.D19.x == null) { a.B19.C19.D19.x } } @@ -234,30 +234,30 @@ fun case_20() { } } - if (a.B19.C19.D19 === null) { + if (a.B19.C19.D19 === null) { a.B19.C19.D19 } } // TESTCASE NUMBER: 21 fun case_21() { - if (EnumClassWithProperty.B.prop_1 == null || false || false || false || false || false || false || false) { + if (EnumClassWithProperty.B.prop_1 == null || false || false || false || false || false || false || false) { EnumClassWithProperty.B.prop_1 } } // TESTCASE NUMBER: 22 fun case_22(a: (() -> Unit)) { - if (a == null) { + if (a == null) { a() } } // TESTCASE NUMBER: 23 fun case_23(a: ((Float) -> Int), b: Float) { - if (a == null && b == null) { + if (a == null && b == null) { val x = a(b) - if (x !== null) { + if (x !== null) { x } } @@ -269,20 +269,20 @@ fun case_23(a: ((Float) -> Int), b: Float) { * ISSUES: KT-28329 */ fun case_24(a: ((() -> Unit) -> Unit), b: (() -> Unit)) { - if (false || false || a == null && b === null) { + if (false || false || a == null && b === null) { , kotlin.Unit>")!>a ")!>b } } // TESTCASE NUMBER: 25 -fun case_25(a: (() -> Unit) -> Unit, b: (() -> Unit) -> Unit = if (a == null) , kotlin.Unit> & kotlin.Nothing")!>a else {{}}) { +fun case_25(a: (() -> Unit) -> Unit, b: (() -> Unit) -> Unit = if (a == null) , kotlin.Unit> & kotlin.Nothing")!>a else {{}}) { , kotlin.Unit>")!>a , kotlin.Unit>")!>b } // TESTCASE NUMBER: 26 -fun case_26(a: Int, b: Int = if (a === null) a else 0) { +fun case_26(a: Int, b: Int = if (a === null) a else 0) { a b } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/45.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/45.fir.kt index eddc8c93038..c57431be0c7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/45.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/45.fir.kt @@ -65,7 +65,7 @@ fun case_5() { val x: Int? val y: Int? x = 10;y = x - if (y != null) { + if (y != null) { x x.inv() } @@ -76,7 +76,7 @@ fun case_6() { var x: Int? val y: Int? x = 10;y = x - if (y != null) { + if (y != null) { x x.inv() } @@ -87,7 +87,7 @@ fun case_7() { val x: Int? var y: Int? x = 10;y = x - if (y != null) { + if (y != null) { x x.inv() } @@ -98,7 +98,7 @@ fun case_8() { var x: Int? var y: Int? x = 10;y = x - if (y != null) { + if (y != null) { x x.inv() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/53.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/53.fir.kt index be7ca52ba40..084beb278d0 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/53.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/53.fir.kt @@ -19,7 +19,7 @@ fun case_2(x: Int?) = 10 fun case_2() { var x: Int? = 10 var y = { x = null } - if (x != null) { + if (x != null) { val z = case_2(x) z } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt index 376a7a7f3f8..45cc13364ce 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/59.fir.kt @@ -13,7 +13,7 @@ fun case_1() { do { x x = x.equals(10) - } while (x != null) + } while (x != null) } /* @@ -27,7 +27,7 @@ fun case_2() { do { x x = x.equals(10) - } while (x !== null) + } while (x !== null) } // TESTCASE NUMBER: 3 @@ -59,7 +59,7 @@ fun case_5() { do { x x = x.equals(10) - } while (x !== null) + } while (x !== null) } /* @@ -73,7 +73,7 @@ fun case_6() { do { x x = x.equals(10) - } while (x != null) + } while (x != null) } /* @@ -87,7 +87,7 @@ fun case_7() { do { x x = x.equals(10) - } while (x !== null) + } while (x !== null) } /* @@ -101,7 +101,7 @@ fun case_8() { do { x x = x.equals(10) - } while (x != null) + } while (x != null) } /* @@ -115,7 +115,7 @@ fun case_9() { do { x x = x.equals(10) - } while (x !== null) + } while (x !== null) } /* @@ -129,7 +129,7 @@ fun case_10() { do { x x = x.equals(10) - } while (x != null) + } while (x != null) } /* @@ -143,7 +143,7 @@ fun case_11() { do { x x = x.equals(10) - } while (x != null) + } while (x != null) } /* @@ -157,7 +157,7 @@ fun case_12() { do { x x = x .equals(10) - } while (x != null) + } while (x != null) } } @@ -172,7 +172,7 @@ fun case_13() { do { x x = x .equals(10) - } while (x != null) + } while (x != null) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt index 8ee66a5381c..79c6bd0f599 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/6.fir.kt @@ -281,7 +281,7 @@ fun case_14() { // TESTCASE NUMBER: 15 fun case_15(x: TypealiasNullableString) { val y = null - val z = if (x === null || y == x && x === y || null === x) "" else { + val z = if (x === null || y == x && x === y || null === x) "" else { x x.equals(null) x.propT diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/60.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/60.fir.kt index 4c0608a642a..b63b8fe9fc8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/60.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/60.fir.kt @@ -9,7 +9,7 @@ fun case_1() { outer@ while (x != null) { inner@ do { x = null - } while (x == null) + } while (x == null) x x.length } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/62.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/62.fir.kt index d7b4737b9b5..83e7fad9b45 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/62.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/62.fir.kt @@ -34,7 +34,7 @@ fun case_2(x: Any) { val y = when(x) { true -> "true" false -> "false" - null -> "false" + null -> "false" } } @@ -98,7 +98,7 @@ fun case_7(x: Any) { val y = when(x) { true -> "true" false -> "false" - null -> "false" + null -> "false" } } } @@ -155,7 +155,7 @@ fun case_10(x: Any): String { fun case_11(x: Any?): String? { if (x is Nothing?) { return when(x) { - null -> null + null -> null } } return "" @@ -169,7 +169,7 @@ fun case_11(x: Any?): String? { fun case_12(x: Any?): String? { if (x == null) { return when(x) { - null -> null + null -> null } } return "" @@ -183,7 +183,7 @@ fun case_12(x: Any?): String? { fun case_13(x: Any?): String? { if (x === null) { return when(x) { - null -> null + null -> null } } return "" @@ -197,7 +197,7 @@ fun case_13(x: Any?): String? { fun case_14(x: Any?): String? { x as Nothing? return when(x) { - null -> null + null -> null } } @@ -220,7 +220,7 @@ fun case_16(x: Any) { EnumClass.SOUTH -> 2 EnumClass.WEST -> 3 EnumClass.EAST -> 4 - null -> 5 + null -> 5 } } } @@ -256,7 +256,7 @@ fun case_19(x: Any): Int { EnumClass.SOUTH -> 2 EnumClass.WEST -> 3 EnumClass.EAST -> 4 - null -> 5 + null -> 5 } } return 0 @@ -323,7 +323,7 @@ fun case_25(x: Any) { is SealedChild1 -> 1 is SealedChild2 -> 2 is SealedChild3 -> 3 - null -> 5 + null -> 5 } } } @@ -356,7 +356,7 @@ fun case_28(x: Any): Int { is SealedChild1 -> 1 is SealedChild2 -> 2 is SealedChild3 -> 3 - null -> 5 + null -> 5 } } return 0 @@ -401,7 +401,7 @@ fun case_32(x: Any) { SealedWithObjectsChild1 -> 1 SealedWithObjectsChild2 -> 2 SealedWithObjectsChild3 -> 3 - null -> 5 + null -> 5 } } } @@ -434,7 +434,7 @@ fun case_35(x: Any): Int { SealedWithObjectsChild1 -> 1 SealedWithObjectsChild2 -> 2 SealedWithObjectsChild3 -> 3 - null -> 5 + null -> 5 } } return 0 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt index f04e9a1c6da..7f5871e7419 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt @@ -18,7 +18,7 @@ import orherpackage.* // TESTCASE NUMBER: 1 fun case_1(x: Any?) { - if (x != null || x != null || x != null || x != null || x != null || x != null || x != null) { + if (x != null || x != null || x != null || x != null || x != null || x != null || x != null) { x x.equals(null) x.propT @@ -38,14 +38,14 @@ fun case_1(x: Any?) { * ISSUES: KT-28159 */ fun case_2(x: Nothing?) { - if (x !== null && x !== null) { + if (x !== null && x !== null) { x } } // TESTCASE NUMBER: 3 fun case_3() { - if (Object.prop_1 == null && Object.prop_1 == null) + if (Object.prop_1 == null && Object.prop_1 == null) else { Object.prop_1 Object.prop_1.equals(null) @@ -80,7 +80,7 @@ fun case_4(x: Char?) { fun case_5() { val x: Unit? = null - if (x !== null || x !== null && x !== null || x !== null && x !== null) { + if (x !== null || x !== null && x !== null || x !== null && x !== null) { x x.equals(null) x.propT @@ -115,7 +115,7 @@ fun case_6(x: Class?) { // TESTCASE NUMBER: 7 fun case_7() { val x: EmptyObject? = null - if (x != null || x != null || x != null) { + if (x != null || x != null || x != null) { x x.equals(null) x.propT @@ -131,7 +131,7 @@ fun case_7() { // TESTCASE NUMBER: 8 fun case_8(x: TypealiasString) { - if (x !== null && x != null) { + if (x !== null && x != null) { x x.equals(null) x.propT @@ -147,9 +147,9 @@ fun case_8(x: TypealiasString) { // TESTCASE NUMBER: 9 fun case_9(x: TypealiasNullableString?) { - if (x === null && x === null || x === null) { + if (x === null && x === null || x === null) { - } else if (x === null || x === null) { + } else if (x === null || x === null) { } else if (false) { x x.equals(null) @@ -168,7 +168,7 @@ fun case_9(x: TypealiasNullableString?) { fun case_10() { val a = Class() - if (a.prop_4 === null || a.prop_4 === null || true) { + if (a.prop_4 === null || a.prop_4 === null || true) { if (a.prop_4 != null) { a.prop_4 a.prop_4.equals(null) @@ -191,10 +191,10 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) { if (x == null) { } else { - if (x != null) { - if (y != null || y != null) { - if (stringProperty == null && nullableNothingProperty == null) { - if (t != null || t != null) { + if (x != null) { + if (y != null || y != null) { + if (stringProperty == null && nullableNothingProperty == null) { + if (t != null || t != null) { x x.equals(null) x.propT @@ -213,8 +213,8 @@ fun case_11(x: TypealiasNullableString?, y: TypealiasNullableString) { } // TESTCASE NUMBER: 12 -fun case_12(x: TypealiasNullableString, y: TypealiasNullableString) = if (x == null) "1" - else if (y === null || y === null) { +fun case_12(x: TypealiasNullableString, y: TypealiasNullableString) = if (x == null) "1" + else if (y === null || y === null) { x.equals(null) x.propT x.propAny diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/8.fir.kt index de86f6b1798..625861fb5f1 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/8.fir.kt @@ -56,7 +56,7 @@ fun case_2(a: Inv?>?>?>?>?>?) { fun case_3(a: Inv?) { if (a != null) { val b = a - if (a == null) { + if (a == null) { ? & kotlin.Nothing")!>b ? & kotlin.Nothing")!>b.equals(null) ? & kotlin.Nothing")!>b.propT diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/9.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/9.fir.kt index 9457f5ceffd..7d65c8c7040 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/9.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/9.fir.kt @@ -60,7 +60,7 @@ fun case_2(a: Out<out Out<out fun case_3(a: Inv?) { if (a != null) { val b = a - if (a == null) + if (a == null) ? & kotlin.Nothing")!>b ? & Inv")!>b.equals(null) ? & Inv")!>b.propT @@ -438,7 +438,7 @@ fun case_18(a: Inv) { * ISSUES: KT-28785 */ fun case_19(a: Inv) { - if (a.x != null) { + if (a.x != null) { a.x a.x.hashCode() } @@ -490,7 +490,7 @@ fun case_21(a: Out<out Int?>) { * ISSUES: KT-28785 */ fun case_22(a: Out<out Nothing?>) { - if (a.x != null) { + if (a.x != null) { a.x a.x.hashCode() } @@ -534,7 +534,7 @@ fun case_24(a: Out) { // TESTCASE NUMBER: 25 fun case_25(a: Out) { - if (a.x != null) { + if (a.x != null) { a.x a.x.hashCode() } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.fir.kt index 1fe86679d4d..56afa538d70 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/1.fir.kt @@ -13,7 +13,7 @@ open class Foo(val prop: Int) { } fun box(): String? { - if (Foo(42) == null) return null + if (Foo(42) == null) return null return "OK" } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.fir.kt index 0be19b01ed4..fc2860f38f3 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/2.fir.kt @@ -13,7 +13,7 @@ open class Foo(val prop: Int) { } fun box(): String? { - if (Foo(42) == null) return null + if (Foo(42) == null) return null return "OK" } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.fir.kt index 09a8c23e326..ba9ebc2f0b3 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/3.fir.kt @@ -13,7 +13,7 @@ open class Foo(val prop: Int) { } fun box(): String? { - if (Foo.MyObject == null) return null + if (Foo.MyObject == null) return null return "OK" } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.fir.kt index e52c3776eef..82bb5b9b170 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/4.fir.kt @@ -13,7 +13,7 @@ open class Foo(val prop: Int) { } fun box(): String? { - if (Foo(42) == null) return null + if (Foo(42) == null) return null return "OK" } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.fir.kt index e303c89ce00..a48c44cc636 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/5.fir.kt @@ -13,7 +13,7 @@ open class Foo(val prop: Int) { } fun box(): String? { - if (Foo(42) == null) return null + if (Foo(42) == null) return null return "OK" } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.fir.kt index 456d1f5f74f..5b0cf1d2f4a 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/6.fir.kt @@ -13,7 +13,7 @@ open class Foo(val prop: Int) { } fun box(): String? { - if (Foo(42) == null) return null + if (Foo(42) == null) return null return "OK" } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.fir.kt index 36195c7bd28..74d71b13bb3 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/objects/inheritance/neg/7.fir.kt @@ -13,7 +13,7 @@ open class Foo(val prop: Int) { } fun box(): String? { - if (Foo.MyObject == null) return null + if (Foo.MyObject == null) return null return "OK" } diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt index 6570fba07cf..cb7161415a4 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDataClassConverters.kt @@ -2608,6 +2608,20 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } + add(FirErrors.SENSELESS_COMPARISON) { firDiagnostic -> + SenselessComparisonImpl( + firDiagnostic.a.source!!.psi as KtExpression, + firDiagnostic.b, + firDiagnostic as FirPsiDiagnostic, + token, + ) + } + add(FirErrors.SENSELESS_NULL_IN_WHEN) { firDiagnostic -> + SenselessNullInWhenImpl( + firDiagnostic as FirPsiDiagnostic, + token, + ) + } add(FirErrors.UNSAFE_CALL) { firDiagnostic -> UnsafeCallImpl( firSymbolBuilder.typeBuilder.buildKtType(firDiagnostic.a), diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt index cf66e699d04..4747ce5a85e 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnostics.kt @@ -1825,6 +1825,16 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { abstract val unreachable: List } + abstract class SenselessComparison : KtFirDiagnostic() { + override val diagnosticClass get() = SenselessComparison::class + abstract val expression: KtExpression + abstract val compareResult: Boolean + } + + abstract class SenselessNullInWhen : KtFirDiagnostic() { + override val diagnosticClass get() = SenselessNullInWhen::class + } + abstract class UnsafeCall : KtFirDiagnostic() { override val diagnosticClass get() = UnsafeCall::class abstract val receiverType: KtType diff --git a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt index 0a541155204..eebb58af85f 100644 --- a/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt +++ b/idea/idea-frontend-fir/src/org/jetbrains/kotlin/idea/frontend/api/fir/diagnostics/KtFirDiagnosticsImpl.kt @@ -2939,6 +2939,22 @@ internal class UnreachableCodeImpl( override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) } +internal class SenselessComparisonImpl( + override val expression: KtExpression, + override val compareResult: Boolean, + firDiagnostic: FirPsiDiagnostic, + override val token: ValidityToken, +) : KtFirDiagnostic.SenselessComparison(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) +} + +internal class SenselessNullInWhenImpl( + firDiagnostic: FirPsiDiagnostic, + override val token: ValidityToken, +) : KtFirDiagnostic.SenselessNullInWhen(), KtAbstractFirDiagnostic { + override val firDiagnostic: FirPsiDiagnostic by weakRef(firDiagnostic) +} + internal class UnsafeCallImpl( override val receiverType: KtType, override val receiverExpression: KtExpression?,