From f283f2db43eb6b7942dde92661104d514e758bed Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 22 Jul 2020 16:40:14 +0300 Subject: [PATCH] [FIR] Improve diagnostic reporting & don't use error symbol for candidate if possible Also introduce few new diagnostics: - NONE_APPLICABLE more many inapplicable candidates - HIDDEN for visible candidates --- .../testData/resolve/arguments/default.txt | 8 +- .../arguments/defaultFromOverrides.txt | 4 +- .../resolve/arguments/integerLiteralTypes.txt | 8 +- .../resolve/arguments/javaArrayVariance.txt | 2 +- .../testData/resolve/arguments/lambda.txt | 14 +-- .../arguments/operatorsOverLiterals.txt | 16 ++-- .../testData/resolve/arguments/simple.txt | 12 +-- .../testData/resolve/arguments/vararg.txt | 8 +- .../callResolution/errorCandidates.txt | 2 +- .../resolve/cfg/flowFromInplaceLambda.dot | 2 +- .../resolve/cfg/flowFromInplaceLambda.txt | 2 +- .../testData/resolve/cfg/jumps.dot | 2 +- .../testData/resolve/cfg/jumps.txt | 2 +- .../resolve/delegatingConstructorCall.kt | 4 +- .../diagnostics/upperBoundViolated.txt | 4 +- .../CallBasedInExpressionGenerator.kt | 4 +- .../CallBasedInExpressionGenerator.txt | 6 +- .../testData/resolve/expresssions/access.kt | 4 +- .../testData/resolve/expresssions/access.txt | 4 +- .../resolve/expresssions/enumEntryUse.txt | 2 +- .../expresssions/inference/typeParameters.txt | 2 +- .../inference/typeParameters2.txt | 2 +- .../resolve/expresssions/nestedVisibility.kt | 12 +-- .../resolve/expresssions/nestedVisibility.txt | 12 +-- .../resolve/expresssions/privateVisibility.kt | 20 ++-- .../expresssions/privateVisibility.txt | 18 ++-- .../expresssions/protectedVisibility.kt | 6 +- .../expresssions/protectedVisibility.txt | 6 +- .../expresssions/syntheticSmartCast.txt | 2 +- .../inference/nullableIntegerLiteralType.txt | 4 +- .../inference/receiverWithCapturedType.txt | 2 +- .../resolve/lambdaArgInScopeFunction.txt | 4 +- .../resolve/lambdaPropertyTypeInference.txt | 8 +- .../testData/resolve/nested/innerTypes.txt | 6 +- .../testData/resolve/overrides/simple.kt | 2 +- .../testData/resolve/overrides/simple.txt | 2 +- .../overrides/supertypeGenericsComplex.txt | 2 +- .../definitelyNotNullAndOriginalType.txt | 2 +- .../genericSamInferenceFromExpectType.txt | 2 +- .../realConstructorFunction.txt | 6 +- .../resolve/samConversions/genericSam.txt | 2 +- .../resolve/samConversions/kotlinSam.txt | 8 +- .../notSamBecauseOfSupertype.txt | 6 +- .../testData/resolve/sealedClass.kt | 4 +- .../testData/resolve/smartcasts/bangbang.dot | 6 +- .../testData/resolve/smartcasts/bangbang.txt | 6 +- .../smartcasts/booleans/equalsToBoolean.dot | 16 ++-- .../smartcasts/booleans/equalsToBoolean.txt | 16 ++-- .../booleans/jumpFromRhsOfOperator.dot | 12 +-- .../booleans/jumpFromRhsOfOperator.txt | 12 +-- .../boundSmartcastsInBranches.dot | 8 +- .../boundSmartcastsInBranches.txt | 8 +- .../resolve/smartcasts/equalsAndIdentity.dot | 8 +- .../resolve/smartcasts/equalsAndIdentity.txt | 8 +- .../resolve/smartcasts/nullability.dot | 68 +++++++------- .../resolve/smartcasts/nullability.kt | 12 +-- .../resolve/smartcasts/nullability.txt | 56 +++++------ .../resolve/smartcasts/orInWhenBranch.txt | 8 +- .../safeCalls/safeCallAndEqualityToBool.dot | 8 +- .../safeCalls/safeCallAndEqualityToBool.txt | 8 +- .../smartcasts/safeCalls/safeCalls.dot | 6 +- .../smartcasts/safeCalls/safeCalls.txt | 6 +- .../variables/delayedAssignment.dot | 2 +- .../variables/delayedAssignment.txt | 2 +- .../variables/smartcastAfterReassignment.dot | 2 +- .../variables/smartcastAfterReassignment.txt | 2 +- .../visibility/singletonConstructors.kt | 4 +- .../visibility/singletonConstructors.txt | 6 +- .../callableReferences/companions.kt | 4 +- .../callableReferences/companions.txt | 4 +- ...llableReferencesAfterAllSimpleArguments.kt | 4 +- ...lableReferencesAfterAllSimpleArguments.txt | 4 +- .../callableReferences/implicitTypes.kt | 2 +- .../callableReferences/implicitTypes.txt | 4 +- .../fromLibrary/notIsNullOrEmpty.txt | 2 +- .../good/returnsImplies/eqNotEq.txt | 2 +- .../good/returnsImplies/receivers.txt | 2 +- .../resolveWithStdlib/j+k/JavaVisibility2.kt | 16 ++-- .../resolveWithStdlib/j+k/JavaVisibility2.txt | 22 ++--- .../j+k/KJKComplexHierarchyWithNested.txt | 4 +- .../j+k/KotlinClassParameter.txt | 2 +- .../j+k/KotlinClassParameterGeneric.txt | 4 +- .../ErrorNodeDiagnosticCollectorComponent.kt | 10 +- .../diagnostics/FirDefaultErrorMessages.kt | 7 +- .../diagnostics/FirDiagnosticRenderers.kt | 16 ++-- .../fir/analysis/diagnostics/FirErrors.kt | 4 +- .../jetbrains/kotlin/fir/dump/HtmlFirDump.kt | 36 ++++--- .../jetbrains/kotlin/fir/FirCallResolver.kt | 46 +++++---- .../kotlin/fir/resolve/calls/Candidate.kt | 5 + .../resolve/calls/ResolutionStageRunner.kt | 6 +- .../fir/resolve/calls/TypeArgumentMapping.kt | 2 +- .../fir/resolve/diagnostics/FirDiagnostics.kt | 26 +++-- .../fir/resolve/inference/FirCallCompleter.kt | 4 +- .../FirExpressionsResolveTransformer.kt | 2 +- .../tests/BinaryCallsOnNullableValues.fir.kt | 8 +- .../tests/ConstructorsOfPrimitives.fir.kt | 4 +- ...tedGetSetPropertyDelegateConvention.fir.kt | 4 +- .../DeprecatedUnaryOperatorConventions.fir.kt | 2 +- .../diagnostics/tests/Nullability.fir.kt | 8 +- .../tests/ObjectWithConstructor.fir.kt | 6 +- .../tests/PackageInExpressionPosition.fir.kt | 4 +- .../tests/PrivateFromOuterPackage.fir.kt | 10 +- .../annotationRenderingInTypes.fir.kt | 2 +- ...ityResolveWithVarargAndOperatorCall.fir.kt | 18 ---- ...ibilityResolveWithVarargAndOperatorCall.kt | 1 + ...nstraintFromLHSWithCorrectDirection.fir.kt | 4 +- ...intFromLHSWithCorrectDirectionError.fir.kt | 2 +- ...expectedTypeAsSubtypeOfFunctionType.fir.kt | 2 +- .../function/extensionToSupertype.fir.kt | 19 ---- .../function/extensionToSupertype.kt | 1 + .../noAmbiguityMemberVsTopLevel.fir.kt | 4 +- .../generic/dependOnArgumentType.fir.kt | 6 +- .../generic/explicitTypeArguments.fir.kt | 2 +- .../generic/genericExtensionFunction.fir.kt | 6 +- ...nericCallWithReferenceAgainstVararg.fir.kt | 4 +- ...renceAdaptationHasDependencyOnApi14.fir.kt | 4 +- ...ctionTypeOverloadWithWrongParameter.fir.kt | 4 +- .../resolve/kt35887_simple.fir.kt | 2 +- ...leReferencesAfterAllSimpleArguments.fir.kt | 6 +- ...resolveTwoReferencesAgainstGenerics.fir.kt | 4 +- .../tests/checkArguments/SpreadVarargs.fir.kt | 4 +- .../checkArguments/overloadedFunction.fir.kt | 8 +- .../classObjects/ClassObjectVisibility.fir.kt | 4 +- .../nestedClassInPrivateClassObject.fir.kt | 4 +- .../lateinitWithErroneousDelegation.fir.kt | 4 +- ...LoopWithExtensionIteratorOnNullable.fir.kt | 4 +- .../forLoopWithNullableRange.fir.kt | 4 +- .../tests/dataFlow/IsExpression.fir.kt | 4 +- .../namedFunAsLastExpressionInBlock.fir.kt | 2 +- .../propertyDefferedType.fir.kt | 2 +- .../delegatedProperty/thisInDelegate.fir.kt | 2 +- .../delegatedProperty/twoGetMethods.fir.kt | 2 +- .../checkDeparenthesizedType.fir.kt | 2 +- .../withInvisibleSynthesized.fir.kt | 8 +- .../enum/ConstructorCallFromOutside.fir.kt | 2 +- .../tests/enum/inheritanceFromEnum.fir.kt | 2 +- .../exposed/exceptionOnFakeInvisible.fir.kt | 2 +- .../tests/extensions/kt1875.fir.kt | 2 +- .../complexInference.fir.kt | 16 ++-- .../noExpectedType.fir.kt | 8 +- .../redeclaration.fir.kt | 2 +- .../destructuringInLambdas/simple.fir.kt | 4 +- .../unusedParameters.fir.kt | 4 +- .../implicitArguments/fromSuperClasses.fir.kt | 4 +- .../fromSuperClassesLocal.fir.kt | 4 +- .../fromSuperClassesTransitive.fir.kt | 2 +- ...rongNumberOfTypeArgumentsDiagnostic.fir.kt | 6 +- .../tests/imports/CheckJavaVisibility2.fir.kt | 16 ++-- .../imports/ImportOverloadFunctions.fir.kt | 8 +- .../tests/imports/ImportPrivateMember.fir.kt | 4 +- .../imports/InaccessiblePrivateClass.fir.kt | 2 +- .../PackageLocalClassNotImported.fir.kt | 2 +- .../PackageLocalClassReferencedError.fir.kt | 2 +- .../imports/PrivateClassNotImported.fir.kt | 2 +- .../PrivateClassReferencedError.fir.kt | 2 +- .../invisibleFakeReferenceInImport.fir.kt | 4 +- ...pleteFunctionArgumentsOfNestedCalls.fir.kt | 8 -- .../completeFunctionArgumentsOfNestedCalls.kt | 1 + .../tests/incompleteCode/kt2014.fir.kt | 4 +- ...cannotCompleteResolveNoneApplicable.fir.kt | 2 +- .../captureFromNullableTypeVariable.fir.kt | 6 +- .../captureFromTypeParameterUpperBound.fir.kt | 6 +- .../inference/capturedTypes/kt2872.fir.kt | 4 +- .../completeInferenceIfManyFailed.fir.kt | 4 +- .../postponedArgumentsAnalysis/basic.fir.kt | 6 +- .../constraintOnFunctionLiteral.fir.kt | 2 +- .../tests/inference/kt39220.fir.kt | 8 +- .../inference/regressions/kt36342.fir.kt | 12 +-- .../tests/inference/regressions/kt742.fir.kt | 2 +- ...renceWrongReceiverForManyCandidates.fir.kt | 4 +- .../tests/inference/tooEagerSmartcast.fir.kt | 4 +- .../diagnostics/tests/inner/visibility.fir.kt | 12 +-- ...isiblePackagePrivateInheritedMember.fir.kt | 2 +- .../tests/j+k/packageVisibility.fir.kt | 16 ++-- .../properties/fieldPropertyOverloads.fir.kt | 8 +- .../fieldPropertyOverloadsDisabled.fir.kt | 8 +- .../fieldPropertyOverloadsNI.fir.kt | 8 +- ...privateCandidatesWithWrongArguments.fir.kt | 4 +- ...nceToSamFunctionAgainstExpectedType.fir.kt | 4 +- .../tests/j+k/selectMoreSpecific.fir.kt | 4 +- ...ctionGenericsInParamsBoundsMismatch.fir.kt | 40 -------- .../functionGenericsInParamsBoundsMismatch.kt | 1 + .../incompleteCodeNoNoneApplicable.fir.kt | 2 +- .../tests/multimodule/internal.fir.kt | 18 ++-- .../tests/multimodule/packagePrivate.fir.kt | 4 +- .../multimodule/publishedApiInternal.fir.kt | 34 +++---- .../enum/constructorInHeaderEnum.fir.kt | 4 +- .../explicitConstructorDelegation.fir.kt | 2 +- .../tests/multiplatform/namedArguments.fir.kt | 2 +- .../InfixCallNullability.fir.kt | 4 +- .../NullableNothingIsExactlyNull.fir.kt | 4 +- .../nullabilityAndSmartCasts/kt2216.fir.kt | 2 +- .../nullabilityAndSmartCasts/kt362.fir.kt | 4 +- ...ullableReceiverWithOverloadedMethod.fir.kt | 10 +- ...leSmartcastWithOverloadedExtensions.fir.kt | 4 +- ...eArgumentToNonNullParameterPlatform.fir.kt | 4 +- ...bleArgumentToNonNullParameterSimple.fir.kt | 6 +- .../deprecatedModConvention.fir.kt | 6 +- ...precatedModConventionWithoutFeature.fir.kt | 6 +- .../InconsistentGetSet.fir.kt | 10 +- .../onlyPrivateOverloadsDiagnostic.fir.kt | 4 +- .../override/AllPrivateFromSuperTypes.fir.kt | 4 +- .../noAnnotationInClassPath.fir.kt | 2 +- .../nullabilityWarnings/arithmetic.fir.kt | 14 +-- .../nullabilityWarnings/for.fir.kt | 2 +- .../rawTypes/genericInnerClass.fir.kt | 4 +- .../topLevelAnnotationCall.fir.kt | 6 +- .../tests/privateInFile/visibility.fir.kt | 12 +-- .../tests/regressions/DoubleDefine.fir.kt | 4 +- .../WrongTraceInCallResolver.fir.kt | 2 +- .../tests/regressions/kt10633.fir.kt | 2 +- .../tests/regressions/kt282.fir.kt | 2 +- .../invoke/errors/invisibleInvoke.fir.kt | 4 +- ...tionExpectedWhenSeveralInvokesExist.fir.kt | 4 +- .../invoke/implicitInvokeAfterSafeCall.fir.kt | 4 +- ...OnVariableWithExtensionFunctionType.fir.kt | 2 +- ...eInferenceForNestedInNoneApplicable.fir.kt | 4 +- ...nyInapplicableCandidatesWithLambdas.fir.kt | 28 +++--- .../noCandidates/resolvedToClassifier.fir.kt | 4 +- .../resolvedToClassifierWithReceiver.fir.kt | 6 +- .../varargsInDifferentPositions.fir.kt | 2 +- .../overloadConflicts/varargsMixed.fir.kt | 4 +- .../specialConstructions/elvisAsCall.fir.kt | 6 +- .../samConversions/OverloadPriority.fir.kt | 6 +- .../samConversions/OverloadPriorityKT.fir.kt | 6 +- .../arrayAsVarargAfterSamArgument.fir.kt | 8 +- ...yAsVarargAfterSamArgumentProhibited.fir.kt | 8 +- ...entWithoutSamConversionsPerArgument.fir.kt | 8 +- .../scopes/VisibilityInClassObject.fir.kt | 6 +- .../statics/hidePrivateByPublic.fir.kt | 4 +- .../diagnostics/tests/scopes/kt1244.fir.kt | 4 +- .../diagnostics/tests/scopes/kt1738.fir.kt | 4 +- .../diagnostics/tests/scopes/kt1805.fir.kt | 8 +- .../diagnostics/tests/scopes/kt1806.fir.kt | 6 +- .../diagnostics/tests/scopes/kt1942.fir.kt | 2 +- .../diagnostics/tests/scopes/kt37.fir.kt | 4 +- .../diagnostics/tests/scopes/kt9430.fir.kt | 4 +- .../innerProtectedClass.fir.kt | 2 +- .../javaInheritedInKotlin.fir.kt | 12 +-- .../protectedCallOnSubClass.fir.kt | 2 +- .../syntheticPropertyExtensions.fir.kt | 2 +- .../syntheticSAMExtensions.fir.kt | 2 +- .../tests/scopes/visibility.fir.kt | 10 +- .../tests/scopes/visibility2.fir.kt | 8 +- .../tests/scopes/visibility3.fir.kt | 12 +-- ...mentsResolveInBodyAndDelegationCall.fir.kt | 2 +- .../companionObjectScope.fir.kt | 17 ---- .../companionObjectScope.kt | 1 + .../constructorCallType.fir.kt | 2 +- .../constructorInObject.fir.kt | 4 +- .../errorsOnEmptyDelegationCall.fir.kt | 10 +- .../superSecondaryNonExisting.fir.kt | 4 +- .../thisNonExisting.fir.kt | 8 -- .../secondaryConstructors/thisNonExisting.kt | 1 + .../unstableSmartCast.fir.kt | 2 +- .../smartCasts/objectLiterals/exclexcl.fir.kt | 2 +- .../objectLiterals/exclexclArgument.fir.kt | 2 +- .../objectLiterals/exclexclTwoArgument.fir.kt | 2 +- .../safecalls/nullableReceiver.fir.kt | 4 +- .../nullableReceiverInLongChain.fir.kt | 4 +- ...castOnSameFieldOfDifferentInstances.fir.kt | 2 +- .../varnotnull/plusplusMinusminus.fir.kt | 6 +- .../varnotnull/unnecessaryWithMap.fir.kt | 6 +- .../smartCasts/varnotnull/varIntNull.fir.kt | 4 +- ...spendConversionForCallableReference.fir.kt | 2 +- ...ndConversionWithReferenceAdaptation.fir.kt | 2 +- .../javaProperties/OnlyPublic.fir.kt | 8 +- .../SetterHasHigherAccess.fir.kt | 8 +- .../samAdapters/PackageLocal.fir.kt | 4 +- .../samAdapters/Private.fir.kt | 4 +- .../samAdapters/Protected.fir.kt | 2 +- .../samAdapters/overloadResolution.fir.kt | 2 +- .../overloadResolutionStatic.fir.kt | 2 +- ...dResolutionStaticWithoutRefinedSams.fir.kt | 2 +- ...verloadResolutionWithoutRefinedSams.fir.kt | 2 +- .../targetedBuiltIns/getOrDefault.fir.kt | 8 +- .../tests/typealias/privateInFile.fir.kt | 4 +- .../typealias/typeAliasConstructor.fir.kt | 6 +- .../typeAliasConstructorWrongClass.fir.kt | 4 +- ...typeAliasConstructorWrongVisibility.fir.kt | 6 +- .../chainedFunSuspendUnitConversion.fir.kt | 2 +- .../chainedUnitSuspendConversion.fir.kt | 2 +- ...entsInNamedFormFunDeprecation_after.fir.kt | 16 ++-- ...ntsInNamedFormFunDeprecation_before.fir.kt | 16 ++-- .../tests/varargs/varargViewedAsArray.fir.kt | 12 +-- .../privateToThis/FunctionCall.fir.kt | 2 +- .../variance/privateToThis/GetVal.fir.kt | 2 +- .../variance/privateToThis/SetVar.fir.kt | 2 +- .../CallCompanionProtectedNonStatic.fir.kt | 8 +- .../dsl/callUsualContractFunction.fir.kt | 2 +- .../callableReferenceOnUnresolvedLHS.fir.kt | 2 +- ...pendConversionForCallableReferences.fir.kt | 4 +- ...callableReferenceToASuspendFunction.fir.kt | 6 +- .../testsWithStdLib/coroutines/kt37309.fir.kt | 6 +- .../suspendExternalFunctions.fir.kt | 4 +- .../coroutines/suspendFunctions.fir.kt | 6 +- .../factoryPattern/multipleOverloads_1.fir.kt | 4 +- .../suspendFunctions.fir.kt | 2 +- .../testsWithStdLib/inference/kt11266.fir.kt | 2 +- .../testsWithStdLib/inference/kt1558.fir.kt | 4 +- .../resolve/samAgainstFunctionalType.fir.kt | 4 +- .../resolve/samOverloadsWithGenerics.fir.kt | 6 +- ...loadsWithGenericsWithoutRefinedSams.fir.kt | 6 +- .../resolve/samOverloadsWithKtFunction.fir.kt | 4 +- ...adsWithKtFunctionWithoutRefinedSams.fir.kt | 4 +- .../smartcasts/forEachUnsafe.fir.kt | 2 +- .../unsupportedFeature.fir.kt | 2 +- .../typeAliasSamAdapterConstructors2.fir.kt | 2 +- .../when/noTypeArgumentsInConstructor.fir.kt | 10 +- .../adaptedWithCoercionToUnit.fir.txt | 8 +- .../caoWithAdaptationForSam.fir.txt | 72 +++++++++----- .../constructorWithAdaptedArguments.fir.txt | 26 +++-- .../suspendConversion.fir.txt | 4 +- ...emberReferenceWithAdaptedArguments.fir.txt | 14 ++- .../withAdaptationForSam.fir.txt | 4 +- .../withAdaptedArguments.fir.txt | 17 ++-- .../withArgumentAdaptationAndReceiver.fir.txt | 25 ++--- .../withVarargViewedAsArray.fir.txt | 4 +- .../samConversionInVarargs.fir.txt | 4 +- .../ir/irText/expressions/kt28456a.fir.txt | 2 +- .../ir/irText/expressions/kt28456b.fir.txt | 17 +++- .../ir/irText/expressions/lambdaInCAO.fir.txt | 24 +---- .../sam/arrayAsVarargAfterSamArgument.fir.txt | 10 +- .../sam/arrayAsVarargAfterSamArgument.kt | 2 +- .../sam/samByProjectedType.fir.txt | 8 +- .../sam/samConversionsWithSmartCasts.fir.txt | 4 +- .../signedToUnsignedConversions_test.fir.txt | 14 +-- ...endConversionOnArbitraryExpression.fir.txt | 30 +++--- .../whenWithSubjectVariable.fir.txt | 6 +- .../abstract-classes/p-2/neg/1.8.fir.kt | 8 +- .../conditional-expression/p-6/neg/1.1.fir.kt | 4 +- .../boolean-literals/p-1/neg/3.1.fir.kt | 12 +-- .../p-1/neg/2.2.fir.kt | 12 +-- .../p-1/neg/2.3.fir.kt | 94 +++++++++---------- .../p-1/neg/2.4.fir.kt | 12 +-- .../p-1/pos/2.2.fir.kt | 4 +- .../p-1/pos/2.3.fir.kt | 4 +- .../p-1/pos/2.4.fir.kt | 4 +- .../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 +- .../p-3/neg/1.1.fir.kt | 4 +- .../p-3/pos/1.4.fir.kt | 8 +- .../p-1/pos/1.1.fir.kt | 4 +- .../kotlin.nothing/p-1/neg/2.1.fir.kt | 4 +- .../analysis/smartcasts/neg/1.fir.kt | 24 ++--- .../analysis/smartcasts/neg/10.fir.kt | 12 +-- .../analysis/smartcasts/neg/15.fir.kt | 4 +- .../analysis/smartcasts/neg/4.fir.kt | 16 ++-- .../analysis/smartcasts/neg/6.fir.kt | 20 ++-- .../analysis/smartcasts/neg/7.fir.kt | 4 +- .../analysis/smartcasts/neg/8.fir.kt | 8 +- .../analysis/smartcasts/pos/1.fir.kt | 10 +- .../analysis/smartcasts/pos/4.fir.kt | 2 +- .../analysis/smartcasts/pos/6.fir.kt | 20 ++-- .../analysis/smartcasts/pos/8.fir.kt | 4 +- .../diagnostics/notLinked/dfa/neg/1.fir.kt | 88 ++++++++--------- .../diagnostics/notLinked/dfa/neg/30.fir.kt | 2 +- .../diagnostics/notLinked/dfa/neg/8.fir.kt | 6 +- .../diagnostics/notLinked/dfa/pos/2.fir.kt | 74 +++++++-------- .../diagnostics/notLinked/dfa/pos/30.fir.kt | 28 +++--- .../diagnostics/notLinked/dfa/pos/31.fir.kt | 24 ++--- .../diagnostics/notLinked/dfa/pos/40.fir.kt | 6 +- .../diagnostics/notLinked/dfa/pos/7.fir.kt | 90 +++++++++--------- 365 files changed, 1400 insertions(+), 1451 deletions(-) delete mode 100644 compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/completeFunctionArgumentsOfNestedCalls.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.fir.kt delete mode 100644 compiler/testData/diagnostics/tests/secondaryConstructors/thisNonExisting.fir.kt diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/default.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/default.txt index b8e5db76369..a009909f0e8 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/default.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/default.txt @@ -10,14 +10,14 @@ FILE: default.kt R|/foo|(Int(1), Double(2.0)) R|/foo|(Int(1), Double(2.0), Boolean(true)) R|/foo|(Int(1), third = Boolean(true)) - #() - #(Int(0), Double(0.0), Boolean(false), String()) + #() + #(Int(0), Double(0.0), Boolean(false), String()) R|/bar|(Int(1), third = Boolean(true)) R|/bar|(Int(1), Double(2.0), Boolean(true)) R|/bar|(Int(1), Double(2.0), Boolean(true), String(my)) - #(Int(1), Boolean(true)) + #(Int(1), Boolean(true)) R|/baz|(Int(1)) R|/baz|(Int(1), vararg(String(my), String(yours))) R|/baz|(Int(1), z = Boolean(true)) - #(Int(0), String(), Boolean(false)) + #(Int(0), String(), Boolean(false)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.txt index 572f865b1f3..c4baec92736 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/defaultFromOverrides.txt @@ -22,8 +22,8 @@ FILE: defaultFromOverrides.kt public final fun foo(a: R|A|): R|kotlin/Unit| { R|/a|.R|/A.foo|() R|/a|.R|/A.foo|(Int(1)) - R|/a|.#() - R|/a|.#(String()) + R|/a|.#() + R|/a|.#(String()) R|/a|.R|/A.bar|(y = Int(1)) R|/a|.R|/A.bar|(String(), Int(2)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.txt index 93573efd765..7e2036a595a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/integerLiteralTypes.txt @@ -20,9 +20,9 @@ FILE: integerLiteralTypes.kt R|/takeLong|(Long(1)) } public final fun test_2(): R|kotlin/Unit| { - #(Long(10000000000)) + #(Long(10000000000)) R|/takeLong|(Long(10000000000)) - #(Int(1000)) + #(Int(1000)) } public final fun test_3(): R|kotlin/Unit| { R|/takeInt|(R|kotlin/run|( = run@fun (): R|kotlin/Int| { @@ -46,8 +46,8 @@ FILE: integerLiteralTypes.kt )) } public final fun test_5(): R|kotlin/Unit| { - #(Int(1)) - #(R|kotlin/run|( = run@fun (): R|kotlin/Int| { + #(Int(1)) + #(R|kotlin/run|( = run@fun (): R|kotlin/Int| { ^ Int(1) } )) diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.txt index 38b33e16f27..da1cddf6a54 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/javaArrayVariance.txt @@ -5,6 +5,6 @@ FILE: main.kt } public final fun test(array: R|kotlin/Array|): R|kotlin/Unit| { Q|A|.R|/A.take|(R|/array|) - #(R|/array|) + #(R|/array|) R|/takeOutA|(R|/array|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.txt index 191b959464d..ef2642d0e31 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/lambda.txt @@ -18,11 +18,11 @@ FILE: lambda.kt ^@foo Unit } ) - #(Int(1), = foo@fun (): R|kotlin/Unit| { + #(Int(1), = foo@fun (): R|kotlin/Unit| { ^@foo Unit } ) - #(f = foo@fun (): R|kotlin/Unit| { + #(f = foo@fun (): R|kotlin/Unit| { ^@foo Unit } , = foo@fun (): R|kotlin/Unit| { @@ -45,11 +45,11 @@ FILE: lambda.kt ^@bar Unit } ) - #( = bar@fun (): R|kotlin/Unit| { + #( = bar@fun (): R|kotlin/Unit| { ^@bar Unit } ) - #(bar@fun (): R|kotlin/Unit| { + #(bar@fun (): R|kotlin/Unit| { ^@bar Unit } ) @@ -61,15 +61,15 @@ FILE: lambda.kt ^@baz Unit } , Boolean(false)) - #( = baz@fun (): R|kotlin/Unit| { + #( = baz@fun (): R|kotlin/Unit| { ^@baz Unit } ) - #( = baz@fun (): R|kotlin/Unit| { + #( = baz@fun (): R|kotlin/Unit| { ^@baz Unit } ) - #(other = Boolean(false), = baz@fun (): R|kotlin/Unit| { + #(other = Boolean(false), = baz@fun (): R|kotlin/Unit| { ^@baz Unit } ) diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.txt index 7df6da04e07..fb21ec6c31b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/operatorsOverLiterals.txt @@ -30,20 +30,20 @@ FILE: operatorsOverLiterals.kt } public final fun test_4(): R|kotlin/Unit| { R|/takeByte|(Byte(1).R|kotlin/Byte.plus|(Byte(1))) - #(Int(1).R|kotlin/Int.plus|(Int(127))) + #(Int(1).R|kotlin/Int.plus|(Int(127))) R|/takeByte|(Byte(1).R|kotlin/Byte.minus|(Byte(1))) - #(Int(100).R|kotlin/Int.unaryMinus|().R|kotlin/Int.minus|(Int(100))) + #(Int(100).R|kotlin/Int.unaryMinus|().R|kotlin/Int.minus|(Int(100))) R|/takeByte|(Byte(10).R|kotlin/Byte.times|(Byte(10))) - #(Int(100).R|kotlin/Int.times|(Int(100))) + #(Int(100).R|kotlin/Int.times|(Int(100))) #(Int(10).R|kotlin/Int.div|(Int(10))) R|/takeByte|(Byte(100).R|kotlin/Byte.rem|(Byte(10))) R|/takeByte|(Int(1000).R|kotlin/Int.rem|(Byte(10))) R|/takeByte|(Int(1000).R|/and|(Byte(100))) - #(Int(128).R|kotlin/Int.and|(Int(511))) + #(Int(128).R|kotlin/Int.and|(Int(511))) R|/takeByte|(Byte(100).R|/or|(Byte(100))) - #(Int(1000).R|kotlin/Int.or|(Int(0))) + #(Int(1000).R|kotlin/Int.or|(Int(0))) R|/takeByte|(Int(511).R|kotlin/Int.xor|(Int(511))) - #(Int(512).R|kotlin/Int.xor|(Int(511))) + #(Int(512).R|kotlin/Int.xor|(Int(511))) } public final fun test_5(): R|kotlin/Unit| { R|/takeByte|(Byte(1).R|kotlin/Byte.unaryMinus|()) @@ -51,11 +51,11 @@ FILE: operatorsOverLiterals.kt R|/takeByte|(Byte(1).R|/inv|()) } public final fun test_6(): R|kotlin/Unit| { - #(R|kotlin/run|( = run@fun (): R|kotlin/Int| { + #(R|kotlin/run|( = run@fun (): R|kotlin/Int| { ^ Int(127).R|kotlin/Int.plus|(Int(1)) } )) - #(Int(1).R|/plus|(R|kotlin/run|( = run@fun (): R|kotlin/Int| { + #(Int(1).R|/plus|(R|kotlin/run|( = run@fun (): R|kotlin/Int| { ^ Int(1) } ))) diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/simple.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/simple.txt index ed1492ff5a4..83f3977e7d3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/simple.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/simple.txt @@ -7,11 +7,11 @@ FILE: simple.kt R|/foo|(Int(1), Double(2.0), fourth = String(???), third = Boolean(false)) R|/foo|(Int(1), second = Double(3.14), third = Boolean(false), fourth = String(!?)) R|/foo|(third = Boolean(false), second = Double(2.71), fourth = String(?!), first = Int(0)) - #() - #(Double(0.0), Boolean(false), Int(0), String()) + #() + #(Double(0.0), Boolean(false), Int(0), String()) R|/foo|(Int(1), Double(2.0), third = Boolean(true), String()) - #(second = Double(0.0), first = Int(0), fourth = String()) - #(first = Double(0.0), second = Int(0), third = String(), fourth = Boolean(false)) - #(first = Int(0), second = Double(0.0), third = Boolean(false), fourth = String(), first = Int(1)) - #(Int(0), Double(0.0), Boolean(false), foth = String()) + #(second = Double(0.0), first = Int(0), fourth = String()) + #(first = Double(0.0), second = Int(0), third = String(), fourth = Boolean(false)) + #(first = Int(0), second = Double(0.0), third = Boolean(false), fourth = String(), first = Int(1)) + #(Int(0), Double(0.0), Boolean(false), foth = String()) } diff --git a/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.txt b/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.txt index 0c1f2e2e558..192c7be531e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.txt +++ b/compiler/fir/analysis-tests/testData/resolve/arguments/vararg.txt @@ -8,9 +8,9 @@ FILE: vararg.kt R|/foo|(Int(1), vararg(String())) R|/foo|(Int(1), vararg(String(my), String(yours))) R|/foo|(Int(1), vararg(*R|kotlin/arrayOf|(vararg(String(my), String(yours))))) - #(String()) - #(Int(1), Int(2)) + #(String()) + #(Int(1), Int(2)) R|/bar|(Int(1), z = Boolean(true), vararg(y = *R|kotlin/arrayOf|(vararg(String(my), String(yours))))) - #(Int(0), z = Boolean(false), y = String(), y = String(other)) - #(Int(0), String(), Boolean(true)) + #(Int(0), z = Boolean(false), y = String(), y = String(other)) + #(Int(0), String(), Boolean(true)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.txt b/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.txt index ca68824e1ad..123bc54e370 100644 --- a/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.txt +++ b/compiler/fir/analysis-tests/testData/resolve/callResolution/errorCandidates.txt @@ -12,7 +12,7 @@ FILE: errorCandidates.kt public final fun bar(x: R|B|): R|kotlin/Unit| { } public final fun test(c: R|C|): R|kotlin/Unit| { - #(String()) + #(String()) #(R|/c|) #() } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot index 0727691f9c6..8e15644d748 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.dot @@ -404,7 +404,7 @@ digraph flowFromInplaceLambda_kt { 142 [label="Function call: R|/select|(...)"]; 143 [label="Variable declaration: lval a: R|kotlin/Int|"]; 144 [label="Access variable R|/x|"]; - 145 [label="Function call: #(...)"]; + 145 [label="Function call: #(...)"]; 146 [label="Access variable R|/y|"]; 147 [label="Function call: R|/takeInt|(...)"]; 148 [label="Access variable R|/a|"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.txt index 6311423fb48..e0ca27481e1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/flowFromInplaceLambda.txt @@ -63,7 +63,7 @@ FILE: flowFromInplaceLambda.kt ^ Int(1) } ))) - #(R|/x|) + #(R|/x|) R|/takeInt|(R|/y|) R|/takeInt|(R|/a|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.dot b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.dot index bb298f57985..0a6cb1c2a81 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.dot +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.dot @@ -127,7 +127,7 @@ digraph jumps_kt { } 51 [label="Variable declaration: lval y: R|kotlin/Int?|"]; 52 [label="Access variable R|/y|"]; - 53 [label="Function call: R|/y|.#()"]; + 53 [label="Function call: R|/y|.#()"]; 54 [label="Exit block"]; } 55 [label="Exit function test_2" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.txt b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.txt index e1af89bd0a7..43ca398ba28 100644 --- a/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.txt +++ b/compiler/fir/analysis-tests/testData/resolve/cfg/jumps.txt @@ -22,7 +22,7 @@ FILE: jumps.kt } } - R|/y|.#() + R|/y|.#() } public final fun test_3(x: R|kotlin/Int?|): R|kotlin/Unit| { while(Boolean(true)) { diff --git a/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt b/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt index 0150e5633e3..f38568a6589 100644 --- a/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt +++ b/compiler/fir/analysis-tests/testData/resolve/delegatingConstructorCall.kt @@ -13,7 +13,7 @@ open class A3(x: String, y: String = "") { class B3_1 : A3("") class B3_2 : A3("", "asas") class B3_3 : A3("", true) -class B3_4 : A3("", Unit) +class B3_4 : A3("", Unit) open class A4(val x: Byte) class B4 : A4( 1 + 1) @@ -24,4 +24,4 @@ open class A5 { } class B5_1 : A5(1 + 1) -class B5_2 : A5(100 * 2) \ No newline at end of file +class B5_2 : A5(100 * 2) diff --git a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.txt b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.txt index 65813044e15..e99de8fe0ed 100644 --- a/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.txt +++ b/compiler/fir/analysis-tests/testData/resolve/diagnostics/upperBoundViolated.txt @@ -70,5 +70,5 @@ FILE: upperBoundViolated.kt } public final val np1: R|NumberPhile| = R|/NumberPhile.NumberPhile|(Int(10)) public get(): R|NumberPhile| - public final val np2: = #(String(Test)) - public get(): + public final val np2: R|NumberPhile| = #(String(Test)) + public get(): R|NumberPhile| diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt index 6754542d7a0..046f46615d0 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.kt @@ -8,7 +8,7 @@ class CallBasedInExpressionGenerator( private val isInverted = operatorReference.getReferencedNameElementType() == KtTokens.NOT_IN override fun generate(argument: StackValue): BranchedValue = - gen(argument).let { if (isInverted) Invert(it) else it } + gen(argument).let { if (isInverted) Invert(it) else it } private fun gen(argument: StackValue): BranchedValue = object : BranchedValue(argument, null, argument.type, Opcodes.IFEQ) { @@ -27,4 +27,4 @@ class CallBasedInExpressionGenerator( result.put(result.type, result.kotlinType, v) } } -} \ No newline at end of file +} diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt index d39ed186e52..7ca63a42ccc 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/CallBasedInExpressionGenerator.txt @@ -14,13 +14,13 @@ FILE: CallBasedInExpressionGenerator.kt private get(): R|kotlin/Boolean| public final override fun generate(argument: R|ERROR CLASS: Symbol not found, for `StackValue`|): R|ERROR CLASS: Symbol not found, for `BranchedValue`| { - ^generate this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.gen|(R|/argument|).#( = let@fun (): { + ^generate this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.gen|(R|/argument|).#( = let@fun (it: R|kotlin/Any?|): { ^ when () { this@R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator|.R|org/jetbrains/kotlin/codegen/range/inExpression/CallBasedInExpressionGenerator.isInverted| -> { - #(#) + #(R|/it|) } else -> { - # + R|/it| } } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt index 21932a5d597..43487deca83 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/access.kt @@ -21,7 +21,7 @@ class Bar { } // NB! abc() here is resolved to member Foo.abc(), and not to extension member of Bar - fun Foo.check() = abc() + bar() + fun Foo.check() = abc() + bar() // NB! + here is resolved to member String.plus (not to extension member above) fun Foo.check2() = "" + bar() @@ -60,4 +60,4 @@ fun f() { dcb() abc() -} \ No newline at end of file +} diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/access.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/access.txt index a75324c9f5c..fa2f219769f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/access.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/access.txt @@ -36,8 +36,8 @@ FILE: access.kt ^plus String() } - public final fun R|Foo|.check(): { - ^check this@R|/Bar.check|.R|/Foo.abc|().#(this@R|/Bar|.R|/Bar.bar|()) + public final fun R|Foo|.check(): { + ^check this@R|/Bar.check|.R|/Foo.abc|().#(this@R|/Bar|.R|/Bar.bar|()) } public final fun R|Foo|.check2(): R|kotlin/String| { diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.txt index 03a2eeb9259..b9c71fe19c9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/enumEntryUse.txt @@ -34,5 +34,5 @@ FILE: enumEntryUse.kt R|/useEnum|(Q|TestEnum|.R|/TestEnum.SECOND|) R|/useEnum|(Q|TestEnum|.R|/TestEnum.THIRD|) R|/useVararg|(vararg(Q|TestEnum|.R|/TestEnum.FIRST|, Q|TestEnum|.R|/TestEnum.SECOND|)) - #(Int(1), Int(2), Int(3), Int(4), Int(5)) + #(Int(1), Int(2), Int(3), Int(4), Int(5)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.txt index aeec9b3958a..72def902fd6 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters.txt @@ -18,5 +18,5 @@ FILE: typeParameters.kt } public final fun main(fooImpl: R|FooImpl|, bar: R|Bar|): R|kotlin/Unit| { lval a: R|FooImpl| = R|/foo|(R|/fooImpl|) - lval b: = #(R|/bar|) + lval b: R|Bar| = #(R|/bar|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.txt index c3db7c75f76..0a968e9238f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/inference/typeParameters2.txt @@ -17,6 +17,6 @@ FILE: typeParameters2.kt ^foo R|/t| } public final fun main(fooImpl: R|FooImpl|, fooBarImpl: R|FooBarImpl|): R|kotlin/Unit| { - lval a: = #(R|/fooBarImpl|) + lval a: R|FooImpl| = #(R|/fooBarImpl|) lval b: R|Foo| = R|/foo|(R|/fooImpl|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt index 9f77c959bb3..73ed9de9800 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.kt @@ -11,8 +11,8 @@ open class Outer { class Derived : Outer() { fun foo() { - Outer.PrivateNested() - super.PrivateInner() + Outer.PrivateNested() + super.PrivateInner() Outer.ProtectedNested() super.ProtectedInner() @@ -23,11 +23,11 @@ class Derived : Outer() { } fun foo() { - Outer.PrivateNested() - Outer().PrivateInner() + Outer.PrivateNested() + Outer().PrivateInner() - Outer.ProtectedNested() - Outer().ProtectedInner() + Outer.ProtectedNested() + Outer().ProtectedInner() Outer.PublicNested() Outer().PublicInner() diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.txt index 81b2fb57feb..f49ada227b3 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/nestedVisibility.txt @@ -53,8 +53,8 @@ FILE: nestedVisibility.kt } public final fun foo(): R|kotlin/Unit| { - Q|Outer|.#() - this@R|/Derived|.super.#() + Q|Outer|.#() + this@R|/Derived|.super.#() Q|Outer|.R|/Outer.ProtectedNested.ProtectedNested|() this@R|/Derived|.super.R|/Outer.ProtectedInner.ProtectedInner|() Q|Outer|.R|/Outer.PublicNested.PublicNested|() @@ -63,10 +63,10 @@ FILE: nestedVisibility.kt } public final fun foo(): R|kotlin/Unit| { - Q|Outer|.#() - R|/Outer.Outer|().#() - Q|Outer|.#() - R|/Outer.Outer|().#() + Q|Outer|.#() + R|/Outer.Outer|().#() + Q|Outer|.#() + R|/Outer.Outer|().#() Q|Outer|.R|/Outer.PublicNested.PublicNested|() R|/Outer.Outer|().R|/Outer.PublicInner.PublicInner|() } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt index bf2d0883ee5..a7a9a682290 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.kt @@ -9,21 +9,21 @@ private class Private { bar() Nested() fromCompanion() - NotCompanion.foo() // hidden + NotCompanion.foo() // hidden } inner class Inner { fun foo() { bar() fromCompanion() - NotCompanion.foo() // hidden + NotCompanion.foo() // hidden } } private class Nested { fun foo() { fromCompanion() - NotCompanion.foo() // hidden + NotCompanion.foo() // hidden } } @@ -54,7 +54,7 @@ fun withLocals() { Local().baz() - Local().bar() // hidden + Local().bar() // hidden } fun test() { @@ -62,14 +62,14 @@ fun test() { Private().baz() Private().Inner() - Private().bar() // hidden - Private.Nested() // hidden - Private.fromCompanion() // hidden + Private().bar() // hidden + Private.Nested() // hidden + Private.fromCompanion() // hidden } // FILE: second.kt fun secondTest() { - foo() // hidden - Private() // hidden -} \ No newline at end of file + foo() // hidden + Private() // hidden +} diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.txt index ec883538a90..221e4238035 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/privateVisibility.txt @@ -13,7 +13,7 @@ FILE: first.kt this@R|/Private|.R|/Private.bar|() R|/Private.Nested.Nested|() this@R|/Private.Companion|.R|/Private.Companion.fromCompanion|() - Q|Private.NotCompanion|.#() + Q|Private.NotCompanion|.#() } public[private] final inner class Inner : R|kotlin/Any| { @@ -24,7 +24,7 @@ FILE: first.kt public[private] final fun foo(): R|kotlin/Unit| { this@R|/Private|.R|/Private.bar|() this@R|/Private.Companion|.R|/Private.Companion.fromCompanion|() - Q|Private.NotCompanion|.#() + Q|Private.NotCompanion|.#() } } @@ -36,7 +36,7 @@ FILE: first.kt public[private] final fun foo(): R|kotlin/Unit| { this@R|/Private.Companion|.R|/Private.Companion.fromCompanion|() - Q|Private.NotCompanion|.#() + Q|Private.NotCompanion|.#() } } @@ -89,18 +89,18 @@ FILE: first.kt } R|/Local.Local|().R|/Local.baz|() - R|/Local.Local|().#() + R|/Local.Local|().#() } public final fun test(): R|kotlin/Unit| { R|/foo|() R|/Private.Private|().R|/Private.baz|() R|/Private.Private|().R|/Private.Inner.Inner|() - R|/Private.Private|().#() - Q|Private|.#() - Q|Private|.#() + R|/Private.Private|().#() + Q|Private|.#() + Q|Private|.#() } FILE: second.kt public final fun secondTest(): R|kotlin/Unit| { - #() - #() + #() + #() } diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt b/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt index 278a3280834..f27cce779d2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.kt @@ -31,7 +31,7 @@ class Derived : Protected() { fun foo() { bar() Nested().foo() - Nested().bar() // hidden + Nested().bar() // hidden fromCompanion() protectedFromCompanion() @@ -48,8 +48,8 @@ fun test() { Protected().baz() Protected().Inner() - Protected().bar() // hidden - Protected.Nested() // hidden + Protected().bar() // hidden + Protected.Nested() // hidden } open class Generic(val x: T) { diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.txt index d74b2d7669a..6c348b0b3c2 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/protectedVisibility.txt @@ -59,7 +59,7 @@ FILE: protectedVisibility.kt public final fun foo(): R|kotlin/Unit| { this@R|/Derived|.R|/Protected.bar|() R|/Protected.Nested.Nested|().R|/Protected.Nested.foo|() - R|/Protected.Nested.Nested|().#() + R|/Protected.Nested.Nested|().#() this@R|/Protected.Companion|.R|/Protected.Companion.fromCompanion|() this@R|/Protected.Companion|.R|/Protected.Companion.protectedFromCompanion|() } @@ -79,8 +79,8 @@ FILE: protectedVisibility.kt public final fun test(): R|kotlin/Unit| { R|/Protected.Protected|().R|/Protected.baz|() R|/Protected.Protected|().R|/Protected.Inner.Inner|() - R|/Protected.Protected|().#() - Q|Protected|.#() + R|/Protected.Protected|().#() + Q|Protected|.#() } public open class Generic : R|kotlin/Any| { public constructor(x: R|T|): R|Generic| { diff --git a/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.txt b/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.txt index 8e382a362ea..cb34d66a436 100644 --- a/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.txt +++ b/compiler/fir/analysis-tests/testData/resolve/expresssions/syntheticSmartCast.txt @@ -36,7 +36,7 @@ FILE: test.kt lval bar: R|kotlin/CharSequence?| = R|/x|?.{ $subj$.R|/SomeClass.bar| } when () { !=(R|/bar|, Null(null)) -> { - R|/x|.R|/SomeClass.bar|.# + R|/x|.R|/SomeClass.bar|.# } } diff --git a/compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.txt b/compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.txt index c80de5e09a6..5c4218a0dd5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.txt +++ b/compiler/fir/analysis-tests/testData/resolve/inference/nullableIntegerLiteralType.txt @@ -11,7 +11,7 @@ FILE: nullableIntegerLiteralType.kt } } - #(R|/x|) + #(R|/x|) } public final fun test_2(b: R|kotlin/Boolean|, y: R|kotlin/Int|): R|kotlin/Unit| { lval x: R|kotlin/Int?| = when () { @@ -23,5 +23,5 @@ FILE: nullableIntegerLiteralType.kt } } - #(R|/x|) + #(R|/x|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.txt b/compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.txt index cffd9ee6a46..0d23752d58e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.txt +++ b/compiler/fir/analysis-tests/testData/resolve/inference/receiverWithCapturedType.txt @@ -24,7 +24,7 @@ FILE: receiverWithCapturedType.kt R|/resolvedCall|.R|/getParameterForArgument|() } public final fun test_2_1(resolvedCall: R|ResolvedCall|, d: R|CallableDescriptor|): R|kotlin/Unit| { - lval x: = R|/resolvedCall|.#(R|/d|) + lval x: R|CallableDescriptor| = R|/resolvedCall|.#(R|/d|) } public final fun test_2_2(resolvedCall: R|ResolvedCall|, d: R|CallableDescriptor|): R|kotlin/Unit| { lval x: R|CallableDescriptor| = R|/resolvedCall|.R|/updateD|(R|/d|) diff --git a/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.txt b/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.txt index 2fd08db01c9..05ea7cf3d39 100644 --- a/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.txt +++ b/compiler/fir/analysis-tests/testData/resolve/lambdaArgInScopeFunction.txt @@ -29,7 +29,7 @@ FILE: lambdaArgInScopeFunction.kt } ) } R|/lambda|.R|tests/_checkType/checkType| KotlinClass|>( = checkType@fun R|tests/_checkType/Inv?>|.(): R|kotlin/Unit| { - ^ #() + this@R|special/anonymous|.# KotlinClass?|>() } ) } @@ -50,7 +50,7 @@ FILE: lambdaArgInScopeFunction.kt } ) R|/lambda|.R|tests/_checkType/checkType| KotlinClass|>( = checkType@fun R|tests/_checkType/Inv>|.(): R|kotlin/Unit| { - ^ #() + this@R|special/anonymous|.# KotlinClass?|>() } ) } diff --git a/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.txt b/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.txt index 135b23a5b72..6d0cbee9c7d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.txt +++ b/compiler/fir/analysis-tests/testData/resolve/lambdaPropertyTypeInference.txt @@ -29,11 +29,11 @@ FILE: KotlinClass.kt } ) R|/invalidType|.R|tests/_checkType/checkType| kotlin/Boolean|>( = checkType@fun R|tests/_checkType/Inv>|.(): R|kotlin/Unit| { - ^ #() + this@R|special/anonymous|.# kotlin/Boolean|>() } ) R|/Case1.Case1|(R|/javaClass|).R|/Case1.x|.R|tests/_checkType/checkType| kotlin/Boolean|>( = checkType@fun R|tests/_checkType/Inv>|.(): R|kotlin/Unit| { - ^ #() + this@R|special/anonymous|.# kotlin/Boolean|>() } ) } @@ -122,11 +122,11 @@ FILE: KotlinClass.kt } ) R|/invalidType|.R|tests/_checkType/checkType| kotlin/Boolean|>( = checkType@fun R|tests/_checkType/Inv>|.(): R|kotlin/Unit| { - ^ #() + this@R|special/anonymous|.# kotlin/Boolean|>() } ) R|/Case2.Case2|(R|/kotlinClass|).R|/Case2.x|.R|tests/_checkType/checkType| kotlin/Boolean|>( = checkType@fun R|tests/_checkType/Inv>|.(): R|kotlin/Unit| { - ^ #() + this@R|special/anonymous|.# kotlin/Boolean|>() } ) } diff --git a/compiler/fir/analysis-tests/testData/resolve/nested/innerTypes.txt b/compiler/fir/analysis-tests/testData/resolve/nested/innerTypes.txt index a0b03646d19..29fb97aca71 100644 --- a/compiler/fir/analysis-tests/testData/resolve/nested/innerTypes.txt +++ b/compiler/fir/analysis-tests/testData/resolve/nested/innerTypes.txt @@ -29,9 +29,9 @@ FILE: innerTypes.kt public final val rrq: R|Outer.Inner| = R|/Boxed.Boxed|().R|FakeOverride|>|() public get(): R|Outer.Inner| public final fun check(): R|kotlin/Unit| { - #(R|/Outer.Outer|().R|/Outer.Inner.Inner|()) - #(R|/Outer.Outer|().R|/Outer.Inner.Inner|()) + #(R|/Outer.Outer|().R|/Outer.Inner.Inner|()) + #(R|/Outer.Outer|().R|/Outer.Inner.Inner|()) R|/accept|(R|/Outer.Outer|().R|/Outer.Inner.Inner|()) - #(R|/Boxed.Boxed|().R|FakeOverride|>|()) + #(R|/Boxed.Boxed|().R|FakeOverride|>|()) R|/accept|(R|/Boxed.Boxed|().R|FakeOverride|>|()) } diff --git a/compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt b/compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt index 56fd4e8522a..1cb76bb2493 100644 --- a/compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt +++ b/compiler/fir/analysis-tests/testData/resolve/overrides/simple.kt @@ -14,7 +14,7 @@ class B : A() { fun test() { foo() bar() - buz() + buz() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/overrides/simple.txt b/compiler/fir/analysis-tests/testData/resolve/overrides/simple.txt index 96d586f583e..7ab286143cb 100644 --- a/compiler/fir/analysis-tests/testData/resolve/overrides/simple.txt +++ b/compiler/fir/analysis-tests/testData/resolve/overrides/simple.txt @@ -37,7 +37,7 @@ FILE: simple.kt public final fun test(): R|kotlin/Unit| { this@R|/B|.R|/B.foo|() this@R|/B|.R|/B.bar|() - #() + #() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.txt b/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.txt index 2580c3deb05..36cb9664b7a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.txt +++ b/compiler/fir/analysis-tests/testData/resolve/overrides/supertypeGenericsComplex.txt @@ -24,5 +24,5 @@ FILE: supertypeGenericsComplex.kt } public final fun f(list: R|kotlin/collections/MutableList|, s: R|kotlin/collections/MutableList|): R|kotlin/Unit| { R|/C.C|().R|FakeOverride|(R|/list|, R|/s|) - R|/C.C|().#(R|/s|, R|/list|) + R|/C.C|().#(R|/s|, R|/list|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.txt b/compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.txt index 35936f324bf..3b082dd4a0d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.txt +++ b/compiler/fir/analysis-tests/testData/resolve/problems/definitelyNotNullAndOriginalType.txt @@ -1,4 +1,4 @@ FILE: main.kt public final fun R|SLRUMap|.getOrPut(value: R|V|): R|kotlin/Unit| { - #(R|/value|) + this@R|/getOrPut|.#(R|/value|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.txt b/compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.txt index edea02d289b..ef1f2089c4a 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.txt +++ b/compiler/fir/analysis-tests/testData/resolve/samConstructors/genericSamInferenceFromExpectType.txt @@ -14,7 +14,7 @@ FILE: main.kt ^ R|/x|.R|kotlin/Number.toInt|().R|kotlin/Any.toString|() } )) - #(R|/MyFunction|!|, R|ft!|>( = MyFunction@fun (x: R|kotlin/Int|): R|kotlin/String| { + #(R|/MyFunction|!|>( = MyFunction@fun (x: R|kotlin/Int|): R|kotlin/String| { ^ R|/x|.R|kotlin/Any.toString|() } )) diff --git a/compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.txt b/compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.txt index bd33352729b..ee199674e3b 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.txt +++ b/compiler/fir/analysis-tests/testData/resolve/samConstructors/realConstructorFunction.txt @@ -5,11 +5,11 @@ FILE: main.kt ^MyRunnable Int(1) } public final fun main(): R|kotlin/Unit| { - #(R|/MyRunnable|( = MyRunnable@fun (x: R|kotlin/Int|): R|kotlin/Boolean| { + #(R|/MyRunnable|( = MyRunnable@fun (x: R|kotlin/Int|): R|kotlin/Boolean| { ^ CMP(>, R|/x|.R|kotlin/Int.compareTo|(Int(1))) } )) - #(R|/MyRunnable|(MyRunnable@fun (it: R|kotlin/Int|): R|kotlin/Boolean| { + #(R|/MyRunnable|(MyRunnable@fun (it: R|kotlin/Int|): R|kotlin/Boolean| { ^ CMP(>, R|/it|.R|kotlin/Int.compareTo|(Int(1))) } )) @@ -17,5 +17,5 @@ FILE: main.kt ^ CMP(>, R|/x|.R|kotlin/Int.compareTo|(Int(1))) } - #(R|/MyRunnable|(R|/x|)) + #(R|/MyRunnable|(R|/x|)) } diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.txt b/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.txt index d170c3508e5..f6758085a0f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.txt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/genericSam.txt @@ -8,7 +8,7 @@ FILE: main.kt ^ R|/x|.R|kotlin/Number.toInt|().R|kotlin/Any.toString|() } ) - Q|JavaUsage|.#( = foo2@fun (x: R|kotlin/Int|): R|kotlin/String| { + Q|JavaUsage|.#( = foo2@fun (x: R|kotlin/Int|): R|ft!| { ^ R|/x|.R|kotlin/Any.toString|() } ) diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.txt b/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.txt index c9d524a906d..b2161f7954e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.txt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/kotlinSam.txt @@ -38,16 +38,16 @@ FILE: kotlinSam.kt } ) R|/foo1|(R|/f|) - #( = foo2@fun (x: R|kotlin/Nothing|): R|kotlin/Boolean| { + #( = foo2@fun (x: R|kotlin/Nothing|): R|kotlin/Boolean| { ^ CMP(>, R|/x|.#(Int(1))) } ) - #(R|/f|) - #( = foo3@fun (x: R|kotlin/Nothing|): R|kotlin/Boolean| { + #(R|/f|) + #( = foo3@fun (x: R|kotlin/Nothing|): R|kotlin/Boolean| { ^ CMP(>, R|/x|.#(Int(1))) } ) - #(R|/f|) + #(R|/f|) R|/foo4|( = foo4@fun (x: R|kotlin/Int|): R|kotlin/Boolean| { ^ CMP(>, R|/x|.R|kotlin/Int.compareTo|(Int(1))) } diff --git a/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.txt b/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.txt index b9ffbb30e9b..d8145c5f91d 100644 --- a/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.txt +++ b/compiler/fir/analysis-tests/testData/resolve/samConversions/notSamBecauseOfSupertype.txt @@ -2,11 +2,11 @@ FILE: main.kt public final fun foo(m: R|MyRunnable|): R|kotlin/Unit| { } public final fun main(): R|kotlin/Unit| { - Q|JavaUsage|.#( = foo@fun (x: R|kotlin/Nothing|): R|kotlin/Boolean| { + Q|JavaUsage|.#( = foo@fun (x: R|kotlin/Nothing|): R|kotlin/Boolean| { ^ CMP(>, R|/x|.#(Int(1))) } ) - Q|JavaUsage|.#(foo@fun (): R|kotlin/Boolean| { + Q|JavaUsage|.#(foo@fun (): R|kotlin/Boolean| { ^ CMP(>, #.#(Int(1))) } ) @@ -14,5 +14,5 @@ FILE: main.kt ^ CMP(>, R|/x|.R|kotlin/Int.compareTo|(Int(1))) } - Q|JavaUsage|.#(R|/x|) + Q|JavaUsage|.#(R|/x|) } diff --git a/compiler/fir/analysis-tests/testData/resolve/sealedClass.kt b/compiler/fir/analysis-tests/testData/resolve/sealedClass.kt index ae5a69ea932..071205181ae 100644 --- a/compiler/fir/analysis-tests/testData/resolve/sealedClass.kt +++ b/compiler/fir/analysis-tests/testData/resolve/sealedClass.kt @@ -6,5 +6,5 @@ sealed class WithPrivateConstructor private constructor(val x: Int) { private constructor() : this(42) } -object First : WithPrivateConstructor() // error -object Second : WithPrivateConstructor(0) // error \ No newline at end of file +object First : WithPrivateConstructor() // error +object Second : WithPrivateConstructor(0) // error diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot index 61d9f031287..86c29ded340 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.dot @@ -202,7 +202,7 @@ digraph bangbang_kt { 78 [label="Exit when"]; } 79 [label="Access variable R|/a|"]; - 80 [label="Function call: R|/a|.#()"]; + 80 [label="Function call: R|/a|.#()"]; 81 [label="Exit block"]; } 82 [label="Exit function test_3" style="filled" fillcolor=red]; @@ -331,14 +331,14 @@ digraph bangbang_kt { color=blue 123 [label="Enter block"]; 124 [label="Access variable R|/a|"]; - 125 [label="Function call: R|/a|.#()"]; + 125 [label="Function call: R|/a|.#()"]; 126 [label="Exit block"]; } 127 [label="Exit when branch result"]; 128 [label="Exit when"]; } 129 [label="Access variable R|/a|"]; - 130 [label="Function call: R|/a|.#()"]; + 130 [label="Function call: R|/a|.#()"]; 131 [label="Exit block"]; } 132 [label="Exit function test_5" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.txt index e8fe8566705..999c67a91a5 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/bangbang.txt @@ -32,7 +32,7 @@ FILE: bangbang.kt } } - R|/a|.#() + R|/a|.#() } public final fun test_4(a: R|A?|, b: R|kotlin/Boolean|): R|kotlin/Unit| { when () { @@ -46,11 +46,11 @@ FILE: bangbang.kt public final fun test_5(a: R|A?|, b: R|kotlin/Boolean|): R|kotlin/Unit| { when () { R|/b| || R|/a|!!.R|/A.foo|() -> { - R|/a|.#() + R|/a|.#() } } - R|/a|.#() + R|/a|.#() } public final fun test_6(x: R|X|): R|kotlin/Unit| { R|/x|!!.R|/A.foo|() diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot index 1737abc42e4..ff028b96aea 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.dot @@ -53,7 +53,7 @@ digraph equalsToBoolean_kt { color=blue 19 [label="Enter block"]; 20 [label="Access variable R|/b|"]; - 21 [label="Function call: R|/b|.#()"]; + 21 [label="Function call: R|/b|.#()"]; 22 [label="Exit block"]; } 23 [label="Exit when branch result"]; @@ -137,7 +137,7 @@ digraph equalsToBoolean_kt { color=blue 52 [label="Enter block"]; 53 [label="Access variable R|/b|"]; - 54 [label="Function call: R|/b|.#()"]; + 54 [label="Function call: R|/b|.#()"]; 55 [label="Exit block"]; } 56 [label="Exit when branch result"]; @@ -212,7 +212,7 @@ digraph equalsToBoolean_kt { color=blue 79 [label="Enter block"]; 80 [label="Access variable R|/b|"]; - 81 [label="Function call: R|/b|.#()"]; + 81 [label="Function call: R|/b|.#()"]; 82 [label="Exit block"]; } 83 [label="Exit when branch result"]; @@ -278,7 +278,7 @@ digraph equalsToBoolean_kt { color=blue 100 [label="Enter block"]; 101 [label="Access variable R|/b|"]; - 102 [label="Function call: R|/b|.#()"]; + 102 [label="Function call: R|/b|.#()"]; 103 [label="Exit block"]; } 104 [label="Exit when branch result"]; @@ -362,7 +362,7 @@ digraph equalsToBoolean_kt { color=blue 133 [label="Enter block"]; 134 [label="Access variable R|/b|"]; - 135 [label="Function call: R|/b|.#()"]; + 135 [label="Function call: R|/b|.#()"]; 136 [label="Exit block"]; } 137 [label="Exit when branch result"]; @@ -428,7 +428,7 @@ digraph equalsToBoolean_kt { color=blue 154 [label="Enter block"]; 155 [label="Access variable R|/b|"]; - 156 [label="Function call: R|/b|.#()"]; + 156 [label="Function call: R|/b|.#()"]; 157 [label="Exit block"]; } 158 [label="Exit when branch result"]; @@ -503,7 +503,7 @@ digraph equalsToBoolean_kt { color=blue 181 [label="Enter block"]; 182 [label="Access variable R|/b|"]; - 183 [label="Function call: R|/b|.#()"]; + 183 [label="Function call: R|/b|.#()"]; 184 [label="Exit block"]; } 185 [label="Exit when branch result"]; @@ -587,7 +587,7 @@ digraph equalsToBoolean_kt { color=blue 214 [label="Enter block"]; 215 [label="Access variable R|/b|"]; - 216 [label="Function call: R|/b|.#()"]; + 216 [label="Function call: R|/b|.#()"]; 217 [label="Exit block"]; } 218 [label="Exit when branch result"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.txt index 543533b04fb..b110b35eae8 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/equalsToBoolean.txt @@ -12,7 +12,7 @@ FILE: equalsToBoolean.kt R|/b|.R|kotlin/Boolean.not|() } else -> { - R|/b|.#() + R|/b|.#() } } @@ -20,7 +20,7 @@ FILE: equalsToBoolean.kt public final fun test_2(b: R|kotlin/Boolean?|): R|kotlin/Unit| { when () { !=(==(R|/b|, Boolean(true)), Boolean(true)) -> { - R|/b|.#() + R|/b|.#() } else -> { R|/b|.R|kotlin/Boolean.not|() @@ -31,7 +31,7 @@ FILE: equalsToBoolean.kt public final fun test_3(b: R|kotlin/Boolean?|): R|kotlin/Unit| { when () { ==(==(R|/b|, Boolean(true)), Boolean(false)) -> { - R|/b|.#() + R|/b|.#() } else -> { R|/b|.R|kotlin/Boolean.not|() @@ -45,7 +45,7 @@ FILE: equalsToBoolean.kt R|/b|.R|kotlin/Boolean.not|() } else -> { - R|/b|.#() + R|/b|.#() } } @@ -53,7 +53,7 @@ FILE: equalsToBoolean.kt public final fun test_5(b: R|kotlin/Boolean?|): R|kotlin/Unit| { when () { ==(!=(R|/b|, Boolean(true)), Boolean(true)) -> { - R|/b|.#() + R|/b|.#() } else -> { R|/b|.R|kotlin/Boolean.not|() @@ -67,7 +67,7 @@ FILE: equalsToBoolean.kt R|/b|.R|kotlin/Boolean.not|() } else -> { - R|/b|.#() + R|/b|.#() } } @@ -78,7 +78,7 @@ FILE: equalsToBoolean.kt R|/b|.R|kotlin/Boolean.not|() } else -> { - R|/b|.#() + R|/b|.#() } } @@ -86,7 +86,7 @@ FILE: equalsToBoolean.kt public final fun test_8(b: R|kotlin/Boolean?|): R|kotlin/Unit| { when () { !=(!=(R|/b|, Boolean(true)), Boolean(false)) -> { - R|/b|.#() + R|/b|.#() } else -> { R|/b|.R|kotlin/Boolean.not|() diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot index ac24806a22a..9db0364683c 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.dot @@ -267,7 +267,7 @@ digraph jumpFromRhsOfOperator_kt { 101 [label="Exit ||"]; } 102 [label="Access variable R|/a|"]; - 103 [label="Function call: R|/a|.#()"]; + 103 [label="Function call: R|/a|.#()"]; 104 [label="Exit block"]; } 105 [label="Exit function test_5" style="filled" fillcolor=red]; @@ -309,7 +309,7 @@ digraph jumpFromRhsOfOperator_kt { 117 [label="Exit &&"]; } 118 [label="Access variable R|/a|"]; - 119 [label="Function call: R|/a|.#()"]; + 119 [label="Function call: R|/a|.#()"]; 120 [label="Exit block"]; } 121 [label="Exit function teat_6" style="filled" fillcolor=red]; @@ -364,14 +364,14 @@ digraph jumpFromRhsOfOperator_kt { color=blue 139 [label="Enter block"]; 140 [label="Access variable R|/a|"]; - 141 [label="Function call: R|/a|.#()"]; + 141 [label="Function call: R|/a|.#()"]; 142 [label="Exit block"]; } 143 [label="Exit when branch result"]; 144 [label="Exit when"]; } 145 [label="Access variable R|/a|"]; - 146 [label="Function call: R|/a|.#()"]; + 146 [label="Function call: R|/a|.#()"]; 147 [label="Exit block"]; } 148 [label="Exit function test_7" style="filled" fillcolor=red]; @@ -437,14 +437,14 @@ digraph jumpFromRhsOfOperator_kt { color=blue 166 [label="Enter block"]; 167 [label="Access variable R|/a|"]; - 168 [label="Function call: R|/a|.#()"]; + 168 [label="Function call: R|/a|.#()"]; 169 [label="Exit block"]; } 170 [label="Exit when branch result"]; 171 [label="Exit when"]; } 172 [label="Access variable R|/a|"]; - 173 [label="Function call: R|/a|.#()"]; + 173 [label="Function call: R|/a|.#()"]; 174 [label="Exit block"]; } 175 [label="Exit function test_8" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.txt index 56bdb1afca4..bba3fe4dde4 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/booleans/jumpFromRhsOfOperator.txt @@ -31,27 +31,27 @@ FILE: jumpFromRhsOfOperator.kt } public final fun test_5(a: R|A?|): R|kotlin/Unit| { ==(R|/a|, Null(null)) || throw R|java/lang/Exception.Exception|() - R|/a|.#() + R|/a|.#() } public final fun teat_6(a: R|A?|): R|kotlin/Unit| { !=(R|/a|, Null(null)) && throw R|java/lang/Exception.Exception|() - R|/a|.#() + R|/a|.#() } public final fun test_7(a: R|A?|): R|kotlin/Unit| { when () { ==(R|/a|, Null(null)) || throw R|java/lang/Exception.Exception|() -> { - R|/a|.#() + R|/a|.#() } } - R|/a|.#() + R|/a|.#() } public final fun test_8(a: R|A?|): R|kotlin/Unit| { when () { !=(R|/a|, Null(null)) && throw R|java/lang/Exception.Exception|() -> { - R|/a|.#() + R|/a|.#() } } - R|/a|.#() + R|/a|.#() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot index eaa3698a9db..f3be68dcb22 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.dot @@ -670,7 +670,7 @@ digraph boundSmartcastsInBranches_kt { 274 [label="Access variable R|/x|"]; 275 [label="Access variable R|kotlin/String.length|"]; 276 [label="Access variable R|/y|"]; - 277 [label="Access variable #"]; + 277 [label="Access variable #"]; 278 [label="Access variable R|/z|"]; 279 [label="Access variable R|kotlin/String.length|"]; 280 [label="Exit block"]; @@ -695,11 +695,11 @@ digraph boundSmartcastsInBranches_kt { color=blue 291 [label="Enter block"]; 292 [label="Access variable R|/x|"]; - 293 [label="Access variable #"]; + 293 [label="Access variable #"]; 294 [label="Access variable R|/y|"]; 295 [label="Access variable R|kotlin/String.length|"]; 296 [label="Access variable R|/z|"]; - 297 [label="Access variable #"]; + 297 [label="Access variable #"]; 298 [label="Exit block"]; } 299 [label="Exit when branch result"]; @@ -724,7 +724,7 @@ digraph boundSmartcastsInBranches_kt { 310 [label="Access variable R|/x|"]; 311 [label="Access variable R|kotlin/String.length|"]; 312 [label="Access variable R|/y|"]; - 313 [label="Access variable #"]; + 313 [label="Access variable #"]; 314 [label="Access variable R|/z|"]; 315 [label="Access variable R|kotlin/String.length|"]; 316 [label="Exit block"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.txt index d13aca2ae60..b652bc4e03f 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/boundSmartcasts/boundSmartcastsInBranches.txt @@ -132,23 +132,23 @@ FILE: boundSmartcastsInBranches.kt when () { !=(R|/x|, Null(null)) -> { R|/x|.R|kotlin/String.length| - R|/y|.# + R|/y|.# R|/z|.R|kotlin/String.length| } } when () { !=(R|/y|, Null(null)) -> { - R|/x|.# + R|/x|.# R|/y|.R|kotlin/String.length| - R|/z|.# + R|/z|.# } } when () { !=(R|/z|, Null(null)) -> { R|/x|.R|kotlin/String.length| - R|/y|.# + R|/y|.# R|/z|.R|kotlin/String.length| } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot index 7b415486a91..49f0d97b8e1 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.dot @@ -136,9 +136,9 @@ digraph equalsAndIdentity_kt { color=blue 50 [label="Enter block"]; 51 [label="Access variable R|/x|"]; - 52 [label="Function call: R|/x|.#()"]; + 52 [label="Function call: R|/x|.#()"]; 53 [label="Access variable R|/y|"]; - 54 [label="Function call: R|/y|.#()"]; + 54 [label="Function call: R|/y|.#()"]; 55 [label="Exit block"]; } 56 [label="Exit when branch result"]; @@ -161,9 +161,9 @@ digraph equalsAndIdentity_kt { color=blue 66 [label="Enter block"]; 67 [label="Access variable R|/x|"]; - 68 [label="Function call: R|/x|.#()"]; + 68 [label="Function call: R|/x|.#()"]; 69 [label="Access variable R|/y|"]; - 70 [label="Function call: R|/y|.#()"]; + 70 [label="Function call: R|/y|.#()"]; 71 [label="Exit block"]; } 72 [label="Exit when branch result"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.txt index a14f253607c..095a40383cf 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/equalsAndIdentity.txt @@ -22,15 +22,15 @@ FILE: equalsAndIdentity.kt public final fun test_2(x: R|A?|, y: R|A?|): R|kotlin/Unit| { when () { ==(R|/x|, R|/y|) -> { - R|/x|.#() - R|/y|.#() + R|/x|.#() + R|/y|.#() } } when () { ===(R|/x|, R|/y|) -> { - R|/x|.#() - R|/y|.#() + R|/x|.#() + R|/y|.#() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot index 59b82a8be7a..4a7ac514c75 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.dot @@ -264,7 +264,7 @@ digraph nullability_kt { color=blue 84 [label="Enter block"]; 85 [label="Access variable R|/x|"]; - 86 [label="Function call: R|/x|.#()"]; + 86 [label="Function call: R|/x|.#()"]; 87 [label="Exit block"]; } 88 [label="Exit when branch result"]; @@ -280,7 +280,7 @@ digraph nullability_kt { 95 [label="Exit when"]; } 96 [label="Access variable R|/x|"]; - 97 [label="Function call: R|/x|.#()"]; + 97 [label="Function call: R|/x|.#()"]; 98 [label="Exit block"]; } 99 [label="Exit function test_1" style="filled" fillcolor=red]; @@ -348,14 +348,14 @@ digraph nullability_kt { color=blue 117 [label="Enter block"]; 118 [label="Access variable R|/x|"]; - 119 [label="Function call: R|/x|.#()"]; + 119 [label="Function call: R|/x|.#()"]; 120 [label="Exit block"]; } 121 [label="Exit when branch result"]; 122 [label="Exit when"]; } 123 [label="Access variable R|/x|"]; - 124 [label="Function call: R|/x|.#()"]; + 124 [label="Function call: R|/x|.#()"]; 125 [label="Exit block"]; } 126 [label="Exit function test_2" style="filled" fillcolor=red]; @@ -517,11 +517,11 @@ digraph nullability_kt { 184 [label="Access variable R|/Q.data|"]; 185 [label="Access variable R|/q|"]; 186 [label="Access variable R|/Q.data|"]; - 187 [label="Access variable #"]; + 187 [label="Access variable #"]; 188 [label="Access variable R|/q|"]; 189 [label="Access variable R|/Q.data|"]; - 190 [label="Access variable #"]; - 191 [label="Function call: R|/q|.R|/Q.data|.#.#()"]; + 190 [label="Access variable #"]; + 191 [label="Function call: R|/q|.R|/Q.data|.#.R|kotlin/Int.inc|()"]; 192 [label="Exit block"]; } 193 [label="Exit when branch result"]; @@ -591,11 +591,11 @@ digraph nullability_kt { 216 [label="Access variable R|/Q.data|"]; 217 [label="Access variable R|/q|"]; 218 [label="Access variable R|/Q.data|"]; - 219 [label="Access variable #"]; + 219 [label="Access variable #"]; 220 [label="Access variable R|/q|"]; 221 [label="Access variable R|/Q.data|"]; - 222 [label="Access variable #"]; - 223 [label="Function call: R|/q|.R|/Q.data|.#.#()"]; + 222 [label="Access variable #"]; + 223 [label="Function call: R|/q|.R|/Q.data|.#.R|kotlin/Int.inc|()"]; 224 [label="Exit block"]; } 225 [label="Exit function test_6" style="filled" fillcolor=red]; @@ -665,11 +665,11 @@ digraph nullability_kt { 247 [label="Function call: R|/q|.R|/Q.fdata|()"]; 248 [label="Access variable R|/q|"]; 249 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 250 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; + 250 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; 251 [label="Access variable R|/q|"]; 252 [label="Function call: R|/q|.R|/Q.fdata|()"]; - 253 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; - 254 [label="Function call: R|/q|.R|/Q.fdata|().#().#()"]; + 253 [label="Function call: R|/q|.R|/Q.fdata|().#()"]; + 254 [label="Function call: R|/q|.R|/Q.fdata|().#().R|kotlin/Int.inc|()"]; 255 [label="Exit block"]; } 256 [label="Exit when branch result"]; @@ -794,7 +794,7 @@ digraph nullability_kt { 293 [label="Exit when"]; } 294 [label="Access variable R|/b|"]; - 295 [label="Function call: R|/b|.#()"]; + 295 [label="Function call: R|/b|.#()"]; subgraph cluster_71 { color=blue 296 [label="Enter when"]; @@ -819,7 +819,7 @@ digraph nullability_kt { 309 [label="Exit when"]; } 310 [label="Access variable R|/b|"]; - 311 [label="Function call: R|/b|.#()"]; + 311 [label="Function call: R|/b|.#()"]; subgraph cluster_74 { color=blue 312 [label="Enter when"]; @@ -844,7 +844,7 @@ digraph nullability_kt { 325 [label="Exit when"]; } 326 [label="Access variable R|/b|"]; - 327 [label="Function call: R|/b|.#()"]; + 327 [label="Function call: R|/b|.#()"]; subgraph cluster_77 { color=blue 328 [label="Enter when"]; @@ -869,7 +869,7 @@ digraph nullability_kt { 341 [label="Exit when"]; } 342 [label="Access variable R|/b|"]; - 343 [label="Function call: R|/b|.#()"]; + 343 [label="Function call: R|/b|.#()"]; 344 [label="Exit block"]; } 345 [label="Exit function test_9" style="filled" fillcolor=red]; @@ -965,14 +965,14 @@ digraph nullability_kt { color=blue 356 [label="Enter block"]; 357 [label="Access variable R|/b|"]; - 358 [label="Function call: R|/b|.#()"]; + 358 [label="Function call: R|/b|.#()"]; 359 [label="Exit block"]; } 360 [label="Exit when branch result"]; 361 [label="Exit when"]; } 362 [label="Access variable R|/b|"]; - 363 [label="Function call: R|/b|.#()"]; + 363 [label="Function call: R|/b|.#()"]; subgraph cluster_85 { color=blue 364 [label="Enter when"]; @@ -990,14 +990,14 @@ digraph nullability_kt { color=blue 372 [label="Enter block"]; 373 [label="Access variable R|/b|"]; - 374 [label="Function call: R|/b|.#()"]; + 374 [label="Function call: R|/b|.#()"]; 375 [label="Exit block"]; } 376 [label="Exit when branch result"]; 377 [label="Exit when"]; } 378 [label="Access variable R|/b|"]; - 379 [label="Function call: R|/b|.#()"]; + 379 [label="Function call: R|/b|.#()"]; subgraph cluster_88 { color=blue 380 [label="Enter when"]; @@ -1015,14 +1015,14 @@ digraph nullability_kt { color=blue 388 [label="Enter block"]; 389 [label="Access variable R|/b|"]; - 390 [label="Function call: R|/b|.#()"]; + 390 [label="Function call: R|/b|.#()"]; 391 [label="Exit block"]; } 392 [label="Exit when branch result"]; 393 [label="Exit when"]; } 394 [label="Access variable R|/b|"]; - 395 [label="Function call: R|/b|.#()"]; + 395 [label="Function call: R|/b|.#()"]; subgraph cluster_91 { color=blue 396 [label="Enter when"]; @@ -1040,14 +1040,14 @@ digraph nullability_kt { color=blue 404 [label="Enter block"]; 405 [label="Access variable R|/b|"]; - 406 [label="Function call: R|/b|.#()"]; + 406 [label="Function call: R|/b|.#()"]; 407 [label="Exit block"]; } 408 [label="Exit when branch result"]; 409 [label="Exit when"]; } 410 [label="Access variable R|/b|"]; - 411 [label="Function call: R|/b|.#()"]; + 411 [label="Function call: R|/b|.#()"]; 412 [label="Exit block"]; } 413 [label="Exit function test_10" style="filled" fillcolor=red]; @@ -1164,11 +1164,11 @@ digraph nullability_kt { 444 [label="Access variable R|/QImpl.data|"]; 445 [label="Access variable R|/q2|"]; 446 [label="Access variable R|/QImpl.data|"]; - 447 [label="Access variable #"]; + 447 [label="Access variable #"]; 448 [label="Access variable R|/q2|"]; 449 [label="Access variable R|/QImpl.data|"]; - 450 [label="Access variable #"]; - 451 [label="Function call: R|/q2|.R|/QImpl.data|.#.#()"]; + 450 [label="Access variable #"]; + 451 [label="Function call: R|/q2|.R|/QImpl.data|.#.R|kotlin/Int.inc|()"]; subgraph cluster_99 { color=blue 452 [label="Enter when"]; @@ -1305,11 +1305,11 @@ digraph nullability_kt { 498 [label="Access variable R|/QImplWithCustomGetter.data|"]; 499 [label="Access variable R|/q|"]; 500 [label="Access variable R|/QImplWithCustomGetter.data|"]; - 501 [label="Access variable #"]; + 501 [label="Access variable #"]; 502 [label="Access variable R|/q|"]; 503 [label="Access variable R|/QImplWithCustomGetter.data|"]; - 504 [label="Access variable #"]; - 505 [label="Function call: R|/q|.R|/QImplWithCustomGetter.data|.#.#()"]; + 504 [label="Access variable #"]; + 505 [label="Function call: R|/q|.R|/QImplWithCustomGetter.data|.#.R|kotlin/Int.inc|()"]; 506 [label="Exit block"]; } 507 [label="Exit when branch result"]; @@ -1388,11 +1388,11 @@ digraph nullability_kt { 532 [label="Access variable R|/QImplMutable.data|"]; 533 [label="Access variable R|/q|"]; 534 [label="Access variable R|/QImplMutable.data|"]; - 535 [label="Access variable #"]; + 535 [label="Access variable #"]; 536 [label="Access variable R|/q|"]; 537 [label="Access variable R|/QImplMutable.data|"]; - 538 [label="Access variable #"]; - 539 [label="Function call: R|/q|.R|/QImplMutable.data|.#.#()"]; + 538 [label="Access variable #"]; + 539 [label="Function call: R|/q|.R|/QImplMutable.data|.#.R|kotlin/Int.inc|()"]; 540 [label="Exit block"]; } 541 [label="Exit when branch result"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt index 3df2ac9fb33..35b4d6f8b97 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.kt @@ -68,7 +68,7 @@ fun test_5(q: Q?) { if (q?.data?.s?.inc() != null) { q.data // good q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s.inc() // should be bad } } @@ -77,14 +77,14 @@ fun test_6(q: Q?) { q?.data?.s?.inc() ?: return q.data // good q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s.inc() // should be bad } fun test_7(q: Q?) { if (q?.fdata()?.fs()?.inc() != null) { q.fdata() // good q.fdata().fs() // bad - q.fdata().fs().inc() // bad + q.fdata().fs().inc() // bad } } @@ -149,7 +149,7 @@ fun test_11(q: QImpl?, q2: QImpl) { // Issue: Smartcasting of QImpl.data affects all instances q2.data q2.data.s // should be bad - q2.data.s.inc() // should be bad + q2.data.s.inc() // should be bad if (q2.data != null) { q2.data.s @@ -163,7 +163,7 @@ fun test_12(q: QImplWithCustomGetter?) { if (q?.data?.s?.inc() != null) { q.data // good q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s.inc() // should be bad } } @@ -172,6 +172,6 @@ fun test_13(q: QImplMutable?) { if (q?.data?.s?.inc() != null) { q.data // good q.data.s // should be bad - q.data.s.inc() // should be bad + q.data.s.inc() // should be bad } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.txt index 0f2025d36fb..f6675dcc8c9 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/nullability.txt @@ -67,23 +67,23 @@ FILE: nullability.kt R|/x|.R|/A.foo|() } else -> { - R|/x|.#() + R|/x|.#() } } - R|/x|.#() + R|/x|.#() } public final fun test_2(x: R|A?|): R|kotlin/Unit| { when () { ==(R|/x|, Null(null)) -> { - R|/x|.#() + R|/x|.#() } else -> { R|/x|.R|/A.foo|() } } - R|/x|.#() + R|/x|.#() } public final fun test_3(x: R|A?|): R|kotlin/Unit| { R|/x| ?: ^test_3 Unit @@ -102,8 +102,8 @@ FILE: nullability.kt when () { !=(R|/q|?.{ $subj$.R|/Q.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> { R|/q|.R|/Q.data| - R|/q|.R|/Q.data|.# - R|/q|.R|/Q.data|.#.#() + R|/q|.R|/Q.data|.# + R|/q|.R|/Q.data|.#.R|kotlin/Int.inc|() } } @@ -111,15 +111,15 @@ FILE: nullability.kt public final fun test_6(q: R|Q?|): R|kotlin/Unit| { R|/q|?.{ $subj$.R|/Q.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() } ?: ^test_6 Unit R|/q|.R|/Q.data| - R|/q|.R|/Q.data|.# - R|/q|.R|/Q.data|.#.#() + R|/q|.R|/Q.data|.# + R|/q|.R|/Q.data|.#.R|kotlin/Int.inc|() } public final fun test_7(q: R|Q?|): R|kotlin/Unit| { when () { !=(R|/q|?.{ $subj$.R|/Q.fdata|() }?.{ $subj$.R|/MyData.fs|() }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> { R|/q|.R|/Q.fdata|() - R|/q|.R|/Q.fdata|().#() - R|/q|.R|/Q.fdata|().#().#() + R|/q|.R|/Q.fdata|().#() + R|/q|.R|/Q.fdata|().#().R|kotlin/Int.inc|() } } @@ -139,58 +139,58 @@ FILE: nullability.kt } } - R|/b|.#() + R|/b|.#() when () { ===(R|/a|, R|/b|) -> { R|/b|.R|kotlin/Int.inc|() } } - R|/b|.#() + R|/b|.#() when () { ==(R|/b|, R|/a|) -> { R|/b|.R|kotlin/Int.inc|() } } - R|/b|.#() + R|/b|.#() when () { ===(R|/b|, R|/a|) -> { R|/b|.R|kotlin/Int.inc|() } } - R|/b|.#() + R|/b|.#() } public final fun test_10(a: R|kotlin/Int?|, b: R|kotlin/Int?|): R|kotlin/Unit| { when () { ==(R|/a|, R|/b|) -> { - R|/b|.#() + R|/b|.#() } } - R|/b|.#() + R|/b|.#() when () { ===(R|/a|, R|/b|) -> { - R|/b|.#() + R|/b|.#() } } - R|/b|.#() + R|/b|.#() when () { ==(R|/b|, R|/a|) -> { - R|/b|.#() + R|/b|.#() } } - R|/b|.#() + R|/b|.#() when () { ===(R|/b|, R|/a|) -> { - R|/b|.#() + R|/b|.#() } } - R|/b|.#() + R|/b|.#() } public final fun test_11(q: R|QImpl?|, q2: R|QImpl|): R|kotlin/Unit| { when () { @@ -199,8 +199,8 @@ FILE: nullability.kt R|/q|.R|/QImpl.data|.R|/MyData.s| R|/q|.R|/QImpl.data|.R|/MyData.s|.R|kotlin/Int.inc|() R|/q2|.R|/QImpl.data| - R|/q2|.R|/QImpl.data|.# - R|/q2|.R|/QImpl.data|.#.#() + R|/q2|.R|/QImpl.data|.# + R|/q2|.R|/QImpl.data|.#.R|kotlin/Int.inc|() when () { !=(R|/q2|.R|/QImpl.data|, Null(null)) -> { R|/q2|.R|/QImpl.data|.R|/MyData.s| @@ -216,8 +216,8 @@ FILE: nullability.kt when () { !=(R|/q|?.{ $subj$.R|/QImplWithCustomGetter.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> { R|/q|.R|/QImplWithCustomGetter.data| - R|/q|.R|/QImplWithCustomGetter.data|.# - R|/q|.R|/QImplWithCustomGetter.data|.#.#() + R|/q|.R|/QImplWithCustomGetter.data|.# + R|/q|.R|/QImplWithCustomGetter.data|.#.R|kotlin/Int.inc|() } } @@ -226,8 +226,8 @@ FILE: nullability.kt when () { !=(R|/q|?.{ $subj$.R|/QImplMutable.data| }?.{ $subj$.R|/MyData.s| }?.{ $subj$.R|kotlin/Int.inc|() }, Null(null)) -> { R|/q|.R|/QImplMutable.data| - R|/q|.R|/QImplMutable.data|.# - R|/q|.R|/QImplMutable.data|.#.#() + R|/q|.R|/QImplMutable.data|.# + R|/q|.R|/QImplMutable.data|.#.R|kotlin/Int.inc|() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.txt index 0adf2def51c..2c4ff649ffa 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/orInWhenBranch.txt @@ -4,7 +4,7 @@ FILE: orInWhenBranch.kt public final fun test_1(a: R|kotlin/Any?|): R|kotlin/Unit| { when (R|/a|) { ($subj$ is R|kotlin/String|) || ($subj$ is R|kotlin/Any|) -> { - R|/a|.#() + R|/a|.#() } } @@ -12,7 +12,7 @@ FILE: orInWhenBranch.kt public final fun test_2(a: R|kotlin/Any?|): R|kotlin/Unit| { when () { (R|/a| is R|kotlin/String|) || (R|/a| is R|kotlin/Any|) -> { - R|/a|.#() + R|/a|.#() } } @@ -20,7 +20,7 @@ FILE: orInWhenBranch.kt public final fun test_3(a: R|kotlin/Any?|, b: R|kotlin/Boolean|): R|kotlin/Unit| { when (R|/a|) { ($subj$ is R|kotlin/String|) || ==($subj$, R|/b|) -> { - R|/a|.#() + R|/a|.#() } } @@ -28,7 +28,7 @@ FILE: orInWhenBranch.kt public final fun test_4(a: R|kotlin/Any?|, b: R|kotlin/Boolean|): R|kotlin/Unit| { when () { (R|/a| is R|kotlin/String|) || R|/b| -> { - R|/a|.#() + R|/a|.#() } } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot index ecc021b81e7..9a7a3cd2378 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.dot @@ -54,7 +54,7 @@ digraph safeCallAndEqualityToBool_kt { color=blue 21 [label="Enter block"]; 22 [label="Access variable R|/s|"]; - 23 [label="Access variable #"]; + 23 [label="Access variable #"]; 24 [label="Exit block"]; } 25 [label="Exit when branch result"]; @@ -131,7 +131,7 @@ digraph safeCallAndEqualityToBool_kt { color=blue 49 [label="Enter block"]; 50 [label="Access variable R|/s|"]; - 51 [label="Access variable #"]; + 51 [label="Access variable #"]; 52 [label="Exit block"]; } 53 [label="Exit when branch result"]; @@ -217,7 +217,7 @@ digraph safeCallAndEqualityToBool_kt { color=blue 83 [label="Enter block"]; 84 [label="Access variable R|/s|"]; - 85 [label="Access variable #"]; + 85 [label="Access variable #"]; 86 [label="Exit block"]; } 87 [label="Exit when branch result"]; @@ -294,7 +294,7 @@ digraph safeCallAndEqualityToBool_kt { color=blue 111 [label="Enter block"]; 112 [label="Access variable R|/s|"]; - 113 [label="Access variable #"]; + 113 [label="Access variable #"]; 114 [label="Exit block"]; } 115 [label="Exit when branch result"]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.txt index cf740b26352..429d819020e 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCallAndEqualityToBool.txt @@ -8,7 +8,7 @@ FILE: safeCallAndEqualityToBool.kt R|/s|.R|kotlin/String.length| } else -> { - R|/s|.# + R|/s|.# } } @@ -19,7 +19,7 @@ FILE: safeCallAndEqualityToBool.kt R|/s|.R|kotlin/String.length| } else -> { - R|/s|.# + R|/s|.# } } @@ -27,7 +27,7 @@ FILE: safeCallAndEqualityToBool.kt public final fun test_3(s: R|kotlin/String?|): R|kotlin/Unit| { when () { !=(R|/s|?.{ $subj$.R|/check|() }, Boolean(true)) -> { - R|/s|.# + R|/s|.# } else -> { R|/s|.R|kotlin/String.length| @@ -38,7 +38,7 @@ FILE: safeCallAndEqualityToBool.kt public final fun test_4(s: R|kotlin/String?|): R|kotlin/Unit| { when () { !=(R|/s|?.{ $subj$.R|/check|() }, Boolean(false)) -> { - R|/s|.# + R|/s|.# } else -> { R|/s|.R|kotlin/String.length| diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot index 06114a7a9f0..e51055dc071 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.dot @@ -53,7 +53,7 @@ digraph safeCalls_kt { 19 [label="Function call: $subj$.R|/foo|(...)"]; 20 [label="Exit safe call"]; 21 [label="Access variable R|/x|"]; - 22 [label="Access variable #"]; + 22 [label="Access variable #"]; 23 [label="Exit block"]; } 24 [label="Exit function test" style="filled" fillcolor=red]; @@ -207,7 +207,7 @@ digraph safeCalls_kt { 78 [label="Function call: $subj$.R|/A.bool|()"]; 79 [label="Exit safe call"]; 80 [label="Access variable R|/x|"]; - 81 [label="Function call: R|/x|.#()"]; + 81 [label="Function call: R|/x|.#()"]; 82 [label="Exit block"]; } 83 [label="Exit function test_4" style="filled" fillcolor=red]; @@ -271,7 +271,7 @@ digraph safeCalls_kt { 101 [label="Function call: $subj$.R|/boo|(...)"]; 102 [label="Exit safe call"]; 103 [label="Access variable R|/x|"]; - 104 [label="Function call: R|/x|.#()"]; + 104 [label="Function call: R|/x|.#()"]; 105 [label="Exit block"]; } 106 [label="Exit function test_5" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.txt index 0882d3231a6..a11922bc998 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/safeCalls/safeCalls.txt @@ -6,7 +6,7 @@ FILE: safeCalls.kt } public final fun test(x: R|kotlin/String?|): R|kotlin/Unit| { R|/x|?.{ $subj$.R|/foo|(==(R|/x|.R|kotlin/String.length|, Int(1))) } - R|/x|.# + R|/x|.# } public abstract interface A : R|kotlin/Any| { public abstract fun bar(a: R|A|): R|kotlin/String| @@ -28,7 +28,7 @@ FILE: safeCalls.kt } public final fun test_4(x: R|A?|): R|kotlin/Unit| { R|/x|?.{ $subj$.R|/A.id|() }?.{ $subj$.R|/A.bool|() } - R|/x|.#() + R|/x|.#() } public final fun R|kotlin/Any?|.boo(b: R|kotlin/Boolean|): R|kotlin/Unit| { } @@ -37,5 +37,5 @@ FILE: safeCalls.kt ^test_5 Unit } ) }?.{ $subj$.R|/boo|(R|/x|.R|/A.bool|()) } - R|/x|.#() + R|/x|.#() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot index f5908c15ff0..7539b0e8749 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.dot @@ -77,7 +77,7 @@ digraph delayedAssignment_kt { 32 [label="Exit when"]; } 33 [label="Access variable R|/a|"]; - 34 [label="Function call: R|/a|.#()"]; + 34 [label="Function call: R|/a|.#()"]; 35 [label="Exit block"]; } 36 [label="Exit function test" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.txt index fe6a3e460b9..de11a016f20 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/delayedAssignment.txt @@ -20,5 +20,5 @@ FILE: delayedAssignment.kt } } - R|/a|.#() + R|/a|.#() } diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.dot b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.dot index ad282a50bce..6700e45b5cd 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.dot +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.dot @@ -103,7 +103,7 @@ digraph smartcastAfterReassignment_kt { 40 [label="Const: Null(null)"]; 41 [label="Assignment: R|/x|"]; 42 [label="Access variable R|/x|"]; - 43 [label="Access variable #"]; + 43 [label="Access variable #"]; 44 [label="Exit block"]; } 45 [label="Exit function test_3" style="filled" fillcolor=red]; diff --git a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.txt b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.txt index afd95360515..7925ccc6398 100644 --- a/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.txt +++ b/compiler/fir/analysis-tests/testData/resolve/smartcasts/variables/smartcastAfterReassignment.txt @@ -19,5 +19,5 @@ FILE: smartcastAfterReassignment.kt R|/x| = String() R|/x|.R|kotlin/String.length| R|/x| = Null(null) - R|/x|.# + R|/x|.# } diff --git a/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt b/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt index da715e91046..51a43a129e8 100644 --- a/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt +++ b/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.kt @@ -2,12 +2,12 @@ class A { companion object Comp {} fun foo() { - Comp() + Comp() } } object B { - private val x = B() + private val x = B() } class D { diff --git a/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.txt b/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.txt index f4dc1b073f3..1d00d23eb87 100644 --- a/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.txt +++ b/compiler/fir/analysis-tests/testData/resolve/visibility/singletonConstructors.txt @@ -12,7 +12,7 @@ FILE: singletonConstructors.kt } public final fun foo(): R|kotlin/Unit| { - #() + #() } } @@ -21,8 +21,8 @@ FILE: singletonConstructors.kt super() } - private final val x: = #() - private get(): + private final val x: R|B| = #() + private get(): R|B| } public final class D : R|kotlin/Any| { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt index 6b358f8f5a7..17ef4ed5510 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.kt @@ -34,13 +34,13 @@ fun main() { foo3(KotlinClass::baz) // Type mismatch - foo1(KotlinClass::bar) + foo1(KotlinClass::bar) foo2(KotlinClass::bar) foo3(KotlinClass::bar) foo1(KotlinClass2::bar) // Type mismatch - foo2(KotlinClass2::bar) + foo2(KotlinClass2::bar) foo3(KotlinClass2::bar) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.txt index a704b4dfce2..57992cb5075 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/companions.txt @@ -53,10 +53,10 @@ FILE: main.kt R|/foo1|(Q|KotlinClass|::R|/KotlinClass.Companion.baz|) R|/foo2|(Q|KotlinClass|::R|/KotlinClass.baz|) #(Q|KotlinClass|::R|/KotlinClass.baz|) - #(Q|KotlinClass|::R|/JavaClass.bar|) + #(Q|KotlinClass|::#) R|/foo2|(Q|KotlinClass|::R|/JavaClass.bar|) R|/foo3|(Q|KotlinClass|::R|/JavaClass.bar|) R|/foo1|(Q|KotlinClass2|::R|/KotlinClass2.Companion.bar|) - #(Q|KotlinClass2|::R|/KotlinClass2.bar|) + #(Q|KotlinClass2|::#) R|/foo3|(Q|KotlinClass2|::R|/KotlinClass2.Companion.bar|) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt index 3748bd5f86a..b2332695285 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.kt @@ -7,6 +7,6 @@ fun bar(f: (T) -> Unit, e: T) {} fun baz(e: T, f: (T) -> Unit) {} fun test(a: A, b: B) { - baz(a, ::fooB) - bar(::fooB, a) + baz(a, ::fooB) + bar(::fooB, a) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.txt index 50048dd39ac..e925f515712 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/fromBasicDiagnosticTests/resolveCallableReferencesAfterAllSimpleArguments.txt @@ -10,6 +10,6 @@ FILE: resolveCallableReferencesAfterAllSimpleArguments.kt public final fun baz(e: R|T|, f: R|(T) -> kotlin/Unit|): R|kotlin/Unit| { } public final fun test(a: R|A|, b: R|B|): R|kotlin/Unit| { - #(R|/a|, ::R|/fooB|) - #(::R|/fooB|, R|/a|) + #(R|/a|, ::#) + #(::#, R|/a|) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt index accabc12667..189e45d3611 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.kt @@ -3,5 +3,5 @@ fun use(x: (T) -> R): (T) -> R = x fun foo() = use(::bar) fun bar(x: String) = 1 -fun loop1() = use(::loop2) +fun loop1() = use(::loop2) fun loop2() = loop1() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.txt index b85e9e78b55..a4aada100e8 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/callableReferences/implicitTypes.txt @@ -8,8 +8,8 @@ FILE: implicitTypes.kt public final fun bar(x: R|kotlin/String|): R|kotlin/Int| { ^bar Int(1) } - public final fun loop1(): { - ^loop1 #(::R|/loop2|) + public final fun loop1(): R|(kotlin/Any?) -> kotlin/Nothing| { + ^loop1 #(::#) } public final fun loop2(): { ^loop2 R|/loop1|() diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.txt index 0f5bdfb67c4..e37ded8cbbd 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromLibrary/notIsNullOrEmpty.txt @@ -10,7 +10,7 @@ FILE: notIsNullOrEmpty.kt public final fun test_2(s: R|kotlin/String?|): R|kotlin/Unit| { when () { R|/s|.R|kotlin/text/isNullOrEmpty|() -> { - R|/s|.# + R|/s|.# } else -> { R|/s|.R|kotlin/String.length| diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.txt index 56a85c143e3..e4a4cff670f 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/eqNotEq.txt @@ -29,7 +29,7 @@ FILE: eqNotEq.kt R|/x|.R|kotlin/String.length| } else -> { - R|/x|.# + R|/x|.# } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.txt index b1f87fc1770..281ac32ce30 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/contracts/fromSource/good/returnsImplies/receivers.txt @@ -33,7 +33,7 @@ FILE: receivers.kt this@R|special/anonymous|.R|/myRequireNotNull|() } ) - R|/x|.#() + R|/x|.#() } public final fun test_4(x: R|A?|): R|kotlin/Unit| { R|kotlin/with|(R|/x|, = with@fun R|A?|.(): R|kotlin/Unit| { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt index bd143fb16da..46bc2d36099 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.kt @@ -22,24 +22,24 @@ import j.JavaProtected import j.JavaPackageLocal class A { - val p1 = JavaPackageLocal.javaPPackage - val p2 = JavaProtected.javaPProtectedStatic - val p3 = JavaProtected().javaPProtectedPackage + val p1 = JavaPackageLocal.javaPPackage + val p2 = JavaProtected.javaPProtectedStatic + val p3 = JavaProtected().javaPProtectedPackage fun test() { - JavaProtected.javaMProtectedStatic() - JavaPackageLocal.javaMPackage() + JavaProtected.javaMProtectedStatic() + JavaPackageLocal.javaMPackage() } } class B : JavaProtected() { - val p1 = JavaPackageLocal.javaPPackage + val p1 = JavaPackageLocal.javaPPackage val p2 = JavaProtected.javaPProtectedStatic val p3 = javaPProtectedPackage fun test() { JavaProtected.javaMProtectedStatic() - JavaPackageLocal.javaMPackage() + JavaPackageLocal.javaMPackage() } } @@ -59,4 +59,4 @@ class C { JavaProtected.javaMProtectedStatic() JavaPackageLocal.javaMPackage() } -} \ No newline at end of file +} diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.txt index 318dd730b1e..79a4de66c35 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/JavaVisibility2.txt @@ -4,18 +4,18 @@ FILE: k.kt super() } - public final val p1: = Q|j/JavaPackageLocal|.# - public get(): + public final val p1: R|kotlin/Int| = Q|j/JavaPackageLocal|.# + public get(): R|kotlin/Int| - public final val p2: = Q|j/JavaProtected|.# - public get(): + public final val p2: R|kotlin/Int| = Q|j/JavaProtected|.# + public get(): R|kotlin/Int| - public final val p3: = R|j/JavaProtected.JavaProtected|().# - public get(): + public final val p3: R|kotlin/Int| = R|j/JavaProtected.JavaProtected|().# + public get(): R|kotlin/Int| public final fun test(): R|kotlin/Unit| { - Q|j/JavaProtected|.#() - Q|j/JavaPackageLocal|.#() + Q|j/JavaProtected|.#() + Q|j/JavaPackageLocal|.#() } } @@ -24,8 +24,8 @@ FILE: k.kt super() } - public final val p1: = Q|j/JavaPackageLocal|.# - public get(): + public final val p1: R|kotlin/Int| = Q|j/JavaPackageLocal|.# + public get(): R|kotlin/Int| public final val p2: R|kotlin/Int| = Q|j/JavaProtected|.R|j/JavaProtected.javaPProtectedStatic| public get(): R|kotlin/Int| @@ -35,7 +35,7 @@ FILE: k.kt public final fun test(): R|kotlin/Unit| { Q|j/JavaProtected|.R|j/JavaProtected.javaMProtectedStatic|() - Q|j/JavaPackageLocal|.#() + Q|j/JavaPackageLocal|.#() } } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.txt index 42790f78ada..8f176ab3c65 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KJKComplexHierarchyWithNested.txt @@ -7,9 +7,9 @@ FILE: K1.kt } public final fun main(k: R|KSub|, vString: R|SuperClass.NestedInSuperClass|, vInt: R|SuperClass.NestedInSuperClass|): R|kotlin/Unit| { R|/k|.R|/J1.getImpl|().R|FakeOverride|(R|/vString|) - R|/k|.R|/J1.getImpl|().#(R|/vInt|) + R|/k|.R|/J1.getImpl|().#(R|/vInt|) R|/k|.R|/J1.getNestedSubClass|().R|FakeOverride|(String()) - R|/k|.R|/J1.getNestedSubClass|().#(Int(1)) + R|/k|.R|/J1.getNestedSubClass|().#(Int(1)) } FILE: K2.kt public open class KFirst : R|SuperClass|, R|SuperI| { diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.txt index f021cfdd380..9befa50c611 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameter.txt @@ -8,5 +8,5 @@ FILE: K1.kt FILE: K2.kt public final fun main(): R|kotlin/Unit| { Q|JavaClass|.R|/JavaClass.baz|(R|/KotlinClass.KotlinClass|()) - Q|JavaClass|.#(String()) + Q|JavaClass|.#(String()) } diff --git a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.txt b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.txt index 514df44bbf3..f14d31a1cfa 100644 --- a/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.txt +++ b/compiler/fir/analysis-tests/testData/resolveWithStdlib/j+k/KotlinClassParameterGeneric.txt @@ -9,6 +9,6 @@ FILE: K2.kt public final fun main(): R|kotlin/Unit| { Q|JavaClass|.R|/JavaClass.baz|(R|/KotlinClass.KotlinClass|!|>()) Q|JavaClass|.R|/JavaClass.baz|(R|/KotlinClass.KotlinClass|()) - Q|JavaClass|.#(R|/KotlinClass.KotlinClass|()) - Q|JavaClass|.#(String()) + Q|JavaClass|.#(R|/KotlinClass.KotlinClass|()) + Q|JavaClass|.#(String()) } diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt index 3128adb18bc..c37b14e0fa2 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/collectors/components/ErrorNodeDiagnosticCollectorComponent.kt @@ -19,6 +19,7 @@ import org.jetbrains.kotlin.fir.diagnostics.DiagnosticKind.* import org.jetbrains.kotlin.fir.expressions.FirErrorExpression import org.jetbrains.kotlin.fir.expressions.FirErrorLoop import org.jetbrains.kotlin.fir.references.FirErrorNamedReference +import org.jetbrains.kotlin.fir.resolve.calls.CandidateApplicability import org.jetbrains.kotlin.fir.resolve.diagnostics.* import org.jetbrains.kotlin.fir.types.FirErrorTypeRef @@ -53,8 +54,13 @@ class ErrorNodeDiagnosticCollectorComponent(collector: AbstractDiagnosticCollect is ConeUnresolvedReferenceError -> FirErrors.UNRESOLVED_REFERENCE.on(source, diagnostic.name?.asString() ?: "") is ConeUnresolvedSymbolError -> FirErrors.UNRESOLVED_REFERENCE.on(source, diagnostic.classId.asString()) is ConeUnresolvedNameError -> FirErrors.UNRESOLVED_REFERENCE.on(source, diagnostic.name.asString()) - is ConeInapplicableCandidateError -> FirErrors.INAPPLICABLE_CANDIDATE.on(source, diagnostic.candidates.map { it.symbol }) - is ConeAmbiguityError -> FirErrors.AMBIGUITY.on(source, diagnostic.candidates) + is ConeHiddenCandidateError -> FirErrors.HIDDEN.on(source, diagnostic.candidateSymbol) + is ConeInapplicableCandidateError -> FirErrors.INAPPLICABLE_CANDIDATE.on(source, diagnostic.candidateSymbol) + is ConeAmbiguityError -> if (diagnostic.applicability < CandidateApplicability.SYNTHETIC_RESOLVED) { + FirErrors.NONE_APPLICABLE.on(source, diagnostic.candidates) + } else { + FirErrors.AMBIGUITY.on(source, diagnostic.candidates) + } is ConeOperatorAmbiguityError -> FirErrors.ASSIGN_OPERATOR_AMBIGUITY.on(source, diagnostic.candidates) is ConeVariableExpectedError -> FirErrors.VARIABLE_EXPECTED.on(source) is ConeTypeMismatchError -> FirErrors.TYPE_MISMATCH.on(source, diagnostic.expectedType, diagnostic.actualType) 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 963695bef2e..8954cc74b0f 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 @@ -9,6 +9,7 @@ import org.jetbrains.kotlin.diagnostics.rendering.DefaultErrorMessages import org.jetbrains.kotlin.diagnostics.rendering.DiagnosticFactoryToRendererMap import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.NULLABLE_STRING import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.PROPERTY_NAME +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOL import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.SYMBOLS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirDiagnosticRenderers.TO_STRING import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.AMBIGUITY @@ -22,11 +23,13 @@ import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_PARAMETER import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_PROPERTY_TYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_RECEIVER_TYPE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.EXPOSED_TYPEALIAS_EXPANDED_TYPE +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.HIDDEN import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_CONST_EXPRESSION import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.ILLEGAL_UNDERSCORE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INAPPLICABLE_CANDIDATE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INCOMPATIBLE_MODIFIERS import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.INFERENCE_ERROR +import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.NONE_APPLICABLE import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.OTHER_ERROR import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.RECURSION_IN_IMPLICIT_TYPES import org.jetbrains.kotlin.fir.analysis.diagnostics.FirErrors.RECURSION_IN_SUPERTYPES @@ -48,7 +51,9 @@ class FirDefaultErrorMessages : DefaultErrorMessages.Extension { companion object { val MAP = FirDiagnosticFactoryToRendererMap("FIR").also { map -> map.put(UNRESOLVED_REFERENCE, "Unresolved reference: {0}", NULLABLE_STRING) - map.put(INAPPLICABLE_CANDIDATE, "Inapplicable candidate(s): {0}", SYMBOLS) + map.put(HIDDEN, "Symbol {0} is invisible", SYMBOL) + map.put(NONE_APPLICABLE, "None of the following functions are applicable: {0}", SYMBOLS) + map.put(INAPPLICABLE_CANDIDATE, "Inapplicable candidate(s): {0}", SYMBOL) map.put(AMBIGUITY, "Ambiguity between candidates: {0}", SYMBOLS) map.put(ASSIGN_OPERATOR_AMBIGUITY, "Ambiguity between assign operator candidates: {0}", SYMBOLS) map.put(SYNTAX_ERROR, "Syntax error") diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt index a99b2c31ce1..092f24e9088 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirDiagnosticRenderers.kt @@ -14,13 +14,17 @@ import org.jetbrains.kotlin.fir.symbols.impl.FirPropertySymbol object FirDiagnosticRenderers { val NULLABLE_STRING = Renderer { it ?: "null" } + val SYMBOL = Renderer { symbol: AbstractFirBasedSymbol<*> -> + when (symbol) { + is FirClassLikeSymbol<*> -> symbol.classId.asString() + is FirCallableSymbol<*> -> symbol.callableId.toString() + else -> "???" + } + } + val SYMBOLS = Renderer { symbols: Collection> -> symbols.joinToString(prefix = "[", postfix = "]", separator = ",", limit = 3, truncated = "...") { symbol -> - when (symbol) { - is FirClassLikeSymbol<*> -> symbol.classId.asString() - is FirCallableSymbol<*> -> symbol.callableId.toString() - else -> "???" - } + SYMBOL.render(symbol) } } @@ -31,4 +35,4 @@ object FirDiagnosticRenderers { val PROPERTY_NAME = Renderer { symbol: FirPropertySymbol -> symbol.fir.name.asString() } -} \ No newline at end of file +} diff --git a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt index 37e5b6461a3..0a2bb0bfe84 100644 --- a/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt +++ b/compiler/fir/checkers/src/org/jetbrains/kotlin/fir/analysis/diagnostics/FirErrors.kt @@ -19,7 +19,9 @@ import org.jetbrains.kotlin.psi.* object FirErrors { val UNRESOLVED_REFERENCE by error1() - val INAPPLICABLE_CANDIDATE by error1>>() + val HIDDEN by error1>() + val NONE_APPLICABLE by error1>>() + val INAPPLICABLE_CANDIDATE by error1>() val AMBIGUITY by error1>>() val ASSIGN_OPERATOR_AMBIGUITY by error1>>() val SYNTAX_ERROR by error0() diff --git a/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt b/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt index 131e8588aed..2f163290329 100644 --- a/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt +++ b/compiler/fir/dump/src/org/jetbrains/kotlin/fir/dump/HtmlFirDump.kt @@ -1229,29 +1229,27 @@ class HtmlFirDump internal constructor(private var linkResolver: FirLinkResolver private fun FlowContent.generate(diagnostic: ConeDiagnostic) { when (diagnostic) { is ConeInapplicableCandidateError -> { - for (candidate in diagnostic.candidates) { - describeVerbose(candidate.symbol) - br - candidate.diagnostics.forEach { callDiagnostic -> - when (callDiagnostic) { - is NewConstraintError -> { - ident() + describeVerbose(diagnostic.candidateSymbol) + br + diagnostic.diagnostics.forEach { callDiagnostic -> + when (callDiagnostic) { + is NewConstraintError -> { + ident() - generate(callDiagnostic.lowerType as ConeKotlinType) + generate(callDiagnostic.lowerType as ConeKotlinType) - ws - span(classes = "subtype-error") { +"<:" } - ws - generate(callDiagnostic.upperType as ConeKotlinType) - } - else -> { - ident() - callDiagnostic::class.qualifiedName?.let { +it } - Unit - } + ws + span(classes = "subtype-error") { +"<:" } + ws + generate(callDiagnostic.upperType as ConeKotlinType) + } + else -> { + ident() + callDiagnostic::class.qualifiedName?.let { +it } + Unit } - br } + br } } is ConeAmbiguityError -> { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt index 7257a27b4f0..313b9c5fed1 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/FirCallResolver.kt @@ -23,6 +23,7 @@ import org.jetbrains.kotlin.fir.resolve.calls.* import org.jetbrains.kotlin.fir.resolve.calls.tower.FirTowerResolver import org.jetbrains.kotlin.fir.resolve.calls.tower.TowerResolveManager import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeAmbiguityError +import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeHiddenCandidateError import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeInapplicableCandidateError import org.jetbrains.kotlin.fir.resolve.diagnostics.ConeUnresolvedNameError import org.jetbrains.kotlin.fir.resolve.inference.ResolvedCallableReferenceAtom @@ -397,20 +398,24 @@ class FirCallResolver( source, name ) - applicability < CandidateApplicability.SYNTHETIC_RESOLVED -> { - val diagnostic = ConeInapplicableCandidateError( - applicability, - candidates.map { - ConeInapplicableCandidateError.CandidateInfo( - it.symbol, - if (it.systemInitialized) it.system.diagnostics else emptyList(), - ) - } - ) - buildErrorReference(callInfo, diagnostic, source, name) + candidates.size > 1 -> buildErrorReference( + callInfo, + ConeAmbiguityError(name, applicability, candidates.map { it.symbol }), + source, + name + ) + + applicability < CandidateApplicability.SYNTHETIC_RESOLVED -> { + val candidate = candidates.single() + val diagnostic = when (applicability) { + CandidateApplicability.HIDDEN -> ConeHiddenCandidateError(candidate.symbol) + else -> ConeInapplicableCandidateError(applicability, candidate) + } + buildErrorReference(source, candidate, diagnostic) } - candidates.size == 1 -> { + + else -> { val candidate = candidates.single() val coneSymbol = candidate.symbol if (coneSymbol is FirBackingFieldSymbol) { @@ -434,12 +439,6 @@ class FirCallResolver( } FirNamedReferenceWithCandidate(source, name, candidate) } - else -> buildErrorReference( - callInfo, - ConeAmbiguityError(name, candidates.map { it.symbol }), - source, - name - ) } } @@ -453,4 +452,15 @@ class FirCallResolver( resolutionStageRunner.processCandidate(candidate, stopOnFirstError = false) return FirErrorReferenceWithCandidate(source, name, candidate, diagnostic) } + + private fun buildErrorReference( + source: FirSourceElement?, + candidate: Candidate, + diagnostic: ConeDiagnostic + ): FirErrorReferenceWithCandidate { + if (!candidate.fullyAnalyzed) { + resolutionStageRunner.processCandidate(candidate, stopOnFirstError = false) + } + return FirErrorReferenceWithCandidate(source, candidate.callInfo.name, candidate, diagnostic) + } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt index aa2f2e7ef60..8d95d0ba856 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/Candidate.kt @@ -115,6 +115,8 @@ class Candidate( val diagnostics: MutableList = mutableListOf() + var passedStages: Int = 0 + fun dispatchReceiverExpression(): FirExpression = when (explicitReceiverKind) { ExplicitReceiverKind.DISPATCH_RECEIVER, ExplicitReceiverKind.BOTH_RECEIVERS -> callInfo.explicitReceiver?.takeIf { it !is FirExpressionStub } ?: FirNoReceiverExpression @@ -143,3 +145,6 @@ class Candidate( return symbol.hashCode() } } + +val Candidate.fullyAnalyzed: Boolean + get() = passedStages == callInfo.callKind.resolutionSequence.size diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStageRunner.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStageRunner.kt index 964e66636db..00fd9035876 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStageRunner.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/ResolutionStageRunner.kt @@ -17,7 +17,9 @@ class ResolutionStageRunner(val components: InferenceComponents) { val sink = CheckerSinkImpl(components, stopOnFirstError = stopOnFirstError) var finished = false sink.continuation = suspend { - for (stage in candidate.callInfo.callKind.resolutionSequence) { + candidate.callInfo.callKind.resolutionSequence.forEachIndexed { index, stage -> + if (index < candidate.passedStages) return@forEachIndexed + candidate.passedStages++ stage.check(candidate, sink, candidate.callInfo) } }.createCoroutineUnintercepted(completion = object : Continuation { @@ -38,4 +40,4 @@ class ResolutionStageRunner(val components: InferenceComponents) { } return sink.current } -} \ No newline at end of file +} diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/TypeArgumentMapping.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/TypeArgumentMapping.kt index ef66400cfb1..6b22dfd778e 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/TypeArgumentMapping.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/calls/TypeArgumentMapping.kt @@ -36,8 +36,8 @@ internal object MapTypeArguments : ResolutionStage() { if (typeArguments.size == owner.typeParameters.size || callInfo.callKind == CallKind.DelegatingConstructorCall) { candidate.typeArgumentMapping = TypeArgumentMapping.Mapped(typeArguments) } else { - sink.yieldApplicability(CandidateApplicability.INAPPLICABLE) candidate.typeArgumentMapping = TypeArgumentMapping.Mapped(emptyList()) + sink.yieldApplicability(CandidateApplicability.INAPPLICABLE) } } } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt index a14ccacc032..9236e2ffb78 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/diagnostics/FirDiagnostics.kt @@ -6,6 +6,7 @@ package org.jetbrains.kotlin.fir.resolve.diagnostics import org.jetbrains.kotlin.fir.diagnostics.ConeDiagnostic +import org.jetbrains.kotlin.fir.resolve.calls.Candidate import org.jetbrains.kotlin.fir.resolve.calls.CandidateApplicability import org.jetbrains.kotlin.fir.symbols.AbstractFirBasedSymbol import org.jetbrains.kotlin.fir.symbols.impl.FirCallableSymbol @@ -27,16 +28,27 @@ class ConeUnresolvedNameError(val name: Name) : ConeDiagnostic() { override val reason: String get() = "Unresolved name: $name" } -class ConeInapplicableCandidateError( - val applicability: CandidateApplicability, - val candidates: Collection +class ConeHiddenCandidateError( + val candidateSymbol: AbstractFirBasedSymbol<*> ) : ConeDiagnostic() { - data class CandidateInfo(val symbol: AbstractFirBasedSymbol<*>, val diagnostics: List) - - override val reason: String get() = "Inapplicable($applicability): ${candidates.map { describeSymbol(it.symbol) }}" + override val reason: String get() = "HIDDEN: ${describeSymbol(candidateSymbol)} is invisible" } -class ConeAmbiguityError(val name: Name, val candidates: Collection>) : ConeDiagnostic() { +class ConeInapplicableCandidateError( + val applicability: CandidateApplicability, + val candidateSymbol: AbstractFirBasedSymbol<*>, + val diagnostics: List +) : ConeDiagnostic() { + constructor(applicability: CandidateApplicability, candidate: Candidate) : this( + applicability, + candidate.symbol, + candidate.system.diagnostics + ) + + override val reason: String get() = "Inapplicable($applicability): ${describeSymbol(candidateSymbol)}" +} + +class ConeAmbiguityError(val name: Name, val applicability: CandidateApplicability, val candidates: Collection>) : ConeDiagnostic() { override val reason: String get() = "Ambiguity: $name, ${candidates.map { describeSymbol(it) }}" } diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirCallCompleter.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirCallCompleter.kt index a62bb8898d4..1b56c3ec380 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirCallCompleter.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/inference/FirCallCompleter.kt @@ -180,7 +180,9 @@ class FirCallCompleter( FirBuilderInferenceSession(components, stubsForPostponedVariables as Map) } - val localContext = towerDataContextForAnonymousFunctions.getValue(lambdaArgument.symbol) + val localContext = towerDataContextForAnonymousFunctions.get(lambdaArgument.symbol) ?: error( + "" + ) transformer.context.withTowerDataContext(localContext) { if (builderInferenceSession != null) { components.inferenceComponents.withInferenceSession(builderInferenceSession) { diff --git a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt index 62c596b4427..4665342b759 100644 --- a/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt +++ b/compiler/fir/resolve/src/org/jetbrains/kotlin/fir/resolve/transformers/body/resolve/FirExpressionsResolveTransformer.kt @@ -917,7 +917,7 @@ open class FirExpressionsResolveTransformer(transformer: FirBodyResolveTransform buildErrorNamedReference { // TODO: add better diagnostic source = augmentedArraySetCall.source - diagnostic = ConeAmbiguityError(operatorName, emptyList()) + diagnostic = ConeAmbiguityError(operatorName, CandidateApplicability.RESOLVED, emptyList()) } ) } diff --git a/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.fir.kt b/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.fir.kt index 2fa18ca9642..520fffe2f90 100644 --- a/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.fir.kt +++ b/compiler/testData/diagnostics/tests/BinaryCallsOnNullableValues.fir.kt @@ -6,9 +6,9 @@ class A() { fun f(): Unit { var x: Int? = 1 x = null - x + 1 - x plus 1 - x < 1 + x + 1 + x plus 1 + x < 1 x += 1 x == 1 @@ -22,7 +22,7 @@ fun f(): Unit { x === 1 x !== 1 - x..2 + x..2 x in 1..2 val y : Boolean? = true diff --git a/compiler/testData/diagnostics/tests/ConstructorsOfPrimitives.fir.kt b/compiler/testData/diagnostics/tests/ConstructorsOfPrimitives.fir.kt index da6e15df17d..08cdb42e71e 100644 --- a/compiler/testData/diagnostics/tests/ConstructorsOfPrimitives.fir.kt +++ b/compiler/testData/diagnostics/tests/ConstructorsOfPrimitives.fir.kt @@ -5,6 +5,6 @@ fun test() { Int() Short() Byte() - Char() + Char() Boolean() -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt index de7494fcfcb..c067f6bb367 100644 --- a/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt +++ b/compiler/testData/diagnostics/tests/DeprecatedGetSetPropertyDelegateConvention.fir.kt @@ -40,8 +40,8 @@ class Example { var d by CustomDelegate3() fun test() { - requireString(a) - requireString(aval) + requireString(a) + requireString(aval) requireString(b) requireInt(c) requireInt(d) diff --git a/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.fir.kt b/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.fir.kt index 36926e1421d..9b208538a2a 100644 --- a/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.fir.kt +++ b/compiler/testData/diagnostics/tests/DeprecatedUnaryOperatorConventions.fir.kt @@ -16,7 +16,7 @@ operator fun String.unaryPlus(): Int = 0 fun test() { requireInt(+ "") requireInt(+ Example()) - requireString(+ ExampleDeprecated()) + requireString(+ ExampleDeprecated()) } fun requireInt(n: Int) {} diff --git a/compiler/testData/diagnostics/tests/Nullability.fir.kt b/compiler/testData/diagnostics/tests/Nullability.fir.kt index ec7997d2a2d..546e69d05d6 100644 --- a/compiler/testData/diagnostics/tests/Nullability.fir.kt +++ b/compiler/testData/diagnostics/tests/Nullability.fir.kt @@ -38,7 +38,7 @@ fun test() { if (out != null && ins != null || out != null) { ins?.read(); - ins.read(); + ins.read(); out.println(); } @@ -114,12 +114,12 @@ fun test() { } else { out?.println(); - out.println(); + out.println(); } if (out == null || out.println() == Unit) { out?.println(); - out.println(); + out.println(); } else { out.println(); @@ -149,7 +149,7 @@ fun test() { while (out2 == null) { out2?.println(); - out2.println(); + out2.println(); } out2.println() diff --git a/compiler/testData/diagnostics/tests/ObjectWithConstructor.fir.kt b/compiler/testData/diagnostics/tests/ObjectWithConstructor.fir.kt index 963a57289f6..446d0eecf65 100644 --- a/compiler/testData/diagnostics/tests/ObjectWithConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/ObjectWithConstructor.fir.kt @@ -1,11 +1,11 @@ object A1() { - constructor(x: Int = "", y: Int) : this() { + constructor(x: Int = "", y: Int) : this() { x + y } } object A2 public constructor(private val prop: Int) { - constructor(x: Int = "", y: Int) : this(x * y) { + constructor(x: Int = "", y: Int) : this(x * y) { x + y } } @@ -19,6 +19,6 @@ val x = object (val prop: Int) { class A3 { companion object B(val prop: Int) { - public constructor() : this(2) + public constructor() : this(2) } } diff --git a/compiler/testData/diagnostics/tests/PackageInExpressionPosition.fir.kt b/compiler/testData/diagnostics/tests/PackageInExpressionPosition.fir.kt index 02b225b0fd2..567a8f4b9b0 100644 --- a/compiler/testData/diagnostics/tests/PackageInExpressionPosition.fir.kt +++ b/compiler/testData/diagnostics/tests/PackageInExpressionPosition.fir.kt @@ -19,8 +19,8 @@ fun main() { java.lang.System = null java.lang.System!! System is Int - System() + System() (System) foo@ System null in System -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/PrivateFromOuterPackage.fir.kt b/compiler/testData/diagnostics/tests/PrivateFromOuterPackage.fir.kt index 7c63a2ef936..1d24360337c 100644 --- a/compiler/testData/diagnostics/tests/PrivateFromOuterPackage.fir.kt +++ b/compiler/testData/diagnostics/tests/PrivateFromOuterPackage.fir.kt @@ -10,8 +10,8 @@ package outer.p1 import outer.a fun use() { - a() - outer.B() + a() + outer.B() } // FILE: c.kt @@ -20,6 +20,6 @@ package outer.p1.p2 import outer.a fun use() { - a() - outer.B() -} \ No newline at end of file + a() + outer.B() +} diff --git a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt index 42ba06bd17d..713b48eea87 100644 --- a/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/annotations/annotationRenderingInTypes.fir.kt @@ -4,7 +4,7 @@ fun f1(x: String) {} fun f2(f: () -> Unit) {} -fun test1() = f2(::f1) +fun test1() = f2(::f1) @Target(AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.TYPE) diff --git a/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.fir.kt b/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.fir.kt deleted file mode 100644 index 2061cdfd368..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.fir.kt +++ /dev/null @@ -1,18 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER - -fun interface IFoo { - fun foo(i: Int) -} - -fun interface IFoo2 : IFoo - -object A - -operator fun A.get(i: IFoo) = 1 -operator fun A.set(i: IFoo, newValue: Int) {} - -fun withVararg(vararg xs: Int) = 42 - -fun test1() { - A[::withVararg] += 1 -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt b/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt index c012456ffbe..821c47c5809 100644 --- a/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt +++ b/compiler/testData/diagnostics/tests/callableReference/compatibilityResolveWithVarargAndOperatorCall.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER fun interface IFoo { diff --git a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.fir.kt b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.fir.kt index cc06049c5b1..baf517a2cdb 100644 --- a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirection.fir.kt @@ -19,6 +19,6 @@ fun B.star(p: KProperty1<*, V>): B = TODO() fun B.test(){ foo(A::bla) bar(A::bla) - baz(A::bla) + baz(A::bla) star(A::bla) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.fir.kt b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.fir.kt index 467dba5dbff..1559616828c 100644 --- a/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/constraintFromLHSWithCorrectDirectionError.fir.kt @@ -15,5 +15,5 @@ fun B.foo(p: KProperty1) {} class C : A fun B.test(){ - foo(C::bla) + foo(C::bla) } diff --git a/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.fir.kt index affb0318308..32bc59ebb43 100644 --- a/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/expectedTypeAsSubtypeOfFunctionType.fir.kt @@ -8,6 +8,6 @@ fun takeIt(x: T, f: SubFunction) {} fun cr() {} fun test() { - takeIt(42, ::cr) + takeIt(42, ::cr) takeIt(42, { }) } diff --git a/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.fir.kt deleted file mode 100644 index cd886eb65e8..00000000000 --- a/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.fir.kt +++ /dev/null @@ -1,19 +0,0 @@ -// !WITH_NEW_INFERENCE -// !CHECK_TYPE -// !DIAGNOSTICS: -UNUSED_PARAMETER - -import kotlin.reflect.* - -interface A -interface B : A - -fun A.foo() {} - -fun take(f: (A) -> Unit) {} -fun take(f: () -> Unit) {} - -fun test() { - B::foo checkType { _>() } - - take(B::foo) -} diff --git a/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.kt b/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.kt index 4f27d448e65..5de7282208f 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/extensionToSupertype.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !WITH_NEW_INFERENCE // !CHECK_TYPE // !DIAGNOSTICS: -UNUSED_PARAMETER diff --git a/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityMemberVsTopLevel.fir.kt b/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityMemberVsTopLevel.fir.kt index 64caf41012d..9c4a1d310b3 100644 --- a/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityMemberVsTopLevel.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/function/noAmbiguityMemberVsTopLevel.fir.kt @@ -25,7 +25,7 @@ class A { expectFunction0Unit(::foo) expectFunction0String(::foo) - expectFunction1Unit(::foo) - expectFunction1String(::foo) + expectFunction1Unit(::foo) + expectFunction1String(::foo) } } diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.fir.kt index 95d19599fb7..7d16ea0ea71 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/dependOnArgumentType.fir.kt @@ -16,15 +16,15 @@ fun bar(s: T) {} fun complex(t: T, f: (T) -> Unit) {} fun test1() { - foo(1, A::invokeLater) // KT-24507 SAM conversion accidentally applied to callable reference and incorrectly handled via BE + foo(1, A::invokeLater) // KT-24507 SAM conversion accidentally applied to callable reference and incorrectly handled via BE foo(1, ::bar) complex(1, ::bar) } fun test2(x: R) { - foo(x, A::invokeLater) // KT-24507 SAM conversion accidentally applied to callable reference and incorrectly handled via BE + foo(x, A::invokeLater) // KT-24507 SAM conversion accidentally applied to callable reference and incorrectly handled via BE foo(x, ::bar) complex(x, ::bar) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.fir.kt index 2806859ae53..32246c43e29 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/explicitTypeArguments.fir.kt @@ -14,7 +14,7 @@ fun Wrapper.baz(transform: (T) -> Unit): T = TODO() fun test() { takeFun(::foo) - takeFun(::fooInt) + takeFun(::fooInt) callFun>(::createWrapper) callFun>(::createWrapper) diff --git a/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.fir.kt b/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.fir.kt index b2d645d4c59..1fcb1e71a55 100644 --- a/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/generic/genericExtensionFunction.fir.kt @@ -23,9 +23,9 @@ fun test1() { fun test2() { bar(Wrapper::fooReturnString).checkType { _>() } bar(Wrapper::fooReturnString).checkType { _>() } - bar(Wrapper::fooReturnString) - bar(Wrapper::fooReturnString) + bar(Wrapper::fooReturnString) + bar(Wrapper::fooReturnString) bar(Wrapper::fooTakeInt).checkType { _>() } bar(Wrapper::fooTakeInt).checkType { _>() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVararg.fir.kt b/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVararg.fir.kt index e63a47a9cbb..b904f79d1e3 100644 --- a/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVararg.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/genericCallWithReferenceAgainstVararg.fir.kt @@ -5,9 +5,9 @@ fun foo(vararg ints: Int) {} fun test(i: IntArray) { myLet(i, ::foo) myLet(::foo) - myLet(::foo) + myLet(::foo) myLet(::foo) - myLetExplicit1(::foo) + myLetExplicit1(::foo) myLetExplicit2(::foo) } diff --git a/compiler/testData/diagnostics/tests/callableReference/referenceAdaptationHasDependencyOnApi14.fir.kt b/compiler/testData/diagnostics/tests/callableReference/referenceAdaptationHasDependencyOnApi14.fir.kt index 6b813f4e609..c3bd1b383a6 100644 --- a/compiler/testData/diagnostics/tests/callableReference/referenceAdaptationHasDependencyOnApi14.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/referenceAdaptationHasDependencyOnApi14.fir.kt @@ -12,7 +12,7 @@ fun allOfTheAbove(f: (A) -> Unit): Any = f fun test() { coercionToUnit(A::foo) - varargToElement(A::foo) + varargToElement(A::foo) defaultAndVararg(A::foo) allOfTheAbove(A::foo) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.fir.kt index 92fbfedf7be..6522f5d262c 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/intersectionTypeOverloadWithWrongParameter.fir.kt @@ -11,9 +11,9 @@ class Foo { } fun foo() { - installRoute(::route) + installRoute(::route) } } -fun route(s: String): Any? = null \ No newline at end of file +fun route(s: String): Any? = null diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.fir.kt index f3aea568a45..f70a9b5d307 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/kt35887_simple.fir.kt @@ -6,4 +6,4 @@ import kotlin.reflect.KProperty0 object A fun property0(property: KProperty0) = A -val K.key get() : A = property0(Map.Entry::key) // should be forbidden +val K.key get() : A = property0(Map.Entry::key) // should be forbidden diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveCallableReferencesAfterAllSimpleArguments.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/resolveCallableReferencesAfterAllSimpleArguments.fir.kt index 563f1fdc365..45505c9a927 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveCallableReferencesAfterAllSimpleArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/resolveCallableReferencesAfterAllSimpleArguments.fir.kt @@ -11,6 +11,6 @@ fun baz(e: T, f: (T) -> Unit) {} fun test(a: A, b: B) { // Note that diagnostic is always on callable references as they are resolved after simple arguments - baz(a, ::fooB) - bar(::fooB, a) -} \ No newline at end of file + baz(a, ::fooB) + bar(::fooB, a) +} diff --git a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveTwoReferencesAgainstGenerics.fir.kt b/compiler/testData/diagnostics/tests/callableReference/resolve/resolveTwoReferencesAgainstGenerics.fir.kt index 9ec54a74492..8fffcbe4ad4 100644 --- a/compiler/testData/diagnostics/tests/callableReference/resolve/resolveTwoReferencesAgainstGenerics.fir.kt +++ b/compiler/testData/diagnostics/tests/callableReference/resolve/resolveTwoReferencesAgainstGenerics.fir.kt @@ -3,8 +3,8 @@ // WITH_RUNTIME -fun List>.flatten(): List = flatMap { it.fold(::emptyList, ::listOf) } +fun List>.flatten(): List = flatMap { it.fold(::emptyList, ::listOf) } class Option { fun fold(ifEmpty: () -> R, ifSome: (T) -> R): R = TODO() -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.fir.kt b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.fir.kt index e40440c30dd..3182eec3a07 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.fir.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/SpreadVarargs.fir.kt @@ -58,7 +58,7 @@ fun main() { val x1 = joinT(1, "2") checkSubtype(x1) val x2 = joinT(*1, "2") - checkSubtype(x2) + checkSubtype(x2) val x6 = joinT(1, *a) checkSubtype(x6) val x7 = joinT(1, *a, "3") @@ -93,4 +93,4 @@ fun joinG(x : Int, vararg a : T) : String { fun joinT(x : Int, vararg a : T) : T? { return null -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.fir.kt b/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.fir.kt index f3502cbdb5a..ae8211a85f7 100644 --- a/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.fir.kt +++ b/compiler/testData/diagnostics/tests/checkArguments/overloadedFunction.fir.kt @@ -9,9 +9,9 @@ fun bar(a: Any) {} fun bar(a: Int) {} fun test() { - foo(1, 2) + foo(1, 2) foo("") - bar(1, 2) - bar() -} \ No newline at end of file + bar(1, 2) + bar() +} diff --git a/compiler/testData/diagnostics/tests/classObjects/ClassObjectVisibility.fir.kt b/compiler/testData/diagnostics/tests/classObjects/ClassObjectVisibility.fir.kt index 7e4d7e0d267..d9f4b9a1864 100644 --- a/compiler/testData/diagnostics/tests/classObjects/ClassObjectVisibility.fir.kt +++ b/compiler/testData/diagnostics/tests/classObjects/ClassObjectVisibility.fir.kt @@ -2,7 +2,7 @@ package foo fun test() { A.d - A.Companion.f + A.Companion.f B.D CCC CCC.classObjectVar @@ -27,4 +27,4 @@ class CCC() { private companion object { val classObjectVar = 3 } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/classObjects/nestedClassInPrivateClassObject.fir.kt b/compiler/testData/diagnostics/tests/classObjects/nestedClassInPrivateClassObject.fir.kt index 5a029292302..73796dc8b0e 100644 --- a/compiler/testData/diagnostics/tests/classObjects/nestedClassInPrivateClassObject.fir.kt +++ b/compiler/testData/diagnostics/tests/classObjects/nestedClassInPrivateClassObject.fir.kt @@ -10,6 +10,6 @@ class A { } } -fun f1() = A.Companion.B.C +fun f1() = A.Companion.B.C -fun f2() = A.Companion.B.C.foo() \ No newline at end of file +fun f2() = A.Companion.B.C.foo() diff --git a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithErroneousDelegation.fir.kt b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithErroneousDelegation.fir.kt index b76c4504f2f..ed776614370 100644 --- a/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithErroneousDelegation.fir.kt +++ b/compiler/testData/diagnostics/tests/controlFlowAnalysis/unnecessaryLateinit/lateinitWithErroneousDelegation.fir.kt @@ -7,5 +7,5 @@ class Foo { x = "Foo" } - constructor(x: String, y: String): this(y.hashCode()) -} \ No newline at end of file + constructor(x: String, y: String): this(y.hashCode()) +} diff --git a/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt index b7ff32fb78a..8c7dc98fa97 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/ForLoopWithExtensionIteratorOnNullable.fir.kt @@ -9,7 +9,7 @@ fun test() { // Error container.iterator() // for extension iterator, this code compiles, but should not - for (s in container) {} + for (s in container) {} } class OtherContainer(val k: K) { operator fun iterator(): Iterator = null!! @@ -18,5 +18,5 @@ class OtherContainer(val k: K) { fun test2() { val other: OtherContainer? = null // Error - for (s in other) {} + for (s in other) {} } diff --git a/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.fir.kt b/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.fir.kt index 596d3d773b3..5f4acc078ec 100644 --- a/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.fir.kt +++ b/compiler/testData/diagnostics/tests/controlStructures/forLoopWithNullableRange.fir.kt @@ -8,9 +8,9 @@ class It { } fun test(c: Coll?) { - for (x in c) {} + for (x in c) {} if (c != null) { for(x in c) {} } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/dataFlow/IsExpression.fir.kt b/compiler/testData/diagnostics/tests/dataFlow/IsExpression.fir.kt index c97b7f0dab6..3ede29e6027 100644 --- a/compiler/testData/diagnostics/tests/dataFlow/IsExpression.fir.kt +++ b/compiler/testData/diagnostics/tests/dataFlow/IsExpression.fir.kt @@ -2,5 +2,5 @@ fun f(a: Boolean, b: Int) {} fun foo(a: Any) { f(a is Int, a) - 1 + a -} \ No newline at end of file + 1 + a +} diff --git a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt index 42202be3f09..991fc0fe076 100644 --- a/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt +++ b/compiler/testData/diagnostics/tests/declarationChecks/namedFunAsLastExpressionInBlock.fir.kt @@ -5,7 +5,7 @@ fun foo(block: () -> (() -> Int)) {} fun test() { val x = fun named1(x: Int): Int { return 1 } - x checkType { _>() } + x checkType { _>() } foo { fun named2(): Int {return 1} } foo({ fun named3() = 1 }) diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt index 6e5547829ff..7ad8d8e86df 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/propertyDefferedType.fir.kt @@ -5,7 +5,7 @@ import kotlin.reflect.KProperty class B { - val c by Delegate(ag) + val c by Delegate(ag) } class Delegate(val init: T) { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.fir.kt index 811a7263d03..86c404b813b 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/thisInDelegate.fir.kt @@ -5,7 +5,7 @@ import kotlin.reflect.KProperty val Int.a by Delegate(this) class A { - val Int.a by Delegate(this) + val Int.a by Delegate(this) } class Delegate(i: Int) { diff --git a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.fir.kt b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.fir.kt index 7d9c4fed52b..d7a9c9067f1 100644 --- a/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.fir.kt +++ b/compiler/testData/diagnostics/tests/delegatedProperty/twoGetMethods.fir.kt @@ -3,7 +3,7 @@ import kotlin.reflect.KProperty class A { - val c: Int by Delegate() + val c: Int by Delegate() } class Delegate { diff --git a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.fir.kt b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.fir.kt index 5a4a7138942..4e839cc1292 100644 --- a/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.fir.kt +++ b/compiler/testData/diagnostics/tests/deparenthesize/checkDeparenthesizedType.fir.kt @@ -20,7 +20,7 @@ fun test(i: Int?) { foo(l4@ "") foo(("")) foo(checkSubtype("")) - foo(checkSubtype("")) + foo(checkSubtype("")) use(a, b, c, d) } diff --git a/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.fir.kt b/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.fir.kt index 75cf307e6b5..fe4ce752d1a 100644 --- a/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.fir.kt +++ b/compiler/testData/diagnostics/tests/dynamicTypes/withInvisibleSynthesized.fir.kt @@ -21,15 +21,15 @@ import p.* class K: J.C() { fun dynamic.test() { - sam(null) - sam( + sam(null) + sam( name = null, name = null ) } fun test() { - sam(null) + sam(null) } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/enum/ConstructorCallFromOutside.fir.kt b/compiler/testData/diagnostics/tests/enum/ConstructorCallFromOutside.fir.kt index 0701f5ccc4f..9057e9a5eee 100644 --- a/compiler/testData/diagnostics/tests/enum/ConstructorCallFromOutside.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/ConstructorCallFromOutside.fir.kt @@ -6,5 +6,5 @@ enum class A(val c: Int) { fun createA(): A { // Error should be here! - return A(10) + return A(10) } diff --git a/compiler/testData/diagnostics/tests/enum/inheritanceFromEnum.fir.kt b/compiler/testData/diagnostics/tests/enum/inheritanceFromEnum.fir.kt index 937cb42fbfe..21db81335c6 100644 --- a/compiler/testData/diagnostics/tests/enum/inheritanceFromEnum.fir.kt +++ b/compiler/testData/diagnostics/tests/enum/inheritanceFromEnum.fir.kt @@ -8,6 +8,6 @@ open enum class MyEnum() { enum class MyEnum2() {} -class MyClass(): MyEnum2() {} +class MyClass(): MyEnum2() {} class MyClass2(): MyJavaEnum() {} diff --git a/compiler/testData/diagnostics/tests/exposed/exceptionOnFakeInvisible.fir.kt b/compiler/testData/diagnostics/tests/exposed/exceptionOnFakeInvisible.fir.kt index bba58b45e5f..7b653470296 100644 --- a/compiler/testData/diagnostics/tests/exposed/exceptionOnFakeInvisible.fir.kt +++ b/compiler/testData/diagnostics/tests/exposed/exceptionOnFakeInvisible.fir.kt @@ -7,6 +7,6 @@ fun bar(arg: String) = arg class Derived : Base("123") { private inline fun foo() { - bar(v) + bar(v) } } diff --git a/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt b/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt index ceffdebe20a..3736d3d3ee2 100644 --- a/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt +++ b/compiler/testData/diagnostics/tests/extensions/kt1875.fir.kt @@ -16,6 +16,6 @@ fun test(t: T) { fun test1(t: T?) { t.f(1) // todo resolve f as value and report UNSAFE_CALL t?.f(1) - t.f?.invoke(1) + t.f?.invoke(1) t?.f?.invoke(1) } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt index 11a8998209f..5a90d6d1d9e 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/complexInference.fir.kt @@ -10,8 +10,8 @@ fun foo(y: Y, x: (X, Y) -> Unit) {} fun bar(aInstance: A, bInstance: B) { foo("") { (a, b): A, c -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } } @@ -24,24 +24,24 @@ fun bar(aInstance: A, bInstance: B) { foo(bInstance) { (a, b): A, (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } foo(bInstance) { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } foo(bInstance) { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.fir.kt index 3b39223d348..d7af54b0415 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/noExpectedType.fir.kt @@ -5,22 +5,22 @@ data class A(val x: Int, val y: String) fun bar() { val x = { (a, b): A -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } } x checkType { _<(A) -> Unit>() } val y = { (a: Int, b): A -> a checkType { _() } - b checkType { _() } + b checkType { _() } } y checkType { _<(A) -> Unit>() } val y2 = { (a: Number, b): A -> a checkType { _() } - b checkType { _() } + b checkType { _() } } y2 checkType { _<(A) -> Unit>() } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt index 61c556743b3..9b4ea9d4756 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/redeclaration.fir.kt @@ -23,7 +23,7 @@ fun bar() { } foo { (a, b), (c, b) -> - a checkType { _() } + a checkType { _() } b checkType { _() } c checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt index e7e9af3047b..41783ca7cee 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/simple.fir.kt @@ -36,8 +36,8 @@ fun bar() { } foobar { (a, b), (c, d) -> - a checkType { _() } - b checkType { _() } + a checkType { _() } + b checkType { _() } c checkType { _() } d checkType { _() } } diff --git a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt index b2de6659aee..db23c7d5f31 100644 --- a/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt +++ b/compiler/testData/diagnostics/tests/functionLiterals/destructuringInLambdas/unusedParameters.fir.kt @@ -32,12 +32,12 @@ fun bar() { } foobar { (a, b), (c, d) -> - a checkType { _() } + a checkType { _() } d checkType { _() } } foobar { (a, b), (c, d) -> - b checkType { _() } + b checkType { _() } c checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt index 4b06fd6d4b4..0f218668cf2 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClasses.fir.kt @@ -20,7 +20,7 @@ class A : Outer() { fun foo() { Derived().foo() checkType { _.Inner>() } - Derived().baz() checkType { _>() } + Derived().baz() checkType { _>() } A.B().bar() checkType { _.Inner>() } - A.B().x() checkType { _>() } + A.B().x() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt index f4db464a50c..bcb0aa6dfa0 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesLocal.fir.kt @@ -43,7 +43,7 @@ fun test() { x = foobar() x().foo().a() checkType { _>() } - x().bar() checkType { _>() } + x().bar() checkType { _>() } x = foobar() @@ -51,5 +51,5 @@ fun test() { y = noParameters() y().foo().a() checkType { _>() } - y().bar() checkType { _>() } + y().bar() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt index 2cbb09b91cd..1ea8a5ee22e 100644 --- a/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/innerClasses/implicitArguments/fromSuperClassesTransitive.fir.kt @@ -15,5 +15,5 @@ class Derived : BaseDerived2() { fun foo() { Derived().foo() checkType { _.Inner>() } - Derived().baz() checkType { _>() } + Derived().baz() checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.fir.kt b/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.fir.kt index 6a1b212e577..e02c42140fd 100644 --- a/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.fir.kt +++ b/compiler/testData/diagnostics/tests/generics/wrongNumberOfTypeArgumentsDiagnostic.fir.kt @@ -5,12 +5,12 @@ fun myFun(i : String) {} fun myFun(i : Int) {} fun test1() { - myFun(3) - myFun('a') + myFun(3) + myFun('a') } fun test2() { val m0 = java.util.HashMap() val m1 = java.util.HashMap() val m2 = java.util.HashMap() -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/imports/CheckJavaVisibility2.fir.kt b/compiler/testData/diagnostics/tests/imports/CheckJavaVisibility2.fir.kt index bd143fb16da..46bc2d36099 100644 --- a/compiler/testData/diagnostics/tests/imports/CheckJavaVisibility2.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/CheckJavaVisibility2.fir.kt @@ -22,24 +22,24 @@ import j.JavaProtected import j.JavaPackageLocal class A { - val p1 = JavaPackageLocal.javaPPackage - val p2 = JavaProtected.javaPProtectedStatic - val p3 = JavaProtected().javaPProtectedPackage + val p1 = JavaPackageLocal.javaPPackage + val p2 = JavaProtected.javaPProtectedStatic + val p3 = JavaProtected().javaPProtectedPackage fun test() { - JavaProtected.javaMProtectedStatic() - JavaPackageLocal.javaMPackage() + JavaProtected.javaMProtectedStatic() + JavaPackageLocal.javaMPackage() } } class B : JavaProtected() { - val p1 = JavaPackageLocal.javaPPackage + val p1 = JavaPackageLocal.javaPPackage val p2 = JavaProtected.javaPProtectedStatic val p3 = javaPProtectedPackage fun test() { JavaProtected.javaMProtectedStatic() - JavaPackageLocal.javaMPackage() + JavaPackageLocal.javaMPackage() } } @@ -59,4 +59,4 @@ class C { JavaProtected.javaMProtectedStatic() JavaPackageLocal.javaMPackage() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/imports/ImportOverloadFunctions.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportOverloadFunctions.fir.kt index 9e93dd8d3d1..05e1b395148 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportOverloadFunctions.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportOverloadFunctions.fir.kt @@ -27,9 +27,9 @@ import k.two import k.all fun test() { - zero() - zero(1) - zero("") + zero() + zero(1) + zero("") one() one(1) @@ -42,4 +42,4 @@ fun test() { all() all(1) all("") -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/imports/ImportPrivateMember.fir.kt b/compiler/testData/diagnostics/tests/imports/ImportPrivateMember.fir.kt index 434a8a9cf82..f7340913f57 100644 --- a/compiler/testData/diagnostics/tests/imports/ImportPrivateMember.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/ImportPrivateMember.fir.kt @@ -29,9 +29,9 @@ private object TopLevelObject { } fun testAccess() { - NestedClass() + NestedClass() E1 InNested() NestedEntry inObject() -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.fir.kt b/compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.fir.kt index cc97cecd2eb..a44cf851515 100644 --- a/compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/InaccessiblePrivateClass.fir.kt @@ -15,4 +15,4 @@ package p1 import p2.* val x: X = X() -val y: Y = Y() +val y: Y = Y() diff --git a/compiler/testData/diagnostics/tests/imports/PackageLocalClassNotImported.fir.kt b/compiler/testData/diagnostics/tests/imports/PackageLocalClassNotImported.fir.kt index a5592ef7931..c3cc649331a 100644 --- a/compiler/testData/diagnostics/tests/imports/PackageLocalClassNotImported.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/PackageLocalClassNotImported.fir.kt @@ -14,4 +14,4 @@ package a import pack1.* import pack2.* -class X : SomeClass() +class X : SomeClass() diff --git a/compiler/testData/diagnostics/tests/imports/PackageLocalClassReferencedError.fir.kt b/compiler/testData/diagnostics/tests/imports/PackageLocalClassReferencedError.fir.kt index 20803950834..f939d2e39be 100644 --- a/compiler/testData/diagnostics/tests/imports/PackageLocalClassReferencedError.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/PackageLocalClassReferencedError.fir.kt @@ -8,4 +8,4 @@ package a import pack1.* -private class X : SomeClass() \ No newline at end of file +private class X : SomeClass() diff --git a/compiler/testData/diagnostics/tests/imports/PrivateClassNotImported.fir.kt b/compiler/testData/diagnostics/tests/imports/PrivateClassNotImported.fir.kt index f65626c3aa4..f522cf7c968 100644 --- a/compiler/testData/diagnostics/tests/imports/PrivateClassNotImported.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/PrivateClassNotImported.fir.kt @@ -17,5 +17,5 @@ package a import pack1.SomeClass.* import pack2.* -class X : N() +class X : N() class Y : PublicNested() diff --git a/compiler/testData/diagnostics/tests/imports/PrivateClassReferencedError.fir.kt b/compiler/testData/diagnostics/tests/imports/PrivateClassReferencedError.fir.kt index a6fda12428f..ffd7e80ca90 100644 --- a/compiler/testData/diagnostics/tests/imports/PrivateClassReferencedError.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/PrivateClassReferencedError.fir.kt @@ -11,4 +11,4 @@ package a import pack1.SomeClass.* -private class X : N() \ No newline at end of file +private class X : N() diff --git a/compiler/testData/diagnostics/tests/imports/invisibleFakeReferenceInImport.fir.kt b/compiler/testData/diagnostics/tests/imports/invisibleFakeReferenceInImport.fir.kt index 1f21b6bb9aa..d78ec9bf63b 100644 --- a/compiler/testData/diagnostics/tests/imports/invisibleFakeReferenceInImport.fir.kt +++ b/compiler/testData/diagnostics/tests/imports/invisibleFakeReferenceInImport.fir.kt @@ -3,7 +3,7 @@ import B.foo fun test() { - foo + foo } // FILE: B.kt @@ -13,4 +13,4 @@ object B : C() open class C { private var foo: String = "abc" -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/completeFunctionArgumentsOfNestedCalls.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/completeFunctionArgumentsOfNestedCalls.fir.kt deleted file mode 100644 index 96dadd79db6..00000000000 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/completeFunctionArgumentsOfNestedCalls.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -package c - -fun demo() { - val bar = 51 - fun map(f : fun - val foo = 3; - bar + map { foo } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/completeFunctionArgumentsOfNestedCalls.kt b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/completeFunctionArgumentsOfNestedCalls.kt index b4a2738c553..fb97a97e798 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/completeFunctionArgumentsOfNestedCalls.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/diagnosticWithSyntaxError/completeFunctionArgumentsOfNestedCalls.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL package c fun demo() { diff --git a/compiler/testData/diagnostics/tests/incompleteCode/kt2014.fir.kt b/compiler/testData/diagnostics/tests/incompleteCode/kt2014.fir.kt index 0d63fefe59b..b7159000e84 100644 --- a/compiler/testData/diagnostics/tests/incompleteCode/kt2014.fir.kt +++ b/compiler/testData/diagnostics/tests/incompleteCode/kt2014.fir.kt @@ -14,7 +14,7 @@ fun x(f : Foo) { f.a() c() - R() + R() } -object R {} \ No newline at end of file +object R {} diff --git a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoneApplicable.fir.kt b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoneApplicable.fir.kt index ae5b852f858..b31d5a847c2 100644 --- a/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoneApplicable.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/cannotCompleteResolveNoneApplicable.fir.kt @@ -4,5 +4,5 @@ fun f(i: Int, t: T, c: MutableCollection) {} fun f(a: Any, t: T, l: MutableList) {} fun test(l: List) { - f(1, "", l) + f(1, "", l) } diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.fir.kt index 177d1f8c10f..43ee1c7910f 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromNullableTypeVariable.fir.kt @@ -5,10 +5,10 @@ fun Array.filterNotNull(): List = throw Exception() fun test1(a: Array) { val list = a.filterNotNull() - list checkType { _>() } + list checkType { _>() } } fun test2(vararg a: Int?) { val list = a.filterNotNull() - list checkType { _>() } -} \ No newline at end of file + list checkType { _>() } +} diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromTypeParameterUpperBound.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromTypeParameterUpperBound.fir.kt index b0672c7516a..ef490e8875a 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromTypeParameterUpperBound.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/captureFromTypeParameterUpperBound.fir.kt @@ -2,10 +2,10 @@ interface Inv fun > foo(x: X, y: Y) { val rX = bar(x) - rX.length + rX.length val rY = bar(y) - rY.length + rY.length } -fun bar(l: Inv): Y = TODO() \ No newline at end of file +fun bar(l: Inv): Y = TODO() diff --git a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.fir.kt b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.fir.kt index 6888e73ef5e..2977fc13931 100644 --- a/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/capturedTypes/kt2872.fir.kt @@ -3,5 +3,5 @@ fun Array.foo() {} fun test(array: Array) { array.foo() - array.foo() -} \ No newline at end of file + array.foo<out Int>() +} diff --git a/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.fir.kt b/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.fir.kt index a63377b4fdb..7848dde3efe 100644 --- a/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completeInferenceIfManyFailed.fir.kt @@ -12,6 +12,6 @@ fun joinT(x: Comparable<*>, y: T): T? { } fun test() { - val x2 = joinT(Unit, "2") + val x2 = joinT(Unit, "2") checkSubtype(x2) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt b/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt index 64feed39415..363d4dd8d6c 100644 --- a/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/completion/postponedArgumentsAnalysis/basic.fir.kt @@ -119,8 +119,8 @@ fun main() { * K <: (A) -> Unit -> TypeVariable(_RP1) >: A * K >: (C) -> TypeVariable(_R) -> TypeVariable(_RP1) <: C */ - val x12 = selectC(id { it }, id { x: B -> }) - val x13 = selectA(id { it }, id { x: C -> }) + val x12 = selectC(id { it }, id { x: B -> }) + val x13 = selectA(id { it }, id { x: C -> }) val x14 = selectC(id { it }, id { x: A -> }, { x -> x }) val x15 = selectC(id { it }, { x: A -> }, id { x -> x }) /* @@ -152,7 +152,7 @@ fun main() { select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x: String, y: String -> x }) // Convert to extension lambda is impossible because the lambda parameter types aren't specified explicitly select(id(fun String.(x: String) {}), id(fun(x: String, y: String) { }), { x, y -> x }) - select(id(id(fun(x: String, y: String) { }), fun String.(x: String) {}), { x, y -> x }) + select(id(id(fun(x: String, y: String) { }), fun String.(x: String) {}), { x, y -> x }) val x26: Int.(String) -> Int = fun (x: String) = 10 // it must be error, see KT-38439 // Receiver must be specified in anonymous function declaration val x27: Int.(String) -> Int = id(fun (x: String) = 10) diff --git a/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.fir.kt b/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.fir.kt index b77422491e4..04d68257dba 100644 --- a/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/constraints/constraintOnFunctionLiteral.fir.kt @@ -3,7 +3,7 @@ package c import java.util.ArrayList -fun Array.toIntArray(): IntArray = this.mapTo(IntArray(size), {it}) +fun Array.toIntArray(): IntArray = this.mapTo(IntArray(size), {it}) fun Array.toArrayList(): ArrayList = this.mapTo(ArrayList(size), {it}) diff --git a/compiler/testData/diagnostics/tests/inference/kt39220.fir.kt b/compiler/testData/diagnostics/tests/inference/kt39220.fir.kt index c54578acf32..30954aabfef 100644 --- a/compiler/testData/diagnostics/tests/inference/kt39220.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/kt39220.fir.kt @@ -114,14 +114,14 @@ fun main() { bar7(Foo::resolve) // OK // with LHS and sentension function expected type - bar10(Int::x1) // ERROR before the fix in NI + bar10(Int::x1) // ERROR before the fix in NI bar10(Int::x1) // OK bar10(Int::x1) // OK fun Int.ext() { // with LHS and sentension function expected type - bar10(::x1) // ERROR before the fix in NI - bar10(::x1) // OK - bar10(::x1) // OK + bar10(::x1) // ERROR before the fix in NI + bar10(::x1) // OK + bar10(::x1) // OK } } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt36342.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt36342.fir.kt index 0c05a63971e..ce7dd68d053 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt36342.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt36342.fir.kt @@ -5,21 +5,21 @@ import java.lang.Exception fun id(arg: K): K = arg fun test() { - id(unresolved)!! + id(unresolved)!! unresolved!!!! try { - id(unresolved) + id(unresolved) } catch (e: Exception) { - id(unresolved) + id(unresolved) } if (true) - id(unresolved) + id(unresolved) else - id(unresolved) + id(unresolved) when { true -> id(unresolved) } - id(unresolved) ?: id(unresolved) + id(unresolved) ?: id(unresolved) } diff --git a/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt b/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt index 2fedc1e6b87..15e81b3b1f5 100644 --- a/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/regressions/kt742.fir.kt @@ -10,4 +10,4 @@ fun List.map1(f: (T)-> Q): List? = tail!!.map1(f) fun List.map2(f: (T)-> Q): List? = tail.sure().map2(f) -fun List.map3(f: (T)-> Q): List? = tail.sure().map3(f) \ No newline at end of file +fun List.map3(f: (T)-> Q): List? = tail.sure().map3(f) diff --git a/compiler/testData/diagnostics/tests/inference/reportingImprovements/reportUnresolvedReferenceWrongReceiverForManyCandidates.fir.kt b/compiler/testData/diagnostics/tests/inference/reportingImprovements/reportUnresolvedReferenceWrongReceiverForManyCandidates.fir.kt index 15f474ac9b4..d55f3fad5a9 100644 --- a/compiler/testData/diagnostics/tests/inference/reportingImprovements/reportUnresolvedReferenceWrongReceiverForManyCandidates.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/reportingImprovements/reportUnresolvedReferenceWrongReceiverForManyCandidates.fir.kt @@ -1,8 +1,8 @@ fun test() { - val a = -false + val a = -false } operator fun A.unaryMinus() {} operator fun B.unaryMinus() {} class A -class B \ No newline at end of file +class B diff --git a/compiler/testData/diagnostics/tests/inference/tooEagerSmartcast.fir.kt b/compiler/testData/diagnostics/tests/inference/tooEagerSmartcast.fir.kt index b1a627aa850..18be734f3fd 100644 --- a/compiler/testData/diagnostics/tests/inference/tooEagerSmartcast.fir.kt +++ b/compiler/testData/diagnostics/tests/inference/tooEagerSmartcast.fir.kt @@ -36,7 +36,7 @@ fun Number.num() {} fun main(b: Base) { b.foo().num() if (b is Derived<*>) { - b.foo().num() - b.baz().length + b.foo().num() + b.baz().length } } diff --git a/compiler/testData/diagnostics/tests/inner/visibility.fir.kt b/compiler/testData/diagnostics/tests/inner/visibility.fir.kt index 9f77c959bb3..73ed9de9800 100644 --- a/compiler/testData/diagnostics/tests/inner/visibility.fir.kt +++ b/compiler/testData/diagnostics/tests/inner/visibility.fir.kt @@ -11,8 +11,8 @@ open class Outer { class Derived : Outer() { fun foo() { - Outer.PrivateNested() - super.PrivateInner() + Outer.PrivateNested() + super.PrivateInner() Outer.ProtectedNested() super.ProtectedInner() @@ -23,11 +23,11 @@ class Derived : Outer() { } fun foo() { - Outer.PrivateNested() - Outer().PrivateInner() + Outer.PrivateNested() + Outer().PrivateInner() - Outer.ProtectedNested() - Outer().ProtectedInner() + Outer.ProtectedNested() + Outer().ProtectedInner() Outer.PublicNested() Outer().PublicInner() diff --git a/compiler/testData/diagnostics/tests/j+k/invisiblePackagePrivateInheritedMember.fir.kt b/compiler/testData/diagnostics/tests/j+k/invisiblePackagePrivateInheritedMember.fir.kt index 99645d5127a..4e236972154 100644 --- a/compiler/testData/diagnostics/tests/j+k/invisiblePackagePrivateInheritedMember.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/invisiblePackagePrivateInheritedMember.fir.kt @@ -19,5 +19,5 @@ package c import b.F fun f() { - F().m + F().m } diff --git a/compiler/testData/diagnostics/tests/j+k/packageVisibility.fir.kt b/compiler/testData/diagnostics/tests/j+k/packageVisibility.fir.kt index ff2aed7313b..61da78ca763 100644 --- a/compiler/testData/diagnostics/tests/j+k/packageVisibility.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/packageVisibility.fir.kt @@ -26,19 +26,19 @@ package b import a.MyJavaClass -val mc1 = MyJavaClass() +val mc1 = MyJavaClass() -val x = MyJavaClass.staticMethod() -val y = MyJavaClass.NestedClass.staticMethodOfNested() -val z = MyJavaClass.NestedClass() +val x = MyJavaClass.staticMethod() +val y = MyJavaClass.NestedClass.staticMethodOfNested() +val z = MyJavaClass.NestedClass() //FILE: c.kt package a.c import a.MyJavaClass -val mc1 = MyJavaClass() +val mc1 = MyJavaClass() -val x = MyJavaClass.staticMethod() -val y = MyJavaClass.NestedClass.staticMethodOfNested() -val z = MyJavaClass.NestedClass() \ No newline at end of file +val x = MyJavaClass.staticMethod() +val y = MyJavaClass.NestedClass.staticMethodOfNested() +val z = MyJavaClass.NestedClass() 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 f02c153f3c8..80760d8daf3 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloads.fir.kt @@ -19,9 +19,9 @@ 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 { _>() } + 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 3321253e4a3..aa113f16ee1 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsDisabled.fir.kt @@ -20,9 +20,9 @@ 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 { _>() } + 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 0bb6d5b9bbe..df77b661fc5 100644 --- a/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/properties/fieldPropertyOverloadsNI.fir.kt @@ -19,9 +19,9 @@ 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 { _>() } + CompressionType.ZIP::name checkType { _>() } + c::size checkType { _>() } } diff --git a/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.fir.kt index f45fd6988e8..c339c400571 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/privateCandidatesWithWrongArguments.fir.kt @@ -17,5 +17,5 @@ public class A { package bar fun main() { - foo.A.f {} -} \ No newline at end of file + foo.A.f {} +} diff --git a/compiler/testData/diagnostics/tests/j+k/sam/referenceToSamFunctionAgainstExpectedType.fir.kt b/compiler/testData/diagnostics/tests/j+k/sam/referenceToSamFunctionAgainstExpectedType.fir.kt index c3363f2f69f..65798d88144 100644 --- a/compiler/testData/diagnostics/tests/j+k/sam/referenceToSamFunctionAgainstExpectedType.fir.kt +++ b/compiler/testData/diagnostics/tests/j+k/sam/referenceToSamFunctionAgainstExpectedType.fir.kt @@ -18,7 +18,7 @@ public class Inv { fun test(inv: Inv) { val m: ((String) -> String) -> Inv = inv::map - take(inv::map) + take(inv::map) } -fun take(f: ((String) -> String) -> Inv) {} \ No newline at end of file +fun take(f: ((String) -> String) -> Inv) {} diff --git a/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt b/compiler/testData/diagnostics/tests/j+k/selectMoreSpecific.fir.kt index dec7050b358..c64eab51fd2 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/functionGenericsInParamsBoundsMismatch.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.fir.kt deleted file mode 100644 index f9946ea73d7..00000000000 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.fir.kt +++ /dev/null @@ -1,40 +0,0 @@ -// !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL - -// MODULE: m1 -// FILE: a.kt -package p - -public interface B { - public fun foo(a: T): B? -} - -// MODULE: m2(m1) -// FILE: b.kt -package p - -public interface C : B { - override fun foo(a: T): B? - -} - -// MODULE: m3 -// FILE: b.kt -package p - -public interface Tr - -public interface B { - public fun foo(a: T): B? -} - -// MODULE: m4(m3, m2) -// FILE: c.kt -import p.* - -fun test(b: B?) { - if (b is C) { - // hard to find parameters for an ambiguous call, so we rely on NONE_APPLICABLE here - // as opposed to diagnostics for a single unmatched candidate - b?.foo() - } -} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.kt index cba582efada..269b4a88787 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/functionGenericsInParamsBoundsMismatch.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNNECESSARY_SAFE_CALL // MODULE: m1 diff --git a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/incompleteCodeNoNoneApplicable.fir.kt b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/incompleteCodeNoNoneApplicable.fir.kt index 3bd3957db38..8802f1cd5b7 100644 --- a/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/incompleteCodeNoNoneApplicable.fir.kt +++ b/compiler/testData/diagnostics/tests/multimodule/duplicateMethod/incompleteCodeNoNoneApplicable.fir.kt @@ -16,5 +16,5 @@ import p.f fun test() { // There should be no "none applicable" error here - f( + f( } diff --git a/compiler/testData/diagnostics/tests/multimodule/internal.fir.kt b/compiler/testData/diagnostics/tests/multimodule/internal.fir.kt index d22b0c4034b..f69810ed517 100644 --- a/compiler/testData/diagnostics/tests/multimodule/internal.fir.kt +++ b/compiler/testData/diagnostics/tests/multimodule/internal.fir.kt @@ -22,14 +22,14 @@ internal class B import p.* fun test() { - val _a = a - val _v = v - a() - B() + val _a = a + val _v = v + a() + B() val inst = A() - val ia = inst.a - val iv = inst.v - inst.a() - inst.B() -} \ No newline at end of file + val ia = inst.a + val iv = inst.v + inst.a() + inst.B() +} diff --git a/compiler/testData/diagnostics/tests/multimodule/packagePrivate.fir.kt b/compiler/testData/diagnostics/tests/multimodule/packagePrivate.fir.kt index 2cc1dbbbe05..dcc962ea7cc 100644 --- a/compiler/testData/diagnostics/tests/multimodule/packagePrivate.fir.kt +++ b/compiler/testData/diagnostics/tests/multimodule/packagePrivate.fir.kt @@ -9,11 +9,11 @@ private val a = 1 package p -val b = a // same package, same module +val b = a // same package, same module // MODULE: m2(m1) // FILE: c.kt package p -val c = a // same package, another module +val c = a // same package, another module diff --git a/compiler/testData/diagnostics/tests/multimodule/publishedApiInternal.fir.kt b/compiler/testData/diagnostics/tests/multimodule/publishedApiInternal.fir.kt index 6828470cc55..3ea44d37d47 100644 --- a/compiler/testData/diagnostics/tests/multimodule/publishedApiInternal.fir.kt +++ b/compiler/testData/diagnostics/tests/multimodule/publishedApiInternal.fir.kt @@ -30,27 +30,27 @@ internal class B import p.* fun test() { - val _a = a - val _v = v - a() - B() + val _a = a + val _v = v + a() + B() val inst = A() - val ia = inst.a - val iv = inst.v - inst.a() - inst.B() + val ia = inst.a + val iv = inst.v + inst.a() + inst.B() } inline fun testInline() { - val _a = a - val _v = v - a() - B() + val _a = a + val _v = v + a() + B() val inst = A() - val ia = inst.a - val iv = inst.v - inst.a() - inst.B() -} \ No newline at end of file + val ia = inst.a + val iv = inst.v + inst.a() + inst.B() +} diff --git a/compiler/testData/diagnostics/tests/multiplatform/enum/constructorInHeaderEnum.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/enum/constructorInHeaderEnum.fir.kt index 6f5ed38c95b..d06d0075a2d 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/enum/constructorInHeaderEnum.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/enum/constructorInHeaderEnum.fir.kt @@ -3,11 +3,11 @@ // FILE: common.kt expect enum class En(x: Int) { - E1, + E1, E2(42), ; - constructor(s: String) + constructor(s: String) } expect enum class En2 { diff --git a/compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.fir.kt index 94dbc558730..1e5a623615a 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/headerClass/explicitConstructorDelegation.fir.kt @@ -8,7 +8,7 @@ expect open class A { } expect class B : A { - constructor(i: Int) + constructor(i: Int) constructor() : super("B") } diff --git a/compiler/testData/diagnostics/tests/multiplatform/namedArguments.fir.kt b/compiler/testData/diagnostics/tests/multiplatform/namedArguments.fir.kt index acd1bb85ef5..5d35855ba45 100644 --- a/compiler/testData/diagnostics/tests/multiplatform/namedArguments.fir.kt +++ b/compiler/testData/diagnostics/tests/multiplatform/namedArguments.fir.kt @@ -4,7 +4,7 @@ // FILE: common.kt expect class Foo(zzz: Int) { - constructor(aaa: Boolean) + constructor(aaa: Boolean) fun f1(xxx: String): String } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt index 619597777fa..839925da1b5 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/InfixCallNullability.fir.kt @@ -9,9 +9,9 @@ operator infix fun A.div(i : Int) {} operator infix fun A?.times(i : Int) {} fun test(x : Int?, a : A?) { - x.plus(1) + x.plus(1) x?.plus(1) - x + 1 + x + 1 -x x.unaryMinus() x?.unaryMinus() diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/NullableNothingIsExactlyNull.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/NullableNothingIsExactlyNull.fir.kt index 6b400c9e105..d5b70b57e5f 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/NullableNothingIsExactlyNull.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/NullableNothingIsExactlyNull.fir.kt @@ -2,7 +2,7 @@ fun test() { val out : Int? = null val x : Nothing? = null if (out != x) - out.plus(1) + out.plus(1) if (out == x) return - out.plus(1) + out.plus(1) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.fir.kt index 673aa7e412a..145f0c0349d 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt2216.fir.kt @@ -16,7 +16,7 @@ fun foo() { val y: Int? = 0 val z: Int? = 0 bar(if (y != null) y else z, y) - y + 2 + y + 2 baz(y, y, if (y == null) return else y, y) baz(y, z!!, z, y) } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt362.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt362.fir.kt index 301ae2f36b3..460e89813aa 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt362.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/kt362.fir.kt @@ -6,11 +6,11 @@ package example fun test() { val p = test.Public() if (p.public is Int) p.public + 1 - if (p.protected is Int) p.protected + 1 + if (p.protected is Int) p.protected + 1 if (p.internal is Int) p.internal + 1 val i = test.Internal() if (i.public is Int) i.public + 1 - if (i.protected is Int) i.protected + 1 + if (i.protected is Int) i.protected + 1 if (i.internal is Int) i.internal + 1 } diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/nullableReceiverWithOverloadedMethod.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/nullableReceiverWithOverloadedMethod.fir.kt index 979f82d3b58..70a83ede2b7 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/nullableReceiverWithOverloadedMethod.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/nullableReceiverWithOverloadedMethod.fir.kt @@ -13,17 +13,17 @@ class B { fun f() { a = A() - a.f(true) - takeInt(a.f("")) - a.f() + a.f(true) + takeInt(a.f("")) + a.f() } fun g() { takeInt(if (3 > 2) { a = A() - a.f(true) + a.f(true) } else { 6 }) } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unstableSmartcastWithOverloadedExtensions.fir.kt b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unstableSmartcastWithOverloadedExtensions.fir.kt index d82782e63de..dc944fc6d17 100644 --- a/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unstableSmartcastWithOverloadedExtensions.fir.kt +++ b/compiler/testData/diagnostics/tests/nullabilityAndSmartCasts/unstableSmartcastWithOverloadedExtensions.fir.kt @@ -9,6 +9,6 @@ var a: A? = null fun smartCastInterference(b: B) { if (a != null) { - a.foo(b) + a.foo(b) } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.fir.kt index f4f557da92c..13ee4dbdf08 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.fir.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterPlatform.fir.kt @@ -13,6 +13,6 @@ public class J { fun test(j: J, nullStr: String?, nullByte: Byte?, nullDouble: Double?) { j.foo(nullStr) - j.foo(nullDouble) + j.foo(nullDouble) j.foo(nullByte) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.fir.kt b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.fir.kt index 02eb22e893e..9c07471393f 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.fir.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/nullableArgumentToNonNullParameterSimple.fir.kt @@ -6,8 +6,8 @@ fun foo(x: Int) {} fun foo(x: Int, y: String) {} fun bar(nullX: Int?, nullY: String?, notNullY: String) { - foo(nullX) + foo(nullX) foo(nullX, notNullY) foo(nullX, nullY) - foo() -} \ No newline at end of file + foo() +} diff --git a/compiler/testData/diagnostics/tests/operatorRem/deprecatedModConvention.fir.kt b/compiler/testData/diagnostics/tests/operatorRem/deprecatedModConvention.fir.kt index 990401d58be..7873fff6e33 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/deprecatedModConvention.fir.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/deprecatedModConvention.fir.kt @@ -25,14 +25,14 @@ operator fun ModMemberAndRemExtension.rem(x: Int) {} fun foo() { ModAndRem % 1 - OldMod % 1 + OldMod % 1 ModAndRemExtension % 1 - ModExtension % 1 + ModExtension % 1 ModMemberAndRemExtension % 1 OldMod.mod(1) ModExtension.mod(1) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/operatorRem/noDeprecatedModConventionWithoutFeature.fir.kt b/compiler/testData/diagnostics/tests/operatorRem/noDeprecatedModConventionWithoutFeature.fir.kt index b3e37e080ec..21117f45dd6 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/noDeprecatedModConventionWithoutFeature.fir.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/noDeprecatedModConventionWithoutFeature.fir.kt @@ -25,14 +25,14 @@ operator fun ModMemberAndRemExtension.rem(x: Int) {} fun foo() { ModAndRem % 1 - OldMod % 1 + OldMod % 1 ModAndRemExtension % 1 - ModExtension % 1 + ModExtension % 1 ModMemberAndRemExtension % 1 OldMod.mod(1) ModExtension.mod(1) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/operatorsOverloading/InconsistentGetSet.fir.kt b/compiler/testData/diagnostics/tests/operatorsOverloading/InconsistentGetSet.fir.kt index 03d70dfc9c3..7050051b223 100644 --- a/compiler/testData/diagnostics/tests/operatorsOverloading/InconsistentGetSet.fir.kt +++ b/compiler/testData/diagnostics/tests/operatorsOverloading/InconsistentGetSet.fir.kt @@ -20,7 +20,7 @@ object MismatchingTypes { fun testMismatchingTypes() { ++MismatchingTypes[0] MismatchingTypes[0]++ - MismatchingTypes[0] += 1 + MismatchingTypes[0] += 1 } object MismatchingArities1 { @@ -36,10 +36,10 @@ object MismatchingArities2 { fun testMismatchingArities() { ++MismatchingArities1[0] MismatchingArities1[0]++ - MismatchingArities1[0] += 1 + MismatchingArities1[0] += 1 - ++MismatchingArities2[0] - MismatchingArities2[0]++ - MismatchingArities2[0] += 1 + ++MismatchingArities2[0] + MismatchingArities2[0]++ + MismatchingArities2[0] += 1 } diff --git a/compiler/testData/diagnostics/tests/overload/onlyPrivateOverloadsDiagnostic.fir.kt b/compiler/testData/diagnostics/tests/overload/onlyPrivateOverloadsDiagnostic.fir.kt index 13028da997e..71cd8529a56 100644 --- a/compiler/testData/diagnostics/tests/overload/onlyPrivateOverloadsDiagnostic.fir.kt +++ b/compiler/testData/diagnostics/tests/overload/onlyPrivateOverloadsDiagnostic.fir.kt @@ -6,7 +6,7 @@ class A { } fun test(a: A) { - a.foo(3) - a.foo() + a.foo(3) + a.foo() } diff --git a/compiler/testData/diagnostics/tests/override/AllPrivateFromSuperTypes.fir.kt b/compiler/testData/diagnostics/tests/override/AllPrivateFromSuperTypes.fir.kt index 4a6d96de823..1d3a12557f7 100644 --- a/compiler/testData/diagnostics/tests/override/AllPrivateFromSuperTypes.fir.kt +++ b/compiler/testData/diagnostics/tests/override/AllPrivateFromSuperTypes.fir.kt @@ -10,5 +10,5 @@ open class C { } class Subject : C(), A { - val c = a -} \ No newline at end of file + val c = a +} diff --git a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt index 27069db2ec1..de64ac8a435 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/noAnnotationInClassPath.fir.kt @@ -13,5 +13,5 @@ public class B { // FILE: main.kt fun test() { - B.bar() { it.hashCode() > 0 } + B.bar() { it.hashCode() > 0 } } diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt index daa58e6d862..b6401dfa2a7 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/arithmetic.fir.kt @@ -30,26 +30,26 @@ fun test() { ++platformJ platformNN++ - platformN++ + platformN++ platformJ++ 1 + platformNN - 1 + platformN + 1 + platformN 1 + platformJ platformNN + 1 - platformN + 1 + platformN + 1 platformJ + 1 1 plus platformNN - 1 plus platformN + 1 plus platformN 1 plus platformJ platformNN plus 1 - platformN plus 1 + platformN plus 1 platformJ plus 1 platformNN += 1 - platformN += 1 + platformN += 1 platformJ += 1 -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/for.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/for.fir.kt index 85fe29d1472..39bda6289ca 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/for.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/nullabilityWarnings/for.fir.kt @@ -22,7 +22,7 @@ fun test() { val platformJ = J.staticJ for (x in platformNN) {} - for (x in platformN) {} + for (x in platformN) {} for (x in platformJ) {} } diff --git a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/genericInnerClass.fir.kt b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/genericInnerClass.fir.kt index 8c109ee9e4c..5f920cab0f7 100644 --- a/compiler/testData/diagnostics/tests/platformTypes/rawTypes/genericInnerClass.fir.kt +++ b/compiler/testData/diagnostics/tests/platformTypes/rawTypes/genericInnerClass.fir.kt @@ -28,7 +28,7 @@ val strList: List = null!! fun main() { val rawA = Test.rawAField var rawInner = rawA.Inner("", "", strList) - rawInner.foo("", "", strList) - rawInner.bar().foo("") + rawInner.foo("", "", strList) + rawInner.bar().foo("") } diff --git a/compiler/testData/diagnostics/tests/privateInFile/topLevelAnnotationCall.fir.kt b/compiler/testData/diagnostics/tests/privateInFile/topLevelAnnotationCall.fir.kt index f3e97cd8266..9704b7c99f6 100644 --- a/compiler/testData/diagnostics/tests/privateInFile/topLevelAnnotationCall.fir.kt +++ b/compiler/testData/diagnostics/tests/privateInFile/topLevelAnnotationCall.fir.kt @@ -17,11 +17,11 @@ class C1 // FILE: 2.kt package pp -@A(foo) +@A(foo) fun f2() {} -@A(foo) +@A(foo) val p2 = "" -@A(foo) +@A(foo) class C2 diff --git a/compiler/testData/diagnostics/tests/privateInFile/visibility.fir.kt b/compiler/testData/diagnostics/tests/privateInFile/visibility.fir.kt index b864aefbc5d..abd889ae431 100644 --- a/compiler/testData/diagnostics/tests/privateInFile/visibility.fir.kt +++ b/compiler/testData/diagnostics/tests/privateInFile/visibility.fir.kt @@ -30,20 +30,20 @@ package a fun test() { val y = makeA() y.bar() - foo() + foo() - val u : A = A() + val u : A = A() - val z = x - x = 30 + val z = x + x = 30 - val po = PO + val po = PO val v = xx xx = 40 } -class B : A() {} +class B : A() {} class Q { class W { diff --git a/compiler/testData/diagnostics/tests/regressions/DoubleDefine.fir.kt b/compiler/testData/diagnostics/tests/regressions/DoubleDefine.fir.kt index 7d8a798f289..6ec5de4f0a3 100644 --- a/compiler/testData/diagnostics/tests/regressions/DoubleDefine.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/DoubleDefine.fir.kt @@ -11,8 +11,8 @@ fun takeFirst(expr: StringBuilder): Char { fun evaluateArg(expr: CharSequence, numbers: ArrayList): Int { if (expr.length == 0) throw Exception("Syntax error: Character expected"); val c = takeFirst(expr) - if (c >= '0' && c <= '9') { - val n = c - '0' + if (c >= '0' && c <= '9') { + val n = c - '0' if (!numbers.contains(n)) throw Exception("You used incorrect number: " + n) numbers.remove(n) return n diff --git a/compiler/testData/diagnostics/tests/regressions/WrongTraceInCallResolver.fir.kt b/compiler/testData/diagnostics/tests/regressions/WrongTraceInCallResolver.fir.kt index bca7a4babd4..895ef9ffa4b 100644 --- a/compiler/testData/diagnostics/tests/regressions/WrongTraceInCallResolver.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/WrongTraceInCallResolver.fir.kt @@ -5,5 +5,5 @@ fun foo(x : Int) {} fun foo(x : Long) {} fun f(): Unit { - foo(1) + foo(1) } diff --git a/compiler/testData/diagnostics/tests/regressions/kt10633.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt10633.fir.kt index 43971cfe338..0b14f8f5049 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt10633.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt10633.fir.kt @@ -13,7 +13,7 @@ operator fun Int.set(s: Int, x: String = "", z: Int) { fun main() { 1[2] = 1 1.set(2, z = 1) - 1[2] += 1 + 1[2] += 1 1.set(2, 1) } diff --git a/compiler/testData/diagnostics/tests/regressions/kt282.fir.kt b/compiler/testData/diagnostics/tests/regressions/kt282.fir.kt index 566da395178..f119809683d 100644 --- a/compiler/testData/diagnostics/tests/regressions/kt282.fir.kt +++ b/compiler/testData/diagnostics/tests/regressions/kt282.fir.kt @@ -12,7 +12,7 @@ operator fun Int?.contains(x : Int) : Boolean = false fun f(): Unit { var set : Set? = null val i : Int? = null - i + 1 + i + 1 set + 1 1 in set 1 in 2 diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.fir.kt index b593f3be4c1..d11dc63cba4 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/errors/invisibleInvoke.fir.kt @@ -5,6 +5,6 @@ class My { } fun My.foo(i: Int) { - i("") - 1("") + i("") + 1("") } diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.fir.kt index b98a5e324ac..221636473b8 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/functionExpectedWhenSeveralInvokesExist.fir.kt @@ -7,8 +7,8 @@ fun Int.invoke(a: Int, b: Int) {} class SomeClass fun test(identifier: SomeClass, fn: String.() -> Unit) { - identifier() + identifier() identifier(123) identifier(1, 2) 1.fn() -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt index cafa9a5dd7f..91c6e8b763d 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/implicitInvokeAfterSafeCall.fir.kt @@ -80,7 +80,7 @@ operator fun Foo6.invoke(x: Int) {} fun main(x: Bar6?) { x?.value(1) - x?.value.invoke(1) + x?.value.invoke(1) } // Test case 7: top-level generic invoke and invoke with compatible additional dispatch recevier @@ -108,7 +108,7 @@ operator fun Foo8.invoke(x: Int) {} fun main(x: Bar8?) { x?.value(1) - x?.value.invoke(1) + x?.value.invoke(1) } // Test case 9: additional receiver, generic invoke with pure type perameter receiver diff --git a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt index 3a4dbb8fdbb..a7c8c04aa1e 100644 --- a/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/invoke/invokeOnVariableWithExtensionFunctionType.fir.kt @@ -17,7 +17,7 @@ fun test(a: A, b: B) { b.(foo)() - (b.foo)() + (b.foo)() foo(b) (foo)(b) diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.fir.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.fir.kt index 08eb5f4d3ac..f416eb22b4d 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/completeTypeInferenceForNestedInNoneApplicable.fir.kt @@ -5,7 +5,7 @@ fun foo(i: Int) = i fun foo(s: String) = s fun test() { - foo(emptyList()) + foo(emptyList()) } -fun emptyList(): List {throw Exception()} \ No newline at end of file +fun emptyList(): List {throw Exception()} diff --git a/compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.fir.kt b/compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.fir.kt index f0b8c73eac2..5da913f1e1b 100644 --- a/compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/nestedCalls/manyInapplicableCandidatesWithLambdas.fir.kt @@ -19,20 +19,20 @@ class E { // `bar` calls are inapplicable since both E nor D aren't proper receivers // But prior to this change, every lambda was analyzed repeatedly for every candidate // Thus, the resulting time was exponential - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { - bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { + bar { } } diff --git a/compiler/testData/diagnostics/tests/resolve/noCandidates/resolvedToClassifier.fir.kt b/compiler/testData/diagnostics/tests/resolve/noCandidates/resolvedToClassifier.fir.kt index 373bd9da30e..e8523a23f44 100644 --- a/compiler/testData/diagnostics/tests/resolve/noCandidates/resolvedToClassifier.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/noCandidates/resolvedToClassifier.fir.kt @@ -9,11 +9,11 @@ fun test() { val interface_as_fun = A() val interface_as_val = A - val object_as_fun = B() + val object_as_fun = B() val class_as_val = C } fun bar() { val typeParameter_as_val = T val typeParameter_as_fun = T() -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/resolve/noCandidates/resolvedToClassifierWithReceiver.fir.kt b/compiler/testData/diagnostics/tests/resolve/noCandidates/resolvedToClassifierWithReceiver.fir.kt index 692b447b83a..e9d9b4acc49 100644 --- a/compiler/testData/diagnostics/tests/resolve/noCandidates/resolvedToClassifierWithReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/noCandidates/resolvedToClassifierWithReceiver.fir.kt @@ -11,7 +11,7 @@ fun testX() { val interface_as_fun = X.A() val interface_as_val = X.A - val object_as_fun = X.B() + val object_as_fun = X.B() val class_as_val = X.C } @@ -26,7 +26,7 @@ fun testY() { val interface_as_fun = Y.A() val interface_as_val = Y.A - val object_as_fun = Y.B() + val object_as_fun = Y.B() val class_as_val = Y.C } @@ -36,4 +36,4 @@ fun test(x: X) { val object_as_fun = x.B() val class_as_val = x.C -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsInDifferentPositions.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsInDifferentPositions.fir.kt index a78ef79e23e..7a0759a1f57 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsInDifferentPositions.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsInDifferentPositions.fir.kt @@ -8,6 +8,6 @@ fun overloadedFun(arg: String, vararg args: String) = X1 fun overloadedFun(arg: String, vararg args: String, flag: Boolean = true) = X2 val test1a: X1 = overloadedFun("", "") -val test1b: X1 = overloadedFun("", args = "") +val test1b: X1 = overloadedFun("", args = "") val test1c: X2 = overloadedFun("", "", "", flag = true) diff --git a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsMixed.fir.kt b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsMixed.fir.kt index d6cb070fa8a..f0b1ad0d89a 100644 --- a/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsMixed.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/overloadConflicts/varargsMixed.fir.kt @@ -9,5 +9,5 @@ fun overloadedFun5(s: String, vararg ss: String) = X2 val test1 = overloadedFun5("") val test2 = overloadedFun5("", "") -val test3: X2 = overloadedFun5(s = "", ss = "") -val test4: X1 = overloadedFun5(ss = "") \ No newline at end of file +val test3: X2 = overloadedFun5(s = "", ss = "") +val test4: X1 = overloadedFun5(ss = "") diff --git a/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.fir.kt b/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.fir.kt index ed8ac74968a..730066d811c 100644 --- a/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.fir.kt +++ b/compiler/testData/diagnostics/tests/resolve/specialConstructions/elvisAsCall.fir.kt @@ -23,15 +23,15 @@ fun testDataFlowInfo1(a: Int?, b: Int?) { val c: Int = a ?: b!! doInt(c) // b is nullable if a != null - b + 1 + b + 1 } fun testDataFlowInfo2(a: Int?, b: Int?) { doInt(a ?: b!!) // b is nullable if a != null - b + 1 + b + 1 } fun testTypeMismatch(a: String?, b: Any) { doInt(a ?: b) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt index 08666e38507..8e4fd966f51 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriority.fir.kt @@ -22,10 +22,10 @@ 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 { _() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt index 9e798e39854..b2d9a1b570a 100644 --- a/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/OverloadPriorityKT.fir.kt @@ -21,10 +21,10 @@ 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 { _() } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt index ac380628de6..7b117600a13 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgument.fir.kt @@ -35,12 +35,12 @@ fun main(x2: Runnable) { Test.foo1(x2, arrayOf("")) Test.foo1(x2, *arrayOf("")) - val i1 = Test({}, arrayOf()) + val i1 = Test({}, arrayOf()) val i2 = Test({}, *arrayOf()) - val i3 = Test({}, x3) - val i4 = Test({}, arrayOf("")) + val i3 = Test({}, x3) + val i4 = Test({}, arrayOf("")) val i5 = Test({}, {}, *arrayOf("")) - val i6 = Test({}, {}, arrayOf()) + val i6 = Test({}, {}, arrayOf()) i1.foo2({}, {}, arrayOf()) i1.foo2({}, {}, *arrayOf()) diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt index 3f1734f84b8..c793fba46ee 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentProhibited.fir.kt @@ -35,12 +35,12 @@ fun main(x2: Runnable) { Test.foo1(x2, arrayOf("")) Test.foo1(x2, *arrayOf("")) - val i1 = Test({}, arrayOf()) + val i1 = Test({}, arrayOf()) val i2 = Test({}, *arrayOf()) - val i3 = Test({}, x3) - val i4 = Test({}, arrayOf("")) + val i3 = Test({}, x3) + val i4 = Test({}, arrayOf("")) val i5 = Test({}, {}, *arrayOf("")) - val i6 = Test({}, {}, arrayOf()) + val i6 = Test({}, {}, arrayOf()) i2.foo2({}, {}, arrayOf()) i2.foo2({}, {}, *arrayOf()) diff --git a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt index 8cb08a16972..bd59ac25695 100644 --- a/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/samConversions/arrayAsVarargAfterSamArgumentWithoutSamConversionsPerArgument.fir.kt @@ -35,12 +35,12 @@ fun main(x2: Runnable) { Test.foo1(x2, arrayOf("")) Test.foo1(x2, *arrayOf("")) - val i1 = Test({}, arrayOf()) + val i1 = Test({}, arrayOf()) val i2 = Test({}, *arrayOf()) - val i3 = Test({}, x3) - val i4 = Test({}, arrayOf("")) + val i3 = Test({}, x3) + val i4 = Test({}, arrayOf("")) val i5 = Test({}, {}, *arrayOf("")) - val i6 = Test({}, {}, arrayOf()) + val i6 = Test({}, {}, arrayOf()) i1.foo2({}, {}, arrayOf()) i1.foo2({}, {}, *arrayOf()) diff --git a/compiler/testData/diagnostics/tests/scopes/VisibilityInClassObject.fir.kt b/compiler/testData/diagnostics/tests/scopes/VisibilityInClassObject.fir.kt index 9ec96d5cc79..7251d6ec170 100644 --- a/compiler/testData/diagnostics/tests/scopes/VisibilityInClassObject.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/VisibilityInClassObject.fir.kt @@ -19,15 +19,15 @@ open class A { fun fromOutside() { devNull(A.internal_val) devNull(A.public_val) - devNull(A.private_val) - devNull(A.protected_val) + devNull(A.private_val) + devNull(A.protected_val) } class B: A() { fun fromSubclass() { devNull(A.internal_val) devNull(A.public_val) - devNull(A.private_val) + devNull(A.private_val) devNull(A.protected_val) } } diff --git a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/hidePrivateByPublic.fir.kt b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/hidePrivateByPublic.fir.kt index 0b98742efd6..5c153794af9 100644 --- a/compiler/testData/diagnostics/tests/scopes/inheritance/statics/hidePrivateByPublic.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/inheritance/statics/hidePrivateByPublic.fir.kt @@ -23,8 +23,8 @@ class B extends A { // FILE: test.kt fun test() { - A.a - A.foo() + A.a + A.foo() A.b A.bar() B.a diff --git a/compiler/testData/diagnostics/tests/scopes/kt1244.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1244.fir.kt index 60cec2541c2..894f7089d50 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1244.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1244.fir.kt @@ -8,6 +8,6 @@ class A { class B() { init { - A().a = "Hello" + A().a = "Hello" } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/kt1738.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1738.fir.kt index 1a47ec37bf5..532007dca8f 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1738.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1738.fir.kt @@ -6,6 +6,6 @@ class A(private var i: Int, var j: Int) { } fun test(a: A) { - a.i++ + a.i++ a.j++ -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/kt1805.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1805.fir.kt index 62dd30d6aa1..eeeff3afa70 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1805.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1805.fir.kt @@ -7,14 +7,14 @@ open class Some { class SomeSubclass : Some() { fun test() { - this.privateField // 1. Unresolved reference + this.privateField // 1. Unresolved reference } } fun test() { val s2 = Some() - s2.privateField // 2. Can't access to 'privateField' in Some + s2.privateField // 2. Can't access to 'privateField' in Some val s1 = SomeSubclass() - s1.privateField // 3. Unresolved reference -} \ No newline at end of file + s1.privateField // 3. Unresolved reference +} diff --git a/compiler/testData/diagnostics/tests/scopes/kt1806.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1806.fir.kt index 657f069c623..7255217b584 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1806.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1806.fir.kt @@ -8,7 +8,7 @@ object MyObject { fun test1() { - doSmth(MyObject.message) + doSmth(MyObject.message) } class Test { @@ -17,8 +17,8 @@ class Test { } fun test2() { - doSmth(MyObject1.message) + doSmth(MyObject1.message) } } -fun doSmth(s: String) = s \ No newline at end of file +fun doSmth(s: String) = s diff --git a/compiler/testData/diagnostics/tests/scopes/kt1942.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt1942.fir.kt index c5bca2a4f52..e10c04b6470 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt1942.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt1942.fir.kt @@ -14,6 +14,6 @@ import a.C class A : C() { fun test() { - val v = myValue + val v = myValue } } diff --git a/compiler/testData/diagnostics/tests/scopes/kt37.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt37.fir.kt index f97b49359ba..1d8fe8aa0f9 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt37.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt37.fir.kt @@ -11,6 +11,6 @@ class C() { fun box(): String { val c = C() - if (c.f != 610) return "fail" + if (c.f != 610) return "fail" return "OK" -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/scopes/kt9430.fir.kt b/compiler/testData/diagnostics/tests/scopes/kt9430.fir.kt index 6ae08ad0b74..fae56d55844 100644 --- a/compiler/testData/diagnostics/tests/scopes/kt9430.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/kt9430.fir.kt @@ -12,5 +12,5 @@ class C: A() { } class D { - fun qux() { B().foo() } -} \ No newline at end of file + fun qux() { B().foo() } +} diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerProtectedClass.fir.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerProtectedClass.fir.kt index e0e8817a654..c4704df078f 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerProtectedClass.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/innerProtectedClass.fir.kt @@ -8,6 +8,6 @@ class Foo : BaseClass() { fun bar() { val f = foo() f.x - f.y + f.y } } diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/javaInheritedInKotlin.fir.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/javaInheritedInKotlin.fir.kt index 2e91e55aa73..05790b6520b 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/javaInheritedInKotlin.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/javaInheritedInKotlin.fir.kt @@ -39,20 +39,20 @@ class KotlinClass2 : JavaClass() { } fun test(a: KotlinClass, b: KotlinClass2) { - a.foo() // Error, protected_and_package declared in different package + a.foo() // Error, protected_and_package declared in different package b.foo() // Error, protected visibility in same package (but could be protected_and_package) - a.field + a.field - JavaClass.bar1() - JavaClass.CONST1 + JavaClass.bar1() + JavaClass.CONST1 KotlinClass.bar1() // Currently it's unresolved, but it should be prohibited even in case it would be resolved KotlinClass.CONST1 - JavaClassSamePackage.bar1() + JavaClassSamePackage.bar1() JavaClassSamePackage.bar2() - JavaClassSamePackage.CONST1 + JavaClassSamePackage.CONST1 JavaClassSamePackage.CONST2 } diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/protectedCallOnSubClass.fir.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/protectedCallOnSubClass.fir.kt index 2a48ebec1a3..c35ea5d7376 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/protectedCallOnSubClass.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/protectedCallOnSubClass.fir.kt @@ -4,7 +4,7 @@ open class A { fun bar(x: B) { x.foo() // OK, foo declared in A - x.baz() // Declared in B + x.baz() // Declared in B x.foobaz() // Declared in B } } diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticPropertyExtensions.fir.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticPropertyExtensions.fir.kt index 52bdddb16ae..f3a96b5818a 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticPropertyExtensions.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticPropertyExtensions.fir.kt @@ -40,6 +40,6 @@ class B : A() { } fun baz(a: A) { - a.foo + a.foo a.bar = a.bar + "" } diff --git a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.fir.kt b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.fir.kt index a36bbbcebd6..71d79553922 100644 --- a/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/protectedVisibility/syntheticSAMExtensions.fir.kt @@ -27,5 +27,5 @@ class B : A() { } fun baz(a: A) { - a.foo { } + a.foo { } } diff --git a/compiler/testData/diagnostics/tests/scopes/visibility.fir.kt b/compiler/testData/diagnostics/tests/scopes/visibility.fir.kt index a6c408dbc7f..4f5423b32c8 100644 --- a/compiler/testData/diagnostics/tests/scopes/visibility.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/visibility.fir.kt @@ -40,8 +40,8 @@ class B { } fun test3(a: A) { - a.v //todo .bMethod() - a.f(0, 1) //todo .bMethod() + a.v //todo .bMethod() + a.f(0, 1) //todo .bMethod() } interface T @@ -54,7 +54,7 @@ open class C : T { } fun test4(c: C) { - c.i++ + c.i++ } class D : C() { @@ -78,7 +78,7 @@ class F : C() { class G : T { fun test8(c: C) { - doSmth(c.i) + doSmth(c.i) } } @@ -91,5 +91,5 @@ import test_visibility.* fun test() { internal_fun() - private_fun() + private_fun() } diff --git a/compiler/testData/diagnostics/tests/scopes/visibility2.fir.kt b/compiler/testData/diagnostics/tests/scopes/visibility2.fir.kt index d9d674129ca..f777acc7ef4 100644 --- a/compiler/testData/diagnostics/tests/scopes/visibility2.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/visibility2.fir.kt @@ -25,15 +25,15 @@ import a.PO fun test() { val y = makeA() y.bar() - foo() + foo() - val u : A = A() + val u : A = A() val a : java.util.Arrays.ArrayList; - val po = PO + val po = PO } -class B : A() {} +class B : A() {} class Q { class W { diff --git a/compiler/testData/diagnostics/tests/scopes/visibility3.fir.kt b/compiler/testData/diagnostics/tests/scopes/visibility3.fir.kt index d9ef372f7fa..3da4f8c66c5 100644 --- a/compiler/testData/diagnostics/tests/scopes/visibility3.fir.kt +++ b/compiler/testData/diagnostics/tests/scopes/visibility3.fir.kt @@ -26,17 +26,17 @@ package a fun test() { val y = makeA() y.bar() - foo() + foo() - val u : A = A() + val u : A = A() - val z = x - x = 30 + val z = x + x = 30 - val po = PO + val po = PO } -class B : A() {} +class B : A() {} class Q { class W { diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/argumentsResolveInBodyAndDelegationCall.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/argumentsResolveInBodyAndDelegationCall.fir.kt index 2ea87126057..10ec62d7609 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/argumentsResolveInBodyAndDelegationCall.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/argumentsResolveInBodyAndDelegationCall.fir.kt @@ -17,7 +17,7 @@ class A : B { foo(x, y, myProp) x + y + myProp + parentProp + super.parentProp } - constructor(x: B, y: Int = global2): this("", x) { + constructor(x: B, y: Int = global2): this("", x) { x.parentProp + y + myProp + parentProp + super.parentProp } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.fir.kt deleted file mode 100644 index 4c912288c9f..00000000000 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.fir.kt +++ /dev/null @@ -1,17 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -class A { - companion object { - fun foo(): Int = 1 - val prop = 2 - val C = 3 - } - object B { - fun bar(): Int = 4 - val prop = 5 - } - object C { - } - - constructor(x: Int) - constructor() : this(foo() + prop + B.bar() + B.prop + C) -} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.kt index 43955eaad66..ae392efed0f 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/companionObjectScope.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER class A { companion object { diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.fir.kt index 84046fb59e6..758a84a4c91 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorCallType.fir.kt @@ -19,7 +19,7 @@ val y2: B = B("") val y3: B = B(1) val y4: B = B("") -val y5: B = B(1) +val y5: B = B(1) val y6: B = B("") val y7: B = B(1) val y8: B = B("") diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorInObject.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorInObject.fir.kt index 9c729568897..db0e6e81180 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/constructorInObject.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/constructorInObject.fir.kt @@ -5,7 +5,7 @@ object A { enum class B { X() { - constructor() + constructor() } } @@ -17,4 +17,4 @@ class C { val anonObject = object { constructor() -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/errorsOnEmptyDelegationCall.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/errorsOnEmptyDelegationCall.fir.kt index adb9db90e3e..519cceb2ace 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/errorsOnEmptyDelegationCall.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/errorsOnEmptyDelegationCall.fir.kt @@ -26,8 +26,8 @@ open class B2 { } class A2 : B2 { - constructor() - constructor(x: Int) : super() + constructor() + constructor(x: Int) : super() } // -------------------------- @@ -37,6 +37,6 @@ open class B3 { } class A3 : B3 { - constructor() - constructor(x: Int) : super() -} \ No newline at end of file + constructor() + constructor(x: Int) : super() +} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/superSecondaryNonExisting.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/superSecondaryNonExisting.fir.kt index 8a039f7c217..df8a596f983 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/superSecondaryNonExisting.fir.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/superSecondaryNonExisting.fir.kt @@ -5,6 +5,6 @@ open class B(x: Double) { } interface C class A : B, C { - constructor(): super(' ') - constructor(x: Int) + constructor(): super(' ') + constructor(x: Int) } diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/thisNonExisting.fir.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/thisNonExisting.fir.kt deleted file mode 100644 index 38fda4d75df..00000000000 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/thisNonExisting.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !WITH_NEW_INFERENCE - -class A { - constructor(x: Int) {} - constructor(x: String) {} - constructor(): this('a') {} -} diff --git a/compiler/testData/diagnostics/tests/secondaryConstructors/thisNonExisting.kt b/compiler/testData/diagnostics/tests/secondaryConstructors/thisNonExisting.kt index 12230ab2219..23dee119533 100644 --- a/compiler/testData/diagnostics/tests/secondaryConstructors/thisNonExisting.kt +++ b/compiler/testData/diagnostics/tests/secondaryConstructors/thisNonExisting.kt @@ -1,3 +1,4 @@ +// FIR_IDENTICAL // !DIAGNOSTICS: -UNUSED_PARAMETER // !WITH_NEW_INFERENCE diff --git a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt index 31282d67b4f..ae481e57005 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/intersectionScope/unstableSmartCast.fir.kt @@ -33,6 +33,6 @@ fun test() { x.baz(1).checkType { _() } x.baz(1, 2) - x.foobar().checkType { _() } + x.foobar().checkType { _() } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexcl.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexcl.fir.kt index a6e7d8391bc..8ce2be9293b 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexcl.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexcl.fir.kt @@ -16,7 +16,7 @@ fun foo(): Int { k.run() val d: Int = c // a is not null because of k constructor, but we do not know it - return a + d + return a + d } else return -1 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexclArgument.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexclArgument.fir.kt index 98186b9a1c3..ffe2b8b8155 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexclArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexclArgument.fir.kt @@ -11,7 +11,7 @@ fun foo(): Int { } k.run() val d: Int = c - return a + d + return a + d } else return -1 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexclTwoArgument.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexclTwoArgument.fir.kt index 0ed5e29c566..41d7c35a27d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexclTwoArgument.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/objectLiterals/exclexclTwoArgument.fir.kt @@ -15,7 +15,7 @@ fun foo(): Int { } k.run() val d: Int = c - return a + d + return a + d } else return -1 } diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt index fc765b7bd64..f5f30b02038 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiver.fir.kt @@ -6,8 +6,8 @@ fun test(foo: Foo?) { // Error, foo?.bar is nullable it.length // Error, foo is nullable - foo.bar.length + foo.bar.length // Correct foo?.bar?.length } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt index eaa94bcd0f5..ecc2789719d 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/safecalls/nullableReceiverInLongChain.fir.kt @@ -13,13 +13,13 @@ fun test(foo: Foo?) { // Error, foo?.bar?.gav is nullable it.length // Error, foo is nullable - foo.bar.gav.length + foo.bar.gav.length // Correct foo?.bar?.gav?.length } foo?.bar?.gav.call { it }?.notNullLet { foo.hashCode() - foo.bar.hashCode() + foo.bar.hashCode() } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt index 0f2d88161aa..464e07a5964 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/smartcastOnSameFieldOfDifferentInstances.fir.kt @@ -5,7 +5,7 @@ class A(val x: String?) { fun foo(other: A) { when { x == null && other.x == null -> "1" - x.length > 0 -> "2" + x.length > 0 -> "2" } } } diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.fir.kt index 3715e9d1bfd..1cfb9d42787 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/plusplusMinusminus.fir.kt @@ -12,10 +12,10 @@ operator fun Long?.inc() = this?.let { it + 1 } fun bar(arg: Long?): Long { var i = arg if (i++ == 5L) { - return i-- + i + return i-- + i } if (i++ == 7L) { - return i++ + i + return i++ + i } return 0L -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.fir.kt index 72785f3b31e..cf186a5270e 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/unnecessaryWithMap.fir.kt @@ -14,8 +14,8 @@ class MyClass { var res = 0 m = create() // See KT-7428 - for ((k, v) in m) - res += (k.length + v.length) + for ((k, v) in m) + res += (k.length + v.length) return res } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.fir.kt b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.fir.kt index 918c32fc744..084c76726f7 100644 --- a/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.fir.kt +++ b/compiler/testData/diagnostics/tests/smartCasts/varnotnull/varIntNull.fir.kt @@ -2,5 +2,5 @@ fun foo(): Int { var i: Int? = 42 i = null - return i + 1 -} \ No newline at end of file + return i + 1 +} diff --git a/compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionForCallableReference.fir.kt b/compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionForCallableReference.fir.kt index c04a53729ca..0dbf408b74a 100644 --- a/compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionForCallableReference.fir.kt +++ b/compiler/testData/diagnostics/tests/suspendConversion/basicSuspendConversionForCallableReference.fir.kt @@ -14,5 +14,5 @@ fun test() { foo2(42, ::bar2) foo2("str", ::bar2) - foo2(42, ::bar1) + foo2(42, ::bar1) } diff --git a/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithReferenceAdaptation.fir.kt b/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithReferenceAdaptation.fir.kt index 98f99688e36..823d1ce01f1 100644 --- a/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithReferenceAdaptation.fir.kt +++ b/compiler/testData/diagnostics/tests/suspendConversion/suspendConversionWithReferenceAdaptation.fir.kt @@ -16,6 +16,6 @@ fun all(s: String = ""): Int = 0 fun test() { unitCoercion(::foo) defaults(::bar) - varargs(::baz) + varargs(::baz) unitCoercionAndDefaults(::all) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyPublic.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyPublic.fir.kt index 90bc8cff6ba..bf8a70fca07 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyPublic.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/OnlyPublic.fir.kt @@ -5,9 +5,9 @@ import JavaClass fun foo(javaClass: JavaClass) { javaClass.somethingPublic - javaClass.somethingProtected - javaClass.somethingPrivate - javaClass.somethingPackage + javaClass.somethingProtected + javaClass.somethingPrivate + javaClass.somethingPackage javaClass.somethingPublic = 1 } @@ -19,4 +19,4 @@ public class JavaClass { int getSomethingPackage() { return 1; } protected void setSomethingPublic(int value) {} -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterHasHigherAccess.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterHasHigherAccess.fir.kt index 1d33ecdeeb6..44f2393036a 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterHasHigherAccess.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/javaProperties/SetterHasHigherAccess.fir.kt @@ -4,13 +4,13 @@ package k import JavaClass fun foo(javaClass: JavaClass) { - val v = javaClass.something - javaClass.something = 1 - javaClass.something++ + val v = javaClass.something + javaClass.something = 1 + javaClass.something++ } // FILE: JavaClass.java public class JavaClass { protected int getSomething() { return 1; } public void setSomething(int value) {} -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PackageLocal.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PackageLocal.fir.kt index fadb8efd770..2a943c92954 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PackageLocal.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/PackageLocal.fir.kt @@ -4,7 +4,7 @@ package k import JavaClass fun foo(javaClass: JavaClass) { - javaClass.doSomething { } + javaClass.doSomething { } } // FILE: KotlinFile2.kt @@ -15,4 +15,4 @@ fun foo(javaClass: JavaClass) { // FILE: JavaClass.java public class JavaClass { void doSomething(Runnable runnable) { runnable.run(); } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.fir.kt index de8bd65a4ef..d9eb9e0a332 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Private.fir.kt @@ -1,10 +1,10 @@ // !WITH_NEW_INFERENCE // FILE: KotlinFile.kt fun foo(javaClass: JavaClass) { - javaClass.doSomething { } + javaClass.doSomething { } } // FILE: JavaClass.java public class JavaClass { private void doSomething(Runnable runnable) { runnable.run(); } -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Protected.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Protected.fir.kt index 4b93a1419dc..65f214569b2 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Protected.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/Protected.fir.kt @@ -4,7 +4,7 @@ package k import JavaClass fun foo(javaClass: JavaClass) { - javaClass.doSomething { + javaClass.doSomething { bar() } } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt index 2f03f7e41dc..ed23a4d1942 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolution.fir.kt @@ -32,5 +32,5 @@ fun x(a: A, r: Runnable) { a.bar(null as CharSequence?) checkType { _() } a.bar("") checkType { _() } - a.bar(123) + a.bar(123) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt index 6f8ef36d796..a66e900f753 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStatic.fir.kt @@ -32,5 +32,5 @@ fun x(r: Runnable) { A.bar(null as CharSequence?) checkType { _() } A.bar("") checkType { _() } - A.bar(123) + A.bar(123) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt index 227af6c4a05..0ea1ab59559 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionStaticWithoutRefinedSams.fir.kt @@ -33,5 +33,5 @@ fun x(r: Runnable) { A.bar(null as CharSequence?) checkType { _() } A.bar("") checkType { _() } - A.bar(123) + A.bar(123) } diff --git a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt index 6408291a5f0..d95da0b3322 100644 --- a/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt +++ b/compiler/testData/diagnostics/tests/syntheticExtensions/samAdapters/overloadResolutionWithoutRefinedSams.fir.kt @@ -33,5 +33,5 @@ fun x(a: A, r: Runnable) { a.bar(null as CharSequence?) checkType { _() } a.bar("") checkType { _() } - a.bar(123) + a.bar(123) } diff --git a/compiler/testData/diagnostics/tests/targetedBuiltIns/getOrDefault.fir.kt b/compiler/testData/diagnostics/tests/targetedBuiltIns/getOrDefault.fir.kt index 0d2469cd512..bf7d1201236 100644 --- a/compiler/testData/diagnostics/tests/targetedBuiltIns/getOrDefault.fir.kt +++ b/compiler/testData/diagnostics/tests/targetedBuiltIns/getOrDefault.fir.kt @@ -5,13 +5,13 @@ abstract class A : Map fun foo(x: Map, a: A, b: java.util.HashMap) { x.getOrDefault(1, "") x.getOrDefault("", "") - x.getOrDefault(1, 2) - x.getOrDefault("", 2) + x.getOrDefault(1, 2) + x.getOrDefault("", 2) a.getOrDefault(1, "") a.getOrDefault("", "") - a.getOrDefault(1, 2) - a.getOrDefault("", 2) + a.getOrDefault(1, 2) + a.getOrDefault("", 2) b.getOrDefault(1, "") b.getOrDefault("", "") diff --git a/compiler/testData/diagnostics/tests/typealias/privateInFile.fir.kt b/compiler/testData/diagnostics/tests/typealias/privateInFile.fir.kt index c76aa214c7e..11605605936 100644 --- a/compiler/testData/diagnostics/tests/typealias/privateInFile.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/privateInFile.fir.kt @@ -5,7 +5,7 @@ private class C { private typealias TA = C -private val test1: C = C() +private val test1: C = C() private val test1co: C.Companion = C private val test2: TA = TA() @@ -19,4 +19,4 @@ private val test2: TA = TA() private val test2co = TA private class C -private typealias TA = Int \ No newline at end of file +private typealias TA = Int diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructor.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructor.fir.kt index 098cb31bb3b..55a68b65027 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructor.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructor.fir.kt @@ -9,7 +9,7 @@ val test2: TC = TC("") val test3: C = TC() val test4: TC = TC() -val test5 = TC("", "") +val test5 = TC("", "") interface Interface typealias TI = Interface @@ -20,5 +20,5 @@ typealias TO = AnObject val test6 = TI() val test6a = Interface() -val test7 = TO() -val test7a = AnObject() +val test7 = TO() +val test7a = AnObject() diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.fir.kt index 554340134b5..f39cf45ac14 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongClass.fir.kt @@ -12,8 +12,8 @@ val test2a = AnnotationClass() enum class EnumClass { VALUE1, VALUE2 } typealias Test3 = EnumClass -val test3 = Test3() -val test3a = EnumClass() +val test3 = Test3() +val test3a = EnumClass() sealed class SealedClass typealias Test4 = SealedClass diff --git a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.fir.kt b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.fir.kt index 0fdf9492549..d46ab13a6f4 100644 --- a/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.fir.kt +++ b/compiler/testData/diagnostics/tests/typealias/typeAliasConstructorWrongVisibility.fir.kt @@ -20,10 +20,10 @@ val test3 = MyAlias(1.0) val test3a = MyClass(1.0) class MyDerived : MyClass(1.0) { - val test4 = MyAlias(1) - val test4a = MyClass(1) + val test4 = MyAlias(1) + val test4a = MyClass(1) val test5 = MyAlias("") val test5a = MyClass("") val test6 = MyAlias(1.0) val test6a = MyClass(1.0) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/unitConversion/chainedFunSuspendUnitConversion.fir.kt b/compiler/testData/diagnostics/tests/unitConversion/chainedFunSuspendUnitConversion.fir.kt index be9c72b2297..ba4a1583d71 100644 --- a/compiler/testData/diagnostics/tests/unitConversion/chainedFunSuspendUnitConversion.fir.kt +++ b/compiler/testData/diagnostics/tests/unitConversion/chainedFunSuspendUnitConversion.fir.kt @@ -15,4 +15,4 @@ fun test(f: () -> String, s: SubInt) { foo(f) foo(s) foo(::bar) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/unitConversion/chainedUnitSuspendConversion.fir.kt b/compiler/testData/diagnostics/tests/unitConversion/chainedUnitSuspendConversion.fir.kt index 3b7720dce05..fc807ad7dd3 100644 --- a/compiler/testData/diagnostics/tests/unitConversion/chainedUnitSuspendConversion.fir.kt +++ b/compiler/testData/diagnostics/tests/unitConversion/chainedUnitSuspendConversion.fir.kt @@ -11,4 +11,4 @@ fun test(g: () -> Double, s: SubInt) { foo(::bar) foo(g) foo(s) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.fir.kt b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.fir.kt index 3a7e5acc4ce..2d690688e04 100644 --- a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.fir.kt +++ b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_after.fir.kt @@ -49,12 +49,12 @@ fun manyFoo(vararg v: Int) {} fun manyFoo(vararg s: String) {} fun testMany(a: Any) { - manyFoo(v = 1) - manyFoo(s = "") + manyFoo(v = 1) + manyFoo(s = "") - manyFoo(a) - manyFoo(v = a) - manyFoo(s = a) - manyFoo(v = a as Int) - manyFoo(s = a as String) -} \ No newline at end of file + manyFoo(a) + manyFoo(v = a) + manyFoo(s = a) + manyFoo(v = a as Int) + manyFoo(s = a as String) +} diff --git a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.fir.kt b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.fir.kt index 6ef4808f15d..f15cc442937 100644 --- a/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.fir.kt +++ b/compiler/testData/diagnostics/tests/varargs/assigningSingleElementsInNamedFormFunDeprecation_before.fir.kt @@ -49,12 +49,12 @@ fun manyFoo(vararg v: Int) {} fun manyFoo(vararg s: String) {} fun testMany(a: Any) { - manyFoo(v = 1) - manyFoo(s = "") + manyFoo(v = 1) + manyFoo(s = "") - manyFoo(a) - manyFoo(v = a) - manyFoo(s = a) - manyFoo(v = a as Int) - manyFoo(s = a as String) -} \ No newline at end of file + manyFoo(a) + manyFoo(v = a) + manyFoo(s = a) + manyFoo(v = a as Int) + manyFoo(s = a as String) +} diff --git a/compiler/testData/diagnostics/tests/varargs/varargViewedAsArray.fir.kt b/compiler/testData/diagnostics/tests/varargs/varargViewedAsArray.fir.kt index ff170fe1c5a..6d630d02642 100644 --- a/compiler/testData/diagnostics/tests/varargs/varargViewedAsArray.fir.kt +++ b/compiler/testData/diagnostics/tests/varargs/varargViewedAsArray.fir.kt @@ -17,13 +17,13 @@ fun useMixedStringArgs3(fn: (String, Array, String) -> Unit) = fn("foo", fun useTwoStringArrays(fn: (Array, Array) -> Unit) = fn(arrayOf("foo", "bar"), arrayOf("baz", "boo")) fun test() { - useStrings(::stringVararg) + useStrings(::stringVararg) useStringArray(::stringVararg) useIntArray(::numberVararg) usePrimitiveIntArray(::intVararg) - useIntArray(::intVararg) - useMixedStringArgs1(::stringVararg) - useMixedStringArgs2(::stringVararg) - useMixedStringArgs3(::stringVararg) - useTwoStringArrays(::stringVararg) + useIntArray(::intVararg) + useMixedStringArgs1(::stringVararg) + useMixedStringArgs2(::stringVararg) + useMixedStringArgs3(::stringVararg) + useTwoStringArrays(::stringVararg) } diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.fir.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.fir.kt index 66745afaede..8204ad96c10 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.fir.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/FunctionCall.fir.kt @@ -33,5 +33,5 @@ class Test { } fun test(t: Test) { - t.apply(t.foo()) + t.apply(t.foo()) } diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.fir.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.fir.kt index e5b46746182..43bb82c1c0b 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.fir.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/GetVal.fir.kt @@ -33,5 +33,5 @@ class Test { } fun test(t: Test) { - t.apply(t.i) + t.apply(t.i) } diff --git a/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.fir.kt b/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.fir.kt index e662794145d..27fc45a1594 100644 --- a/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.fir.kt +++ b/compiler/testData/diagnostics/tests/variance/privateToThis/SetVar.fir.kt @@ -33,5 +33,5 @@ class Test { } fun test(t: Test) { - t.i = getT() + t.i = getT() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/CallCompanionProtectedNonStatic.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/CallCompanionProtectedNonStatic.fir.kt index ca67e5f5c76..794cd08d94b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/CallCompanionProtectedNonStatic.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/CallCompanionProtectedNonStatic.fir.kt @@ -74,20 +74,20 @@ class Derived : Base() { class Other { fun test(base: Base, derived: Derived) { - base.foo() + base.foo() base.gav() base.bar() - derived.foo() + derived.foo() derived.gav() derived.bar() } } fun top(base: Base, derived: Derived) { - base.foo() + base.foo() base.bar() base.gav() - derived.foo() + derived.foo() derived.bar() derived.gav() } diff --git a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.fir.kt index debe29d832a..4ccdc7ee1a2 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/contracts/dsl/callUsualContractFunction.fir.kt @@ -20,7 +20,7 @@ class SomeClass { } fun callMemberContractWithoutThis() { - contract() + contract() } fun callTopLevelSamePsiInMember() { diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/callableReferenceOnUnresolvedLHS.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/callableReferenceOnUnresolvedLHS.fir.kt index c94a7379e3a..87486d2a91b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/callableReferenceOnUnresolvedLHS.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/callableReferenceOnUnresolvedLHS.fir.kt @@ -8,6 +8,6 @@ class Scope(private val implClass: j.C val hm = c.asSequence() .filter(implClass::isInstance) .map(implClass::cast) - .toSet() + .toSet() } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.fir.kt index 110f7d31685..007a8e58ec5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/callableReference/suspendConversionForCallableReferences.fir.kt @@ -11,7 +11,7 @@ suspend fun String.id(): String = this fun box() { val x = "f" builder { - go1(x::id) - go2(x::id) + go1(x::id) + go2(x::id) } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.fir.kt index 844ca85ec37..6e52c567b70 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/inference/callableReferenceToASuspendFunction.fir.kt @@ -15,8 +15,8 @@ suspend fun bar(x: Int) {} fun test() { test0(::foo) - test1(::foo) + test1(::foo) - test0(::bar) + test0(::bar) test1(::bar) -} \ No newline at end of file +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.fir.kt index aee1b1c7925..c97c28694cc 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/kt37309.fir.kt @@ -11,14 +11,14 @@ fun myBuildList(@BuilderInference builderAction: MutableList.() -> Unit) @OptIn(ExperimentalStdlibApi::class) fun main() { val newList1 = myBuildList { - addAll( + addAll( listOf(1).map { Foo(null) } ) } val newList2 = buildList { - addAll(listOf(1,2,3).map{ Foo(null) }) + addAll(listOf(1,2,3).map{ Foo(null) }) } } -class Foo(val notNullProp: String) \ No newline at end of file +class Foo(val notNullProp: String) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendExternalFunctions.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendExternalFunctions.fir.kt index c2013feafb8..d9965faf092 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendExternalFunctions.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendExternalFunctions.fir.kt @@ -22,7 +22,7 @@ fun test() { builder { noParams() yieldString("abc") checkType { _() } - yieldString(1) checkType { _() } + yieldString(1) checkType { _() } await { "123" } checkType { _() } @@ -36,7 +36,7 @@ fun test() { severalParams("", 89) checkType { _() } // TODO: should we allow somehow to call with passing continuation explicitly? - severalParams("", 89, 6.9) checkType { _() } + severalParams("", 89, 6.9) checkType { _() } "".stringReceiver(1) Any().anyReceiver(1) diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.fir.kt index edf2d483b96..4e5c8968405 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendFunctions.fir.kt @@ -23,7 +23,7 @@ fun test() { builder { noParams() yieldString("abc") checkType { _() } - yieldString(1) checkType { _() } + yieldString(1) checkType { _() } await { "123" } checkType { _() } @@ -38,7 +38,7 @@ fun test() { severalParams("", 89) checkType { _() } // TODO: should we allow somehow to call with passing continuation explicitly? - severalParams("", 89, 6.9) checkType { _() } - severalParams("", 89, this as Continuation) checkType { _() } + severalParams("", 89, 6.9) checkType { _() } + severalParams("", 89, this as Continuation) checkType { _() } } } diff --git a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/multipleOverloads_1.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/multipleOverloads_1.fir.kt index 9d743017c38..d017efdc4ba 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/multipleOverloads_1.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/factoryPattern/multipleOverloads_1.fir.kt @@ -28,8 +28,8 @@ fun Iterable.fooMap(t: (T) -> Sequence): List { } fun test() { - val list = ubyteArrayOf(0u).fooMap { listOf(it) } + val list = ubyteArrayOf(0u).fooMap { listOf(it) } takeUByteList(list) } -fun takeUByteList(list: List) {} \ No newline at end of file +fun takeUByteList(list: List) {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/suspendFunctions.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/suspendFunctions.fir.kt index fee33cb29c0..e3a4c42ee63 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/suspendFunctions.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/completion/postponedArgumentsAnalysis/suspendFunctions.fir.kt @@ -21,5 +21,5 @@ fun main() { // Here, the error should be val x2: (Int) -> Unit = takeSuspend( & kotlin.Function1")!>id { it }, ")!>{ x -> x }) val x3: suspend (Int) -> Unit = takeSimpleFunction( & kotlin.coroutines.SuspendFunction1")!>id { it }, ")!>{ x -> x }) - val x4: (Int) -> Unit = takeSimpleFunction(id Unit> {}, ")!>{}) + val x4: (Int) -> Unit = takeSimpleFunction(id Unit> {}, {}) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.fir.kt index e7ceb67e29a..13a8675f6c9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt11266.fir.kt @@ -1,4 +1,4 @@ // !WITH_NEW_INFERENCE // NI_EXPECTED_FILE -fun foo(first: Array, second: Array) = Pair(first.toCollection(), second.toCollection()) \ No newline at end of file +fun foo(first: Array, second: Array) = Pair(first.toCollection(), second.toCollection()) diff --git a/compiler/testData/diagnostics/testsWithStdLib/inference/kt1558.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/inference/kt1558.fir.kt index ab5614de074..a360a7cd9d9 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/inference/kt1558.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/inference/kt1558.fir.kt @@ -20,7 +20,7 @@ fun testArrays(ci: List, cii: List?) { checkSubtype>(c1) checkSubtype>(c2) - checkSubtype>(c3) + checkSubtype>(c3) checkSubtype>(c4) - checkSubtype>(c5) + checkSubtype>(c5) } diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samAgainstFunctionalType.fir.kt index 09ff515b7d4..428d894df0c 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 68cd3929737..05a5ed0f4c9 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 { _() } -} \ No newline at end of file + 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 23b2268fa37..2d46f94bee1 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 { _() } -} \ No newline at end of file + 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 394b4ee42b7..377b771ff37 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 { _() } -} \ No newline at end of file + Foo().test {} checkType { _() } +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/resolve/samOverloadsWithKtFunctionWithoutRefinedSams.fir.kt index cacba88804e..9d5f49b6125 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 { _() } -} \ No newline at end of file + Foo().test {} checkType { _() } +} diff --git a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/forEachUnsafe.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/forEachUnsafe.fir.kt index 30f30de0207..9aef644def0 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/smartcasts/forEachUnsafe.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/smartcasts/forEachUnsafe.fir.kt @@ -3,7 +3,7 @@ fun indexOfMax(a: IntArray): Int? { var maxI: Int? = 0 a.forEachIndexed { i, value -> - if (value >= a[maxI]) { + if (value >= a[maxI]) { maxI = i } else if (value < 0) { diff --git a/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.fir.kt index a02e5346146..bdffced2b4b 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/targetedBuiltIns/unsupportedFeature.fir.kt @@ -28,7 +28,7 @@ interface A2 : List { override fun stream(): java.util.stream.Stream = null!! } -class B : Throwable("", null, false, false) +class B : Throwable("", null, false, false) class B1 : RuntimeException() { override fun fillInStackTrace(): Throwable { // 'override' keyword must be prohibited, as it was in 1.0.x diff --git a/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt index 63c2639f042..a0a54e305f8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/typealias/typeAliasSamAdapterConstructors2.fir.kt @@ -23,5 +23,5 @@ 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 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/testData/diagnostics/testsWithStdLib/when/noTypeArgumentsInConstructor.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/when/noTypeArgumentsInConstructor.fir.kt index 1c01b530832..d6bb676ce71 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/when/noTypeArgumentsInConstructor.fir.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/when/noTypeArgumentsInConstructor.fir.kt @@ -24,20 +24,20 @@ val test3: MutableList = val test4: Collection = listOf(1, 2, 3).flatMapTo(LinkedHashSet()) { - listOf(it) + listOf(it) } val test5: Collection = listOf(1, 2, 3).flatMapTo(LinkedHashSet()) { // TODO - if (true) listOf(it) else listOf(it) + if (true) listOf(it) else listOf(it) } val test6: Collection = listOf(1, 2, 3).flatMapTo(LinkedHashSet()) { - if (true) listOf(it) else listOf(it) + if (true) listOf(it) else listOf(it) } val test7: Collection = listOf(1, 2, 3).flatMapTo(LinkedHashSet()) { - select(listOf(it), listOf(it)) - } \ No newline at end of file + select(listOf(it), listOf(it)) + } diff --git a/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.fir.txt index a13c6d537c2..20403a99e73 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/adaptedWithCoercionToUnit.fir.txt @@ -34,8 +34,8 @@ FILE fqName: fileName:/adaptedWithCoercionToUnit.kt RETURN type=kotlin.Nothing from='public final fun testV0 (): kotlin.Unit declared in ' CALL 'public final fun useUnit0 (fn: kotlin.Function0): kotlin.Unit declared in ' type=kotlin.Unit origin=null fn: FUNCTION_REFERENCE 'public final fun fnv (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= - FUN name:testV1 visibility:public modality:FINAL <> () returnType:IrErrorType + FUN name:testV1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testV1 (): IrErrorType declared in ' - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun fnv (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + RETURN type=kotlin.Nothing from='public final fun testV1 (): kotlin.Unit declared in ' + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: ::#' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt index d0e87f7db6c..fc801840aa4 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/caoWithAdaptationForSam.fir.txt @@ -104,27 +104,47 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt CONST Int type=kotlin.Int value=42 FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit + BLOCK type=kotlin.Unit origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] + GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.reflect.KFunction0 [val] + FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + GET_VAR 'val tmp_1: kotlin.reflect.KFunction0 [val] declared in .test1' type=kotlin.reflect.KFunction0 origin=null + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: ERROR_CALL 'Unresolved reference: #' type=kotlin.Int + GET_VAR 'val tmp_1: kotlin.reflect.KFunction0 [val] declared in .test1' type=kotlin.reflect.KFunction0 origin=null + other: CONST Int type=kotlin.Int value=1 FUN name:test2 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit + BLOCK type=kotlin.Unit origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.B [val] + GET_OBJECT 'CLASS OBJECT name:B modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.B + VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:kotlin.reflect.KFunction0 [val] + FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction0 origin=null reflectionTarget= + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + GET_VAR 'val tmp_3: kotlin.reflect.KFunction0 [val] declared in .test2' type=kotlin.reflect.KFunction0 origin=null + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: ERROR_CALL 'Unresolved reference: #' type=kotlin.Int + GET_VAR 'val tmp_3: kotlin.reflect.KFunction0 [val] declared in .test2' type=kotlin.reflect.KFunction0 origin=null + other: CONST Int type=kotlin.Int value=1 FUN name:test3 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Function1 [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Function1 [val] GET_VAR 'fn: kotlin.Function1 declared in .test3' type=kotlin.Function1 origin=null CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'val tmp_0: .A [val] declared in .test3' type=.A origin=null + $receiver: GET_VAR 'val tmp_4: .A [val] declared in .test3' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_1: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=null + GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=null newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun get (i: .IFoo): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null - $receiver: GET_VAR 'val tmp_0: .A [val] declared in .test3' type=.A origin=null + $receiver: GET_VAR 'val tmp_4: .A [val] declared in .test3' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_1: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=null + GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test3' type=kotlin.Function1 origin=null other: CONST Int type=kotlin.Int value=1 FUN name:test4 visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 @@ -134,18 +154,18 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt if: TYPE_OP type=kotlin.Boolean origin=INSTANCEOF typeOperand=.IFoo GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null then: BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:.IFoo [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:.IFoo [val] TYPE_OP type=.IFoo origin=IMPLICIT_CAST typeOperand=.IFoo GET_VAR 'fn: kotlin.Function1 declared in .test4' type=kotlin.Function1 origin=null CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'val tmp_2: .A [val] declared in .test4' type=.A origin=null - i: GET_VAR 'val tmp_3: .IFoo [val] declared in .test4' type=.IFoo origin=null + $receiver: GET_VAR 'val tmp_6: .A [val] declared in .test4' type=.A origin=null + i: GET_VAR 'val tmp_7: .IFoo [val] declared in .test4' type=.IFoo origin=null newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun get (i: .IFoo): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null - $receiver: GET_VAR 'val tmp_2: .A [val] declared in .test4' type=.A origin=null - i: GET_VAR 'val tmp_3: .IFoo [val] declared in .test4' type=.IFoo origin=null + $receiver: GET_VAR 'val tmp_6: .A [val] declared in .test4' type=.A origin=null + i: GET_VAR 'val tmp_7: .IFoo [val] declared in .test4' type=.IFoo origin=null other: CONST Int type=kotlin.Int value=1 FUN name:test5 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any @@ -153,20 +173,20 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt TYPE_OP type=kotlin.Function1 origin=CAST typeOperand=kotlin.Function1 GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_4 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_8 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - VAR IR_TEMPORARY_VARIABLE name:tmp_5 type:kotlin.Function1 [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_9 type:kotlin.Function1 [val] TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 GET_VAR 'a: kotlin.Any declared in .test5' type=kotlin.Any origin=null CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'val tmp_4: .A [val] declared in .test5' type=.A origin=null + $receiver: GET_VAR 'val tmp_8: .A [val] declared in .test5' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=null + GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=null newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun get (i: .IFoo): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null - $receiver: GET_VAR 'val tmp_4: .A [val] declared in .test5' type=.A origin=null + $receiver: GET_VAR 'val tmp_8: .A [val] declared in .test5' type=.A origin=null i: TYPE_OP type=.IFoo origin=SAM_CONVERSION typeOperand=.IFoo - GET_VAR 'val tmp_5: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=null + GET_VAR 'val tmp_9: kotlin.Function1 [val] declared in .test5' type=kotlin.Function1 origin=null other: CONST Int type=kotlin.Int value=1 FUN name:test6 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any @@ -177,16 +197,16 @@ FILE fqName: fileName:/caoWithAdaptationForSam.kt TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_6 type:.A [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_10 type:.A [val] GET_OBJECT 'CLASS OBJECT name:A modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.A - VAR IR_TEMPORARY_VARIABLE name:tmp_7 type:kotlin.Function1 [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_11 type:kotlin.Function1 [val] TYPE_OP type=kotlin.Function1 origin=IMPLICIT_CAST typeOperand=kotlin.Function1 GET_VAR 'a: kotlin.Any declared in .test6' type=kotlin.Any origin=null CALL 'public final fun set (i: .IFoo, newValue: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'val tmp_6: .A [val] declared in .test6' type=.A origin=null - i: GET_VAR 'val tmp_7: kotlin.Function1 [val] declared in .test6' type=kotlin.Function1 origin=null + $receiver: GET_VAR 'val tmp_10: .A [val] declared in .test6' type=.A origin=null + i: GET_VAR 'val tmp_11: kotlin.Function1 [val] declared in .test6' type=kotlin.Function1 origin=null newValue: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: CALL 'public final fun get (i: .IFoo): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null - $receiver: GET_VAR 'val tmp_6: .A [val] declared in .test6' type=.A origin=null - i: GET_VAR 'val tmp_7: kotlin.Function1 [val] declared in .test6' type=kotlin.Function1 origin=null + $receiver: GET_VAR 'val tmp_10: .A [val] declared in .test6' type=.A origin=null + i: GET_VAR 'val tmp_11: kotlin.Function1 [val] declared in .test6' type=kotlin.Function1 origin=null other: CONST Int type=kotlin.Int value=1 diff --git a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt index 6a3247c9adc..933352ca8c9 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/constructorWithAdaptedArguments.fir.txt @@ -66,21 +66,19 @@ FILE fqName: fileName:/constructorWithAdaptedArguments.kt overridden: public open fun toString (): kotlin.String declared in kotlin.Any $this: VALUE_PARAMETER name: type:kotlin.Any - FUN name:testConstructor visibility:public modality:FINAL <> () returnType:IrErrorType + FUN name:testConstructor visibility:public modality:FINAL <> () returnType:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testConstructor (): IrErrorType declared in ' - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public constructor (vararg xs: kotlin.Int) [primary] declared in .C' type=kotlin.reflect.KFunction1.C> origin=null reflectionTarget= - FUN name:testInnerClassConstructor visibility:public modality:FINAL <> (outer:.Outer) returnType:IrErrorType + RETURN type=kotlin.Nothing from='public final fun testConstructor (): kotlin.Any declared in ' + ERROR_CALL 'Unresolved reference: #' type=kotlin.Any + ERROR_CALL 'Unsupported callable reference: ::#' type=IrErrorType + FUN name:testInnerClassConstructor visibility:public modality:FINAL <> (outer:.Outer) returnType:kotlin.Any VALUE_PARAMETER name:outer index:0 type:.Outer BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructor (outer: .Outer): IrErrorType declared in ' - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public constructor (vararg xs: kotlin.Int) [primary] declared in .Outer.Inner' type=kotlin.reflect.KFunction1.Outer.Inner> origin=null reflectionTarget= - $this: GET_VAR 'outer: .Outer declared in .testInnerClassConstructor' type=.Outer origin=null - FUN name:testInnerClassConstructorCapturingOuter visibility:public modality:FINAL <> () returnType:IrErrorType + RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructor (outer: .Outer): kotlin.Any declared in ' + ERROR_CALL 'Unresolved reference: #' type=kotlin.Any + ERROR_CALL 'Unsupported callable reference: R|/outer|::#' type=IrErrorType + FUN name:testInnerClassConstructorCapturingOuter visibility:public modality:FINAL <> () returnType:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructorCapturingOuter (): IrErrorType declared in ' - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public constructor (vararg xs: kotlin.Int) [primary] declared in .Outer.Inner' type=kotlin.reflect.KFunction1.Outer.Inner> origin=null reflectionTarget= - $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Outer' type=.Outer origin=null + RETURN type=kotlin.Nothing from='public final fun testInnerClassConstructorCapturingOuter (): kotlin.Any declared in ' + ERROR_CALL 'Unresolved reference: #' type=kotlin.Any + ERROR_CALL 'Unsupported callable reference: R|/Outer.Outer|()::#' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.txt index 5cca1b0d2c3..5827e995583 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/suspendConversion.fir.txt @@ -82,8 +82,8 @@ FILE fqName: fileName:/suspendConversion.kt CALL 'public final fun foo2 (vararg xs: kotlin.Int): kotlin.Unit declared in ' type=kotlin.Unit origin=null FUN name:testWithVarargMapped visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun foo2 (vararg xs: kotlin.Int): kotlin.Unit declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: ::#' type=IrErrorType FUN name:testWithCoercionToUnit visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun useSuspend (fn: kotlin.coroutines.SuspendFunction0): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.fir.txt index 6495ec3eb86..0efda6e1405 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/unboundMemberReferenceWithAdaptedArguments.fir.txt @@ -59,16 +59,14 @@ FILE fqName: fileName:/unboundMemberReferenceWithAdaptedArguments.kt $this: VALUE_PARAMETER name: type:kotlin.Any FUN name:testUnbound visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A' type=kotlin.reflect.KFunction2<.A, kotlin.IntArray, kotlin.Int> origin=null reflectionTarget= + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: Q|A|::#' type=IrErrorType FUN name:testBound visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public open fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .A' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - $this: GET_VAR 'a: .A declared in .testBound' type=.A origin=null + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: R|/a|::#' type=IrErrorType FUN name:testObject visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun foo (vararg xs: kotlin.Int): kotlin.Int declared in .Obj' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - $this: GET_OBJECT 'CLASS OBJECT name:Obj modality:FINAL visibility:public superTypes:[.A]' type=.Obj + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: Q|Obj|::#' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.fir.txt index 23e2f715fd3..4bdbb17c700 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptationForSam.fir.txt @@ -27,5 +27,5 @@ FILE fqName: fileName:/withAdaptationForSam.kt CONST Int type=kotlin.Int value=42 FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: ::#' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt index 6628be0fa48..e59ee184b04 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withAdaptedArguments.fir.txt @@ -68,22 +68,21 @@ FILE fqName: fileName:/withAdaptedArguments.kt RETURN type=kotlin.Nothing from='public final fun testDefault (): kotlin.String declared in ' CALL 'public final fun use (fn: kotlin.Function1): kotlin.String declared in ' type=kotlin.String origin=null fn: FUNCTION_REFERENCE 'public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - FUN name:testVararg visibility:public modality:FINAL <> () returnType:IrErrorType + FUN name:testVararg visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testVararg (): IrErrorType declared in ' - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun fnWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + RETURN type=kotlin.Nothing from='public final fun testVararg (): kotlin.String declared in ' + ERROR_CALL 'Unresolved reference: #' type=kotlin.String + ERROR_CALL 'Unsupported callable reference: ::#' type=IrErrorType FUN name:testCoercionToUnit visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testCoercionToUnit (): kotlin.Unit declared in ' CALL 'public final fun coerceToUnit (fn: kotlin.Function1): kotlin.Unit declared in ' type=kotlin.Unit origin=null fn: FUNCTION_REFERENCE 'public final fun fnWithDefault (a: kotlin.Int, b: kotlin.Int): kotlin.String declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - FUN name:testImportedObjectMember visibility:public modality:FINAL <> () returnType:IrErrorType + FUN name:testImportedObjectMember visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY - RETURN type=kotlin.Nothing from='public final fun testImportedObjectMember (): IrErrorType declared in ' - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun importedObjectMemberWithVarargs (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - $this: GET_OBJECT 'CLASS OBJECT name:Host modality:FINAL visibility:public superTypes:[kotlin.Any]' type=.Host + RETURN type=kotlin.Nothing from='public final fun testImportedObjectMember (): kotlin.String declared in ' + ERROR_CALL 'Unresolved reference: #' type=kotlin.String + ERROR_CALL 'Unsupported callable reference: ::#' type=IrErrorType FUN name:testDefault0 visibility:public modality:FINAL <> () returnType:kotlin.String BLOCK_BODY RETURN type=kotlin.Nothing from='public final fun testDefault0 (): kotlin.String declared in ' diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt index 6d745578ef1..9ab9953e080 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withArgumentAdaptationAndReceiver.fir.txt @@ -20,38 +20,33 @@ FILE fqName: fileName:/withArgumentAdaptationAndReceiver.kt FUN name:testImplicitThis visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - $this: GET_VAR ': .Host declared in .Host.testImplicitThis' type=.Host origin=null + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: ::#' type=IrErrorType FUN name:testBoundReceiverLocalVal visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY VAR name:h type:.Host [val] CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Host' type=.Host origin=null - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - $this: GET_VAR 'val h: .Host [val] declared in .Host.testBoundReceiverLocalVal' type=.Host origin=null + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: R|/h|::#' type=IrErrorType FUN name:testBoundReceiverLocalVar visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY VAR name:h type:.Host [var] CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Host' type=.Host origin=null - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - $this: GET_VAR 'var h: .Host [var] declared in .Host.testBoundReceiverLocalVar' type=.Host origin=null + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: R|/h|::#' type=IrErrorType FUN name:testBoundReceiverParameter visibility:public modality:FINAL <> ($this:.Host, h:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host VALUE_PARAMETER name:h index:0 type:.Host BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - $this: GET_VAR 'h: .Host declared in .Host.testBoundReceiverParameter' type=.Host origin=null + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: R|/h|::#' type=IrErrorType FUN name:testBoundReceiverExpression visibility:public modality:FINAL <> ($this:.Host) returnType:kotlin.Unit $this: VALUE_PARAMETER name: type:.Host BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVararg (vararg xs: kotlin.Int): kotlin.String declared in .Host' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= - $this: CONSTRUCTOR_CALL 'public constructor () [primary] declared in .Host' type=.Host origin=null + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: R|/Host.Host|()::#' type=IrErrorType FUN FAKE_OVERRIDE name:equals visibility:public modality:OPEN <> ($this:kotlin.Any, other:kotlin.Any?) returnType:kotlin.Boolean [fake_override,operator] overridden: public open fun equals (other: kotlin.Any?): kotlin.Boolean [operator] declared in kotlin.Any diff --git a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt index 629043117f3..e482286b7be 100644 --- a/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt +++ b/compiler/testData/ir/irText/expressions/callableReferences/withVarargViewedAsArray.fir.txt @@ -60,8 +60,8 @@ FILE fqName: fileName:/withVarargViewedAsArray.kt BLOCK_BODY FUN name:testPlainArgs visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun sum (vararg args: kotlin.Int): kotlin.Int declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: ::#' type=IrErrorType FUN name:testPrimitiveArrayAsVararg visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY CALL 'public final fun usePrimitiveArray (fn: kotlin.Function1): kotlin.Unit declared in ' type=kotlin.Unit origin=null diff --git a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt index 3fa5d7cbf61..bbc5a28e03e 100644 --- a/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt +++ b/compiler/testData/ir/irText/expressions/funInterface/samConversionInVarargs.fir.txt @@ -59,5 +59,5 @@ FILE fqName: fileName:/samConversionInVarargs.kt CONST String type=kotlin.String value="" FUN name:testAdaptedCR visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUNCTION_REFERENCE 'public final fun withVarargOfInt (vararg xs: kotlin.Int): kotlin.String declared in ' type=kotlin.reflect.KFunction1 origin=null reflectionTarget= + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + ERROR_CALL 'Unsupported callable reference: ::#' type=IrErrorType diff --git a/compiler/testData/ir/irText/expressions/kt28456a.fir.txt b/compiler/testData/ir/irText/expressions/kt28456a.fir.txt index 5d4746621d2..b566f6bef30 100644 --- a/compiler/testData/ir/irText/expressions/kt28456a.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456a.fir.txt @@ -26,7 +26,7 @@ FILE fqName: fileName:/kt28456a.kt FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=1 CONST Int type=kotlin.Int value=2 CONST Int type=kotlin.Int value=3 diff --git a/compiler/testData/ir/irText/expressions/kt28456b.fir.txt b/compiler/testData/ir/irText/expressions/kt28456b.fir.txt index ffdb443573d..c745d402ec4 100644 --- a/compiler/testData/ir/irText/expressions/kt28456b.fir.txt +++ b/compiler/testData/ir/irText/expressions/kt28456b.fir.txt @@ -47,7 +47,7 @@ FILE fqName: fileName:/kt28456b.kt FUN name:testSimpleAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=1 CONST Int type=kotlin.Int value=0 FUN name:testPostfixIncrement visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Int @@ -59,7 +59,7 @@ FILE fqName: fileName:/kt28456b.kt CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null $receiver: GET_VAR 'a: .A declared in .testPostfixIncrement' type=.A origin=null i: CONST Int type=kotlin.Int value=1 - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=1 CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null $this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in .testPostfixIncrement' type=kotlin.Int origin=null @@ -67,4 +67,15 @@ FILE fqName: fileName:/kt28456b.kt FUN name:testCompoundAssignment visibility:public modality:FINAL <> (a:.A) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:.A BLOCK_BODY - ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit + BLOCK type=kotlin.Unit origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:.A [val] + GET_VAR 'a: .A declared in .testCompoundAssignment' type=.A origin=null + VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] + CONST Int type=kotlin.Int value=1 + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testCompoundAssignment' type=kotlin.Int origin=null + CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null + $this: CALL 'public final fun get (i: kotlin.Int, a: kotlin.Int, b: kotlin.Int, c: kotlin.Int, d: kotlin.Int): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null + $receiver: GET_VAR 'val tmp_1: .A [val] declared in .testCompoundAssignment' type=.A origin=null + i: GET_VAR 'val tmp_2: kotlin.Int [val] declared in .testCompoundAssignment' type=kotlin.Int origin=null + other: CONST Int type=kotlin.Int value=10 diff --git a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt index 077e9d8cd54..a385b271c3a 100644 --- a/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt +++ b/compiler/testData/ir/irText/expressions/lambdaInCAO.fir.txt @@ -27,27 +27,11 @@ FILE fqName: fileName:/lambdaInCAO.kt FUN name:test2 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY - BLOCK type=kotlin.Unit origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Any [val] - GET_VAR 'a: kotlin.Any declared in .test2' type=kotlin.Any origin=null - VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Function0 [val] - FUN_EXPR type=kotlin.Function0 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit - BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test2' - GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit - CALL 'public final fun set (index: kotlin.Function0, value: kotlin.Int): kotlin.Unit [operator] declared in ' type=kotlin.Unit origin=null - $receiver: GET_VAR 'val tmp_0: kotlin.Any [val] declared in .test2' type=kotlin.Any origin=null - index: GET_VAR 'val tmp_1: kotlin.Function0 [val] declared in .test2' type=kotlin.Function0 origin=null - value: CALL 'public final fun plus (other: kotlin.Int): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: CALL 'public final fun get (index: kotlin.Function0): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null - $receiver: GET_VAR 'val tmp_0: kotlin.Any [val] declared in .test2' type=kotlin.Any origin=null - index: GET_VAR 'val tmp_1: kotlin.Function0 [val] declared in .test2' type=kotlin.Function0 origin=null - other: CONST Int type=kotlin.Int value=42 + ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit FUN name:test3 visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY - VAR IR_TEMPORARY_VARIABLE name:tmp_2 type:kotlin.Int [val] + VAR IR_TEMPORARY_VARIABLE name:tmp_0 type:kotlin.Int [val] CALL 'public final fun get (index: kotlin.Function0): kotlin.Int [operator] declared in ' type=kotlin.Int origin=null $receiver: GET_VAR 'a: kotlin.Any declared in .test3' type=kotlin.Any origin=null index: FUN_EXPR type=kotlin.Function0 origin=LAMBDA @@ -63,5 +47,5 @@ FILE fqName: fileName:/lambdaInCAO.kt RETURN type=kotlin.Nothing from='local final fun (): kotlin.Unit declared in .test3' GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit value: CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null - $this: GET_VAR 'val tmp_2: kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null - GET_VAR 'val tmp_2: kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null + $this: GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null + GET_VAR 'val tmp_0: kotlin.Int [val] declared in .test3' type=kotlin.Int origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt index 244b909b2f8..290c443ca95 100644 --- a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.fir.txt @@ -4,7 +4,7 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt VALUE_PARAMETER name:r index:1 type:java.lang.Runnable VALUE_PARAMETER name:arr index:2 type:kotlin.Array BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.String? FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY @@ -21,7 +21,7 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.String? GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null @@ -34,7 +34,7 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt r: GET_VAR 'r: java.lang.Runnable declared in .test' type=java.lang.Runnable origin=null strs: VARARG type=kotlin.Array? varargElementType=kotlin.String? CONST String type=kotlin.String value="" - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.String? GET_VAR 'fn: kotlin.Function0 declared in .test' type=kotlin.Function0 origin=null GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null CALL 'public open fun foo1 (r: java.lang.Runnable?, vararg strs: kotlin.String?): kotlin.String? declared in .Test' type=kotlin.String? origin=null @@ -49,7 +49,7 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null VAR name:i1 type:IrErrorType [val] - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY @@ -68,7 +68,7 @@ FILE fqName: fileName:/arrayAsVarargAfterSamArgument.kt SPREAD_ELEMENT GET_VAR 'arr: kotlin.Array declared in .test' type=kotlin.Array origin=null VAR name:i3 type:IrErrorType [val] - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=IrErrorType FUN_EXPR type=kotlin.Function0 origin=LAMBDA FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY diff --git a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt index f15facf43d1..1265dadb7d7 100644 --- a/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt +++ b/compiler/testData/ir/irText/expressions/sam/arrayAsVarargAfterSamArgument.kt @@ -37,4 +37,4 @@ public class Test { } public Test(Runnable r, String... strs) {} public Test(Runnable r1, Runnable r2, String... strs) {} -} \ No newline at end of file +} diff --git a/compiler/testData/ir/irText/expressions/sam/samByProjectedType.fir.txt b/compiler/testData/ir/irText/expressions/sam/samByProjectedType.fir.txt index 954101e48bb..b60ea9db1a7 100644 --- a/compiler/testData/ir/irText/expressions/sam/samByProjectedType.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samByProjectedType.fir.txt @@ -1,10 +1,10 @@ FILE fqName: fileName:/samByProjectedType.kt FUN name:test1 visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType - FUN_EXPR type=kotlin.Function1 origin=LAMBDA - FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit + FUN_EXPR type=kotlin.Function1 origin=LAMBDA + FUN LOCAL_FUNCTION_FOR_LAMBDA name: visibility:local modality:FINAL <> (x:kotlin.Any) returnType:kotlin.Any? VALUE_PARAMETER name:x index:0 type:kotlin.Any BLOCK_BODY - RETURN type=kotlin.Nothing from='local final fun (x: kotlin.Any): kotlin.Any declared in .test1' + RETURN type=kotlin.Nothing from='local final fun (x: kotlin.Any): kotlin.Any? declared in .test1' GET_VAR 'x: kotlin.Any declared in .test1.' type=kotlin.Any origin=null diff --git a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt index f32a585d296..8c23723abba 100644 --- a/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt +++ b/compiler/testData/ir/irText/expressions/sam/samConversionsWithSmartCasts.fir.txt @@ -88,13 +88,13 @@ FILE fqName: fileName:/samConversionsWithSmartCasts.kt BLOCK_BODY TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Function1 declared in .test7' type=kotlin.Function1 origin=null FUN name:test8 visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Function0 BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CALL 'public open fun id (x: T of .J.id?): T of .J.id? declared in .J' type=kotlin.Function0? origin=null : kotlin.Function0? x: GET_VAR 'a: kotlin.Function0 declared in .test8' type=kotlin.Function0 origin=null diff --git a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt index a23886530df..9ae545d9b20 100644 --- a/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt +++ b/compiler/testData/ir/irText/expressions/signedToUnsignedConversions_test.fir.txt @@ -97,19 +97,19 @@ FILE fqName: fileName:/signedToUnsignedConversions_test.kt BLOCK_BODY FUN name:test visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=255 - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=255 - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=255 - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=256 - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=255 - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=255 - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CONST Int type=kotlin.Int value=255 CONST Int type=kotlin.Int value=255 CONST Int type=kotlin.UInt value=42 diff --git a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt index a96d6f7e020..8defa1e18cc 100644 --- a/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt +++ b/compiler/testData/ir/irText/expressions/suspendConversionOnArbitraryExpression.fir.txt @@ -27,77 +27,77 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt FUN name:testSimple visibility:public modality:FINAL <> (fn:kotlin.Function0) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function0 BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function0 declared in .testSimple' type=kotlin.Function0 origin=null FUN name:testSimpleNonVal visibility:public modality:FINAL <> () returnType:kotlin.Unit BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit CALL 'public final fun produceFun (): kotlin.Function0 declared in ' type=kotlin.Function0 origin=null FUN name:testExtAsExt visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1 declared in .testExtAsExt' type=kotlin.Function1 origin=null FUN name:testExtAsSimple visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1 declared in .testExtAsSimple' type=kotlin.Function1 origin=null FUN name:testSimpleAsExt visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExt' type=kotlin.Function1 origin=null FUN name:testSimpleAsSimpleT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsSimpleT' type=kotlin.Function1 origin=null FUN name:testSimpleAsExtT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1 declared in .testSimpleAsExtT' type=kotlin.Function1 origin=null FUN name:testExtAsSimpleT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1 declared in .testExtAsSimpleT' type=kotlin.Function1 origin=null FUN name:testExtAsExtT visibility:public modality:FINAL <> (fn:kotlin.Function1) returnType:kotlin.Unit VALUE_PARAMETER name:fn index:0 type:kotlin.Function1 BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1 declared in .testExtAsExtT' type=kotlin.Function1 origin=null FUN name:testSimpleSAsSimpleT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> declared in .testSimpleSAsSimpleT' type=kotlin.Function1.testSimpleSAsSimpleT, kotlin.Unit> origin=null FUN name:testSimpleSAsExtT visibility:public modality:FINAL (fn:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> declared in .testSimpleSAsExtT' type=kotlin.Function1.testSimpleSAsExtT, kotlin.Unit> origin=null FUN name:testExtSAsSimpleT visibility:public modality:FINAL (fn:kotlin.Function1.testExtSAsSimpleT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> declared in .testExtSAsSimpleT' type=kotlin.Function1.testExtSAsSimpleT, kotlin.Unit> origin=null FUN name:testExtSAsExtT visibility:public modality:FINAL (fn:kotlin.Function1.testExtSAsExtT, kotlin.Unit>) returnType:kotlin.Unit TYPE_PARAMETER name:S index:0 variance: superTypes:[kotlin.Any?] VALUE_PARAMETER name:fn index:0 type:kotlin.Function1.testExtSAsExtT, kotlin.Unit> BLOCK_BODY - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit GET_VAR 'fn: kotlin.Function1.testExtSAsExtT, kotlin.Unit> declared in .testExtSAsExtT' type=kotlin.Function1.testExtSAsExtT, kotlin.Unit> origin=null FUN name:testSmartCastWithSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit VALUE_PARAMETER name:a index:0 type:kotlin.Any BLOCK_BODY TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'a: kotlin.Any declared in .testSmartCastWithSuspendConversion' type=kotlin.Any origin=null FUN name:testSmartCastOnVarWithSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit @@ -107,7 +107,7 @@ FILE fqName: fileName:/suspendConversionOnArbitraryExpression.kt GET_VAR 'a: kotlin.Any declared in .testSmartCastOnVarWithSuspendConversion' type=kotlin.Any origin=null TYPE_OP type=kotlin.Function0 origin=CAST typeOperand=kotlin.Function0 GET_VAR 'var b: kotlin.Any [var] declared in .testSmartCastOnVarWithSuspendConversion' type=kotlin.Any origin=null - ERROR_CALL 'Unresolved reference: #' type=IrErrorType + ERROR_CALL 'Unresolved reference: #' type=kotlin.Unit TYPE_OP type=kotlin.Function0 origin=IMPLICIT_CAST typeOperand=kotlin.Function0 GET_VAR 'var b: kotlin.Any [var] declared in .testSmartCastOnVarWithSuspendConversion' type=kotlin.Any origin=null FUN name:testSmartCastVsSuspendConversion visibility:public modality:FINAL <> (a:kotlin.Function0) returnType:kotlin.Unit diff --git a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt index 9d6b1f0c331..bc95af7482d 100644 --- a/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt +++ b/compiler/testData/ir/irText/expressions/whenWithSubjectVariable.fir.txt @@ -26,11 +26,13 @@ FILE fqName: fileName:/whenWithSubjectVariable.kt GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=2 BRANCH - if: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + if: ERROR_CALL 'Unresolved reference: #' type=kotlin.Boolean GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=3 BRANCH - if: ERROR_CALL 'Unresolved reference: #' type=IrErrorType + if: CALL 'public final fun not (): kotlin.Boolean [operator] declared in kotlin.Boolean' type=kotlin.Boolean origin=null + $this: ERROR_CALL 'Unresolved reference: #' type=kotlin.Boolean + GET_VAR 'val y: kotlin.Any [val] declared in .test' type=kotlin.Any origin=null then: CONST Int type=kotlin.Int value=4 BRANCH if: CONST Boolean type=kotlin.Boolean value=true diff --git a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.8.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.8.fir.kt index 7a00768ea8b..c1517834449 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/declarations/classifier-declaration/class-declaration/abstract-classes/p-2/neg/1.8.fir.kt @@ -40,12 +40,12 @@ class Case1 : AbstractClassCase1(){ fun case1(){ val a = Case1() - a.priv() + a.priv() a.prot() a.int() a.pub() - a.priv1 + a.priv1 a.prot1 a.int1 a.pub1 @@ -59,12 +59,12 @@ import base.* // TESTCASE NUMBER: 2 fun case2() { val a = Case1() - a.priv() + a.priv() a.prot() a.int() a.pub() - a.priv1 + a.priv1 a.prot1 a.int1 a.pub1 diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.fir.kt index dbf424495ff..197f9d17952 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/conditional-expression/p-6/neg/1.1.fir.kt @@ -27,7 +27,7 @@ import checkSubtype fun case1() { val a: Any = true if (a) { "true" } else "false" - checkSubtype(a) + checkSubtype(a) } /* @@ -38,7 +38,7 @@ fun case1() { fun case2() { val a = JavaContainer.aO if (a) { "true" } else "false" - checkSubtype(a) + checkSubtype(a) } // TESTCASE NUMBER: 3 diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/neg/3.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/neg/3.1.fir.kt index af4d4e862de..d6afa98cfa2 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/neg/3.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/boolean-literals/p-1/neg/3.1.fir.kt @@ -1,11 +1,11 @@ // TESTCASE NUMBER: 1 fun case_1() { - true checkType { check() } - false checkType { check() } + true checkType { check() } + false checkType { check() } - true checkType { check() } - false checkType { check() } + true checkType { check() } + false checkType { check() } - true checkType { check() } - false checkType { check() } + true checkType { check() } + false checkType { check() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.2.fir.kt index d3e6a866657..258dc53741d 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/neg/2.2.fir.kt @@ -2,12 +2,12 @@ // TESTCASE NUMBER: 1 fun case_1() { - 0L checkType { check() } - 1000000L checkType { check() } - 0XAf10cDL checkType { check() } - 0x0_0L checkType { check() } - 0b100_000_111_111L checkType { check() } - 0b0L checkType { check() } + 0L checkType { check() } + 1000000L checkType { check() } + 0XAf10cDL checkType { check() } + 0x0_0L checkType { check() } + 0b100_000_111_111L checkType { check() } + 0b0L checkType { check() } checkSubtype(0L) checkSubtype(1000000L) 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 30aec196a78..40f41bd4986 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 @@ -2,83 +2,83 @@ // TESTCASE NUMBER: 1 fun case_1() { - 0 checkType { check() } - 0 checkType { check() } - 0 checkType { check() } + 0 checkType { check() } + 0 checkType { check() } + 0 checkType { check() } } // TESTCASE NUMBER: 2 fun case_2() { - 127 checkType { check() } - 127 checkType { check() } - 127 checkType { check() } + 127 checkType { check() } + 127 checkType { check() } + 127 checkType { check() } checkSubtype(128) - 128 checkType { check() } - 128 checkType { check() } - 128 checkType { check() } + 128 checkType { check() } + 128 checkType { check() } + 128 checkType { check() } - -128 checkType { check() } - -128 checkType { check() } - -128 checkType { check() } + -128 checkType { check() } + -128 checkType { check() } + -128 checkType { check() } checkSubtype(-129) - -129 checkType { check() } - -129 checkType { check() } - -129 checkType { check() } + -129 checkType { check() } + -129 checkType { check() } + -129 checkType { check() } } // TESTCASE NUMBER: 3 fun case_3() { checkSubtype(32767) - 32767 checkType { check() } - 32767 checkType { check() } - 32767 checkType { check() } + 32767 checkType { check() } + 32767 checkType { check() } + 32767 checkType { check() } checkSubtype(32768) checkSubtype(32768) - 32768 checkType { check() } - 32768 checkType { check() } - 32768 checkType { check() } + 32768 checkType { check() } + 32768 checkType { check() } + 32768 checkType { check() } checkSubtype(-32768) - -32768 checkType { check() } - -32768 checkType { check() } - -32768 checkType { check() } + -32768 checkType { check() } + -32768 checkType { check() } + -32768 checkType { check() } checkSubtype(-32769) checkSubtype(-32769) - -32769 checkType { check() } - -32769 checkType { check() } - -32769 checkType { check() } + -32769 checkType { check() } + -32769 checkType { check() } + -32769 checkType { check() } } // TESTCASE NUMBER: 4 fun case_4() { checkSubtype(2147483647) checkSubtype(2147483647) - 2147483647 checkType { check() } - 2147483647 checkType { check() } - 2147483647 checkType { check() } + 2147483647 checkType { check() } + 2147483647 checkType { check() } + 2147483647 checkType { check() } checkSubtype(2147483648) checkSubtype(2147483648) checkSubtype(2147483648) - 2147483648 checkType { check() } - 2147483648 checkType { check() } - 2147483648 checkType { check() } + 2147483648 checkType { check() } + 2147483648 checkType { check() } + 2147483648 checkType { check() } checkSubtype(-2147483648) checkSubtype(-2147483648) - -2147483648 checkType { check() } - -2147483648 checkType { check() } - -2147483648 checkType { check() } + -2147483648 checkType { check() } + -2147483648 checkType { check() } + -2147483648 checkType { check() } checkSubtype(-2147483649) checkSubtype(-2147483649) checkSubtype(-2147483649) - -2147483649 checkType { check() } - -2147483649 checkType { check() } + -2147483649 checkType { check() } + -2147483649 checkType { check() } -2147483649 checkType { check() } } @@ -87,15 +87,15 @@ fun case_5() { checkSubtype(9223372036854775807) checkSubtype(9223372036854775807) checkSubtype(9223372036854775807) - 9223372036854775807 checkType { check() } - 9223372036854775807 checkType { check() } - 9223372036854775807 checkType { check() } + 9223372036854775807 checkType { check() } + 9223372036854775807 checkType { check() } + 9223372036854775807 checkType { check() } checkSubtype(-9223372036854775807) checkSubtype(-9223372036854775807) checkSubtype(-9223372036854775807) - -9223372036854775807 checkType { check() } - -9223372036854775807 checkType { check() } + -9223372036854775807 checkType { check() } + -9223372036854775807 checkType { check() } -9223372036854775807 checkType { check() } } @@ -105,8 +105,8 @@ fun case_6() { checkSubtype(-100000000000000000000000000000000) checkSubtype(-100000000000000000000000000000000) checkSubtype(-100000000000000000000000000000000) - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } - -100000000000000000000000000000000 checkType { check() } + -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 2288e362f16..393c857b1c3 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 @@ -3,23 +3,23 @@ // TESTCASE NUMBER: 1 fun case_1() { checkSubtype(-9223372036854775808L) - -9223372036854775808L checkType { check() } + -9223372036854775808L checkType { check() } checkSubtype(9223372036854775808L) - 9223372036854775808L checkType { check() } + 9223372036854775808L checkType { check() } } // TESTCASE NUMBER: 2 fun case_2() { checkSubtype(100000000000000000000000000000000L) - 100000000000000000000000000000000L checkType { check() } + 100000000000000000000000000000000L checkType { check() } checkSubtype(100000000000000000000000000000000l) - 100000000000000000000000000000000l checkType { check() } + 100000000000000000000000000000000l checkType { check() } checkSubtype(-100000000000000000000000000000000L) - -100000000000000000000000000000000L checkType { check() } + -100000000000000000000000000000000L checkType { check() } checkSubtype(-100000000000000000000000000000000l) - -100000000000000000000000000000000l checkType { check() } + -100000000000000000000000000000000l checkType { check() } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.2.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.2.fir.kt index 6c3d05169a4..dd9ece5e2b2 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.2.fir.kt @@ -68,7 +68,7 @@ fun case_4() { checkSubtype(-2147483648) checkSubtype(-2147483648) - -2147483649 checkType { check() } + -2147483649 checkType { check() } checkSubtype(-2147483649) } @@ -77,6 +77,6 @@ fun case_5() { 9223372036854775807 checkType { check() } checkSubtype(9223372036854775807) - -9223372036854775807 checkType { check() } + -9223372036854775807 checkType { check() } checkSubtype(-9223372036854775807) } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.3.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.3.fir.kt index 576cd6457a8..62c9bcc60c7 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.3.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.3.fir.kt @@ -68,7 +68,7 @@ fun case_4() { checkSubtype(-0x80000000) checkSubtype(-0x80000000) - -0x80000001 checkType { check() } + -0x80000001 checkType { check() } checkSubtype(-0x80000001) } @@ -77,6 +77,6 @@ fun case_5() { 0X7FFFFFFFFFFFFFFF checkType { check() } checkSubtype(0X7FFFFFFFFFFFFFFF) - -0X7FFFFFFFFFFFFFFF checkType { check() } + -0X7FFFFFFFFFFFFFFF checkType { check() } checkSubtype(-0X7FFFFFFFFFFFFFFF) } diff --git a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.4.fir.kt index b2c9aad6c50..4bac1e36f61 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/expressions/constant-literals/the-types-for-integer-literals/p-1/pos/2.4.fir.kt @@ -68,7 +68,7 @@ fun case_4() { checkSubtype(-0B10000000000000000000000000000000) checkSubtype(-0B10000000000000000000000000000000) - -0b10000000000000000000000000000001 checkType { check() } + -0b10000000000000000000000000000001 checkType { check() } checkSubtype(-0b10000000000000000000000000000001) } @@ -77,6 +77,6 @@ fun case_5() { 0b111111111111111111111111111111111111111111111111111111111111111 checkType { check() } checkSubtype(0b111111111111111111111111111111111111111111111111111111111111111) - -0B111111111111111111111111111111111111111111111111111111111111111 checkType { check() } + -0B111111111111111111111111111111111111111111111111111111111111111 checkType { check() } checkSubtype(-0B111111111111111111111111111111111111111111111111111111111111111) } 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 55f359e267b..cf2d070a07f 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 3f8fc30d091..826f0cd7805 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 d59c58591be..e67c169a61b 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 0ab07843503..5ed2a9bb3f0 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/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 5c35f534262..497a847ab43 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 @@ -11,7 +11,7 @@ class Case1() { } fun case() { - Companion(::x) + Companion(::x) } val x = "" @@ -27,7 +27,7 @@ class Case2() { } fun case() { - Companion(::x) + Companion(::x) } val x = C() diff --git a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos/1.4.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos/1.4.fir.kt index 4f9e6675147..58000bc1618 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos/1.4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/overload-resolution/resolving-callable-references/bidirectional-resolution-for-callable-calls/p-3/pos/1.4.fir.kt @@ -28,10 +28,10 @@ class Case2() { } fun case() { - foo(::invoke, ::invoke) - foo(::invoke, ::invoke) - foo(::invoke, ::invoke) - foo(::invoke, ::invoke) + foo(::invoke, ::invoke) + foo(::invoke, ::invoke) + foo(::invoke, ::invoke) + foo(::invoke, ::invoke) } fun foo(vararg x: (Int)->Any): String = TODO() // (1.1) diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/pos/1.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/pos/1.1.fir.kt index 24bc6b3ea93..d3f5851c91e 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/pos/1.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-contexts-and-scopes/inner-and-nested-type-contexts/p-1/pos/1.1.fir.kt @@ -22,7 +22,7 @@ class Case1(val x: AT) { when (k) { is AT -> { - k checkType { check() } + k checkType { check() } } } } @@ -31,7 +31,7 @@ class Case1(val x: AT) { val k: AT = x!! if (k is AT) { - k checkType { check() } + k checkType { check() } } } } diff --git a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/neg/2.1.fir.kt b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/neg/2.1.fir.kt index 380284e03eb..4417f42a6d7 100644 --- a/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/neg/2.1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/linked/type-system/type-kinds/built-in-types/kotlin.nothing/p-1/neg/2.1.fir.kt @@ -6,7 +6,7 @@ class Case1(val nothing: Nothing) fun case1() { - val res = Case1(Nothing()) + val res = Case1(Nothing()) } @@ -17,5 +17,5 @@ class Case2 { fun case2(c: Case2) { val testValue = c.data ?: throw IllegalArgumentException("data required") - testValue checkType { check() } + testValue checkType { check() } } 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 03cd6e2f5c6..f938331e4aa 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 @@ -29,13 +29,13 @@ fun case_4(value_1: Any?) { // TESTCASE NUMBER: 5 fun case_5(value_1: String?) { funWithReturnsAndNullCheck(value_1) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 6 fun case_6(value_1: String?) { funWithReturnsAndNullCheck(value_1) - println(value_1.length) + println(value_1.length) } // TESTCASE NUMBER: 7 @@ -61,14 +61,14 @@ fun case_8(value_1: Any?) { // TESTCASE NUMBER: 9 fun case_9(value_1: String?) { - if (!funWithReturnsTrue(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) + if (!funWithReturnsTrue(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) if (funWithReturnsNotNull(value_1 != null) == null) println(value_1.length) if (funWithReturnsNotNullAndInvertCondition(value_1 == null) == null) println(value_1.length) - if (funWithReturnsNull(value_1 != null) != null) println(value_1.length) - if (funWithReturnsNullAndInvertCondition(value_1 == null) != null) println(value_1.length) + if (funWithReturnsNull(value_1 != null) != null) println(value_1.length) + if (funWithReturnsNullAndInvertCondition(value_1 == null) != null) println(value_1.length) } // TESTCASE NUMBER: 10 @@ -83,14 +83,14 @@ fun case_10(value_1: Any?) { // TESTCASE NUMBER: 11 fun case_11(value_1: Number?) { - if (!funWithReturnsTrueAndNotNullCheck(value_1)) println(value_1.toByte()) + if (!funWithReturnsTrueAndNotNullCheck(value_1)) println(value_1.toByte()) if (!funWithReturnsTrueAndNullCheck(value_1)) println(value_1) - if (funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1.toByte()) + if (funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1.toByte()) if (funWithReturnsFalseAndNullCheck(value_1)) println(value_1) if ((funWithReturnsNotNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) if (!!!(funWithReturnsNotNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) if (!!(funWithReturnsNotNullAndNullCheck(value_1) == null)) println(value_1) - if (!(funWithReturnsNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) - if (!!(funWithReturnsNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) + if (!(funWithReturnsNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) + if (!!(funWithReturnsNullAndNotNullCheck(value_1) != null)) println(value_1.toByte()) if (!!!(funWithReturnsNullAndNullCheck(value_1) == null)) println(value_1) } 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 ad770638750..8906c056c4d 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 @@ -250,8 +250,8 @@ fun case_8(value_1: Any?) { // TESTCASE NUMBER: 9 fun case_9(value_1: Number?) { - if (!funWithReturnsTrueAndNullCheck(value_1)) println(value_1.toByte()) - if (funWithReturnsFalseAndNullCheck(value_1)) println(value_1.toByte()) + if (!funWithReturnsTrueAndNullCheck(value_1)) println(value_1.toByte()) + if (funWithReturnsFalseAndNullCheck(value_1)) println(value_1.toByte()) if (funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1) if (!(funWithReturnsNotNullAndNullCheck(value_1) != null)) println(value_1) if (!(funWithReturnsNullAndNullCheck(value_1) == null)) println(value_1) @@ -458,9 +458,9 @@ fun case_19(value_1: Number) { // TESTCASE NUMBER: 20 fun case_20(value_1: String?, value_2: String?, value_3: String?, value_4: String?) { if (!value_1.case_20_1()) println(value_1) - if (!value_2.case_20_2()) println(value_2.length) + if (!value_2.case_20_2()) println(value_2.length) when (value_3.case_20_3()) { - true -> println(value_4.length) + true -> println(value_4.length) false -> println(value_3) } } @@ -468,13 +468,13 @@ fun case_20(value_1: String?, value_2: String?, value_3: String?, value_4: Strin // TESTCASE NUMBER: 21 fun case_21(value_1: String?) { when { !value_1.case_21_1() -> println(value_1) } - when { !value_1.case_21_2() -> println(value_1.length) } + when { !value_1.case_21_2() -> println(value_1.length) } when { value_1.case_21_5() == null -> println(value_1.length) value_1.case_21_5() != null -> println(value_1) } when { - value_1.case_21_7() != null -> println(value_1.length) + value_1.case_21_7() != null -> println(value_1.length) value_1.case_21_7() == null -> println(value_1) } } 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 3040e009cbc..b737b5d437f 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/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/4.fir.kt index 27484e292cc..c6701562edf 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 @@ -152,7 +152,7 @@ fun case_2(value_1: Number) { // TESTCASE NUMBER: 3 fun case_3(value_1: String?, value_2: String?) { value_1.case_3_1() - println(value_1.length) + println(value_1.length) value_2.case_3_2() println(value_2) } @@ -160,7 +160,7 @@ fun case_3(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 4 fun case_4(value_1: String?, value_2: String?) { value_1.case_4_1() - println(value_1.length) + println(value_1.length) value_2.case_4_2() println(value_2) } @@ -183,7 +183,7 @@ fun case_6(value_1: Number) { // TESTCASE NUMBER: 7 fun case_7(value_1: String?, value_2: String?) { - if (value_1.case_7_1()) println(value_1.length) + if (value_1.case_7_1()) println(value_1.length) if (value_2.case_7_2()) println(value_2) if (!(value_2.case_7_3() == null)) println(value_2) if (value_2.case_7_3() == null) println(value_2) @@ -191,7 +191,7 @@ fun case_7(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 8 fun case_8(value_1: String?, value_2: String?) { - when { value_1.case_8_1() -> println(value_1.length) } + when { value_1.case_8_1() -> println(value_1.length) } when { value_2.case_8_2() -> println(value_2) } when { !(value_2.case_8_3() == null) -> println(value_2) } when { value_2.case_8_3() == null -> println(value_2) } @@ -199,13 +199,13 @@ fun case_8(value_1: String?, value_2: String?) { // TESTCASE NUMBER: 9 fun case_9(value_1: Number?) { - if (value_1?.case_9() == null) println(value_1.toByte()) + if (value_1?.case_9() == null) println(value_1.toByte()) } // TESTCASE NUMBER: 10 fun case_10(value_1: Number?) { if (value_1?.case_10() == null) { - println(value_1.toByte()) + println(value_1.toByte()) } else { println(value_1.toByte()) } @@ -217,13 +217,13 @@ fun case_10(value_1: Number?) { */ fun case_11(value_1: Number?, value_2: Number?) { if (value_1?.case_11_1() == null) { - println(value_1.toByte()) + println(value_1.toByte()) } else { println(value_1.toByte()) } if (value_2?.case_11_2() != null) { println(value_2.toByte()) } else { - println(value_2.toByte()) + println(value_2.toByte()) } } 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 0f28e64af95..3465ff56e1a 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 @@ -125,7 +125,7 @@ fun case_2(value_1: Number?, value_2: Any?) { fun case_3(value_1: Any?, value_2: String?) { value_1.case_3(value_2) println(value_1.inv()) - println(value_2.length) + println(value_2.length) } // TESTCASE NUMBER: 4 @@ -133,7 +133,7 @@ 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_4.length) + println(value_4.length) } // TESTCASE NUMBER: 5 @@ -182,19 +182,19 @@ fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, val 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_2.length) + println(value_2.length) } if (value_3.case_7_2(value_4)) { println(value_3.inv()) - println(value_4.length) + println(value_4.length) } if (value_5.case_7_3(value_6) != null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } if (value_5.case_7_4(value_6) == null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } } @@ -202,14 +202,14 @@ fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, val 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_4.length) } + 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_4.length) } + 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_4.length) } + 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_4.length) } + when { value_1.case_8_4(value_2, value_3, value_4) != null -> println(value_4.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt index 47defcf0611..6a1acfce5e7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/neg/7.fir.kt @@ -338,9 +338,9 @@ fun case_8(value_1: Any?) { } if (!case_8_4(value_1)) { value_1?.toByte() - if (!case_8_5(value_1)) { + if (!case_8_5(value_1)) { value_1.toByte() - if (!case_8_6(value_1)) value_1.inv() + if (!case_8_6(value_1)) value_1.inv() } } if (case_8_7(value_1) == null) { 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 4ce97b7f28c..839cfe16fc0 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 @@ -103,11 +103,11 @@ fun case_4(value_1: Number, value_2: (() -> Unit)?) { fun case_5(value_1: Number?, value_2: String?) { when (value_2.case_5(value_1)) { true -> { - println(value_2.length) + println(value_2.length) println(value_1.toByte()) } false -> { - println(value_2.length) + println(value_2.length) println(value_1.inv()) } } @@ -118,11 +118,11 @@ fun case_6(value_1: Number, value_2: String?, value_3: Any?) { when (value_3.case_6(value_1, value_2)) { true -> { println(value_3.equals("")) - println(value_2.length) + println(value_2.length) } false -> { println(value_3.length) - println(value_2.length) + println(value_2.length) } null -> { println(value_1.inv()) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/1.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/1.fir.kt index 7cd53da885d..b3858186833 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/1.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/1.fir.kt @@ -62,9 +62,9 @@ fun case_9(value_1: String?) { 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 (funWithReturnsNotNull(value_1 != null) != null) println(value_1.length) - if (!(funWithReturnsNotNull(value_1 != null) == null)) println(value_1.length) - if (!(funWithReturnsNotNullAndInvertCondition(value_1 == null) == null)) println(value_1.length) + if (funWithReturnsNotNull(value_1 != null) != null) println(value_1.length) + if (!(funWithReturnsNotNull(value_1 != null) == null)) println(value_1.length) + if (!(funWithReturnsNotNullAndInvertCondition(value_1 == null) == null)) println(value_1.length) } // TESTCASE NUMBER: 10 @@ -82,7 +82,7 @@ fun case_11(value_1: Number?, value_2: Int?) { if (!funWithReturnsFalseAndNotNullCheck(value_2)) value_2.inc() if (!funWithReturnsFalseAndNotNullCheck(value_1)) println(value_1.toByte()) if (!funWithReturnsFalseAndNullCheck(value_1)) println(value_1) - if (!(funWithReturnsNotNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) - if (funWithReturnsNotNullAndNotNullCheck(value_1) != null) println(value_1.toByte()) + if (!(funWithReturnsNotNullAndNotNullCheck(value_1) == null)) println(value_1.toByte()) + if (funWithReturnsNotNullAndNotNullCheck(value_1) != null) println(value_1.toByte()) if (funWithReturnsNotNullAndNullCheck(value_1) != null) println(value_1) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/4.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/4.fir.kt index 3c4a365270d..f19ea1c50c0 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/4.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/4.fir.kt @@ -207,7 +207,7 @@ fun case_7(value_1: String?) { else println(value_1) when (value_1.case_7_6() == null) { true -> println(value_1) - false -> println(value_1.length) + false -> println(value_1.length) } if (value_1.case_7_7() != null) println(value_1) else println(value_1.length) diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt index 468cbc41bb9..2f93a5d0fd7 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/6.fir.kt @@ -124,7 +124,7 @@ fun case_2(value_1: Number?, value_2: Any?) { fun case_3(value_1: Any?, value_2: String?) { value_1.case_3(value_2) println(value_1.inv()) - println(value_2.length) + println(value_2.length) } // TESTCASE NUMBER: 4 @@ -132,7 +132,7 @@ 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_4.length) + println(value_4.length) } // TESTCASE NUMBER: 5 @@ -187,19 +187,19 @@ fun case_6(value_1: Number?, value_2: Any?, value_3: Number?, value_4: Any?, val 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_2.length) + println(value_2.length) } if (value_3.case_7_2(value_4)) { println(value_3.inv()) - println(value_4.length) + println(value_4.length) } if (value_5.case_7_3(value_6) != null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } if (value_5.case_7_4(value_6) == null) { println(value_5.inv()) - println(value_6.length) + println(value_6.length) } } @@ -207,14 +207,14 @@ fun case_7(value_1: Any?, value_2: String?, value_3: Any?, value_4: String?, val fun case_8(value_1: Any?, value_2: Number, value_3: Any?, value_4: String?, value_5: Any?, value_6: Number, value_7: Any?, value_8: String?) { when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_2.inv()) } when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_3.toByte()) } - when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } + when { value_1.case_8_1(value_2, value_3, value_4) -> println(value_4.length) } when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_6.inv()) } when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_7.toByte()) } - when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_8.length) } + when { !value_5.case_8_2(value_6, value_7, value_8) -> println(value_8.length) } when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_6.inv()) } when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_7.toByte()) } - when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_8.length) } + when { value_5.case_8_3(value_6, value_7, value_8) != null -> println(value_8.length) } when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_6.inv()) } when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_7.toByte()) } - when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_8.length) } + when { value_5.case_8_4(value_6, value_7, value_8) == null -> println(value_8.length) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/contracts/analysis/smartcasts/pos/8.fir.kt index b4d00288a71..f9b7b8d157c 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 @@ -111,7 +111,7 @@ fun case_5(value_1: Number?, value_2: String?) { println(value_1.toByte()) } false -> { - println(value_2.length) + println(value_2.length) println(value_1.inv()) } } @@ -130,7 +130,7 @@ fun case_6(value_1: Number, value_2: String?, value_3: Any?) { } false -> { println(value_3.length) - println(value_2.length) + println(value_2.length) } null -> { 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 b8f49568e01..5cd070dbb0a 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 @@ -263,7 +263,7 @@ fun case_16() { // TESTCASE NUMBER: 17 val case_17 = if (nullableIntProperty == null == true == false) 0 else { nullableIntProperty - nullableIntProperty.java + nullableIntProperty.java } //TESTCASE NUMBER: 18 @@ -302,17 +302,17 @@ fun case_19(b: Boolean) { } } else null - if (a != null !is Boolean && a.B19 != null is Boolean && a.B19.C19 != null is Boolean && a.B19.C19.D19 != null == null && a.B19.C19.D19.x != null !== null) { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + if (a != null !is Boolean && a.B19 != null is Boolean && a.B19.C19 != null is Boolean && a.B19.C19.D19 != null == null && a.B19.C19.D19.x != null !== null) { + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -361,34 +361,34 @@ fun case_21() { // TESTCASE NUMBER: 22 fun case_22(a: (() -> Unit)?) { if (a != null !is Boolean) { - a() - a().equals(null) - a().propT - a().propAny - a().propNullableT - a().propNullableAny - a().funT() - a().funAny() - a().funNullableT() - a().funNullableAny() + a() + a().equals(null) + a().propT + a().propAny + a().propNullableT + a().propNullableAny + a().funT() + a().funAny() + a().funNullableT() + a().funNullableAny() } } // TESTCASE NUMBER: 23 fun case_23(a: ((Float) -> Int?)?, b: Float?) { if (a != null !is Boolean && b !== null is Boolean) { - val x = a(b) + val x = a(b) if (x != null) { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } } @@ -440,18 +440,18 @@ fun case_25(b: Boolean) { // TESTCASE NUMBER: 26 fun case_26(a: ((Float) -> Int?)?, b: Float?) { if (a != null == true == false && b != null == true == false) { - val x = a(b) + val x = a(b) if (x != null == true === false) { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt index 98a0c759152..05ab6ad76a3 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/30.fir.kt @@ -32,6 +32,6 @@ class Case5(val y: Any?): ClassWithCostructorParam(y as Interface1), Interface1 fun case_6(a: Int?) = object : ClassWithCostructorParam(a!!) { fun run() = a.toShort() init { - println(a.toShort()) + println(a.toShort()) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt index 609fa3dcdb1..05b2ea29d44 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/neg/8.fir.kt @@ -8,8 +8,8 @@ fun case_1(x: Class?) { x x.fun_4() x.fun_4().fun_4() - x.fun_4().fun_4().fun_4() - x.fun_4().fun_4().fun_4().fun_4() + x.fun_4().fun_4().fun_4() + x.fun_4().fun_4().fun_4().fun_4() } } @@ -36,6 +36,6 @@ fun case_4(x: Class?) { if (x?.prop_8.also { } != null) { x x.prop_8 - x.prop_8.fun_4() + x.prop_8.fun_4() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt index 2faba557ee0..02c785698d2 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/2.fir.kt @@ -67,7 +67,7 @@ fun case_3(b: Boolean) { val y = if (b) x else null if (false || false || false || false || y !== null) { - val z = y() + val z = ?")!>y() ?>?")!>y.equals(null) ?>?")!>y.propT ?>?")!>y.propAny @@ -79,7 +79,7 @@ fun case_3(b: Boolean) { ?>?")!>y.funNullableAny() if (z != null || false) { - z.a + ?")!>z.a } } } @@ -87,7 +87,7 @@ fun case_3(b: Boolean) { // TESTCASE NUMBER: 4 fun case_4(a: ((Float) -> Int?)?, b: Float?) { if (a != null == true && b != null == true || false || false || false || false || false || false || false || false || false) { - val x = a(b) + val x = a(b) ?")!>a.equals(null) ?")!>a.propT ?")!>a.propAny @@ -99,7 +99,7 @@ fun case_4(a: ((Float) -> Int?)?, b: Float?) { ?")!>a.funNullableAny() if (false || x != null == true) { - x + x } } } @@ -125,16 +125,16 @@ fun case_5(b: Boolean) { } else null if (a != null && a.B5 != null && a.B5.C5 != null && a.B5.C5.D5 != null && a.B5.C5.D5.x != null && b || false) { - a.B5.C5.D5.x - a.B5.C5.D5.x.equals(null) - a.B5.C5.D5.x.propT - a.B5.C5.D5.x.propAny - a.B5.C5.D5.x.propNullableT - a.B5.C5.D5.x.propNullableAny - a.B5.C5.D5.x.funT() - a.B5.C5.D5.x.funAny() - a.B5.C5.D5.x.funNullableT() - a.B5.C5.D5.x.funNullableAny() + a.B5.C5.D5.x + a.B5.C5.D5.x.equals(null) + a.B5.C5.D5.x.propT + a.B5.C5.D5.x.propAny + a.B5.C5.D5.x.propNullableT + a.B5.C5.D5.x.propNullableAny + a.B5.C5.D5.x.funT() + a.B5.C5.D5.x.funAny() + a.B5.C5.D5.x.funNullableT() + a.B5.C5.D5.x.funNullableAny() } } @@ -274,7 +274,7 @@ fun case_11(b: Boolean) { val y = if (b) x else null if (y === null && true) else { - val z = y() + val z = ?")!>y() ?>?")!>y.equals(null) ?>?")!>y.propT ?>?")!>y.propAny @@ -288,7 +288,7 @@ fun case_11(b: Boolean) { if (z != null || b) { } else { - z + ?")!>z } } } @@ -298,7 +298,7 @@ fun case_12(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) { if (true && a == null == true || b == null == true) { } else { - val x = a(b) + val x = a(b) ?")!>a.equals(null) ?")!>a.propT ?")!>a.propAny @@ -320,16 +320,16 @@ fun case_12(a: ((Float) -> Int?)?, b: Float?, c: Boolean?) { if (x == null == true || (c != null && !c)) { } else { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } } @@ -357,16 +357,16 @@ fun case_13(b: Boolean, c: Boolean, d: Boolean) { if ((a == null || a.B19 == null || a.B19.C19 == null || a.B19.C19.D19 == null || a.B19.C19.D19.x == null || b || c || !d) && true) { } else { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt index 1990b2dc9cc..fc70e9530eb 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/30.fir.kt @@ -12,8 +12,8 @@ fun case_1(x: Class?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -28,7 +28,7 @@ fun case_2(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -57,8 +57,8 @@ fun case_4(x: Class?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -73,7 +73,7 @@ fun case_5(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -102,8 +102,8 @@ fun case_7(x: Class) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -117,8 +117,8 @@ fun case_8(x: Class) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } // TESTCASE NUMBER: 9 @@ -136,8 +136,8 @@ fun case_9(x: T) { */ fun case_10(x: Inv?) { if (x!!.prop_1?.prop_1?.prop_1?.prop_2 != null) { - x.prop_1.prop_1.prop_1.prop_2 - x.prop_1.prop_1.prop_1.prop_2.equals(10) + x.prop_1.prop_1.prop_1.prop_2 + x.prop_1.prop_1.prop_1.prop_2.equals(10) } } @@ -148,8 +148,8 @@ fun case_10(x: Inv?) { */ inline fun case_11(x: Inv?) { if (x?.prop_1!!.prop_1?.prop_1?.prop_2 == null) else { - x.prop_1.prop_1.prop_1.prop_2 - x.prop_1.prop_1.prop_1.prop_2.equals(10) + x.prop_1.prop_1.prop_1.prop_2 + x.prop_1.prop_1.prop_1.prop_2.equals(10) } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt index cbbb80150a4..d2c30cd69ea 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/31.fir.kt @@ -12,8 +12,8 @@ fun case_1(x: Any?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -27,8 +27,8 @@ fun case_2(x: Class?) { x x.prop_8 x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -41,9 +41,9 @@ fun case_3(x: Any?) { if ((x as Class?)?.prop_8?.prop_8?.prop_8?.prop_8 == null) else { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -56,9 +56,9 @@ fun case_4(x: Any?) { if ((x as Class?)!!.prop_8?.prop_8?.prop_8?.prop_8 == null) else { x x.prop_8 - x.prop_8.prop_8 - x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8 + x.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } @@ -73,7 +73,7 @@ fun case_5(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8 } } @@ -88,7 +88,7 @@ fun case_6(x: Class?) { x.prop_8 x.prop_8.prop_8 x.prop_8.prop_8.prop_8 - x.prop_8.prop_8.prop_8.prop_8.prop_8 + x.prop_8.prop_8.prop_8.prop_8.prop_8 } } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt index 4614cf4b29f..9b62fcdd1c6 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/40.fir.kt @@ -161,7 +161,7 @@ fun case_15(x: Any?) { */ fun case_16(x: Nothing?) { x - x?.equals(10) - x!!.equals(10) - x.equals(10) + x?.equals(10) + x!!.equals(10) + x.equals(10) } diff --git a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt index 8a90ac07e8f..f0c2ef2fb9f 100644 --- a/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt +++ b/compiler/tests-spec/testData/diagnostics/notLinked/dfa/pos/7.fir.kt @@ -344,17 +344,17 @@ fun case_19(b: Boolean) { } } else null - if (a != null && a.B19 != a.y && a.B19.C19 != a.y && a.B19.C19.D19 != a.y && a.B19.C19.D19.x != a.y) { - a.B19.C19.D19.x - a.B19.C19.D19.x.equals(null) - a.B19.C19.D19.x.propT - a.B19.C19.D19.x.propAny - a.B19.C19.D19.x.propNullableT - a.B19.C19.D19.x.propNullableAny - a.B19.C19.D19.x.funT() - a.B19.C19.D19.x.funAny() - a.B19.C19.D19.x.funNullableT() - a.B19.C19.D19.x.funNullableAny() + if (a != null && a.B19 != a.y && a.B19.C19 != a.y && a.B19.C19.D19 != a.y && a.B19.C19.D19.x != a.y) { + a.B19.C19.D19.x + a.B19.C19.D19.x.equals(null) + a.B19.C19.D19.x.propT + a.B19.C19.D19.x.propAny + a.B19.C19.D19.x.propNullableT + a.B19.C19.D19.x.propNullableAny + a.B19.C19.D19.x.funT() + a.B19.C19.D19.x.funAny() + a.B19.C19.D19.x.funNullableT() + a.B19.C19.D19.x.funNullableAny() } } @@ -406,7 +406,7 @@ fun case_21() { fun case_22(a: (() -> Unit)?) { var y = null if (a != null || y != a) { - a() + a() ?")!>a.equals(null) ?")!>a.propT ?")!>a.propAny @@ -422,18 +422,18 @@ fun case_22(a: (() -> Unit)?) { // TESTCASE NUMBER: 23 fun case_23(a: ((Float) -> Int?)?, b: Float?, c: Nothing?) { if (a != null && b !== null || a != c && b !== c) { - val x = a(b) + val x = a(b) if (x != null || c !== x) { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } } @@ -475,19 +475,19 @@ fun case_25(b: Boolean) { if (y !== null || x()!!.b != y) { if (x()!!.b != y) { - val z = y() + val z = ?")!>y() if (z != null) { - z.a - z.equals(null) - z.propT - z.propAny - z.propNullableT - z.propNullableAny - z.funT() - z.funAny() - z.funNullableT() - z.funNullableAny() + & ?")!>z.a + & ?")!>z.equals(null) + & ?")!>z.propT + & ?")!>z.propAny + & ?")!>z.propNullableT + & ?")!>z.propNullableAny + & ?")!>z.funT() + & ?")!>z.funAny() + & ?")!>z.funNullableT() + & ?")!>z.funNullableAny() } } } @@ -498,18 +498,18 @@ fun case_26(a: ((Float) -> Int?)?, b: Float?) { var c: Nothing? = null if (a != null == true && b != null == true || c != a == true && b != c == true) { - val x = a(b) + val x = a(b) if (x != null == true) { - x - x.equals(null) - x.propT - x.propAny - x.propNullableT - x.propNullableAny - x.funT() - x.funAny() - x.funNullableT() - x.funNullableAny() + x + x.equals(null) + x.propT + x.propAny + x.propNullableT + x.propNullableAny + x.funT() + x.funAny() + x.funNullableT() + x.funNullableAny() } } }