From f0ff9ad5a7b536467b99414a2e02f38f2b3a63dd Mon Sep 17 00:00:00 2001 From: Mikhail Glukhikh Date: Fri, 2 Apr 2021 11:51:36 +0300 Subject: [PATCH] FIR: rename AMBIGUITY to OVERLOAD_RESOLUTION_AMBIGUITY to match FE 1.0 --- .../resolve/arrays/arraySetWithOperation.kt | 2 +- .../resolve/callResolution/errorCandidates.kt | 2 +- .../resolve/delegatingConstructorCall.kt | 2 +- .../properties/javaAccessorConversion.kt | 2 +- .../callableReferences/companions.kt | 2 +- .../callableReferences/javaStatic.kt | 2 +- .../manyInnermanyOuterCandidatesAmbiguity.kt | 2 +- .../diagnostics/FirDiagnosticsList.kt | 2 +- .../fir/analysis/diagnostics/FirErrors.kt | 2 +- .../diagnostics/FirDefaultErrorMessages.kt | 4 +- .../coneDiagnosticToFirDiagnostic.kt | 2 +- ...guityForSimpleLastExpressionOfBlock.fir.kt | 25 -- ...AmbiguityForSimpleLastExpressionOfBlock.kt | 1 + .../resolve/withPlaceholderTypes.fir.kt | 4 +- .../IfThenElseBothInvalid.fir.kt | 4 +- .../inference/manyIncompleteCandidates.fir.kt | 2 +- .../LabeledFunctionLiterals.fir.kt | 2 +- .../tests/imports/RenameOnImport.fir.kt | 2 +- .../incompleteCode/unresolvedArguments.fir.kt | 4 +- .../cannotCompleteResolveAmbiguity.fir.kt | 2 +- ...ompleteResolveFunctionLiteralsNoUse.fir.kt | 2 +- ...otCompleteResolveNoInfoForParameter.fir.kt | 2 +- ...CompleteResolveWithFunctionLiterals.fir.kt | 2 +- ...rsectionTypesWithContravariantTypes.fir.kt | 2 +- .../recursiveLocalFuns/selfCall.fir.kt | 2 +- .../tests/j+k/ambiguousSamAdapters.fir.kt | 17 - .../tests/j+k/ambiguousSamAdapters.kt | 1 + .../j+k/brokenCode/fieldDuplicates.fir.kt | 2 +- .../collectionStringImpl.fir.kt | 2 +- .../containsAndOverload.fir.kt | 4 +- .../overridesBuiltinNoMagic.fir.kt | 6 +- .../collectionOverrides/removeAtInt.fir.kt | 2 +- .../tests/j+k/fieldOverridesNothing.fir.kt | 2 +- .../primitiveOverrides/specializedMap.fir.kt | 4 +- .../properties/fieldPropertyOverloads.fir.kt | 4 +- .../fieldPropertyOverloadsDisabled.fir.kt | 4 +- .../fieldPropertyOverloadsNI.fir.kt | 4 +- .../staticFieldPropertyOverloads.fir.kt | 16 - .../staticFieldPropertyOverloads.kt | 1 + .../tests/j+k/selectMoreSpecific.fir.kt | 4 +- .../classGenericsInParamsIndexMismatch.fir.kt | 2 +- ...sVsFunctionGenericsInParamsMismatch.fir.kt | 4 +- .../differentGenericsInParams.fir.kt | 43 --- .../differentGenericsInParams.kt | 1 + .../duplicateMethod/sinceKotlin.fir.kt | 2 +- .../funcLiteralArgsInsideAmbiguity.fir.kt | 2 +- .../IteratorAmbiguity.fir.kt | 4 +- .../plusAssignOnArray.fir.kt | 2 +- .../overload/EmptyArgumentListInLambda.fir.kt | 2 +- .../tests/overload/defaultParameters.fir.kt | 2 +- ...ambiguateByFailedAbstractClassCheck.fir.kt | 34 -- .../disambiguateByFailedAbstractClassCheck.kt | 1 + .../diagnostics/tests/overload/kt2493.fir.kt | 2 +- .../tests/recovery/absentLeftHandSide.fir.kt | 2 +- .../tests/regressions/kt26303.fir.kt | 2 +- .../tests/regressions/kt30245.fir.kt | 6 +- ...yOnPropertiesWithTheSamePackageName.fir.kt | 30 -- ...guityOnPropertiesWithTheSamePackageName.kt | 1 + ...tyWithTwoCorrespondingFunctionTypes.fir.kt | 11 - ...iguityWithTwoCorrespondingFunctionTypes.kt | 1 + .../invoke/errors/ambiguityForInvoke.fir.kt | 4 +- .../overloadConflicts/genericClash.fir.kt | 6 +- .../resolve/overloadConflicts/kt31670.fir.kt | 2 +- .../overloadConflicts/kt31670_compat.fir.kt | 2 +- .../resolve/overloadConflicts/kt31758.fir.kt | 2 +- .../overloadConflicts/kt31758_compat.fir.kt | 2 +- .../resolve/overloadConflicts/kt37692.fir.kt | 2 +- .../overloadConflicts/withVariance.fir.kt | 2 +- .../samConversions/OverloadPriority.fir.kt | 4 +- .../samConversions/OverloadPriorityKT.fir.kt | 4 +- .../scopes/AmbiguousNonExtensions.fir.kt | 18 -- .../tests/scopes/AmbiguousNonExtensions.kt | 1 + .../inheritance/statics/nameClash0.fir.kt | 32 -- .../scopes/inheritance/statics/nameClash0.kt | 1 + .../inheritance/statics/nameClash1.fir.kt | 32 -- .../scopes/inheritance/statics/nameClash1.kt | 1 + .../inheritance/statics/nameClash2.fir.kt | 66 ---- .../scopes/inheritance/statics/nameClash2.kt | 1 + .../innerInstanceCreation.fir.kt | 4 +- .../headerCallChecker/memberFunAccess.fir.kt | 4 +- .../headerCallChecker/propertyAccess.fir.kt | 4 +- .../propertyAccessUnitialized.fir.kt | 4 +- .../headerCallChecker/superFunAccess.fir.kt | 4 +- .../superFunAccessOverriden.fir.kt | 4 +- .../superPropertyAccess.fir.kt | 4 +- .../redeclarations.fir.kt | 12 +- ...rtcastToNothingAfterCheckingForNull.fir.kt | 4 +- ...nForOverloadResolutionWithAmbiguity.fir.kt | 2 +- ...overloadResolutionBySuspendModifier.fir.kt | 4 +- .../samAdapters/overloadResolution.fir.kt | 36 --- .../samAdapters/overloadResolution.kt | 1 + .../overloadResolutionStatic.fir.kt | 36 --- .../samAdapters/overloadResolutionStatic.kt | 1 + ...dResolutionStaticWithoutRefinedSams.fir.kt | 2 +- ...verloadResolutionWithoutRefinedSams.fir.kt | 2 +- .../MostSepcificVarargsWithJava.fir.kt | 19 -- .../varargs/MostSepcificVarargsWithJava.kt | 1 + .../diagnostics/tests/when/When.fir.kt | 2 +- .../functionVsSuspendFunction.fir.kt | 2 +- ...bdaReturnType_enabled_no_annotation.fir.kt | 10 +- .../resolve/samAgainstFunctionalType.fir.kt | 4 +- .../resolve/samOverloadsWithGenerics.fir.kt | 4 +- ...loadsWithGenericsWithoutRefinedSams.fir.kt | 4 +- .../resolve/samOverloadsWithKtFunction.fir.kt | 2 +- ...adsWithKtFunctionWithoutRefinedSams.fir.kt | 2 +- .../typeAliasSamAdapterConstructors2.fir.kt | 6 +- .../real-literals/p-4/neg/2.2.fir.kt | 8 +- .../real-literals/p-4/neg/2.3.fir.kt | 10 +- .../p-1/neg/2.3.fir.kt | 16 +- .../p-1/neg/2.4.fir.kt | 12 +- .../p-1/neg/2.5.fir.kt | 8 +- .../p-2/neg/1.1.fir.kt | 6 +- .../p-2/pos/1.1.fir.kt | 2 +- .../p-2/neg/1.1.fir.kt | 6 +- .../p-2/pos/1.1.fir.kt | 2 +- .../when-expression/p-6/neg/3.2.fir.kt | 6 +- .../p-5/neg/2.3.fir.kt | 2 +- .../p-5/neg/2.5.fir.kt | 2 +- .../p-5/neg/6.1.fir.kt | 8 +- .../p-5/neg/6.4.fir.kt | 293 ------------------ .../p-5/neg/6.4.kt | 1 + .../operator-call/p-1/neg/2.4.fir.kt | 8 +- .../operator-call/p-1/neg/2.5.fir.kt | 4 +- .../operator-call/p-1/neg/2.6.fir.kt | 4 +- .../operator-call/p-1/neg/2.7.fir.kt | 4 +- .../operator-call/p-1/neg/2.8.fir.kt | 10 +- .../p-14/neg/1.1.fir.kt | 14 +- .../p-14/neg/1.2.fir.kt | 2 +- .../p-14/neg/1.3.fir.kt | 4 +- .../p-14/neg/1.4.fir.kt | 2 +- .../p-14/neg/1.6.fir.kt | 2 +- .../p-14/neg/1.7.fir.kt | 2 +- .../p-17/neg/2.1.fir.kt | 18 +- .../p-17/neg/2.2.fir.kt | 18 +- .../p-9/neg/2.1.fir.kt | 2 +- .../p-9/neg/2.2.fir.kt | 8 +- .../p-9/neg/2.3.fir.kt | 2 +- .../rationale-1/p-3/neg/1.1.fir.kt | 2 +- .../p-3/neg/1.1.fir.kt | 6 +- .../statements/assignments/p-1/neg/2.1.fir.kt | 6 +- .../introduction-1/p-6/neg/2.2.fir.kt | 2 +- .../contracts/analysis/common/neg/1.fir.kt | 2 +- .../contracts/analysis/common/pos/1.fir.kt | 2 +- .../analysis/smartcasts/neg/1.fir.kt | 32 +- .../analysis/smartcasts/neg/10.fir.kt | 180 +++++------ .../analysis/smartcasts/neg/11.fir.kt | 2 +- .../analysis/smartcasts/neg/13.fir.kt | 2 +- .../analysis/smartcasts/neg/14.fir.kt | 2 +- .../analysis/smartcasts/neg/15.fir.kt | 4 +- .../analysis/smartcasts/neg/2.fir.kt | 72 ++--- .../analysis/smartcasts/neg/3.fir.kt | 50 +-- .../analysis/smartcasts/neg/4.fir.kt | 20 +- .../analysis/smartcasts/neg/5.fir.kt | 30 +- .../analysis/smartcasts/neg/6.fir.kt | 58 ++-- .../analysis/smartcasts/neg/8.fir.kt | 22 +- .../analysis/smartcasts/pos/2.fir.kt | 10 +- .../analysis/smartcasts/pos/3.fir.kt | 10 +- .../analysis/smartcasts/pos/8.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/1.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/31.fir.kt | 2 +- .../diagnostics/KtFirDataClassConverters.kt | 4 +- .../api/fir/diagnostics/KtFirDiagnostics.kt | 4 +- .../fir/diagnostics/KtFirDiagnosticsImpl.kt | 4 +- idea/testData/checker/When.fir.kt | 2 +- .../ClassDeclarationAsExpression.fir.kt | 2 +- .../ClassDeclarationAsExpression2.fir.kt | 2 +- .../ClassDeclarationAsExpression3.fir.kt | 2 +- .../InterfaceDeclarationAsExpression.fir.kt | 2 +- 168 files changed, 504 insertions(+), 1197 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/callableReference/resolve/overloadAmbiguityForSimpleLastExpressionOfBlock.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/ambiguityOnPropertiesWithTheSamePackageName.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/resolve/ambiguityWithTwoCorrespondingFunctionTypes.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/AmbiguousNonExtensions.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash0.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash1.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash2.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.fir.kt delete mode 100644 compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/arrays/arraySetWithOperation.kt b/compiler/fir/analysis-tests/testData/resolve/arrays/arraySetWithOperation.kt index 2413f4bde3a..cfbe55ad6cf 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arrays/arraySetWithOperation.kt +++ b/compiler/fir/analysis-tests/testData/resolve/arrays/arraySetWithOperation.kt @@ -28,7 +28,7 @@ fun test_2(a: A) { } fun test_3(a: A) { - a[0] += D() // ambiguity + a[0] += D() // ambiguity } fun test_4(b: B) { diff --git a/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt b/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt index 390901c0302..bd6a5a00a3e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt +++ b/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.kt @@ -12,7 +12,7 @@ fun test(c: C) { foo("") // Ambiguity - bar(c) + bar(c) // Unresolved reference baz() diff --git a/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt b/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt index 5d6d63eb1a1..237b64d4f3f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt @@ -10,7 +10,7 @@ open class A3(x: String, y: String = "") { constructor(x: String, b: Boolean = true) : this(x, x) } -class B3_1 : A3("") +class B3_1 : A3("") class B3_2 : A3("", "asas") class B3_3 : A3("", true) class B3_4 : A3("", Unit) diff --git a/compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorConversion.kt b/compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorConversion.kt index addedb1513a..a7b0c4379b8 100644 --- a/compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorConversion.kt +++ b/compiler/fir/analysis-tests/testData/resolve/properties/javaAccessorConversion.kt @@ -65,7 +65,7 @@ fun test_2(x: B) { } fun test_3(x: C) { - val error = x.vmParameters // should be error + val error = x.vmParameters // should be error val int = x.vMParameters // should be error } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt index a7546dddafb..61165ab4e70 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt @@ -31,7 +31,7 @@ fun main() { foo1(KotlinClass::baz) foo2(KotlinClass::baz) // Ambiguity (companion/class) - foo3(KotlinClass::baz) + foo3(KotlinClass::baz) // Type mismatch foo1(KotlinClass::bar) diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt index b3057626abe..db2ac41a53d 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/javaStatic.kt @@ -16,5 +16,5 @@ fun foo3(x: (String) -> Int) {} fun main() { foo1(JavaClass::bar) foo2(JavaClass::bar) - foo3(JavaClass::bar) + foo3(JavaClass::bar) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt index f1e01b0d817..4c9ebd28d02 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/manyInnermanyOuterCandidatesAmbiguity.kt @@ -6,5 +6,5 @@ fun bar(): Int = 1 fun bar(x: String): Int = 1 fun main() { - foo(::bar) + foo(::bar) } 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 518ed74a24f..4b038bd6029 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 @@ -236,7 +236,7 @@ object DIAGNOSTICS_LIST : DiagnosticList() { } val AMBIGUITY by object : DiagnosticGroup("Ambiguity") { - val AMBIGUITY by error(PositioningStrategy.REFERENCE_BY_QUALIFIED) { + val OVERLOAD_RESOLUTION_AMBIGUITY by error(PositioningStrategy.REFERENCE_BY_QUALIFIED) { parameter>>("candidates") } val ASSIGN_OPERATOR_AMBIGUITY by error { 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 6fd2146d19a..c4523f77a90 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 @@ -189,7 +189,7 @@ object FirErrors { val NO_VALUE_FOR_PARAMETER by error1(SourceElementPositioningStrategies.VALUE_ARGUMENTS) // Ambiguity - val AMBIGUITY by error1>>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) + val OVERLOAD_RESOLUTION_AMBIGUITY by error1>>(SourceElementPositioningStrategies.REFERENCE_BY_QUALIFIED) val ASSIGN_OPERATOR_AMBIGUITY by error1>>() // Types & type parameters 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 64f401d036d..80b02190c1a 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 @@ -33,7 +33,6 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ABSTRACT_PROPERTY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ABSTRACT_PROPERTY_WITH_INITIALIZER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ABSTRACT_PROPERTY_WITH_SETTER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ABSTRACT_SUPER_CALL -import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.AMBIGUITY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_ARGUMENT_MUST_BE_CONST import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_CLASS_MEMBER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ANNOTATION_PARAMETER_DEFAULT_VALUE_MUST_BE_CONSTANT @@ -153,6 +152,7 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NO_VALUE_FOR_PARA import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NULLABLE_TYPE_IN_CLASS_LITERAL_LHS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NULLABLE_TYPE_OF_ANNOTATION_MEMBER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.OTHER_ERROR +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.OVERLOAD_RESOLUTION_AMBIGUITY import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.OVERRIDING_FINAL_MEMBER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.PRIMARY_CONSTRUCTOR_REQUIRED_FOR_DATA_CLASS @@ -396,7 +396,7 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { map.put(NO_VALUE_FOR_PARAMETER, "No value passed for parameter ''{0}''", NAME) // Ambiguity - map.put(AMBIGUITY, "Ambiguity between candidates: {0}", SYMBOLS) + map.put(OVERLOAD_RESOLUTION_AMBIGUITY, "Overload resolution ambiguity between candidates: {0}", SYMBOLS) map.put(ASSIGN_OPERATOR_AMBIGUITY, "Ambiguity between assign operator candidates: {0}", SYMBOLS) // Types & type parameters diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt index f8ed9d4f158..9b4679652f0 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/coneDiagnosticToFirDiagnostic.kt @@ -33,7 +33,7 @@ private fun ConeDiagnostic.toFirDiagnostic( is ConeAmbiguityError -> if (!this.applicability.isSuccess) { FirErrors.NONE_APPLICABLE.on(source, this.candidates) } else { - FirErrors.AMBIGUITY.on(source, this.candidates) + FirErrors.OVERLOAD_RESOLUTION_AMBIGUITY.on(source, this.candidates) } is ConeOperatorAmbiguityError -> FirErrors.ASSIGN_OPERATOR_AMBIGUITY.on(source, this.candidates) is ConeVariableExpectedError -> FirErrors.VARIABLE_EXPECTED.on(source) diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadAmbiguityForSimpleLastExpressionOfBlock.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/overloadAmbiguityForSimpleLastExpressionOfBlock.fir.kt deleted file mode 100644 index a1e617ea8a3..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadAmbiguityForSimpleLastExpressionOfBlock.fir.kt +++ /dev/null @@ -1,25 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -interface A -interface B -object C : A, B - -fun foo(a: A): Int = 0 -fun foo(b: B): Double = 0.0 - -fun bar(a: A): Int = 0 - -val l0: Int - get() = - if (1 < 2) { - foo(C) - } else { - bar(C) - } - -val l1: Int - get() = when { - true -> foo(C) - false -> { foo(C) } - else -> bar(C) - } diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadAmbiguityForSimpleLastExpressionOfBlock.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/overloadAmbiguityForSimpleLastExpressionOfBlock.kt index 017e5efbbec..3ef0618fe6e 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/overloadAmbiguityForSimpleLastExpressionOfBlock.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/overloadAmbiguityForSimpleLastExpressionOfBlock.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER interface A diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.fir.kt index 2ce974ab1be..ae5c26750ad 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/withPlaceholderTypes.fir.kt @@ -22,7 +22,7 @@ val x1 = fn1(1, ::foo, ::foo) val x2 = fn1(1, ::foo, ::bar) val x3 = fn2(::bar, ::foo) -val x4 = fn2(::foo, ::bar) -val x5 = fn2(::foo, ::foo) +val x4 = fn2(::foo, ::bar) +val x5 = fn2(::foo, ::foo) val x6 = fn3(1, ::qux) diff --git a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt index 148d614d6da..4c5495cd267 100644 --- a/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/IfThenElseBothInvalid.fir.kt @@ -6,11 +6,11 @@ fun foo() { bar(x) if (x != 2) { if (x == null) return - 2+ + 2+ } else { if (x == null) return - 2+ + 2+ } bar(x) } diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.fir.kt index 9039756c190..cfcbbdb2b9a 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/inference/manyIncompleteCandidates.fir.kt @@ -5,7 +5,7 @@ package test import first.* import second.* -val a12 by A() +val a12 by A() // FILE: first.kt package first diff --git a/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.fir.kt index 1d4a71b2a7b..66d13d14d6f 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/LabeledFunctionLiterals.fir.kt @@ -10,7 +10,7 @@ fun foo(a: A, f: () -> T): T = f() fun foo(b: B, f: () -> T): T = f() fun test(c: C) { - foo(c) f@ { + foo(c) f@ { c!! } } diff --git a/compiler/testData/diagnostics/tests/imports/RenameOnImport.fir.kt b/compiler/testData/diagnostics/tests/imports/RenameOnImport.fir.kt index 7e82d721032..5cc7b6b6f66 100644 --- a/compiler/testData/diagnostics/tests/imports/RenameOnImport.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/RenameOnImport.fir.kt @@ -18,5 +18,5 @@ import b.* import a.y as AY val v1: Int = AX -val v2: String = x +val v2: String = x val v3 = y diff --git a/compiler/testData/diagnostics/tests/incompleteCode/unresolvedArguments.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/unresolvedArguments.fir.kt index 0eb8580efed..cf5b76944a2 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/unresolvedArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/unresolvedArguments.fir.kt @@ -8,6 +8,6 @@ fun bar(i: Int) {} fun bar(s: String) {} fun test() { - foo(rrr, 1) - bar(rrr) + foo(rrr, 1) + bar(rrr) } diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.fir.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.fir.kt index c719e53bab0..0192043f3bc 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveAmbiguity.fir.kt @@ -5,5 +5,5 @@ fun g(i: Int, a: Any): List {throw Exception()} fun g(a: Any, i: Int): Collection {throw Exception()} fun test() { - val c: List = g(1, 1) + val c: List = g(1, 1) } diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.fir.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.fir.kt index 8058e01af53..98ffbb92738 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveFunctionLiteralsNoUse.fir.kt @@ -4,4 +4,4 @@ package f fun h(i: Int, a: Any, r: R, f: (Boolean) -> Int) = 1 fun h(a: Any, i: Int, r: R, f: (Boolean) -> Int) = 1 -fun test() = h(1, 1, 1, { b -> 42 }) +fun test() = h(1, 1, 1, { b -> 42 }) diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.fir.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.fir.kt index 59123b0ae4e..68ddfaa283f 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoInfoForParameter.fir.kt @@ -5,7 +5,7 @@ fun f(i: Int, c: Collection): List {throw Exception()} fun f(a: Any, l: List): Collection {throw Exception()} fun test(l: List) { - f(1, emptyList()) + f(1, emptyList()) } fun emptyList(): List {throw Exception()} diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.fir.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.fir.kt index f35f4fc87e2..3db6dd11b4a 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveWithFunctionLiterals.fir.kt @@ -5,7 +5,7 @@ package f fun h(f: (Boolean) -> R) = 1 fun h(f: (String) -> R) = 2 -fun test() = h{ i -> getAnswer() } +fun test() = h{ i -> getAnswer() } fun getAnswer() = 42 diff --git a/compiler/testData/diagnostics/tests/inference/intersectionTypesWithContravariantTypes.fir.kt b/compiler/testData/diagnostics/tests/inference/intersectionTypesWithContravariantTypes.fir.kt index 79cf65fbf00..b12d836a9b2 100644 --- a/compiler/testData/diagnostics/tests/inference/intersectionTypesWithContravariantTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/intersectionTypesWithContravariantTypes.fir.kt @@ -8,6 +8,6 @@ fun , S : T> greater(x: Bar, t: T): Int = 0 fun , S : T> greater(x: Bar, other: Foo): String = "" fun test(b: Bar) { - val result = greater(b, b) + val result = greater(b, b) result } diff --git a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.fir.kt b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.fir.kt index b8269f29987..3313fa3c6fe 100644 --- a/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/recursiveLocalFuns/selfCall.fir.kt @@ -2,7 +2,7 @@ fun foo() { fun bar1() = bar1() - fun bar2() = 1 + bar2() + fun bar2() = 1 + bar2() fun bar3() = id(bar3()) } diff --git a/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.fir.kt b/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.fir.kt deleted file mode 100644 index 4b0edc1fab3..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// FILE: A.java -import java.io.Closeable; - -public class A { - public static void foo(Runnable r) { - } - - public static void foo(Closeable c) { - } -} - -// FILE: test.kt - -fun main() { - A.foo { "Hello!" } - A.foo(Runnable { "Hello!" }) -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.kt b/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.kt index 4a03ebed2b7..78d544baccd 100644 --- a/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.kt +++ b/compiler/testData/diagnostics/tests/j+k/ambiguousSamAdapters.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java import java.io.Closeable; diff --git a/compiler/testData/diagnostics/tests/j+k/brokenCode/fieldDuplicates.fir.kt b/compiler/testData/diagnostics/tests/j+k/brokenCode/fieldDuplicates.fir.kt index 857d09668c8..08dc8101902 100644 --- a/compiler/testData/diagnostics/tests/j+k/brokenCode/fieldDuplicates.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/brokenCode/fieldDuplicates.fir.kt @@ -9,5 +9,5 @@ public class A { fun foo() { // no exception is thrown (see KT-3898) - A().foo + A().foo } diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.fir.kt index 6dcb7e4ed52..5a749cb4da4 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/collectionStringImpl.fir.kt @@ -80,6 +80,6 @@ public class CollectionStringImpl implements Collection { // FILE: main.kt fun test(x: CollectionStringImpl) { - x.contains("") + x.contains("") (x as Collection).contains("") } diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/containsAndOverload.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/containsAndOverload.fir.kt index 71d078632c4..922dee9c897 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/containsAndOverload.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/containsAndOverload.fir.kt @@ -12,9 +12,9 @@ abstract class KA : A() { } fun foo(a: A, ka: KA) { - a.contains("") + a.contains("") a.contains(1) - "" in a + "" in a 1 in a ka.contains("") diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/overridesBuiltinNoMagic.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/overridesBuiltinNoMagic.fir.kt index 95bba9d8c0d..104ba2ee53e 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/overridesBuiltinNoMagic.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/overridesBuiltinNoMagic.fir.kt @@ -150,14 +150,14 @@ class Y2 : X() { fun main() { X().remove("") - X().removeAt(1) + X().removeAt(1) val y: MutableList = Y() y.removeAt(1) Y().remove("") - Y().removeAt(1) + Y().removeAt(1) X().remove("") - X().removeAt(1) + X().removeAt(1) } diff --git a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.fir.kt b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.fir.kt index 9a5e740ed35..60d481ca3a9 100644 --- a/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/collectionOverrides/removeAtInt.fir.kt @@ -24,7 +24,7 @@ abstract class D : AbstractList() { fun main(a: A, b: B, c: ArrayList) { a.remove(1) - a.removeAt(0) + a.removeAt(0) b.remove(1) b.removeAt(0) c.remove(1) diff --git a/compiler/testData/diagnostics/tests/j+k/fieldOverridesNothing.fir.kt b/compiler/testData/diagnostics/tests/j+k/fieldOverridesNothing.fir.kt index 406300c578a..22597ce5383 100644 --- a/compiler/testData/diagnostics/tests/j+k/fieldOverridesNothing.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/fieldOverridesNothing.fir.kt @@ -17,5 +17,5 @@ class C : B() { } fun foo() { - C().size + C().size } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/j+k/primitiveOverrides/specializedMap.fir.kt b/compiler/testData/diagnostics/tests/j+k/primitiveOverrides/specializedMap.fir.kt index 2bfe4e906af..f2960f1f362 100644 --- a/compiler/testData/diagnostics/tests/j+k/primitiveOverrides/specializedMap.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/primitiveOverrides/specializedMap.fir.kt @@ -102,10 +102,10 @@ fun foo(x: SpecializedMap) { x.containsKey(1) x.containsKey(null) - x.get(2) + x.get(2) x.get(null) - x.remove(3) + x.remove(3) x.remove(null) x.put(4, 5.0) diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt index 6e0cc2b4eed..7bbee3f0ca6 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt @@ -19,8 +19,8 @@ public abstract class CollectionWithSize implements java.util.Collection // FILE: main.kt fun main(c: CollectionWithSize) { - CompressionType.ZIP.name checkType { _() } - c.size checkType { _() } + CompressionType.ZIP.name checkType { _() } + c.size checkType { _() } CompressionType.ZIP::name checkType { _>() } c::size checkType { _>() } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt index 54137c0e6d6..6e6e7cf4c55 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt @@ -20,8 +20,8 @@ public abstract class CollectionWithSize implements java.util.Collection // FILE: main.kt fun main(c: CollectionWithSize) { - CompressionType.ZIP.name checkType { _() } - c.size checkType { _() } + CompressionType.ZIP.name checkType { _() } + c.size checkType { _() } CompressionType.ZIP::name checkType { _>() } c::size checkType { _>() } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt index c13949bbd50..de3cb2b490b 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt @@ -19,8 +19,8 @@ public abstract class CollectionWithSize implements java.util.Collection // FILE: main.kt fun main(c: CollectionWithSize) { - CompressionType.ZIP.name checkType { _() } - c.size checkType { _() } + CompressionType.ZIP.name checkType { _() } + c.size checkType { _() } CompressionType.ZIP::name checkType { _>() } c::size checkType { _>() } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.fir.kt b/compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.fir.kt deleted file mode 100644 index 9369695fe25..00000000000 --- a/compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.fir.kt +++ /dev/null @@ -1,16 +0,0 @@ -// SKIP_TXT -// !LANGUAGE: +PreferJavaFieldOverload -// FILE: a/JClass.java -package a; -public class JClass { - public static int foo = 42; -} -// FILE: a.kt -package b -val foo = 42 - -// FILE: b.kt - -import a.JClass.foo -import b.foo -fun test() { foo } diff --git a/compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.kt b/compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.kt index 3100d018d92..2b4738c3bae 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/staticFieldPropertyOverloads.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // SKIP_TXT // !LANGUAGE: +PreferJavaFieldOverload // FILE: a/JClass.java diff --git a/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt b/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt index c64eab51fd2..f74336ba78b 100644 --- a/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt @@ -11,6 +11,6 @@ public class A { // FILE: main.kt fun foo(a: A) { - a.foo() checkType { _() } - A.bar() checkType { _() } + a.foo() checkType { _() } + A.bar() checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsIndexMismatch.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsIndexMismatch.fir.kt index 0cd1fe3fde3..af66c73c557 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsIndexMismatch.fir.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classGenericsInParamsIndexMismatch.fir.kt @@ -29,6 +29,6 @@ import p.* fun test(b: B?) { if (b is C) { - b?.foo(null) + b?.foo(null) } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.fir.kt index 1761ad42693..548dc513914 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.fir.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/classVsFunctionGenericsInParamsMismatch.fir.kt @@ -30,8 +30,8 @@ import p.* fun test(b: B?, c: C) { b?.foo(1, 1) - c.foo(1, 1) + c.foo(1, 1) if (b is C) { - b?.foo(1, 1) + b?.foo(1, 1) } } diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.fir.kt deleted file mode 100644 index e98bcaaa473..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.fir.kt +++ /dev/null @@ -1,43 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m0 -// FILE: a.kt -package p - -public interface G1 -public interface G2 - -// MODULE: m1(m0) -// FILE: a.kt -package p - -public interface B { - public fun foo(a: G1?, b: G2?) -} - -// MODULE: m2(m1, m0) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: G1?, b: G2?) - -} - -// MODULE: m3(m0) -// FILE: b.kt -package p - -public interface B { - public fun foo(a: G1?, b: G2?) -} - -// MODULE: m4(m3, m2, m0) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b is C) { - b?.foo(null, null) - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.kt index de288240c3e..3dcea53736a 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/differentGenericsInParams.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m0 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sinceKotlin.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sinceKotlin.fir.kt index f3aa06a1cf2..13d904a5615 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sinceKotlin.fir.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/sinceKotlin.fir.kt @@ -20,7 +20,7 @@ import p1.* import p2.* fun test1(): Int { - val r = foo(42) + val r = foo(42) return r } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/funcLiteralArgsInsideAmbiguity.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/funcLiteralArgsInsideAmbiguity.fir.kt index c1cedf45194..b5a286c1d30 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/funcLiteralArgsInsideAmbiguity.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/funcLiteralArgsInsideAmbiguity.fir.kt @@ -4,7 +4,7 @@ package d fun bar() { val i: Int? = 42 if (i != null) { - doSmth1 { + doSmth1 { val x = i + 1 } } diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/IteratorAmbiguity.fir.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/IteratorAmbiguity.fir.kt index f709915a9d1..52fe90ad2fb 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/IteratorAmbiguity.fir.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/IteratorAmbiguity.fir.kt @@ -21,7 +21,7 @@ class MyIterator { class MyElement fun test1(collection: MyCollection) { - collection.iterator() - for (element in collection) { + collection.iterator() + for (element in collection) { } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.fir.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.fir.kt index 288139fe2c2..08d33f67b5f 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.fir.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/plusAssignOnArray.fir.kt @@ -16,5 +16,5 @@ fun test() { val c = C() c[0] += "" var c1 = C1() - c1[0] += "" + c1[0] += "" } diff --git a/compiler/testData/diagnostics/tests/overload/EmptyArgumentListInLambda.fir.kt b/compiler/testData/diagnostics/tests/overload/EmptyArgumentListInLambda.fir.kt index c7967cb0894..c633afa5c9b 100644 --- a/compiler/testData/diagnostics/tests/overload/EmptyArgumentListInLambda.fir.kt +++ b/compiler/testData/diagnostics/tests/overload/EmptyArgumentListInLambda.fir.kt @@ -4,5 +4,5 @@ fun foo(g: () -> Int) {} fun foo(f: (Int) -> Int) {} fun test() { - foo { -> 42 } + foo { -> 42 } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/overload/defaultParameters.fir.kt b/compiler/testData/diagnostics/tests/overload/defaultParameters.fir.kt index c4b41b2f79e..5b7b7f84d11 100644 --- a/compiler/testData/diagnostics/tests/overload/defaultParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/overload/defaultParameters.fir.kt @@ -55,5 +55,5 @@ fun test() { withGenericDefaults("") - wrong(null!!) + wrong(null!!) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.fir.kt b/compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.fir.kt deleted file mode 100644 index fc78bbf9fb8..00000000000 --- a/compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.fir.kt +++ /dev/null @@ -1,34 +0,0 @@ -// !WITH_NEW_IFERENCE -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_PARAMETER - -// FILE: packageA.kt - -package a - -abstract class Cls -abstract class Cls2 - -// FILE: packageB.kt - -package b - -fun Cls() {} -class Cls2 - -// FILE: test.kt - -package c - -import a.* -import b.* - -fun take(arg: Any) {} - -fun test() { - Cls() - take(Cls()) - - Cls2() - take(Cls2()) -} diff --git a/compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.kt b/compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.kt index b3c036c0cce..c750d7ef086 100644 --- a/compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.kt +++ b/compiler/testData/diagnostics/tests/overload/disambiguateByFailedAbstractClassCheck.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_IFERENCE // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/overload/kt2493.fir.kt b/compiler/testData/diagnostics/tests/overload/kt2493.fir.kt index 39b45d7b9d6..40c426b7fe4 100644 --- a/compiler/testData/diagnostics/tests/overload/kt2493.fir.kt +++ b/compiler/testData/diagnostics/tests/overload/kt2493.fir.kt @@ -16,5 +16,5 @@ class C: A, B fun main() { AImpl().f() BImpl().f() - C().f() + C().f() } diff --git a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt index 0f6952f867d..86c7ff9bf37 100644 --- a/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt +++ b/compiler/testData/diagnostics/tests/recovery/absentLeftHandSide.fir.kt @@ -4,7 +4,7 @@ fun import() { } fun composite() { - val s = 13+~/12 + val s = 13+~/12 } fun html() { diff --git a/compiler/testData/diagnostics/tests/regressions/kt26303.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt26303.fir.kt index 39472371d47..22954d9768e 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt26303.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt26303.fir.kt @@ -14,5 +14,5 @@ import foo.foo as invoke import foo.invoke fun main(args: Array) { - 42() + 42() } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/regressions/kt30245.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt30245.fir.kt index 4b6806e2ab7..8ab57f61314 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt30245.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt30245.fir.kt @@ -83,8 +83,8 @@ fun test2() { // to extension lambda 1 val i27: E1 = when (e) { E.VALUE -> { s: String -> this + s.length } } // oi+ ni+ val i27a: E1 = when (e) { E.VALUE -> { s -> this + s.length } } // oi+ ni+ - val w28 = W2 { i: Int, s -> i + s.length } // oi- ni- - val i28: E1 = id { i: Int, s -> i + s.length } // oi- ni- + val w28 = W2 { i: Int, s -> i + s.length } // oi- ni- + val i28: E1 = id { i: Int, s -> i + s.length } // oi- ni- val w29 = W2 { i: Int, s: String -> i + s.length } // oi- ni- val i29: E1 = id { i: Int, s: String -> i + s.length } // oi+ ni+ @@ -130,7 +130,7 @@ fun test4() { // to non-extension lambda 2 } open class A(a: () -> Unit) { - constructor(f: (String) -> Unit) : this({ -> f("") }) + constructor(f: (String) -> Unit) : this({ -> f("") }) } class B: A({ s -> "1" }) diff --git a/compiler/testData/diagnostics/tests/resolve/ambiguityOnPropertiesWithTheSamePackageName.fir.kt b/compiler/testData/diagnostics/tests/resolve/ambiguityOnPropertiesWithTheSamePackageName.fir.kt deleted file mode 100644 index 215e3b619ac..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/ambiguityOnPropertiesWithTheSamePackageName.fir.kt +++ /dev/null @@ -1,30 +0,0 @@ -// FILE: a.kt -package a - -class A - -// FILE: b.kt -package b - -import a.A - -val A.d: Int get() = 1 - -// FILE: c.kt -package c - -import a.A - -val A.d: Int get() = 2 - -// FILE: d.kt - -package d - -import a.A -import b.d -import c.d - -fun A.test() { - d -} diff --git a/compiler/testData/diagnostics/tests/resolve/ambiguityOnPropertiesWithTheSamePackageName.kt b/compiler/testData/diagnostics/tests/resolve/ambiguityOnPropertiesWithTheSamePackageName.kt index c8ca6a8de53..9dfa204317e 100644 --- a/compiler/testData/diagnostics/tests/resolve/ambiguityOnPropertiesWithTheSamePackageName.kt +++ b/compiler/testData/diagnostics/tests/resolve/ambiguityOnPropertiesWithTheSamePackageName.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/resolve/ambiguityWithTwoCorrespondingFunctionTypes.fir.kt b/compiler/testData/diagnostics/tests/resolve/ambiguityWithTwoCorrespondingFunctionTypes.fir.kt deleted file mode 100644 index b4f39e24de8..00000000000 --- a/compiler/testData/diagnostics/tests/resolve/ambiguityWithTwoCorrespondingFunctionTypes.fir.kt +++ /dev/null @@ -1,11 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun foo(a: Any, f: ()->Int) = f() -fun foo(a: Any, f: (Any)->Int) = f(a) -fun foo(i: Int, f: Int.()->Int) = i.f() - -fun test1() { - foo(1) { -> - this - } -} diff --git a/compiler/testData/diagnostics/tests/resolve/ambiguityWithTwoCorrespondingFunctionTypes.kt b/compiler/testData/diagnostics/tests/resolve/ambiguityWithTwoCorrespondingFunctionTypes.kt index 984dbdb2c74..8cce960ac6e 100644 --- a/compiler/testData/diagnostics/tests/resolve/ambiguityWithTwoCorrespondingFunctionTypes.kt +++ b/compiler/testData/diagnostics/tests/resolve/ambiguityWithTwoCorrespondingFunctionTypes.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun foo(a: Any, f: ()->Int) = f() diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.fir.kt index ab2ff938366..67eacd217bc 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/ambiguityForInvoke.fir.kt @@ -5,7 +5,7 @@ fun Int.invoke(i: Int, a: Any) {} fun Int.invoke(a: Any, i: Int) {} fun foo(i: Int) { - i(1, 1) + i(1, 1) - 5(1, 2) + 5(1, 2) } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.fir.kt index 20d555ddddc..10d4e2c32e4 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/genericClash.fir.kt @@ -13,8 +13,8 @@ fun baz(x: E, y: String) {} fun baz(x: String, y: E) {} fun bar(x: A) { - x.foo("") + x.foo("") - x.baz("", "") - baz("", "") + x.baz("", "") + baz("", "") } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670.fir.kt index 7f17a2117c0..a0bfa633ac6 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670.fir.kt @@ -12,5 +12,5 @@ fun B.foo(block: (T) -> Unit) { } fun main() { - B("string").foo { } + B("string").foo { } } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670_compat.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670_compat.fir.kt index 021ff3cea73..17b204a21cf 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670_compat.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31670_compat.fir.kt @@ -12,5 +12,5 @@ fun B.foo(block: (T) -> Unit) { } fun main() { - B("string").foo { } + B("string").foo { } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758.fir.kt index 468039157a6..f54ca2ce975 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758.fir.kt @@ -22,5 +22,5 @@ import a.* import b.* fun test() { - foo { } + foo { } } diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758_compat.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758_compat.fir.kt index 69fa18f44ae..b488722cef2 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758_compat.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt31758_compat.fir.kt @@ -22,5 +22,5 @@ import a.* import b.* fun test() { - foo { } + foo { } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.fir.kt index 3549720cd66..3edb4997dc0 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/kt37692.fir.kt @@ -10,5 +10,5 @@ infix fun , S : T?> Bar.test(t: T) { } infix fun , S : T?> Bar.test(other: Bar) {} fun checkFunctions(exp1: Foo, exp2: Foo) { - exp1.test(exp2) + exp1.test(exp2) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.fir.kt index b02cbaad936..f59daaf9445 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/withVariance.fir.kt @@ -7,4 +7,4 @@ class A fun A.foo() = X1 fun A.foo() = X2 -fun A.test() = foo() // TODO fix constraint system +fun A.test() = foo() // TODO fix constraint system diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt index 7d3beabb5c4..2b9e8280bc3 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt @@ -22,9 +22,9 @@ public interface J { // FILE: 1.kt fun test(j: J) { - j.foo({ it checkType { _() }; "" }, "") checkType { _() } + j.foo({ it checkType { _() }; "" }, "") checkType { _() } - j.bas({ it checkType { _() }; "" }, "") checkType { _() } + j.bas({ it checkType { _() }; "" }, "") checkType { _() } // NI: TODO j.bar { it checkType { _() }; "" } checkType { _() } diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt index c13f3796a33..175ebce069f 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt @@ -21,9 +21,9 @@ interface K { } fun test(k: K) { - k.foo { it checkType { _() }; "" } checkType { _() } + k.foo { it checkType { _() }; "" } checkType { _() } - k.bas { it checkType { _() }; "" } checkType { _() } + k.bas { it checkType { _() }; "" } checkType { _() } // NI: TODO k.bar { it checkType { _() }; "" } checkType { _() } diff --git a/compiler/testData/diagnostics/tests/scopes/AmbiguousNonExtensions.fir.kt b/compiler/testData/diagnostics/tests/scopes/AmbiguousNonExtensions.fir.kt deleted file mode 100644 index d1cd4c0f388..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/AmbiguousNonExtensions.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// FILE: a.kt -package a - -val v = 1 -fun f() = 1 - -// FILE: b.kt -package b - -val v = 1 -fun f() = 1 - -// FILE: main.kt -import a.* -import b.* - -val vv = v -val ff = f() diff --git a/compiler/testData/diagnostics/tests/scopes/AmbiguousNonExtensions.kt b/compiler/testData/diagnostics/tests/scopes/AmbiguousNonExtensions.kt index 2ea728f0fee..a5c2166a24c 100644 --- a/compiler/testData/diagnostics/tests/scopes/AmbiguousNonExtensions.kt +++ b/compiler/testData/diagnostics/tests/scopes/AmbiguousNonExtensions.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: a.kt package a diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash0.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash0.fir.kt deleted file mode 100644 index a4d5d41458c..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash0.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// FILE: A.java - -public interface A { - int field = 1; -} - -// FILE: B.java - -public interface B { - String field = 1; -} - -// FILE: E.java - -public class E implements A, B { -} - -// FILE: O.java - -public class O implements A, B { - public static double field = 1; -} - -// FILE: test.kt - -fun test() { - A.field - B.field - - E.field - O.field -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash0.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash0.kt index 96088333ab1..22cb2004441 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash0.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash0.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public interface A { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash1.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash1.fir.kt deleted file mode 100644 index e8bcee6dce8..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash1.fir.kt +++ /dev/null @@ -1,32 +0,0 @@ -// FILE: A.java - -public interface A { - int field = 1; -} - -// FILE: B.java - -public interface B extends A { - String field = 1; -} - -// FILE: E.java - -public class E implements A, B { -} - -// FILE: O.java - -public class O implements A, B { - public static double field = 1; -} - -// FILE: test.kt - -fun test() { - A.field - B.field - - E.field - O.field -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash1.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash1.kt index bd332ebdb3c..0c3a858bd61 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash1.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash1.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public interface A { diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash2.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash2.fir.kt deleted file mode 100644 index cd844de6e74..00000000000 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash2.fir.kt +++ /dev/null @@ -1,66 +0,0 @@ -// FILE: A.java - -public interface A { - int field = 1; -} - -// FILE: B.java - -public interface B { - String field = 1; -} - -// FILE: C.java - -public interface C extends A { -} - -// FILE: D.java - -public interface D extends B { -} - -// FILE: E.java - -public class E implements C, D { -} - -// FILE: EE.java - -public class EE extends E { -} - -// FILE: EO.java - -public class EO extends E { - public static double field = 1; -} - -// FILE: O.java - -public class O implements C, D { - public static double field = 1; -} - -// FILE: OO.java - -public class OO extends O { -} - -// FILE: test.kt - -fun test() { - A.field - B.field - - C.field - D.field - - E.field - O.field - - EE.field - EO.field - - OO.field -} diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash2.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash2.kt index 46996a8a01d..1c3874d8613 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash2.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/nameClash2.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: A.java public interface A { diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/innerInstanceCreation.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/innerInstanceCreation.fir.kt index b6f7ae8f977..9f08a417929 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/innerInstanceCreation.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/innerInstanceCreation.fir.kt @@ -6,6 +6,6 @@ class Outer { } constructor(x: Int) - constructor(x: Int, y: Int, z: Int = x + Inner().prop + this.Inner().prop) : - this(x + Inner().prop + this.Inner().prop) + constructor(x: Int, y: Int, z: Int = x + Inner().prop + this.Inner().prop) : + this(x + Inner().prop + this.Inner().prop) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/memberFunAccess.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/memberFunAccess.fir.kt index dece2048ae4..e208dce08c2 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/memberFunAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/memberFunAccess.fir.kt @@ -2,6 +2,6 @@ class A { fun foo() = 1 constructor(x: Int) - constructor(x: Int, y: Int, z: Int = x + foo() + this.foo()) : - this(x + foo() + this.foo()) + constructor(x: Int, y: Int, z: Int = x + foo() + this.foo()) : + this(x + foo() + this.foo()) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccess.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccess.fir.kt index 1bfa4b4cb08..82e8f6d4025 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccess.fir.kt @@ -2,6 +2,6 @@ class A { val prop = 1 constructor(x: Int) - constructor(x: Int, y: Int, z: Int = x + prop + this.prop) : - this(x + prop + this.prop) + constructor(x: Int, y: Int, z: Int = x + prop + this.prop) : + this(x + prop + this.prop) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccessUnitialized.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccessUnitialized.fir.kt index 72465299653..21ce8d1cc69 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccessUnitialized.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/propertyAccessUnitialized.fir.kt @@ -2,6 +2,6 @@ open class B(x: Int) class A : B { val prop = 1 - constructor(x: Int, y: Int = x + prop + this.prop) : - super(x + prop + this.prop) + constructor(x: Int, y: Int = x + prop + this.prop) : + super(x + prop + this.prop) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccess.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccess.fir.kt index f301b0054c8..bb7f9953e6d 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccess.fir.kt @@ -3,6 +3,6 @@ open class B(x: Int) { fun foo() = 1 } class A : B { - constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) : - super(x + foo() + this.foo() + super.foo()) + constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) : + super(x + foo() + this.foo() + super.foo()) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccessOverriden.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccessOverriden.fir.kt index 9af9f94d508..3dab69e60f7 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccessOverriden.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superFunAccessOverriden.fir.kt @@ -4,6 +4,6 @@ open class B(x: Int) { } class A : B { override fun foo() = 2 - constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) : - super(x + foo() + this.foo() + super.foo()) + constructor(x: Int, y: Int = x + foo() + this.foo() + super.foo()) : + super(x + foo() + this.foo() + super.foo()) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superPropertyAccess.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superPropertyAccess.fir.kt index 3162eb46624..1303d995e52 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superPropertyAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/headerCallChecker/superPropertyAccess.fir.kt @@ -1,6 +1,6 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER open class B(val prop: Int) class A : B { - constructor(x: Int, y: Int = x + prop + this.prop + super.prop) : - super(x + prop + this.prop + super.prop) + constructor(x: Int, y: Int = x + prop + this.prop + super.prop) : + super(x + prop + this.prop + super.prop) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/redeclarations.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/redeclarations.fir.kt index d7e777985f1..96e12c13c85 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/redeclarations.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/redeclarations.fir.kt @@ -1,9 +1,9 @@ // !DIAGNOSTICS: -UNUSED_PARAMETER class A(x: String = "", y: String = "") { - constructor(x: String, y: String): this(x, y) - constructor(): this("", "") - constructor(): this("", "") + constructor(x: String, y: String): this(x, y) + constructor(): this("", "") + constructor(): this("", "") } class B { @@ -14,9 +14,9 @@ fun B(x: Int) {} class Outer { class A(x: String = "", y: String = "") { - constructor(x: String, y: String): this(x, y) - constructor(): this("", "") - constructor(): this("", "") + constructor(x: String, y: String): this(x, y) + constructor(): this("", "") + constructor(): this("", "") } class B { diff --git a/compiler/testData/diagnostics/tests/smartCasts/smartcastToNothingAfterCheckingForNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/smartcastToNothingAfterCheckingForNull.fir.kt index 3e5ac605323..26fa0e97dea 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/smartcastToNothingAfterCheckingForNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/smartcastToNothingAfterCheckingForNull.fir.kt @@ -23,7 +23,7 @@ fun g(x: B) { } if (y is Nothing?) { - f(y) - g(y) + f(y) + g(y) } } \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.fir.kt b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.fir.kt index 5df68887ee8..bbe6bcc0bbf 100644 --- a/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.fir.kt +++ b/compiler/testData/diagnostics/tests/substitutions/upperBoundsSubstitutionForOverloadResolutionWithAmbiguity.fir.kt @@ -15,5 +15,5 @@ import foo.* import bar.* fun test(l: List) { - f(l) + f(l) } diff --git a/compiler/testData/diagnostics/tests/suspendConversion/overloadResolutionBySuspendModifier.fir.kt b/compiler/testData/diagnostics/tests/suspendConversion/overloadResolutionBySuspendModifier.fir.kt index 8e1492e8364..614919f121c 100644 --- a/compiler/testData/diagnostics/tests/suspendConversion/overloadResolutionBySuspendModifier.fir.kt +++ b/compiler/testData/diagnostics/tests/suspendConversion/overloadResolutionBySuspendModifier.fir.kt @@ -8,8 +8,8 @@ suspend fun suspendCall(): Int = 42 // it's important to have ambiguity in these cases to introduce overload resolution by suspend modifier in future fun test1() { - foo { usualCall() } - foo { suspendCall() } + foo { usualCall() } + foo { suspendCall() } } // candidate without suspend conversions is more specific diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt deleted file mode 100644 index ed23a4d1942..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !CHECK_TYPE -// FILE: A.java -public class A { - public int foo(Runnable r) { return 0; } - public String foo(Object r) { return null;} - - public int bar(Runnable r) { return 1; } - public String bar(CharSequence r) { return null; } -} - -// FILE: 1.kt -fun fn() {} -fun x(a: A, r: Runnable) { - a.foo(::fn) checkType { _() } - a.foo {} checkType { _() } - - a.foo(null) checkType { _() } - a.foo(Runnable { }) checkType { _() } - a.foo(r) checkType { _() } - - a.foo(123) checkType { _() } - a.foo("") checkType { _() } - - a.bar(::fn) checkType { _() } - a.bar {} checkType { _() } - - a.bar(r) checkType { _() } - - a.bar(null) - - a.bar(null as Runnable?) checkType { _() } - a.bar(null as CharSequence?) checkType { _() } - - a.bar("") checkType { _() } - a.bar(123) -} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.kt index ef369301d6e..2320eb64a0b 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt deleted file mode 100644 index a66e900f753..00000000000 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt +++ /dev/null @@ -1,36 +0,0 @@ -// !CHECK_TYPE -// FILE: A.java -public class A { - public static int foo(Runnable r) { return 0; } - public static String foo(Object r) { return null;} - - public static int bar(Runnable r) { return 1; } - public static String bar(CharSequence r) { return null; } -} - -// FILE: 1.kt -fun fn() {} -fun x(r: Runnable) { - A.foo(::fn) checkType { _() } - A.foo {} checkType { _() } - - A.foo(null) checkType { _() } - A.foo(Runnable { }) checkType { _() } - A.foo(r) checkType { _() } - - A.foo(123) checkType { _() } - A.foo("") checkType { _() } - - A.bar(::fn) checkType { _() } - A.bar {} checkType { _() } - - A.bar(r) checkType { _() } - - A.bar(null) - - A.bar(null as Runnable?) checkType { _() } - A.bar(null as CharSequence?) checkType { _() } - - A.bar("") checkType { _() } - A.bar(123) -} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.kt index eb2b0ffc892..83ffbb75b9a 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !CHECK_TYPE // FILE: A.java public class A { diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt index 0ea1ab59559..d347532c799 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt @@ -27,7 +27,7 @@ fun x(r: Runnable) { A.bar(r) checkType { _() } - A.bar(null) + A.bar(null) A.bar(null as Runnable?) checkType { _() } A.bar(null as CharSequence?) checkType { _() } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt index d95da0b3322..8da21938c13 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt @@ -27,7 +27,7 @@ fun x(a: A, r: Runnable) { a.bar(r) checkType { _() } - a.bar(null) + a.bar(null) a.bar(null as Runnable?) checkType { _() } a.bar(null as CharSequence?) checkType { _() } diff --git a/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.fir.kt b/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.fir.kt deleted file mode 100644 index dfb55e3a99f..00000000000 --- a/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// FILE: kotlin.kt -fun main(j : C, s : Array) { - j.from() - j.from("") - j.from("", "") - j.from("", "", "") - - j.from("", *s) // This should not be an ambiguity, see KT-1842 - j.from(*s) -} - -// FILE: C.java -public class C { - void from() {} - void from(String s) {} - void from(String s, String s1) {} - void from(String... s) {} - void from(String s1, String... s) {} -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.kt b/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.kt index c862a4aa15a..edf727a9840 100644 --- a/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.kt +++ b/compiler/testData/diagnostics/tests/varargs/MostSepcificVarargsWithJava.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // FILE: kotlin.kt fun main(j : C, s : Array) { j.from() diff --git a/compiler/testData/diagnostics/tests/when/When.fir.kt b/compiler/testData/diagnostics/tests/when/When.fir.kt index f292d20fbd8..bd7b7e2cff1 100644 --- a/compiler/testData/diagnostics/tests/when/When.fir.kt +++ b/compiler/testData/diagnostics/tests/when/When.fir.kt @@ -25,7 +25,7 @@ fun foo() : Int { is Any -> 1 s -> 1 1 -> 1 - 1 + a -> 1 + 1 + a -> 1 in 1..a -> 1 !in 1..a -> 1 else -> 1 diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/functionVsSuspendFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/functionVsSuspendFunction.fir.kt index a29feb03691..31da9e048d3 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/functionVsSuspendFunction.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctionType/functionVsSuspendFunction.fir.kt @@ -16,4 +16,4 @@ fun test5() = useSuspendFn {} fun test5(sfn: suspend () -> Unit) = ambiguous(sfn) fun test6(fn: () -> Unit) = ambiguous(fn) -fun test7(): () -> Unit = ambiguous {} \ No newline at end of file +fun test7(): () -> Unit = ambiguous {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_enabled_no_annotation.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_enabled_no_annotation.fir.kt index 49f717234b2..083e0063d3a 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_enabled_no_annotation.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/overloadByLambdaReturnType_enabled_no_annotation.fir.kt @@ -9,28 +9,28 @@ fun takeString(s: String) {} fun takeInt(s: Int) {} fun test_1() { - val x = create { "" } + val x = create { "" } takeString(x) } fun test_2() { - val x = create { 1 } + val x = create { 1 } takeInt(x) } fun test_3() { - val x = create { 1.0 } + val x = create { 1.0 } } fun create(x: K, f: (K) -> Int): Int = 1 fun create(x: T, f: (T) -> String): String = "" fun test_4() { - val x = create("") { "" } + val x = create("") { "" } takeString(x) } fun test_5() { - val x = create("") { 1 } + val x = create("") { 1 } takeInt(x) } \ No newline at end of file diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt index 428d894df0c..8ee19af58f0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt @@ -24,7 +24,7 @@ public class StaticOverrides { // FILE: test.kt fun test() { - StaticOverrides.A.foo {} checkType { _() } + StaticOverrides.A.foo {} checkType { _() } StaticOverrides.B.foo {} checkType { _() } - StaticOverrides.C.foo {} checkType { _() } + StaticOverrides.C.foo {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt index 05a5ed0f4c9..60ed93ede03 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenerics.fir.kt @@ -20,6 +20,6 @@ class Foo { // FILE: 1.kt fun test() { - Foo().foo {} checkType { _() } - Foo().bar {} checkType { _() } + Foo().foo {} checkType { _() } + Foo().bar {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt index 2d46f94bee1..7109542cc20 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithGenericsWithoutRefinedSams.fir.kt @@ -21,6 +21,6 @@ class Foo { // FILE: 1.kt fun test() { - Foo().foo {} checkType { _() } - Foo().bar {} checkType { _() } + Foo().foo {} checkType { _() } + Foo().bar {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt index 377b771ff37..b51fb3e82d5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunction.fir.kt @@ -16,5 +16,5 @@ public class Foo { // FILE: 1.kt fun bar() { - Foo().test {} checkType { _() } + Foo().test {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt index 9d5f49b6125..064aa69a9fb 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt @@ -18,5 +18,5 @@ public class Foo { // FILE: 1.kt fun bar() { - Foo().test {} checkType { _() } + Foo().test {} checkType { _() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt index 650f42d5269..260e9c5bdb0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt @@ -22,6 +22,6 @@ typealias C2 = JHost.Consumer2 val test1 = R { } val test2 = C { s -> println(s.length) } -val test3 = CStr { s -> println(s.length) } -val test4 = CStrList { ss -> for (s in ss) { println(s.length) } } -val test5 = C2 { a, b -> val x: Int = a + b; println(x)} +val test3 = CStr { s -> println(s.length) } +val test4 = CStrList { ss -> for (s in ss) { println(s.length) } } +val test5 = C2 { a, b -> val x: Int = a + b; println(x)} diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.2.fir.kt index 21420844b81..1bfe2c446b2 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.2.fir.kt @@ -17,10 +17,10 @@ val value_5 = 1E-_2F val value_6 = 3e+_0f // TESTCASE NUMBER: 7 -val value_7 = 5E_-0 +val value_7 = 5E_-0 // TESTCASE NUMBER: 8 -val value_8 = 5e_-0F +val value_8 = 5e_-0F // TESTCASE NUMBER: 9 val value_9 = 5e_00000000 @@ -29,7 +29,7 @@ val value_9 = 5e_00000000 val value_10 = 0.0_0e_1_0f // TESTCASE NUMBER: 11 -val value_11 = 0.0_0E____-0__0_0F +val value_11 = 0.0_0E____-0__0_0F // TESTCASE NUMBER: 12 val value_12 = .0_0E__0_0 @@ -53,7 +53,7 @@ val value_17 = 666_666.0__________________________________ val value_18 = 8888888_8.000e_____0f // TESTCASE NUMBER: 19 -val value_19 = 9_______9______9_____9____9___9__9_9.0E__-1 +val value_19 = 9_______9______9_____9____9___9__9_9.0E__-1 // TESTCASE NUMBER: 20 val value_20 = 0_0_0_0_0_0_0_0_0_0.12345678e+__90F diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.3.fir.kt index 429a99c31d8..9f73b0da05e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/real-literals/p-4/neg/2.3.fir.kt @@ -11,16 +11,16 @@ val value_3 = 1_E-_2F val value_4 = 3_e+_0f // TESTCASE NUMBER: 5 -val value_5 = 5_E_-0 +val value_5 = 5_E_-0 // TESTCASE NUMBER: 6 -val value_6 = 5_e_-0F +val value_6 = 5_e_-0F // TESTCASE NUMBER: 7 val value_7 = 5_e_00000000 // TESTCASE NUMBER: 8 -val value_8 = 0.0_0___E____-0__0_0F +val value_8 = 0.0_0___E____-0__0_0F // TESTCASE NUMBER: 9 val value_9 = 0__0.0_____e___0f @@ -44,7 +44,7 @@ val value_14 = 5_________555_________5.0____e____-666_666.0__________________________________________________1_E+_2___________________________________________________________________0F // TESTCASE NUMBER: 16 -val value_16 = 9_______9______9_____9____9___9__9_9.0___E__-1 +val value_16 = 9_______9______9_____9____9___9__9_9.0___E__-1 // TESTCASE NUMBER: 17 val value_17 = 0_0_0_0_0_0_0_0_0_0.12345678___e+__90F @@ -65,7 +65,7 @@ val value_21 = 6_54.76_5_e-_4 val value_22 = 7_6543.8____E____7654_3 // TESTCASE NUMBER: 23 -val value_23 = 9_____________87654321.0__e__-9_8765432_____________1F +val value_23 = 9_____________87654321.0__e__-9_8765432_____________1F // TESTCASE NUMBER: 24 val value_24 = 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000___0.000000000000000000000000_e_000000000000000000000000000000000000000000000000000000000000000_0F diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt index 0a202b59a59..d699364d62f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.3.fir.kt @@ -101,12 +101,12 @@ fun case_5() { // TESTCASE NUMBER: 6 fun case_6() { - checkSubtype(-100000000000000000000000000000000) - checkSubtype(-100000000000000000000000000000000) - checkSubtype(-100000000000000000000000000000000) - checkSubtype(-100000000000000000000000000000000) - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } + checkSubtype(-100000000000000000000000000000000) + checkSubtype(-100000000000000000000000000000000) + checkSubtype(-100000000000000000000000000000000) + checkSubtype(-100000000000000000000000000000000) + -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } + -100000000000000000000000000000000 checkType { check() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt index 393c857b1c3..562a11cf94e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.4.fir.kt @@ -2,8 +2,8 @@ // TESTCASE NUMBER: 1 fun case_1() { - checkSubtype(-9223372036854775808L) - -9223372036854775808L checkType { check() } + checkSubtype(-9223372036854775808L) + -9223372036854775808L checkType { check() } checkSubtype(9223372036854775808L) 9223372036854775808L checkType { check() } @@ -17,9 +17,9 @@ fun case_2() { checkSubtype(100000000000000000000000000000000l) 100000000000000000000000000000000l checkType { check() } - checkSubtype(-100000000000000000000000000000000L) - -100000000000000000000000000000000L checkType { check() } + checkSubtype(-100000000000000000000000000000000L) + -100000000000000000000000000000000L checkType { check() } - checkSubtype(-100000000000000000000000000000000l) - -100000000000000000000000000000000l checkType { check() } + checkSubtype(-100000000000000000000000000000000l) + -100000000000000000000000000000000l checkType { check() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.5.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.5.fir.kt index 4a1e8a96d9c..35748287864 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.5.fir.kt @@ -28,7 +28,7 @@ fun case_1() { f1(9223372036854775807) f1(-9223372036854775807) f1(1000000000000000000000000000000000000000000000000) - f1(-1000000000000000000000000000000000000000000000000) + f1(-1000000000000000000000000000000000000000000000000) } // TESTCASE NUMBER: 2 @@ -40,7 +40,7 @@ fun case_2() { f2(9223372036854775807) f2(-9223372036854775807) f2(1000000000000000000000000000000000000000000000000) - f2(-1000000000000000000000000000000000000000000000000) + f2(-1000000000000000000000000000000000000000000000000) } // TESTCASE NUMBER: 3 @@ -48,11 +48,11 @@ fun case_3() { f3(9223372036854775807) f3(-9223372036854775807) f3(1000000000000000000000000000000000000000000000000) - f3(-1000000000000000000000000000000000000000000000000) + f3(-1000000000000000000000000000000000000000000000000) } // TESTCASE NUMBER: 4 fun case_4() { f3(1000000000000000000000000000000000000000000000000) - f3(-1000000000000000000000000000000000000000000000000) + f3(-1000000000000000000000000000000000000000000000000) } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/neg/1.1.fir.kt index c1972ebfce1..fa246996883 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/neg/1.1.fir.kt @@ -26,7 +26,7 @@ fun case1() { val a: Boolean? = false checkSubtype(a) val x4 = a && true - x4 checkType { check() } + x4 checkType { check() } } // TESTCASE NUMBER: 2 @@ -34,7 +34,7 @@ fun case2() { val a: Any = false a val x4 = a && true - x4 checkType { check() } + x4 checkType { check() } } // TESTCASE NUMBER: 3 @@ -46,7 +46,7 @@ fun case3() { val x3 = a1 && a2 x3 - x3 checkType { check() } + x3 checkType { check() } } // TESTCASE NUMBER: 4 diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/pos/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/pos/1.1.fir.kt index 826f0cd7805..7f26a7df57f 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/pos/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-conjunction-expression/p-2/pos/1.1.fir.kt @@ -42,5 +42,5 @@ fun case1() { val x3 = a1 && a2 && a3 && a4 && a5 as Boolean x3 - x3 checkType { check()} + x3 checkType { check()} } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/neg/1.1.fir.kt index 39970ea2b99..abc2a7b3b9c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/neg/1.1.fir.kt @@ -26,7 +26,7 @@ fun case1() { val a: Boolean? = false checkSubtype(a) val x4 = a || true - x4 checkType { check() } + x4 checkType { check() } } // TESTCASE NUMBER: 2 @@ -34,7 +34,7 @@ fun case2() { val a: Any = false a val x4 = a || true - x4 checkType { check() } + x4 checkType { check() } } // TESTCASE NUMBER: 3 @@ -46,7 +46,7 @@ fun case3() { val x3 = a1 || a2 x3 - x3 checkType { check() } + x3 checkType { check() } } // TESTCASE NUMBER: 4 diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/pos/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/pos/1.1.fir.kt index 5ed2a9bb3f0..b5afa8682b5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/pos/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/logical-disjunction-expression/p-2/pos/1.1.fir.kt @@ -42,5 +42,5 @@ fun case1() { val x3 = a1 || a2 || a3 || a4 || a5 as Boolean x3 - x3 checkType { check()} + x3 checkType { check()} } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/3.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/3.2.fir.kt index 4c2f90362ad..b813cc55dc5 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/3.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/when-expression/p-6/neg/3.2.fir.kt @@ -19,8 +19,8 @@ fun case_1(value_1: Int, value_2: EmptyClass, value_3: Int, value_4: Any): Strin */ fun case_2(value_1: Int, value_3: Nothing) { when (value_1) { - in value_3 -> {} - in throw Exception() -> {} - in return -> {} + in value_3 -> {} + in throw Exception() -> {} + in return -> {} } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt index 50eb95f646e..17483c6bb39 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.3.fir.kt @@ -40,6 +40,6 @@ import libPackageCase1ExplicitDuplicate.emptyArray class Case1(){ fun case1() { - emptyArray() + emptyArray() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt index f88363e7ee5..d40474914b1 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/2.5.fir.kt @@ -35,6 +35,6 @@ import libPackageCase1Explicit.emptyArray class Case1(){ fun case1() { - emptyArray() + emptyArray() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.fir.kt index 6ffc5a758cd..e0f1ac7f2bf 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.1.fir.kt @@ -13,7 +13,7 @@ import libCase1.* import kotlin.text.* fun case1() { - Regex("") + Regex("") } // FILE: Lib1.kt @@ -33,7 +33,7 @@ import kotlin.text.* fun case2() { - Regex("") + Regex("") } // FILE: Lib2.kt @@ -80,7 +80,7 @@ import libCase5.a.* import libCase5.b.* fun case5() { - Regex("") + Regex("") } // FILE: Lib6.kt @@ -101,7 +101,7 @@ import libCase6.a.* import libCase6.b.* fun case6() { - MyRegex("") + MyRegex("") } // FILE: Lib8.kt diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.fir.kt deleted file mode 100644 index f2b084bd2cb..00000000000 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.fir.kt +++ /dev/null @@ -1,293 +0,0 @@ -// !LANGUAGE: +NewInference -// !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION -// SKIP_TXT - -/* - * KOTLIN DIAGNOSTICS SPEC TEST (NEGATIVE) - * - * SPEC VERSION: 0.1-401 - * MAIN LINK: overload-resolution, building-the-overload-candidate-set-ocs, call-without-an-explicit-receiver -> paragraph 5 -> sentence 6 - * NUMBER: 4 - * DESCRIPTION: - */ - - - -// FILE: TestCase1.kt -/* - * TESTCASE NUMBER: 1 - * - * UNEXPECTED BEHAVIOUR - * ISSUES: KT-39162 - */ -package testPackCase1 -import libCase1.a.* -import libCase1.b.* - -fun case1() { - Regex("") -} - -// FILE: Lib1.kt -package libCase1.a -fun Regex(pattern: String) {} - -object Regex { - operator fun invoke(s: String) {} -} - -// FILE: Lib1_1.kt -package libCase1.b - -enum class Regex{ - ; - - companion object { - operator fun invoke(s: String) {} - } -} - - - - -// FILE: TestCase2.kt -/* - * TESTCASE NUMBER: 2 - * UNEXPECTED BEHAVIOUR - * ISSUES: KT-39162 - */ -package testPackCase2 -import libCase2.a.* -import libCase2.b.* - -fun case2() { - Regex("") -} - -// FILE: Lib2.kt -package libCase2.a -fun Regex(pattern: String) {} - -//object Regex { -// operator fun invoke(s: String) {} -//} - -// FILE: Lib12.kt -package libCase2.b - -enum class Regex{ - ; - - companion object { - operator fun invoke(s: String) {} - } -} - - - -// FILE: TestCase3.kt -/* - * TESTCASE NUMBER: 3 - * UNEXPECTED BEHAVIOUR - * ISSUES: KT-39162 - */ -package testPackCase3 -import libCase3.a.* -import libCase3.b.* - -fun case3() { - Regex("") -} - -// FILE: Lib3.kt -package libCase3.a -fun Regex(pattern: String) {} - -object Regex { - operator fun invoke(s: String) {} -} - -// FILE: Lib1_3.kt -package libCase3.b - -class Regex(val s: String) - - -// FILE: TestCase4.kt -/* - * TESTCASE NUMBER: 4 - */ -package testPackCase4 -import libCase4.a.* -import libCase4.b.* - -fun case4() { - Regex("") -} - -// FILE: Lib4.kt -package libCase4.a -fun Regex(pattern: String) {} - -//object Regex { -// operator fun invoke(s: String) {} -//} - -// FILE: Lib14.kt -package libCase4.b - -class Regex(val s: String) - - -// FILE: TestCase5.kt -/* - * TESTCASE NUMBER: 5 - */ -package testPackCase5 -import libCase5.a.* -import libCase5.b.* - -fun case(){ - A() -} - -// FILE: Lib5.kt -package libCase5.a -fun A() {} //(1) -//object A{ -// operator fun invoke(){} -//} - -// FILE: Lib6.kt -package libCase5.b -class A() - -// FILE: TestCase6.kt -/* - * TESTCASE NUMBER: 6 - * UNEXPECTED BEHAVIOUR - * ISSUES: KT-39162 - */ -package testPackCase6 -import libCase6.a.* -import libCase6.b.* - -fun case(){ - A() - A() -} - -// FILE: Lib7.kt -package libCase6.a -fun A() : String = " " //(1) -object A{ - //operator fun invoke(){} -} -// FILE: Lib8.kt -package libCase6.b -class A() - -// FILE: TestCase7.kt -/* - * TESTCASE NUMBER: 7 - */ -package testPackCase7 -import libCase7.a.* -import libCase7.b.* - -fun case7(){ - A() -} -object A{ - //operator fun invoke(){} -} -// FILE: Lib9.kt -package libCase7.a -fun A() : String = " " //(1) - -// FILE: Lib10.kt -package libCase7.b -class A() - -// FILE: TestCase8.kt -/* - * TESTCASE NUMBER: 8 - * UNEXPECTED BEHAVIOUR - * ISSUES: KT-39162 - */ -package testPackCase8 -import libCase8.a.* -import libCase8.b.* -import libCase8.c.* - -fun case8(){ - A() - A() -} - -// FILE: Lib11.kt -package libCase8.a -fun A() : String = " " //(1) - -// FILE: Lib1_2.kt -package libCase8.b -class A() -// FILE: Lib13.kt -package libCase8.c -object A{ - //operator fun invoke(){} -} - - -// FILE: TestCase9.kt -/* - * TESTCASE NUMBER: 9 - */ -package testPackCase -import libCase9.a.* -import libCase9.b.* -import libCase9.c.A - -fun case9(){ - A() -} - -// FILE: Lib1_4.kt -package libCase9.a -fun A() : String = " " //(1) - -// FILE: Lib15.kt -package libCase9.b -class A() -// FILE: Lib16.kt -package libCase9.c -object A{ - //operator fun invoke(){} -} - - -// FILE: TestCase10.kt -/* - * TESTCASE NUMBER: 10 - * UNEXPECTED BEHAVIOUR - * ISSUES: KT-39162 - */ -package testPackCase -import libCase10.a.* -import libCase10.b.* -import libCase10.c.* - -fun case10(){ - A() -} - -// FILE: Liba.kt -package libCase10.a -fun A() : String = " " //(1) - -// FILE: Libb.kt -package libCase10.b -class A() -// FILE: Libc.kt -package libCase10.c -interface A diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt index f9c7c512721..630b644c398 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/call-without-an-explicit-receiver/p-5/neg/6.4.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !LANGUAGE: +NewInference // !DIAGNOSTICS: -UNUSED_VARIABLE -ASSIGNED_BUT_NEVER_ACCESSED_VARIABLE -UNUSED_VALUE -UNUSED_PARAMETER -UNUSED_EXPRESSION // SKIP_TXT diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt index f2a664e306e..7769a420d61 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.4.fir.kt @@ -26,9 +26,9 @@ import LibPackCase1.b.* fun case1 (){ var b: B? = B() - b += { C() } + b += { C() } - b += {1} + b += {1} } class B { @@ -63,9 +63,9 @@ import LibPackCase2.b.* fun case2 (){ var b: B = B() - b += { C() } + b += { C() } - b += {1} + b += {1} } class B { diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.fir.kt index 7dd153b55a1..b58059a8d80 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.5.fir.kt @@ -10,9 +10,9 @@ import LibPackCase1.a.* import LibPackCase1.b.* fun case1 (){ var b: B? = null - b += { C() } + b += { C() } - b += {1} + b += {1} } class B { diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.fir.kt index d2ba79f7ee0..3a450a2c662 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.6.fir.kt @@ -15,9 +15,9 @@ import LibPackCase1.b.* fun case1 (){ var b: B? = B() - b += { C() } + b += { C() } - b += {1} + b += {1} } class B { diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.fir.kt index 84b91dc6529..263ec1b07d3 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.7.fir.kt @@ -15,9 +15,9 @@ import LibPackCase1.b.plusAssign fun case1 (){ var b: B? = B() - b += { C() } + b += { C() } - b += {1} + b += {1} } class B { diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.fir.kt index 5df10ae0ab8..83dda7ba2c9 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/building-the-overload-candidate-set-ocs/operator-call/p-1/neg/2.8.fir.kt @@ -15,8 +15,8 @@ import LibPackCase1.b.plusAssign fun case1 (){ var b: B = B() - b +={ C() } - b +={ 1 } + b +={ C() } + b +={ 1 } } class B @@ -48,10 +48,10 @@ import LibPackCase2.b.plusAssign fun case2 (){ var b: B = B() - b +={ C() } - b +={ 1 } + b +={ C() } + b +={ 1 } - b.plusAssign{ C() } + b.plusAssign{ C() } } class B diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.1.fir.kt index 0f5b5e2ae1c..116c5d1dcd3 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.1.fir.kt @@ -8,7 +8,7 @@ class Case1() { fun foo(vararg x: Short): Unit = TODO()//(2) fun testcase() { - foo(1, 1) + foo(1, 1) } } @@ -18,7 +18,7 @@ class Case2() { fun foo(vararg x: Int?): Unit = TODO() // (1.2) fun case(){ - foo(1, 1) + foo(1, 1) } } // TESTCASE NUMBER: 3 @@ -27,7 +27,7 @@ class Case3() { fun foo(vararg x: Int?): Unit = TODO() // (1.2) fun case(){ - foo(1, 1) + foo(1, 1) } } @@ -37,7 +37,7 @@ class Case4() { fun foo(y: Int, x: Long): Unit = TODO() // (1.2) fun case(){ - foo(1, 1) + foo(1, 1) } } @@ -48,8 +48,8 @@ class Case5() { fun foo(y: Int, x: Long, a : Any =""): Unit = TODO() // (1.2) fun case(){ - foo(1, 1) - foo(1, 1) + foo(1, 1) + foo(1, 1) } } @@ -61,5 +61,5 @@ interface C fun foo(x: B) {} //(1) fun foo(y: C, z: String = "foo") {} //2 fun bar() { - foo(A()) //OVERLOAD_RESOLUTION_AMBIGUITY + foo(A()) //OVERLOAD_RESOLUTION_AMBIGUITY } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.2.fir.kt index d4fb5a8596d..4f2dd846d57 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.2.fir.kt @@ -11,5 +11,5 @@ interface C fun foo(x: B) {} //(1) fun foo(y: C, z: String = "foo") {} //2 fun bar() { - foo(A()) //OVERLOAD_RESOLUTION_AMBIGUITY + foo(A()) //OVERLOAD_RESOLUTION_AMBIGUITY } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.3.fir.kt index 1cbb3f314a5..71e5f1ae919 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.3.fir.kt @@ -13,7 +13,7 @@ import testPackCase1.I1.Companion.foo class Case2() : I2, I1{ fun test(){ - foo(1) + foo(1) } } @@ -39,7 +39,7 @@ import testPackCase2.I1.Companion.foo class Case2() : I2, I1{ fun test(){ - foo(1) + foo(1) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.4.fir.kt index ebc348cbafa..4bb2a1a3293 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.4.fir.kt @@ -15,7 +15,7 @@ import testPackCase1.I4.Companion.foo class Case1() : I2, I1, I3, I4 { fun test() { - foo(1) + foo(1) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.6.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.6.fir.kt index 4ba4ad842e5..7e76e2434fb 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.6.fir.kt @@ -15,7 +15,7 @@ import testPackCase1.I4.Companion.foo class Case1() : I2, I1, I3, I4 { fun test() { - foo(1) + foo(1) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.7.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.7.fir.kt index f41d2776d7c..b03a9b4a913 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-14/neg/1.7.fir.kt @@ -15,7 +15,7 @@ import testPackCase1.I4.Companion.foo class Case1() : I2, I1, I3, I4 { fun test() { - foo(1) + foo(1) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.1.fir.kt index 66968f0590a..164f851901b 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.1.fir.kt @@ -15,9 +15,9 @@ interface I2 operator fun I2.invoke(): String = TODO() fun case1(a: A) { - a.invoke() - a() - A()() + a.invoke() + a() + A()() } // FILE: TestCase2.kt @@ -33,10 +33,10 @@ interface Interface2 operator fun Interface2.invoke(): String = TODO() fun case1(a: I) { - a.invoke() - a() + a.invoke() + a() - val x = object : I {} () + val x = object : I {} () } // FILE: TestCase3.kt @@ -53,8 +53,8 @@ interface Interface2 operator fun Interface2.invoke(x :() -> Unit): String = TODO() fun case1(a: I) { - a.invoke{} - a{} + a.invoke{} + a{} - val x = object : I {} {} + val x = object : I {} {} } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.2.fir.kt index 1e3365503c0..4e0b9ac9734 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-17/neg/2.2.fir.kt @@ -15,9 +15,9 @@ interface I2 operator fun I2.invoke(): String = TODO() fun case1(a: A) { - a.invoke() - a() - A()() + a.invoke() + a() + A()() } // FILE: TestCase2.kt @@ -33,10 +33,10 @@ interface Interface2 operator fun Interface2.invoke(): String = TODO() fun case1(a: I) { - a.invoke() - a() + a.invoke() + a() - val x = object : I {} () + val x = object : I {} () } // FILE: TestCase3.kt @@ -53,8 +53,8 @@ interface Interface2 operator fun Interface2.invoke(x :() -> Unit): String = TODO() fun case1(a: I) { - a.invoke{} - a{} + a.invoke{} + a{} - val x = object : I {} {} + val x = object : I {} {} } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.1.fir.kt index bf2b86b8240..94b12645e1c 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.1.fir.kt @@ -9,5 +9,5 @@ interface C fun foo(x: B) {} //(1) fun foo(y: C, z: String = "foo") {} //2 fun case1() { - foo(A()) //OVERLOAD_RESOLUTION_AMBIGUITY + foo(A()) //OVERLOAD_RESOLUTION_AMBIGUITY } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt index 84d9c542ca1..50f66439b92 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.2.fir.kt @@ -14,8 +14,8 @@ import LibPackCase1.a.boo import LibPackCase1.b.boo fun case1 (b: B?){ - b.boo({ C() }) - b.boo({1}) + b.boo({ C() }) + b.boo({1}) } class B { @@ -49,8 +49,8 @@ import LibPackCase2.a.* import LibPackCase2.b.* fun case2 (b: B?){ - b.boo({ C() }) - b.boo({1}) + b.boo({ C() }) + b.boo({1}) } class B { diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.3.fir.kt index b75cf2db4a0..34715bb2956 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/algorithm-of-msc-selection/p-9/neg/2.3.fir.kt @@ -14,6 +14,6 @@ fun case1(x: Any) { x.foo() // to (3) x.foo() if (x is B1 && x is A1) { - x.foo() + x.foo() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3/neg/1.1.fir.kt index 8e7c3855118..f0d55265dd7 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/choosing-the-most-specific-candidate-from-the-overload-candidate-set/rationale-1/p-3/neg/1.1.fir.kt @@ -10,6 +10,6 @@ class Case1 { fun List.foo(x: T) {} fun case(x: List, y: T) { - x.foo(y) + x.foo(y) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg/1.1.fir.kt index 8522b1443a5..01af27251fe 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/neg/1.1.fir.kt @@ -54,8 +54,8 @@ class Case3() : I { fun x() = "" as CharSequence fun case() { - I.invoke(::x) - I(::x) - Case3(::x) + I.invoke(::x) + I(::x) + Case3(::x) } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1/neg/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1/neg/2.1.fir.kt index fbb161e68ec..ded1370c989 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1/neg/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/statements/assignments/p-1/neg/2.1.fir.kt @@ -7,7 +7,7 @@ * NOTE: right-hand side of an assignment must be expression */ fun case1() { - val x = for () { } + val x = for () { } val y = for (x in 1..2) { } val a = while () { } @@ -20,7 +20,7 @@ fun case1() { * NOTE: right-hand side of an assignment must be expression */ fun case2() { - var x = for () { } + var x = for () { } var y = for (x in 1..2) { } var a = while () { } @@ -40,7 +40,7 @@ fun case3() { var b :Any? var c :Any? - x = for () { } + x = for () { } y = for (x in 1..2) { } a = while () { } diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.2.fir.kt index eee44c28622..942e2cd5b8e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/introduction-1/p-6/neg/2.2.fir.kt @@ -14,7 +14,7 @@ fun case_2(x: Any = null) { // TESTCASE NUMBER: 3 fun case_3(x: Nothing = null) { - println(x) + println(x) } // TESTCASE NUMBER: 4 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt index 7e8619e31bd..74282ed81cb 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/neg/1.fir.kt @@ -56,7 +56,7 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) { val value_4: Int when (value_1.case_2(value_2, value_3) { value_4 = 10 }) { true -> { - println(value_3?.xor(true)) + println(value_3?.xor(true)) println(value_4) println(value_1.inv()) println(value_2.inv()) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/1.fir.kt index c77ac5af174..591ae9fe76f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/common/pos/1.fir.kt @@ -61,7 +61,7 @@ fun case_2(value_1: Int?, value_2: Int?, value_3: Any?) { println(value_2) } null -> { - println(value_3?.xor(true)) + println(value_3?.xor(true)) println(value_4) println(value_1) println(value_2) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt index 79675c1390b..e4c4e2e01b7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/1.fir.kt @@ -5,7 +5,7 @@ // TESTCASE NUMBER: 1 fun case_1(value_1: Any?) { funWithReturns(value_1 !is String) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 2 @@ -23,7 +23,7 @@ fun case_3(value_1: Int?) { // TESTCASE NUMBER: 4 fun case_4(value_1: Any?) { funWithReturnsAndInvertTypeCheck(value_1) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 5 @@ -49,14 +49,14 @@ fun case_7() { // TESTCASE NUMBER: 8 fun case_8(value_1: Any?) { - if (!funWithReturnsTrue(value_1 is String)) println(value_1.length) - if (!funWithReturnsTrueAndInvertCondition(value_1 !is String)) println(value_1.length) - if (funWithReturnsFalse(value_1 is String)) println(value_1.length) - if (funWithReturnsFalseAndInvertCondition(value_1 !is String)) println(value_1.length) - if (funWithReturnsNotNull(value_1 is String) == null) println(value_1.length) - if (!(funWithReturnsNotNull(value_1 is String) != null)) println(value_1.length) - if (!(funWithReturnsNull(value_1 is String) == null)) println(value_1.length) - if (funWithReturnsNull(value_1 is String) != null) println(value_1.length) + if (!funWithReturnsTrue(value_1 is String)) println(value_1.length) + if (!funWithReturnsTrueAndInvertCondition(value_1 !is String)) println(value_1.length) + if (funWithReturnsFalse(value_1 is String)) println(value_1.length) + if (funWithReturnsFalseAndInvertCondition(value_1 !is String)) println(value_1.length) + if (funWithReturnsNotNull(value_1 is String) == null) println(value_1.length) + if (!(funWithReturnsNotNull(value_1 is String) != null)) println(value_1.length) + if (!(funWithReturnsNull(value_1 is String) == null)) println(value_1.length) + if (funWithReturnsNull(value_1 is String) != null) println(value_1.length) } // TESTCASE NUMBER: 9 @@ -73,12 +73,12 @@ fun case_9(value_1: String?) { // TESTCASE NUMBER: 10 fun case_10(value_1: Any?) { - if (!funWithReturnsTrueAndTypeCheck(value_1)) println(value_1.length) - if (!!funWithReturnsFalseAndTypeCheck(value_1)) println(value_1.length) - if (!(funWithReturnsNotNullAndTypeCheck(value_1) != null)) println(value_1.length) - if (!!(funWithReturnsNotNullAndTypeCheck(value_1) == null)) println(value_1.length) - if (!!(funWithReturnsNullAndTypeCheck(value_1) != null)) println(value_1.length) - if (!(funWithReturnsNullAndTypeCheck(value_1) == null)) println(value_1.length) + if (!funWithReturnsTrueAndTypeCheck(value_1)) println(value_1.length) + if (!!funWithReturnsFalseAndTypeCheck(value_1)) println(value_1.length) + if (!(funWithReturnsNotNullAndTypeCheck(value_1) != null)) println(value_1.length) + if (!!(funWithReturnsNotNullAndTypeCheck(value_1) == null)) println(value_1.length) + if (!!(funWithReturnsNullAndTypeCheck(value_1) != null)) println(value_1.length) + if (!(funWithReturnsNullAndTypeCheck(value_1) == null)) println(value_1.length) } // TESTCASE NUMBER: 11 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 b307dd1035e..44b83b4e1e1 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 @@ -203,12 +203,12 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Any?) { - if (!contracts.case_1(value_1)) println(value_1.toByte()) + if (!contracts.case_1(value_1)) println(value_1.toByte()) } // TESTCASE NUMBER: 2 fun case_2(value_1: Any?) { - if (!contracts.case_2(value_1)) println(value_1?.toByte()) + if (!contracts.case_2(value_1)) println(value_1?.toByte()) } // TESTCASE NUMBER: 3 @@ -218,34 +218,34 @@ fun case_3(number: Int?) { // TESTCASE NUMBER: 4 fun case_4(value_1: Any?) { - if (!funWithReturnsTrue(value_1 !is String)) println(value_1.length) + if (!funWithReturnsTrue(value_1 !is String)) println(value_1.length) } // TESTCASE NUMBER: 5 fun case_5(value_1: Any?) { - if (!funWithReturnsTrueAndInvertCondition(value_1 is String)) println(value_1.length) - if (funWithReturnsFalse(value_1 !is String)) println(value_1.length) - if (funWithReturnsFalseAndInvertCondition(value_1 is String)) println(value_1.length) - if (!(funWithReturnsNotNullAndInvertCondition(value_1 !is String) != null)) println(value_1.length) - if (!(funWithReturnsNullAndInvertCondition(value_1 !is String) == null)) println(value_1.length) + if (!funWithReturnsTrueAndInvertCondition(value_1 is String)) println(value_1.length) + if (funWithReturnsFalse(value_1 !is String)) println(value_1.length) + if (funWithReturnsFalseAndInvertCondition(value_1 is String)) println(value_1.length) + if (!(funWithReturnsNotNullAndInvertCondition(value_1 !is String) != null)) println(value_1.length) + if (!(funWithReturnsNullAndInvertCondition(value_1 !is String) == null)) println(value_1.length) } // TESTCASE NUMBER: 6 fun case_6(value_1: Any?) { - if (!funWithReturnsTrue(value_1 == null)) println(value_1.length) + if (!funWithReturnsTrue(value_1 == null)) println(value_1.length) } // TESTCASE NUMBER: 7 fun case_7(value_1: Any?) { - if (!funWithReturnsTrueAndInvertCondition(value_1 != null)) println(value_1.length) - if (funWithReturnsFalse(value_1 == null)) println(value_1.length) - if (funWithReturnsFalseAndInvertCondition(value_1 != null)) println(value_1.length) + if (!funWithReturnsTrueAndInvertCondition(value_1 != null)) println(value_1.length) + if (funWithReturnsFalse(value_1 == null)) println(value_1.length) + if (funWithReturnsFalseAndInvertCondition(value_1 != null)) println(value_1.length) } // TESTCASE NUMBER: 8 fun case_8(value_1: Any?) { - if (!funWithReturnsTrueAndInvertTypeCheck(value_1)) println(value_1.length) - if (funWithReturnsFalseAndInvertTypeCheck(value_1)) println(value_1.length) + if (!funWithReturnsTrueAndInvertTypeCheck(value_1)) println(value_1.length) + if (funWithReturnsFalseAndInvertTypeCheck(value_1)) println(value_1.length) } // TESTCASE NUMBER: 9 @@ -260,40 +260,40 @@ fun case_9(value_1: Number?) { // TESTCASE NUMBER: 10 fun case_10(value_1: Any?, value_2: Any?) { if (!funWithReturnsTrueAndInvertCondition(value_1 is String && value_2 is Number)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } } // TESTCASE NUMBER: 11 fun case_11(value_1: Any?, value_2: Any?) { if (!funWithReturnsTrue(value_1 !is String || value_2 !is Number)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (funWithReturnsFalse(value_1 !is String || value_2 !is Number)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } } // TESTCASE NUMBER: 12 fun case_12(value_1: Any?, value_2: Any?) { if (!funWithReturnsTrue(value_1 !is String || value_2 != null)) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null)) { println(value_1.dec()) - println(value_2?.toByte()) + println(value_2?.toByte()) } if (funWithReturnsNotNull(value_1 !is String || value_2 !is Number) == null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (funWithReturnsNull(value_1 !is String || value_2 !is Number) != null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } } @@ -301,39 +301,39 @@ fun case_12(value_1: Any?, value_2: Any?) { fun case_13(value_1: Any?, value_2: Any?) { if (!funWithReturnsTrueAndInvertCondition(value_1 is Float? && value_1 != null && value_2 != null)) { println(value_1.dec()) - println(value_2?.toByte()) + println(value_2?.toByte()) } if (funWithReturnsFalseAndInvertCondition(value_1 is String && value_2 is Number)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (funWithReturnsFalseAndInvertCondition(value_1 is String && value_2 == null)) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (funWithReturnsNotNullAndInvertCondition(value_1 is String && value_2 is Number) == null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (funWithReturnsNotNullAndInvertCondition(value_1 is String && value_2 == null) == null) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (funWithReturnsNotNull(value_1 is Float? && value_1 != null && value_2 != null) == null) { println(value_1.dec()) - println(value_2?.toByte()) + println(value_2?.toByte()) } if (funWithReturnsNullAndInvertCondition(value_1 is String && value_2 is Number) != null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (funWithReturnsNullAndInvertCondition(value_1 is String && value_2 == null) != null) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (funWithReturnsNull(value_1 is Float? && value_1 != null && value_2 != null) != null) { println(value_1.dec()) - println(value_2?.toByte()) + println(value_2?.toByte()) } } @@ -346,22 +346,22 @@ class case_14_class { if (!funWithReturnsTrueAndInvertCondition(value_1 is Float? && value_1 != null && value_2 != null && o.prop_1 != null)) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null)) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsNotNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) == null) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) != null) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } } @@ -369,40 +369,40 @@ class case_14_class { // TESTCASE NUMBER: 15 fun case_15(value_1: Any?, value_2: Any?) { if (!contracts.case_15_1(value_1, value_2)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (contracts.case_15_2(value_1, value_2)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (!(contracts.case_15_3(value_1, value_2) != null)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (!(contracts.case_15_4(value_1, value_2) == null)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } } // TESTCASE NUMBER: 16 fun case_16(value_1: Any?, value_2: Any?) { if (!contracts.case_16_1(value_1, value_2)) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (contracts.case_16_2(value_1, value_2)) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (contracts.case_16_3(value_1, value_2) == null) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (contracts.case_16_4(value_1, value_2) != null) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } } @@ -415,44 +415,44 @@ class case_17_class { if (contracts.case_17_1(value_1, value_2, o.prop_1, this.prop_1)) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } if (contracts.case_17_2(value_1, value_2, o.prop_1, this.prop_1)) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } if (contracts.case_17_3(value_1, value_2, o.prop_1, this.prop_1) == null) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } if (contracts.case_17_4(value_1, value_2, o.prop_1, this.prop_1) != null) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) - println(this.prop_1.plus(3)) + println(o.prop_1.plus(3)) + println(this.prop_1.plus(3)) } } } // TESTCASE NUMBER: 18 fun case_18(value_1: Any?) { - if (!value_1.case_18_1()) println(value_1.length) - if (value_1.case_18_2()) println(value_1.length) - if (value_1.case_18_3() == null) println(value_1.length) - if (value_1.case_18_4() != null) println(value_1.length) + if (!value_1.case_18_1()) println(value_1.length) + if (value_1.case_18_2()) println(value_1.length) + if (value_1.case_18_3() == null) println(value_1.length) + if (value_1.case_18_4() != null) println(value_1.length) } // TESTCASE NUMBER: 19 fun case_19(value_1: Number) { - when { !value_1.case_19_1() -> println(value_1.inv()) } - when { value_1.case_19_2() -> println(value_1.inv()) } - when { value_1.case_19_3() == null -> println(value_1.inv()) } - when { value_1.case_19_4() != null -> println(value_1.inv()) } + when { !value_1.case_19_1() -> println(value_1.inv()) } + when { value_1.case_19_2() -> println(value_1.inv()) } + when { value_1.case_19_3() == null -> println(value_1.inv()) } + when { value_1.case_19_4() != null -> println(value_1.inv()) } } // TESTCASE NUMBER: 20 @@ -481,42 +481,42 @@ fun case_21(value_1: String?) { // TESTCASE NUMBER: 22 fun case_22(value_1: Any?, value_2: Any?) { - when { value_1.case_22_1() -> println(value_1.length) } - when { value_2.case_22_2() == null -> println(value_2.length) } - when { value_2.case_22_3() != null -> println(value_2.length) } + when { value_1.case_22_1() -> println(value_1.length) } + when { value_2.case_22_2() == null -> println(value_2.length) } + when { value_2.case_22_3() != null -> println(value_2.length) } } // TESTCASE NUMBER: 23 fun case_23(value_1: Number?, value_2: Number?) { - if (value_1.case_23_1()) println(value_1.inv()) - if (value_2.case_23_2() == null) println(value_2.inv()) - if (value_2.case_23_3() != null) println(value_2.inv()) + if (value_1.case_23_1()) println(value_1.inv()) + if (value_2.case_23_2() == null) println(value_2.inv()) + if (value_2.case_23_3() != null) println(value_2.inv()) } // TESTCASE NUMBER: 24 fun case_24(value_1: Any?, value_2: Any?) { - if (value_1.case_24_1()) println(value_1.inv()) - if (value_2.case_24_2() != null) println(value_2.inv()) - if (value_2.case_24_3() == null) println(value_2.inv()) + if (value_1.case_24_1()) println(value_1.inv()) + if (value_2.case_24_2() != null) println(value_2.inv()) + if (value_2.case_24_3() == null) println(value_2.inv()) } // TESTCASE NUMBER: 25 fun case_25(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?) { when { value_1.case_25_1(value_2) -> { - println(value_1.length) + println(value_1.length) println(value_2.inv()) } } when { value_3.case_25_2(value_4) == null -> { - println(value_3.length) + println(value_3.length) println(value_4.inv()) } } when { value_3.case_25_3(value_4) != null -> { - println(value_3.length) + println(value_3.length) println(value_4.inv()) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/11.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/11.fir.kt index 128c97e9b06..4fcebcba1ad 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/11.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/11.fir.kt @@ -33,7 +33,7 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Any?) { if (!(value_1.case_1_1() || value_1.case_1_2() == null)) { - println(value_1.length) + println(value_1.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/13.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/13.fir.kt index c711b2ceb36..e61809dd606 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/13.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/13.fir.kt @@ -33,7 +33,7 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Any?) { if (!(value_1.case_1_1() || value_1.case_1_2() == null)) { - println(value_1.length) + println(value_1.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/14.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/14.fir.kt index c711b2ceb36..e61809dd606 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/14.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/14.fir.kt @@ -33,7 +33,7 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Any?) { if (!(value_1.case_1_1() || value_1.case_1_2() == null)) { - println(value_1.length) + println(value_1.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt index 43e98cfd178..28e7c382409 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/15.fir.kt @@ -30,14 +30,14 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value: Any) { if (contracts.case_1_2(contracts.case_1_1(value is Char))) { - println(value.category) + println(value.category) } } // TESTCASE NUMBER: 2 fun case_2(value: Any) { if (contracts.case_2(value is Char) is Boolean) { - println(value.category) + println(value.category) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt index bc29a2981e5..b4a1d35cdb8 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/2.fir.kt @@ -5,22 +5,22 @@ // TESTCASE NUMBER: 1 fun case_1(value_1: Any?, value_2: Any?) { funWithReturns(value_1 !is String || value_2 !is Number) - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } // TESTCASE NUMBER: 2 fun case_2(value_1: Any?, value_2: Any?) { funWithReturnsAndInvertCondition(value_1 is String && value_2 is Number) - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Any?, value_2: Any?) { funWithReturnsAndInvertCondition(value_1 is String && value_2 == null) - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } // TESTCASE NUMBER: 4 @@ -38,67 +38,67 @@ class case_5_class { funWithReturns(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null) println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } // TESTCASE NUMBER: 6 fun case_6(value_1: Any?, value_2: Any) { if (funWithReturnsTrue(value_1 !is String || value_2 !is Number)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (!funWithReturnsFalse(value_1 !is String || value_2 !is Number)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (funWithReturnsNotNull(value_1 !is String || value_2 !is Number) != null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (funWithReturnsNull(value_1 !is String || value_2 !is Number) == null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } } // TESTCASE NUMBER: 7 fun case_7(value_1: Any?, value_2: Any?) { if (funWithReturnsTrueAndInvertCondition(value_1 is String && value_2 is Number)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (!funWithReturnsFalseAndInvertCondition(value_1 is String && value_2 is Number)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (funWithReturnsNotNullAndInvertCondition(value_1 is String && value_2 is Number) != null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (funWithReturnsNullAndInvertCondition(value_1 is String && value_2 is Number) == null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } } // TESTCASE NUMBER: 8 fun case_8(value_1: Any?, value_2: Any?) { if (funWithReturnsTrueAndInvertCondition(value_1 is String && value_2 == null)) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (!funWithReturnsFalseAndInvertCondition(value_1 is String && value_2 == null)) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (funWithReturnsNotNullAndInvertCondition(value_1 is String && value_2 == null) != null) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (funWithReturnsNullAndInvertCondition(value_1 is String && value_2 == null) == null) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } } @@ -131,22 +131,22 @@ class case_10_class { if (funWithReturnsTrue(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null)) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (!funWithReturnsFalse(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null)) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsNotNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) != null) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (funWithReturnsNull(value_1 !is Float? || value_1 == null || value_2 == null || o.prop_1 == null || this.prop_1 == null) == null) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } } @@ -155,6 +155,6 @@ class case_10_class { fun case_11(value_1: Any?, value_2: Any?, value_3: Any?) { funWithReturnsAndInvertCondition(value_1 !is String? || value_2 !is Number && value_3 !is Float) println(value_1!!.length) - println(value_2.toByte()) + println(value_2.toByte()) println(value_3.dec()) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt index 65b309dbade..768dadde6bb 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/3.fir.kt @@ -85,15 +85,15 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Any?, value_2: Any?) { contracts.case_1(value_1, value_2) - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } // TESTCASE NUMBER: 2 fun case_2(value_1: Any?, value_2: Any?) { contracts.case_2(value_1, value_2) - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } // TESTCASE NUMBER: 3 @@ -105,47 +105,47 @@ class case_3_class { contracts.case_3(value_1, value_2, o.prop_1, this.prop_1) println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } // TESTCASE NUMBER: 4 fun case_4(value_1: Any?, value_2: Any?) { if (contracts.case_4_1(value_1, value_2)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (!contracts.case_4_2(value_1, value_2)) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (contracts.case_4_3(value_1, value_2) != null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } if (contracts.case_4_4(value_1, value_2) == null) { - println(value_1.length) - println(value_2.toByte()) + println(value_1.length) + println(value_2.toByte()) } } // TESTCASE NUMBER: 5 fun case_5(value_1: Any?, value_2: Any?) { if (contracts.case_5_1(value_1, value_2)) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (!contracts.case_5_2(value_1, value_2)) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (contracts.case_5_3(value_1, value_2) == null) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } if (contracts.case_5_4(value_1, value_2) != null) { - println(value_1.length) - println(value_2?.toByte()) + println(value_1.length) + println(value_2?.toByte()) } } @@ -158,22 +158,22 @@ class case_6_class { if (contracts.case_6_1(value_1, value_2, o.prop_1, this.prop_1)) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (!contracts.case_6_2(value_1, value_2, o.prop_1, this.prop_1)) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (contracts.case_6_3(value_1, value_2, o.prop_1, this.prop_1) == null) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } if (contracts.case_6_4(value_1, value_2, o.prop_1, this.prop_1) != null) { println(value_1.dec()) println(value_2?.toByte()) - println(o.prop_1.plus(3)) + println(o.prop_1.plus(3)) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt index b2bafefdab4..09a961797bf 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt @@ -140,13 +140,13 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Any?) { value_1.case_1() - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 2 fun case_2(value_1: Number) { value_1.case_2() - println(value_1.inv()) + println(value_1.inv()) } // TESTCASE NUMBER: 3 @@ -167,18 +167,18 @@ fun case_4(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 5 fun case_5(value_1: Any?) { - if (value_1.case_5_1()) println(value_1.length) - if (!value_1.case_5_2()) println(value_1.length) - if (value_1.case_5_3() != null) println(value_1.length) - if (value_1.case_5_4() == null) println(value_1.length) + if (value_1.case_5_1()) println(value_1.length) + if (!value_1.case_5_2()) println(value_1.length) + if (value_1.case_5_3() != null) println(value_1.length) + if (value_1.case_5_4() == null) println(value_1.length) } // TESTCASE NUMBER: 6 fun case_6(value_1: Number) { - when { value_1.case_6_1() -> println(value_1.inv()) } - when { !value_1.case_6_2() -> println(value_1.inv()) } - when { value_1.case_6_3() != null -> println(value_1.inv()) } - when { value_1.case_6_4() != null -> println(value_1.inv()) } + when { value_1.case_6_1() -> println(value_1.inv()) } + when { !value_1.case_6_2() -> println(value_1.inv()) } + when { value_1.case_6_3() != null -> println(value_1.inv()) } + when { value_1.case_6_4() != null -> println(value_1.inv()) } } // TESTCASE NUMBER: 7 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/5.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/5.fir.kt index a35f95eb265..5c200f212ea 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 @@ -86,41 +86,41 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Any?) { value_1.case_1() - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 2 fun case_2(value_1: Number?) { value_1.case_2() - println(value_1.inv()) + println(value_1.inv()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Any?) { value_1.case_3() - println(value_1.inv()) + println(value_1.inv()) } // TESTCASE NUMBER: 4 fun case_4(value_1: Any?, value_2: Any?, value_3: Any?) { - when { value_1.case_4_1() -> println(value_1.length) } - when { !value_2.case_4_2() -> println(value_2.length) } - when { value_3.case_4_3() != null -> println(value_3.length) } - when { value_3.case_4_4() == null -> println(value_3.length) } + when { value_1.case_4_1() -> println(value_1.length) } + when { !value_2.case_4_2() -> println(value_2.length) } + when { value_3.case_4_3() != null -> println(value_3.length) } + when { value_3.case_4_4() == null -> println(value_3.length) } } // TESTCASE NUMBER: 5 fun case_5(value_1: Number?, value_2: Number?, value_3: Number?) { - if (value_1.case_5_1()) println(value_1.inv()) - if (!value_2.case_5_2()) println(value_2.inv()) - if (value_3.case_5_3() != null) println(value_3.inv()) - if (value_3.case_5_4() == null) println(value_3.inv()) + if (value_1.case_5_1()) println(value_1.inv()) + if (!value_2.case_5_2()) println(value_2.inv()) + if (value_3.case_5_3() != null) println(value_3.inv()) + if (value_3.case_5_4() == null) println(value_3.inv()) } // TESTCASE NUMBER: 6 fun case_6(value_1: Any?, value_2: Any?, value_3: Any?) { - if (value_1.case_6_1()) println(value_1.inv()) - if (!value_2.case_6_2()) println(value_2.inv()) - if (value_3.case_6_3() == null) println(value_3.inv()) - if (value_3.case_6_4() != null) println(value_3.inv()) + if (value_1.case_6_1()) println(value_1.inv()) + if (!value_2.case_6_2()) println(value_2.inv()) + if (value_3.case_6_3() == null) println(value_3.inv()) + if (value_3.case_6_4() != null) println(value_3.inv()) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/6.fir.kt index 1e60fb25615..5795800edec 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 @@ -110,29 +110,29 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Any?, value_2: Int?) { value_1.case_1(value_2) - println(value_1.length) + println(value_1.length) println(value_2.inv()) } // TESTCASE NUMBER: 2 fun case_2(value_1: Number?, value_2: Any?) { value_1.case_2(value_2) - println(value_1.inv()) - println(value_2.toByte()) + println(value_1.inv()) + println(value_2.toByte()) } // TESTCASE NUMBER: 3 fun case_3(value_1: Any?, value_2: String?) { value_1.case_3(value_2) - println(value_1.inv()) + println(value_1.inv()) println(value_2.length) } // TESTCASE NUMBER: 4 fun case_4(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { value_1.case_4(value_2, value_3, value_4) - println(value_2.inv()) - println(value_3.toByte()) + println(value_2.inv()) + println(value_3.toByte()) println(value_4.length) } @@ -140,19 +140,19 @@ fun case_4(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: Any?, value_6: Int?) { when { value_1.case_5_1(value_2) -> { - println(value_1.length) + println(value_1.length) println(value_2.inv()) } } when { !value_3.case_5_2(value_4) -> { - println(value_3.length) + println(value_3.length) println(value_4.inv()) } } when { value_5.case_5_3(value_6) != null -> { - println(value_5.length) + println(value_5.length) println(value_6.inv()) } } @@ -161,55 +161,55 @@ fun case_5(value_1: Any?, value_2: Int?, value_3: Any?, value_4: Int?, value_5: // TESTCASE NUMBER: 6 fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, value_5: Number?, value_6: Any?) { if (value_1.case_6_1(value_2)) { - println(value_1.inv()) - println(value_2.toByte()) + println(value_1.inv()) + println(value_2.toByte()) } if (!value_3.case_6_2(value_4)) { - println(value_3.inv()) - println(value_4.toByte()) + println(value_3.inv()) + println(value_4.toByte()) } if (value_5.case_6_3(value_6) != null) { - println(value_5.inv()) - println(value_6.toByte()) + println(value_5.inv()) + println(value_6.toByte()) } if (value_5.case_6_4(value_6) == null) { - println(value_5.inv()) - println(value_6.toByte()) + println(value_5.inv()) + println(value_6.toByte()) } } // TESTCASE NUMBER: 7 fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, value_5: Any?, value_6: String?) { if (value_1.case_7_1(value_2)) { - println(value_1.inv()) + println(value_1.inv()) println(value_2.length) } if (value_3.case_7_2(value_4)) { - println(value_3.inv()) + println(value_3.inv()) println(value_4.length) } if (value_5.case_7_3(value_6) != null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.length) } if (value_5.case_7_4(value_6) == null) { - println(value_5.inv()) + println(value_5.inv()) println(value_6.length) } } // TESTCASE NUMBER: 8 fun case_8(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?) { - when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } - when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) } + when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } + when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } - when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_2.inv()) } - when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_3.toByte()) } + when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_2.inv()) } + when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_3.toByte()) } when { !value_1.case_8_2(value_2, value_3, value_4) -> println(value_4.length) } - when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_2.inv()) } - when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_3.toByte()) } + when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_2.inv()) } + when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_3.toByte()) } when { value_1.case_8_3(value_2, value_3, value_4) == null -> println(value_4.length) } - when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_2.inv()) } - when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_3.toByte()) } + when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_2.inv()) } + when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_3.toByte()) } when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_4.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/8.fir.kt index 3e5cb46bcbf..ab9f5489046 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 @@ -59,32 +59,32 @@ import contracts.* // TESTCASE NUMBER: 1 fun case_1(value_1: Any?) { funWithReturns(value_1 !is Number?) - println(value_1?.toByte()) + println(value_1?.toByte()) if (funWithReturnsTrue(value_1 !is Number)) { - println(value_1.toByte()) - if (funWithReturnsNotNull(value_1 is Int) == null) println(value_1.inv()) + println(value_1.toByte()) + if (funWithReturnsNotNull(value_1 is Int) == null) println(value_1.inv()) } } // TESTCASE NUMBER: 2 fun case_2(value_1: Any?) { if (!funWithReturnsFalse(value_1 !is Number?)) { - println(value_1?.toByte()) + println(value_1?.toByte()) funWithReturns(value_1 !is Number) - println(value_1.toByte()) - if (funWithReturnsNull(value_1 !is Int) == null) println(value_1.inv()) + println(value_1.toByte()) + if (funWithReturnsNull(value_1 !is Int) == null) println(value_1.inv()) } } // TESTCASE NUMBER: 3 fun case_3(value_1: Int?, value_2: Any?) { if (!value_1.case_3(value_1, value_2 is Number?)) { - println(value_2?.toByte()) + println(value_2?.toByte()) println(value_1) } else if (value_1.case_3(value_1, value_2 is Number?)) { - println(value_2?.toByte()) + println(value_2?.toByte()) } else { - println(value_2?.toByte()) + println(value_2?.toByte()) } } @@ -108,7 +108,7 @@ fun case_5(value_1: Number?, value_2: String?) { } false -> { println(value_2.length) - println(value_1.inv()) + println(value_1.inv()) } } } @@ -121,7 +121,7 @@ fun case_6(value_1: Number, value_2: String?, value_3: Any?) { println(value_2.length) } false -> { - println(value_3.length) + println(value_3.length) println(value_2.length) } null -> { diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/2.fir.kt index 93ee82d4c22..fe59b28d9a9 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/2.fir.kt @@ -20,7 +20,7 @@ fun case_2(value_1: Any?, value_2: Any?) { fun case_3(value_1: Any?, value_2: Any?) { funWithReturnsAndInvertCondition(value_1 !is String || value_2 != null) println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } // TESTCASE NUMBER: 4 @@ -87,19 +87,19 @@ fun case_7(value_1: Any?, value_2: Any?) { fun case_8(value_1: Any?, value_2: Any?) { if (funWithReturnsTrueAndInvertCondition(value_1 !is String || value_2 != null)) { println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } if (!funWithReturnsFalseAndInvertCondition(value_1 !is String || value_2 != null)) { println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } if (funWithReturnsNotNullAndInvertCondition(value_1 !is String || value_2 != null) != null) { println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } if (funWithReturnsNullAndInvertCondition(value_1 !is String || value_2 != null) == null) { println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt index 6fb01fcd8bf..18a9970141c 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/3.fir.kt @@ -93,7 +93,7 @@ fun case_1(value_1: Any?, value_2: Any?) { fun case_2(value_1: Any?, value_2: Any?) { contracts.case_2(value_1, value_2) println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } // TESTCASE NUMBER: 3 @@ -132,19 +132,19 @@ fun case_4(value_1: Any?, value_2: Any?) { fun case_5(value_1: Any?, value_2: Any?) { if (contracts.case_5_1(value_1, value_2)) { println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } if (!contracts.case_5_2(value_1, value_2)) { println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } if (contracts.case_5_3(value_1, value_2) != null) { println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } if (contracts.case_5_4(value_1, value_2) == null) { println(value_1.length) - println(value_2?.toByte()) + println(value_2?.toByte()) } } 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 7266c75c17d..f5870d06e5f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt @@ -133,7 +133,7 @@ fun case_6(value_1: Number, value_2: String?, value_3: Any?) { println(value_2.length) } null -> { - println(value_1.inv()) + println(value_1.inv()) } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/1.fir.kt index 986488008d0..c1fd73da009 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 @@ -184,7 +184,7 @@ fun case_13(x: otherpackage.Case13?) = throw Exception() } else { x - x.equals(x) + x.equals(x) } // TESTCASE NUMBER: 14 diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/31.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/31.fir.kt index b8e6634377c..fafe7410b27 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/31.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/31.fir.kt @@ -8,5 +8,5 @@ fun case_1(x: Interface2) = x fun case_1() { val x: Interface1 = null as Interface1 x as Interface2 - case_1(x) + case_1(x) } 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 b6f2f23c2ae..35baed53938 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 @@ -726,8 +726,8 @@ internal val KT_DIAGNOSTIC_CONVERTER = KtDiagnosticConverterBuilder.buildConvert token, ) } - add(FirErrors.AMBIGUITY) { firDiagnostic -> - AmbiguityImpl( + add(FirErrors.OVERLOAD_RESOLUTION_AMBIGUITY) { firDiagnostic -> + OverloadResolutionAmbiguityImpl( firDiagnostic.a.map { abstractFirBasedSymbol -> firSymbolBuilder.buildSymbol(abstractFirBasedSymbol.fir as FirDeclaration) }, 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 9d7872fb9b1..af1b7e5d6bb 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 @@ -523,8 +523,8 @@ sealed class KtFirDiagnostic : KtDiagnosticWithPsi { abstract val violatedParameter: KtSymbol } - abstract class Ambiguity : KtFirDiagnostic() { - override val diagnosticClass get() = Ambiguity::class + abstract class OverloadResolutionAmbiguity : KtFirDiagnostic() { + override val diagnosticClass get() = OverloadResolutionAmbiguity::class abstract val candidates: List } 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 b484d46de52..15959dc34be 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 @@ -836,11 +836,11 @@ internal class NoValueForParameterImpl( override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) } -internal class AmbiguityImpl( +internal class OverloadResolutionAmbiguityImpl( override val candidates: List, firDiagnostic: FirPsiDiagnostic<*>, override val token: ValidityToken, -) : KtFirDiagnostic.Ambiguity(), KtAbstractFirDiagnostic { +) : KtFirDiagnostic.OverloadResolutionAmbiguity(), KtAbstractFirDiagnostic { override val firDiagnostic: FirPsiDiagnostic<*> by weakRef(firDiagnostic) } diff --git a/idea/testData/checker/When.fir.kt b/idea/testData/checker/When.fir.kt index 7280b6c4422..8ffc17839e1 100644 --- a/idea/testData/checker/When.fir.kt +++ b/idea/testData/checker/When.fir.kt @@ -9,7 +9,7 @@ fun foo() : Int { is Any? -> 1 s -> 1 1 -> 1 - 1 + a -> 1 + 1 + a -> 1 in 1..a -> 1 !in 1..a -> 1 else -> 1 diff --git a/idea/testData/checker/regression/ClassDeclarationAsExpression.fir.kt b/idea/testData/checker/regression/ClassDeclarationAsExpression.fir.kt index d01010738dc..dc96e6568ab 100644 --- a/idea/testData/checker/regression/ClassDeclarationAsExpression.fir.kt +++ b/idea/testData/checker/regression/ClassDeclarationAsExpression.fir.kt @@ -1,4 +1,4 @@ -val p = 1 < class A { +val p = 1 < class A { fun f() { f() } diff --git a/idea/testData/checker/regression/ClassDeclarationAsExpression2.fir.kt b/idea/testData/checker/regression/ClassDeclarationAsExpression2.fir.kt index 7b11e72d26d..88bc55d4cc7 100644 --- a/idea/testData/checker/regression/ClassDeclarationAsExpression2.fir.kt +++ b/idea/testData/checker/regression/ClassDeclarationAsExpression2.fir.kt @@ -1 +1 @@ -fun g() = 1 < class A +fun g() = 1 < class A diff --git a/idea/testData/checker/regression/ClassDeclarationAsExpression3.fir.kt b/idea/testData/checker/regression/ClassDeclarationAsExpression3.fir.kt index ee45f361ade..d6da5c8f0a6 100644 --- a/idea/testData/checker/regression/ClassDeclarationAsExpression3.fir.kt +++ b/idea/testData/checker/regression/ClassDeclarationAsExpression3.fir.kt @@ -1,4 +1,4 @@ -fun f(i: Int = 3 < class A { +fun f(i: Int = 3 < class A { fun f() { f() } diff --git a/idea/testData/checker/regression/InterfaceDeclarationAsExpression.fir.kt b/idea/testData/checker/regression/InterfaceDeclarationAsExpression.fir.kt index d020b156090..e9984f52ac6 100644 --- a/idea/testData/checker/regression/InterfaceDeclarationAsExpression.fir.kt +++ b/idea/testData/checker/regression/InterfaceDeclarationAsExpression.fir.kt @@ -1,4 +1,4 @@ -val p = 1 < interface A { +val p = 1 < interface A { fun f() { f() }