From 009e3f9cd7b520775508dda4d7465e2f65a2e28e Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 9 Dec 2015 19:30:38 +0100 Subject: [PATCH] rename PSI classes according to current terminology: KtMultiDeclaration(Entry) -> KtDestructuringDeclaration(Entry) KtFunctionLiteralExpression -> KtLambdaExpression KtFunctionLiteralArgument -> KtLambdaArgument KtDelegationSpecifierList -> KtSuperTypeList KtDelegationSpecifier -> KtSuperTypeListEntry KtDelegatorToSuperClass -> KtSuperTypeEntry KtDelegatorToSuperCall -> KtSuperTypeCallEntry KtDelegationByExpressionSpecifier ->KtDelegatedSuperTypeEntry --- .../kotlin/backend/common/CodegenUtil.java | 2 +- .../kotlin/codegen/ExpressionCodegen.java | 30 ++-- .../codegen/ImplementationBodyCodegen.java | 50 +++--- .../binding/CodegenAnnotatingVisitor.java | 16 +- .../kotlin/codegen/inline/InlineCodegen.java | 2 +- .../kotlin/codegen/inline/LambdaInfo.java | 6 +- .../kotlin/codegen/state/JetTypeMapper.java | 4 +- .../checkers/JvmSimpleNameBacktickChecker.kt | 2 +- .../src/org/jetbrains/kotlin/KtNodeTypes.java | 16 +- .../cfg/KotlinControlFlowProcessor.java | 34 ++-- .../cfg/KotlinFlowInformationProvider.java | 6 +- ...otlinControlFlowInstructionsGenerator.java | 2 +- .../kotlin/cfg/pseudocode/pseudocodeUtils.kt | 4 +- .../kotlin/checkers/DebugInfoUtil.java | 6 +- .../jetbrains/kotlin/diagnostics/Errors.java | 18 +-- .../diagnostics/PositioningStrategies.kt | 4 +- .../parsing/KotlinExpressionParsing.java | 8 +- .../kotlin/parsing/KotlinParsing.java | 14 +- .../src/org/jetbrains/kotlin/psi/Call.java | 2 +- .../org/jetbrains/kotlin/psi/DebugTextUtil.kt | 12 +- .../kotlin/psi/KtAnnotationEntry.java | 2 +- .../jetbrains/kotlin/psi/KtCallElement.java | 2 +- .../kotlin/psi/KtCallExpression.java | 6 +- .../jetbrains/kotlin/psi/KtClassOrObject.kt | 25 ++- .../psi/KtConstructorDelegationCall.java | 2 +- ...er.java => KtDelegatedSuperTypeEntry.java} | 10 +- ...n.java => KtDestructuringDeclaration.java} | 10 +- ...a => KtDestructuringDeclarationEntry.java} | 8 +- .../org/jetbrains/kotlin/psi/KtEnumEntry.java | 7 +- .../jetbrains/kotlin/psi/KtForExpression.java | 4 +- .../kotlin/psi/KtInitializerList.java | 4 +- ...LiteralArgument.kt => KtLambdaArgument.kt} | 10 +- ...xpression.java => KtLambdaExpression.java} | 6 +- .../org/jetbrains/kotlin/psi/KtPsiFactory.kt | 16 +- .../org/jetbrains/kotlin/psi/KtPsiUtil.java | 8 +- .../kotlin/psi/KtSecondaryConstructor.kt | 2 +- ...perCall.java => KtSuperTypeCallEntry.java} | 12 +- ...oSuperClass.java => KtSuperTypeEntry.java} | 10 +- ...pecifierList.java => KtSuperTypeList.java} | 14 +- ...ecifier.java => KtSuperTypeListEntry.java} | 18 +-- .../org/jetbrains/kotlin/psi/KtVisitor.java | 22 +-- .../jetbrains/kotlin/psi/KtVisitorVoid.java | 66 ++++---- .../psi/KtVisitorVoidWithParameter.java | 70 ++++---- .../org/jetbrains/kotlin/psi/ValueArgument.kt | 4 +- .../jetbrains/kotlin/psi/createByPattern.kt | 2 +- .../jetbrains/kotlin/psi/psiUtil/ktPsiUtil.kt | 10 +- .../stubs/elements/KtStubElementTypes.java | 18 +-- .../kotlin/resolve/AnnotationChecker.kt | 10 +- .../kotlin/resolve/BindingContext.java | 6 +- .../kotlin/resolve/BodyResolver.java | 26 +-- .../kotlin/resolve/DeclarationsChecker.kt | 6 +- .../kotlin/resolve/DelegationResolver.kt | 6 +- .../kotlin/resolve/DescriptorResolver.java | 10 +- .../kotlin/resolve/LazyTopDownAnalyzer.kt | 3 +- .../kotlin/resolve/ModifiersChecker.java | 4 +- .../kotlin/resolve/VarianceChecker.kt | 2 +- .../resolve/calls/ArgumentTypeResolver.java | 13 +- .../resolve/calls/CallExpressionResolver.java | 3 +- .../kotlin/resolve/calls/CallResolver.java | 4 +- .../kotlin/resolve/calls/CallResolverUtil.kt | 2 +- .../kotlin/resolve/calls/CallTransformer.java | 2 +- .../ValueArgumentsToParametersMapper.java | 8 +- ...egyForImplicitConstructorDelegationCall.kt | 2 +- .../resolve/calls/tasks/dynamicCalls.kt | 6 +- .../kotlin/resolve/calls/util/CallMaker.java | 6 +- .../resolve/calls/util/DelegatingCall.java | 2 +- .../kotlin/resolve/calls/util/callUtil.kt | 4 +- .../AbstractPsiBasedDeclarationProvider.kt | 2 +- .../descriptors/AbstractLazyMemberScope.kt | 2 +- .../lazy/descriptors/LazyClassDescriptor.java | 2 +- .../validation/DeprecatedSymbolValidator.kt | 2 +- .../resolve/validation/OperatorValidator.kt | 2 +- .../expressions/AssignedVariablesSearcher.kt | 6 +- .../BasicExpressionTypingVisitor.java | 6 +- .../ControlStructureTypingUtils.java | 2 +- .../ControlStructureTypingVisitor.java | 10 +- ...kt => DestructuringDeclarationResolver.kt} | 12 +- .../ExpressionTypingComponents.java | 6 +- .../ExpressionTypingVisitorDispatcher.java | 4 +- .../ExpressionTypingVisitorForStatements.java | 7 +- .../expressions/FunctionsTypingVisitor.kt | 8 +- .../types/expressions/LabelResolver.java | 8 +- compiler/testData/psi/BabySteps.txt | 8 +- compiler/testData/psi/BabySteps_ERR.txt | 8 +- compiler/testData/psi/ByClauses.txt | 44 ++--- .../testData/psi/CallWithManyClosures.txt | 68 ++++---- compiler/testData/psi/CallsInWhen.txt | 6 +- compiler/testData/psi/Constructors.txt | 16 +- compiler/testData/psi/DynamicSoftKeyword.txt | 4 +- compiler/testData/psi/EmptyName.txt | 6 +- compiler/testData/psi/EnumMissingName.txt | 6 +- compiler/testData/psi/EnumShortCommas.txt | 6 +- .../testData/psi/EnumShortWithOverload.txt | 6 +- compiler/testData/psi/Enums.txt | 6 +- compiler/testData/psi/ForWithMultiDecl.txt | 110 ++++++------- compiler/testData/psi/FunctionCalls.txt | 22 +-- compiler/testData/psi/FunctionExpressions.txt | 12 +- compiler/testData/psi/FunctionLiterals.txt | 16 +- .../testData/psi/FunctionLiterals_ERR.txt | 84 +++++----- .../psi/IncompleteFunctionLiteral.txt | 2 +- compiler/testData/psi/Labels.txt | 8 +- .../psi/MultiVariableDeclarations.txt | 150 +++++++++--------- .../testData/psi/NewlinesInParentheses.txt | 8 +- .../psi/NonTypeBeforeDotInBaseClass.txt | 4 +- .../testData/psi/ObjectLiteralAsStatement.txt | 4 +- compiler/testData/psi/SimpleClassMembers.txt | 36 ++--- compiler/testData/psi/SimpleExpressions.txt | 4 +- compiler/testData/psi/SoftKeywords.txt | 4 +- compiler/testData/psi/StringTemplates.txt | 16 +- compiler/testData/psi/TripleDot.txt | 2 +- compiler/testData/psi/When.txt | 2 +- .../psi/annotation/TypeAnnotations.txt | 10 +- .../at/annotationValueArgumentsAmbiguity.txt | 4 +- .../psi/annotation/at/enumEntries.txt | 6 +- .../psi/annotation/at/primaryConstructor.txt | 4 +- .../psi/annotation/at/validExpressions.txt | 2 +- .../testData/psi/annotation/forParameters.txt | 24 +-- compiler/testData/psi/annotation/lambda.txt | 28 ++-- .../psi/annotation/lambdaRecovery.txt | 32 ++-- .../modifiersMigration/newModifiers.txt | 8 +- .../psi/annotation/multiDeclaration.txt | 24 +-- .../psi/annotation/oldAnnotationsRecovery.txt | 2 +- .../annotation/targeted/onParam/recovery.txt | 4 +- .../psi/examples/AnonymousObjects.txt | 4 +- compiler/testData/psi/examples/BinaryTree.txt | 8 +- compiler/testData/psi/examples/BitArith.txt | 4 +- compiler/testData/psi/examples/Builder.txt | 28 ++-- compiler/testData/psi/examples/Color.txt | 6 +- .../psi/examples/FunctionsAndTypes.txt | 8 +- compiler/testData/psi/examples/Graph.txt | 24 +-- compiler/testData/psi/examples/LINQ.txt | 6 +- compiler/testData/psi/examples/Queue.txt | 4 +- compiler/testData/psi/examples/Stack.txt | 4 +- compiler/testData/psi/examples/With.txt | 6 +- .../psi/examples/array/MutableArray.txt | 14 +- .../psi/examples/collections/ArrayList.txt | 8 +- .../psi/examples/collections/HashMap.txt | 24 +-- .../psi/examples/collections/IList.txt | 6 +- .../examples/collections/IMutableIterable.txt | 4 +- .../examples/collections/IMutableIterator.txt | 4 +- .../psi/examples/collections/IMutableList.txt | 6 +- .../psi/examples/collections/IMutableSet.txt | 6 +- .../psi/examples/collections/ISet.txt | 6 +- .../psi/examples/collections/LinkedList.txt | 4 +- .../testData/psi/examples/io/IOSamples.txt | 16 +- .../examples/priorityqueues/BinaryHeap.txt | 4 +- .../priorityqueues/PriorityQueueAsPushPop.txt | 4 +- .../testData/psi/examples/util/Comparison.txt | 2 +- ...ropertiesWithFunctionReceiversRecovery.txt | 2 +- .../greatSyntacticShift/functionLiterals.txt | 18 +-- compiler/testData/psi/newLabels/basic.txt | 8 +- .../psi/newLabels/oldSyntaxExpressions.txt | 4 +- compiler/testData/psi/newLabels/recovery.txt | 10 +- .../nestedClassAmbiguity.txt | 8 +- .../psi/primaryConstructor/recovery.txt | 8 +- .../recoveryNestedClassAmbiguity.txt | 4 +- .../testData/psi/primaryConstructor/valid.txt | 6 +- .../propertyDelegate/BracketsInDelegate.txt | 4 +- .../psi/recovery/BrokenFunctionSuperType.txt | 4 +- .../InvalidCharInSingleLineLambda.txt | 4 +- .../recovery/SameLineStatementRecovery.txt | 2 +- .../WithWithoutInAndMultideclaration.txt | 6 +- compiler/testData/psi/recovery/kt5102.txt | 4 +- .../declarations/ConstructorModifiers.txt | 4 +- .../objects/declarations/EmptyParentheses.txt | 4 +- .../objects/declarations/Everything.txt | 6 +- .../declarations/ParametersInParentheses.txt | 4 +- .../TypeParametersAndParentheses.txt | 4 +- .../objects/declarations/TypeParameterss.txt | 4 +- .../recovery/objects/declarations/Where.txt | 12 +- .../expressions/ConstructorModifiers.txt | 4 +- .../ConstructorModifiersAndName.txt | 4 +- .../objects/expressions/EmptyParentheses.txt | 4 +- .../objects/expressions/Everything.txt | 6 +- .../objects/expressions/InFunction.txt | 4 +- .../expressions/ParametersInParentheses.txt | 4 +- .../TypeParametersAndParentheses.txt | 4 +- .../objects/expressions/TypeParameterss.txt | 4 +- .../recovery/objects/expressions/Where.txt | 12 +- .../unnamedParameter/firstInLambda.txt | 2 +- .../unnamedParameter/secondInLambda.txt | 2 +- .../psi/secondaryConstructors/enumParsing.txt | 4 +- ...ctionDescriptorInExpressionRendererTest.kt | 8 +- .../idea/util/ShadowedDeclarationsFilter.kt | 2 +- .../org/jetbrains/kotlin/idea/util/Utils.kt | 2 +- .../resolve/lazy/PartialBodyResolveFilter.kt | 2 +- .../idea/caches/resolve/KotlinResolveCache.kt | 4 +- .../stubBuilder/ClassClsStubBuilder.kt | 10 +- .../findUsages/KotlinFindUsagesProvider.kt | 2 +- .../kotlin/idea/findUsages/UsageTypeUtils.kt | 10 +- .../FunctionsHighlightingVisitor.java | 4 +- .../KotlinSuppressableWarningProblemGroup.kt | 8 +- .../SoftKeywordsHighlightingVisitor.java | 6 +- .../intentions/OperatorToFunctionIntention.kt | 6 +- .../idea/project/ResolveElementCache.kt | 16 +- .../references/KotlinReferenceContributor.kt | 4 +- ...=> KtDestructuringDeclarationReference.kt} | 8 +- .../references/KtInvokeFunctionReference.java | 6 +- .../kotlin/idea/references/referenceUtil.kt | 2 +- .../kotlin/idea/search/usagesSearch/utils.kt | 4 +- .../UnfocusedPossibleFunctionParameter.java | 4 +- .../smart/SmartCompletionSession.kt | 6 +- .../kotlin/idea/core/ExpectedInfos.kt | 10 +- .../org/jetbrains/kotlin/idea/core/Utils.kt | 2 +- .../kotlin/idea/core/psiModificationUtils.kt | 16 +- ...otlinGenerateSecondaryConstructorAction.kt | 2 +- .../KotlinFunctionLiteralSurrounder.java | 2 +- .../unwrap/KotlinLambdaUnwrapper.java | 10 +- .../upDownMover/KotlinExpressionMover.java | 4 +- .../KotlinFrameExtraVariablesProvider.kt | 2 +- .../extractFunctionForDebuggerUtil.kt | 2 +- .../stepping/KotlinSmartStepIntoHandler.kt | 6 +- .../stepping/KotlinSteppingCommandProvider.kt | 4 +- .../editor/fixers/KotlinForConditionFixer.kt | 2 +- .../KotlinDeclarationSelectioner.kt | 6 +- .../KotlinElementDescriptionProvider.kt | 2 +- .../kotlin/idea/formatter/KotlinBlock.java | 6 +- .../idea/formatter/kotlinSpacingRules.kt | 10 +- .../KotlinCalleeMethodsTreeStructure.java | 2 +- .../inspections/EqualsOrHashCodeInspection.kt | 2 +- .../RedundantSamConstructorInspection.kt | 2 +- .../intentions/AddForLoopIndicesIntention.kt | 4 +- .../intentions/AddNameToArgumentIntention.kt | 4 +- .../ConvertAssertToIfWithThrowIntention.kt | 10 +- .../ConvertForEachToForLoopIntention.kt | 6 +- .../InfixCallToOrdinaryIntention.kt | 2 +- .../MoveLambdaInsideParenthesesIntention.kt | 10 +- .../MoveLambdaOutsideParenthesesIntention.kt | 2 +- .../ObjectLiteralToLambdaIntention.kt | 4 +- ...veExplicitLambdaParameterTypesIntention.kt | 8 +- .../RemoveForLoopIndicesIntention.kt | 4 +- ...thExplicitFunctionLiteralParamIntention.kt | 2 +- ...SpecifyExplicitLambdaSignatureIntention.kt | 8 +- .../UsePropertyAccessSyntaxIntention.kt | 2 +- .../ReplaceContainsIntention.kt | 2 +- .../KotlinFunctionParameterInfoHandler.kt | 4 +- .../ChangeFunctionLiteralReturnTypeFix.java | 8 +- .../quickfix/ChangeFunctionReturnTypeFix.java | 8 +- .../idea/quickfix/ChangeVariableTypeFix.java | 4 +- .../kotlin/idea/quickfix/QuickFixRegistrar.kt | 4 +- .../idea/quickfix/RemoveSupertypeFix.java | 12 +- .../idea/quickfix/SuperClassNotInitialized.kt | 16 +- .../callableBuilder/CallableBuilder.kt | 4 +- .../callableBuilder/typeUtils.kt | 2 +- .../CreateComponentFunctionActionFactory.kt | 12 +- ...structorFromSuperTypeCallActionFactory.kt} | 11 +- .../CreateIteratorFunctionActionFactory.kt | 2 +- .../CreateNextFunctionActionFactory.kt | 2 +- ...mCallWithConstructorCalleeActionFactory.kt | 6 +- ...eateClassFromTypeReferenceActionFactory.kt | 4 +- .../CreateParameterByRefActionFactory.kt | 4 +- .../CallableUsageReplacementStrategy.kt | 10 +- .../KotlinRefactoringSupportProvider.kt | 2 +- .../KotlinChangeSignatureHandler.kt | 2 +- .../KotlinChangeSignatureUsageProcessor.kt | 10 +- .../changeSignature/changeSignatureUtils.kt | 4 +- .../usages/KotlinCallableDefinitionUsage.kt | 2 +- .../KotlinConstructorDelegationCallUsage.kt | 2 +- .../KotlinEnumEntryWithoutSuperCallUsage.kt | 2 +- .../usages/KotlinFunctionCallUsage.kt | 16 +- .../inline/KotlinInlineValHandler.kt | 6 +- .../ExtractableCodeDescriptor.kt | 2 +- .../extractableAnalysisUtil.kt | 2 +- .../extractionEngine/extractorUtil.kt | 4 +- .../extractionEngine/inferParameterInfo.kt | 2 +- .../KotlinIntroduceParameterHandler.kt | 6 +- .../KotlinIntroduceVariableHandler.kt | 12 +- .../idea/refactoring/jetRefactoringUtil.kt | 4 +- .../memberInfo/KotlinMemberInfoStorage.kt | 4 +- .../MoveJavaInnerClassKotlinUsagesHandler.kt | 2 +- .../JavaToKotlinPreconversionPullUpHelper.kt | 2 +- .../refactoring/pullUp/KotlinPullUpHelper.kt | 14 +- .../idea/refactoring/pullUp/pullUpUtils.kt | 16 +- .../pushDown/KotlinPushDownProcessor.kt | 8 +- .../KotlinJavaSafeDeleteDelegate.kt | 2 +- .../KotlinCreateTestIntention.kt | 2 +- .../kotlin/idea/util/DebuggerUtils.kt | 6 +- .../psi/patternMatching/KotlinPsiUnifier.kt | 13 +- idea/testData/decompiler/builtIns/Int.stubs | 10 +- .../AnnotationClass/AnnotationClass.txt | 4 +- .../stubBuilder/ClassObject/ClassObject.txt | 8 +- .../stubBuilder/Delegation/Delegation.txt | 4 +- .../DependencyOnNestedClasses.txt | 4 +- .../decompiler/stubBuilder/Enum/Enum.txt | 4 +- .../InheritingClasses/InheritingClasses.txt | 50 +++--- .../stubBuilder/Modifiers/Modifiers.txt | 4 +- .../NamedCompanionObject.txt | 8 +- .../stubBuilder/Objects/Objects.txt | 8 +- .../decompiler/stubBuilder/Sealed/Sealed.txt | 8 +- .../TypeBoundsAndDelegationSpecifiers.txt | 6 +- idea/testData/stubs/AnonymousObject.expected | 6 +- idea/testData/stubs/LocalClass.expected | 6 +- .../stubs/LocalClassInLocalFunction.expected | 6 +- idea/testData/stubs/LocalNamedObject.expected | 6 +- idea/testData/stubs/NamedObject.expected | 6 +- .../search/KotlinReferencesSearchTest.kt | 4 +- .../declaration/DelegationTranslator.kt | 12 +- ...> DestructuringDeclarationTranslator.java} | 18 +-- .../expression/ExpressionVisitor.java | 6 +- .../expression/FunctionTranslator.java | 4 +- .../js/translate/expression/LoopTranslator.kt | 14 +- .../ClassInitializerTranslator.java | 6 +- 302 files changed, 1375 insertions(+), 1391 deletions(-) rename compiler/frontend/src/org/jetbrains/kotlin/psi/{KtDelegatorByExpressionSpecifier.java => KtDelegatedSuperTypeEntry.java} (74%) rename compiler/frontend/src/org/jetbrains/kotlin/psi/{KtMultiDeclaration.java => KtDestructuringDeclaration.java} (82%) rename compiler/frontend/src/org/jetbrains/kotlin/psi/{KtMultiDeclarationEntry.java => KtDestructuringDeclarationEntry.java} (91%) rename compiler/frontend/src/org/jetbrains/kotlin/psi/{KtFunctionLiteralArgument.kt => KtLambdaArgument.kt} (72%) rename compiler/frontend/src/org/jetbrains/kotlin/psi/{KtFunctionLiteralExpression.java => KtLambdaExpression.java} (90%) rename compiler/frontend/src/org/jetbrains/kotlin/psi/{KtDelegatorToSuperCall.java => KtSuperTypeCallEntry.java} (83%) rename compiler/frontend/src/org/jetbrains/kotlin/psi/{KtDelegatorToSuperClass.java => KtSuperTypeEntry.java} (72%) rename compiler/frontend/src/org/jetbrains/kotlin/psi/{KtDelegationSpecifierList.java => KtSuperTypeList.java} (66%) rename compiler/frontend/src/org/jetbrains/kotlin/psi/{KtDelegationSpecifier.java => KtSuperTypeListEntry.java} (71%) rename compiler/frontend/src/org/jetbrains/kotlin/types/expressions/{MultiDeclarationResolver.kt => DestructuringDeclarationResolver.kt} (90%) rename idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/{KtMultiDeclarationReference.kt => KtDestructuringDeclarationReference.kt} (91%) rename idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/{CreateConstructorFromDelegatorToSuperCallActionFactory.kt => CreateConstructorFromSuperTypeCallActionFactory.kt} (86%) rename js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/{MultiDeclarationTranslator.java => DestructuringDeclarationTranslator.java} (84%) diff --git a/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtil.java b/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtil.java index b54214d2f82..6bc3e95e586 100644 --- a/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtil.java +++ b/compiler/backend-common/src/org/jetbrains/kotlin/backend/common/CodegenUtil.java @@ -140,7 +140,7 @@ public class CodegenUtil { } @NotNull - public static ClassDescriptor getSuperClassByDelegationSpecifier(@NotNull KtDelegationSpecifier specifier, @NotNull BindingContext bindingContext) { + public static ClassDescriptor getSuperClassBySuperTypeListEntry(@NotNull KtSuperTypeListEntry specifier, @NotNull BindingContext bindingContext) { KotlinType superType = bindingContext.get(BindingContext.TYPE, specifier.getTypeReference()); assert superType != null : "superType should not be null: " + specifier.getText(); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java index ff4ea930d68..8e94f5ed02b 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ExpressionCodegen.java @@ -668,7 +668,7 @@ public class ExpressionCodegen extends KtVisitor impleme }); } else { - KtMultiDeclaration multiParameter = forExpression.getMultiParameter(); + KtDestructuringDeclaration multiParameter = forExpression.getDestructuringParameter(); assert multiParameter != null; // E tmp = tmp.next() @@ -686,15 +686,15 @@ public class ExpressionCodegen extends KtVisitor impleme assignToLoopParameter(); if (forExpression.getLoopParameter() == null) { - KtMultiDeclaration multiParameter = forExpression.getMultiParameter(); + KtDestructuringDeclaration multiParameter = forExpression.getDestructuringParameter(); assert multiParameter != null; generateMultiVariables(multiParameter.getEntries()); } } - private void generateMultiVariables(List entries) { - for (KtMultiDeclarationEntry variableDeclaration : entries) { + private void generateMultiVariables(List entries) { + for (KtDestructuringDeclarationEntry variableDeclaration : entries) { final VariableDescriptor componentDescriptor = bindingContext.get(VARIABLE, variableDeclaration); @SuppressWarnings("ConstantConditions") final Type componentAsmType = asmType(componentDescriptor.getReturnType()); @@ -1331,7 +1331,7 @@ public class ExpressionCodegen extends KtVisitor impleme } @Override - public StackValue visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression, StackValue receiver) { + public StackValue visitLambdaExpression(@NotNull KtLambdaExpression expression, StackValue receiver) { if (Boolean.TRUE.equals(bindingContext.get(BLOCK, expression))) { return gen(expression.getFunctionLiteral().getBodyExpression()); } @@ -1568,9 +1568,9 @@ public class ExpressionCodegen extends KtVisitor impleme private void putDescriptorIntoFrameMap(@NotNull KtElement statement) { - if (statement instanceof KtMultiDeclaration) { - KtMultiDeclaration multiDeclaration = (KtMultiDeclaration) statement; - for (KtMultiDeclarationEntry entry : multiDeclaration.getEntries()) { + if (statement instanceof KtDestructuringDeclaration) { + KtDestructuringDeclaration multiDeclaration = (KtDestructuringDeclaration) statement; + for (KtDestructuringDeclarationEntry entry : multiDeclaration.getEntries()) { putLocalVariableIntoFrameMap(entry); } } @@ -1608,9 +1608,9 @@ public class ExpressionCodegen extends KtVisitor impleme @NotNull Label blockEnd, @NotNull List> leaveTasks ) { - if (statement instanceof KtMultiDeclaration) { - KtMultiDeclaration multiDeclaration = (KtMultiDeclaration) statement; - for (KtMultiDeclarationEntry entry : multiDeclaration.getEntries()) { + if (statement instanceof KtDestructuringDeclaration) { + KtDestructuringDeclaration multiDeclaration = (KtDestructuringDeclaration) statement; + for (KtDestructuringDeclarationEntry entry : multiDeclaration.getEntries()) { addLeaveTaskToRemoveLocalVariableFromFrameMap(entry, blockEnd, leaveTasks); } } @@ -2250,8 +2250,8 @@ public class ExpressionCodegen extends KtVisitor impleme final SamType samType = bindingContext.get(SAM_VALUE, probablyParenthesizedExpression); if (samType == null || expression == null) return null; - if (expression instanceof KtFunctionLiteralExpression) { - return genClosure(((KtFunctionLiteralExpression) expression).getFunctionLiteral(), samType); + if (expression instanceof KtLambdaExpression) { + return genClosure(((KtLambdaExpression) expression).getFunctionLiteral(), samType); } if (expression instanceof KtNamedFunction) { @@ -3274,7 +3274,7 @@ public class ExpressionCodegen extends KtVisitor impleme } @Override - public StackValue visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, StackValue receiver) { + public StackValue visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, StackValue receiver) { KtExpression initializer = multiDeclaration.getInitializer(); if (initializer == null) return StackValue.none(); @@ -3291,7 +3291,7 @@ public class ExpressionCodegen extends KtVisitor impleme v.store(tempVarIndex, initializerAsmType); StackValue.Local local = StackValue.local(tempVarIndex, initializerAsmType); - for (KtMultiDeclarationEntry variableDeclaration : multiDeclaration.getEntries()) { + for (KtDestructuringDeclarationEntry variableDeclaration : multiDeclaration.getEntries()) { ResolvedCall resolvedCall = bindingContext.get(COMPONENT_RESOLVED_CALL, variableDeclaration); assert resolvedCall != null : "Resolved call is null for " + variableDeclaration.getText(); Call call = makeFakeCall(initializerAsReceiver); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java index c0a97f8e6f9..c777d4f733e 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/ImplementationBodyCodegen.java @@ -371,7 +371,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { generateCompanionObjectBackingFieldCopies(); - DelegationFieldsInfo delegationFieldsInfo = getDelegationFieldsInfo(myClass.getDelegationSpecifiers()); + DelegationFieldsInfo delegationFieldsInfo = getDelegationFieldsInfo(myClass.getSuperTypeListEntries()); try { lookupConstructorExpressionsInClosureIfPresent(); generatePrimaryConstructor(delegationFieldsInfo); @@ -1012,9 +1012,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { } } - for (KtDelegationSpecifier specifier : myClass.getDelegationSpecifiers()) { - if (specifier instanceof KtDelegatorByExpressionSpecifier) { - genCallToDelegatorByExpressionSpecifier(iv, codegen, (KtDelegatorByExpressionSpecifier) specifier, fieldsInfo); + for (KtSuperTypeListEntry specifier : myClass.getSuperTypeListEntries()) { + if (specifier instanceof KtDelegatedSuperTypeEntry) { + genCallToDelegatorByExpressionSpecifier(iv, codegen, (KtDelegatedSuperTypeEntry) specifier, fieldsInfo); } } @@ -1153,41 +1153,41 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { return StackValue.field(type, classAsmType, name, false, StackValue.none()); } } - private final Map fields = new HashMap(); + private final Map fields = new HashMap(); @NotNull - public Field getInfo(KtDelegatorByExpressionSpecifier specifier) { + public Field getInfo(KtDelegatedSuperTypeEntry specifier) { return fields.get(specifier); } - private void addField(KtDelegatorByExpressionSpecifier specifier, PropertyDescriptor propertyDescriptor) { + private void addField(KtDelegatedSuperTypeEntry specifier, PropertyDescriptor propertyDescriptor) { fields.put(specifier, new Field(typeMapper.mapType(propertyDescriptor), propertyDescriptor.getName().asString(), false)); } - private void addField(KtDelegatorByExpressionSpecifier specifier, Type type, String name) { + private void addField(KtDelegatedSuperTypeEntry specifier, Type type, String name) { fields.put(specifier, new Field(type, name, true)); } } @NotNull - private DelegationFieldsInfo getDelegationFieldsInfo(@NotNull List delegationSpecifiers) { + private DelegationFieldsInfo getDelegationFieldsInfo(@NotNull List delegationSpecifiers) { DelegationFieldsInfo result = new DelegationFieldsInfo(); int n = 0; - for (KtDelegationSpecifier specifier : delegationSpecifiers) { - if (specifier instanceof KtDelegatorByExpressionSpecifier) { - KtExpression expression = ((KtDelegatorByExpressionSpecifier) specifier).getDelegateExpression(); + for (KtSuperTypeListEntry specifier : delegationSpecifiers) { + if (specifier instanceof KtDelegatedSuperTypeEntry) { + KtExpression expression = ((KtDelegatedSuperTypeEntry) specifier).getDelegateExpression(); PropertyDescriptor propertyDescriptor = CodegenUtil.getDelegatePropertyIfAny(expression, descriptor, bindingContext); if (CodegenUtil.isFinalPropertyWithBackingField(propertyDescriptor, bindingContext)) { - result.addField((KtDelegatorByExpressionSpecifier) specifier, propertyDescriptor); + result.addField((KtDelegatedSuperTypeEntry) specifier, propertyDescriptor); } else { KotlinType expressionType = expression != null ? bindingContext.getType(expression) : null; Type asmType = expressionType != null ? typeMapper.mapType(expressionType) : typeMapper.mapType(getSuperClass(specifier)); - result.addField((KtDelegatorByExpressionSpecifier) specifier, asmType, "$delegate_" + n); + result.addField((KtDelegatedSuperTypeEntry) specifier, asmType, "$delegate_" + n); } n++; } @@ -1196,14 +1196,14 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { } @NotNull - private ClassDescriptor getSuperClass(@NotNull KtDelegationSpecifier specifier) { - return CodegenUtil.getSuperClassByDelegationSpecifier(specifier, bindingContext); + private ClassDescriptor getSuperClass(@NotNull KtSuperTypeListEntry specifier) { + return CodegenUtil.getSuperClassBySuperTypeListEntry(specifier, bindingContext); } private void genCallToDelegatorByExpressionSpecifier( InstructionAdapter iv, ExpressionCodegen codegen, - KtDelegatorByExpressionSpecifier specifier, + KtDelegatedSuperTypeEntry specifier, DelegationFieldsInfo fieldsInfo ) { KtExpression expression = specifier.getDelegateExpression(); @@ -1303,9 +1303,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { } } - for (KtDelegationSpecifier specifier : myClass.getDelegationSpecifiers()) { - if (specifier instanceof KtDelegatorByExpressionSpecifier) { - KtExpression delegateExpression = ((KtDelegatorByExpressionSpecifier) specifier).getDelegateExpression(); + for (KtSuperTypeListEntry specifier : myClass.getSuperTypeListEntries()) { + if (specifier instanceof KtDelegatedSuperTypeEntry) { + KtExpression delegateExpression = ((KtDelegatedSuperTypeEntry) specifier).getDelegateExpression(); assert delegateExpression != null; delegateExpression.accept(visitor); } @@ -1620,7 +1620,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { iv.aconst(enumEntry.getName()); iv.iconst(ordinal); - List delegationSpecifiers = enumEntry.getDelegationSpecifiers(); + List delegationSpecifiers = enumEntry.getSuperTypeListEntries(); if (delegationSpecifiers.size() == 1 && !enumEntryNeedSubclass(bindingContext, enumEntry)) { ResolvedCall resolvedCall = CallUtilKt.getResolvedCallWithAssert(delegationSpecifiers.get(0), bindingContext); @@ -1638,11 +1638,11 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { } private void generateDelegates(DelegationFieldsInfo delegationFieldsInfo) { - for (KtDelegationSpecifier specifier : myClass.getDelegationSpecifiers()) { - if (specifier instanceof KtDelegatorByExpressionSpecifier) { - DelegationFieldsInfo.Field field = delegationFieldsInfo.getInfo((KtDelegatorByExpressionSpecifier) specifier); + for (KtSuperTypeListEntry specifier : myClass.getSuperTypeListEntries()) { + if (specifier instanceof KtDelegatedSuperTypeEntry) { + DelegationFieldsInfo.Field field = delegationFieldsInfo.getInfo((KtDelegatedSuperTypeEntry) specifier); generateDelegateField(field); - KtExpression delegateExpression = ((KtDelegatorByExpressionSpecifier) specifier).getDelegateExpression(); + KtExpression delegateExpression = ((KtDelegatedSuperTypeEntry) specifier).getDelegateExpression(); KotlinType delegateExpressionType = delegateExpression != null ? bindingContext.getType(delegateExpression) : null; generateDelegates(getSuperClass(specifier), delegateExpressionType, field); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java index 5962b5dfdab..131076aa263 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/binding/CodegenAnnotatingVisitor.java @@ -129,7 +129,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { if (element instanceof KtObjectDeclaration && element.getParent() instanceof KtObjectLiteralExpression && - child instanceof KtDelegationSpecifierList) { + child instanceof KtSuperTypeList) { // If we're passing an anonymous object's super call, it means "container" is ConstructorDescriptor of that object. // To reach outer context, we should call getContainingDeclaration() twice // TODO: this is probably not entirely correct, mostly because DECLARATION_TO_DESCRIPTOR can return null @@ -178,7 +178,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { @Override public void visitEnumEntry(@NotNull KtEnumEntry enumEntry) { if (enumEntry.getDeclarations().isEmpty()) { - for (KtDelegationSpecifier specifier : enumEntry.getDelegationSpecifiers()) { + for (KtSuperTypeListEntry specifier : enumEntry.getSuperTypeListEntries()) { specifier.accept(this); } return; @@ -248,7 +248,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { String name = inventAnonymousClassName(); recordClosure(classDescriptor, name); - KtDelegationSpecifierList delegationSpecifierList = object.getDelegationSpecifierList(); + KtSuperTypeList delegationSpecifierList = object.getSuperTypeList(); if (delegationSpecifierList != null) { delegationSpecifierList.accept(this); } @@ -264,8 +264,8 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { } @Override - public void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression) { - KtFunctionLiteral functionLiteral = expression.getFunctionLiteral(); + public void visitLambdaExpression(@NotNull KtLambdaExpression lambdaExpression) { + KtFunctionLiteral functionLiteral = lambdaExpression.getFunctionLiteral(); FunctionDescriptor functionDescriptor = (FunctionDescriptor) bindingContext.get(DECLARATION_TO_DESCRIPTOR, functionLiteral); // working around a problem with shallow analysis @@ -278,7 +278,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { classStack.push(classDescriptor); nameStack.push(name); - super.visitFunctionLiteralExpression(expression); + super.visitLambdaExpression(lambdaExpression); nameStack.pop(); classStack.pop(); } @@ -432,8 +432,8 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid { } @Override - public void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call) { - super.visitDelegationToSuperCallSpecifier(call); + public void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call) { + super.visitSuperTypeCallEntry(call); checkSamCall(call); } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java index 66afead1e32..b76bf6dd20c 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/InlineCodegen.java @@ -546,7 +546,7 @@ public class InlineCodegen extends CallGenerator { } protected static boolean isInlinableParameterExpression(KtExpression deparenthesized) { - return deparenthesized instanceof KtFunctionLiteralExpression || + return deparenthesized instanceof KtLambdaExpression || deparenthesized instanceof KtNamedFunction || deparenthesized instanceof KtCallableReferenceExpression; } diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/LambdaInfo.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/LambdaInfo.java index 06a44169673..02655cfbb8c 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/LambdaInfo.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/inline/LambdaInfo.java @@ -25,7 +25,7 @@ import org.jetbrains.kotlin.codegen.state.JetTypeMapper; import org.jetbrains.kotlin.descriptors.ClassDescriptor; import org.jetbrains.kotlin.descriptors.FunctionDescriptor; import org.jetbrains.kotlin.psi.KtExpression; -import org.jetbrains.kotlin.psi.KtFunctionLiteralExpression; +import org.jetbrains.kotlin.psi.KtLambdaExpression; import org.jetbrains.kotlin.resolve.BindingContext; import org.jetbrains.kotlin.resolve.jvm.AsmTypes; import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature; @@ -61,8 +61,8 @@ public class LambdaInfo implements CapturedParamOwner, LabelOwner { private final Type closureClassType; LambdaInfo(@NotNull KtExpression expr, @NotNull JetTypeMapper typeMapper) { - this.expression = expr instanceof KtFunctionLiteralExpression ? - ((KtFunctionLiteralExpression) expr).getFunctionLiteral() : expr; + this.expression = expr instanceof KtLambdaExpression ? + ((KtLambdaExpression) expr).getFunctionLiteral() : expr; this.typeMapper = typeMapper; BindingContext bindingContext = typeMapper.getBindingContext(); diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java index 5ae570ccc4e..2ed5616d206 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/state/JetTypeMapper.java @@ -49,7 +49,7 @@ import org.jetbrains.kotlin.platform.JavaToKotlinClassMap; import org.jetbrains.kotlin.psi.KtExpression; import org.jetbrains.kotlin.psi.KtFile; import org.jetbrains.kotlin.psi.KtFunctionLiteral; -import org.jetbrains.kotlin.psi.KtFunctionLiteralExpression; +import org.jetbrains.kotlin.psi.KtLambdaExpression; import org.jetbrains.kotlin.resolve.*; import org.jetbrains.kotlin.resolve.annotations.AnnotationUtilKt; import org.jetbrains.kotlin.resolve.calls.model.DefaultValueArgument; @@ -898,7 +898,7 @@ public class JetTypeMapper { PsiElement element = DescriptorToSourceUtils.getSourceFromDescriptor(descriptor); if (element instanceof KtFunctionLiteral) { PsiElement expression = element.getParent(); - if (expression instanceof KtFunctionLiteralExpression) { + if (expression instanceof KtLambdaExpression) { SamType samType = bindingContext.get(SAM_VALUE, (KtExpression) expression); if (samType != null) { return samType.getAbstractMethod().getName().asString(); diff --git a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/JvmSimpleNameBacktickChecker.kt b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/JvmSimpleNameBacktickChecker.kt index 94101074598..7757bf36fd4 100644 --- a/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/JvmSimpleNameBacktickChecker.kt +++ b/compiler/frontend.java/src/org/jetbrains/kotlin/resolve/jvm/checkers/JvmSimpleNameBacktickChecker.kt @@ -33,7 +33,7 @@ object JvmSimpleNameBacktickChecker : IdentifierChecker { } override fun checkDeclaration(declaration: KtDeclaration, diagnosticHolder: DiagnosticSink) { - if (declaration is KtMultiDeclaration) { + if (declaration is KtDestructuringDeclaration) { declaration.entries.forEach { checkNamed(it, diagnosticHolder) } } if (declaration is KtCallableDeclaration) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java b/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java index 98a71dfa4db..81a0b07ae39 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/KtNodeTypes.java @@ -28,8 +28,8 @@ public interface KtNodeTypes { IElementType CLASS = KtStubElementTypes.CLASS; IElementType FUN = KtStubElementTypes.FUNCTION; IElementType PROPERTY = KtStubElementTypes.PROPERTY; - IElementType MULTI_VARIABLE_DECLARATION = new KtNodeType("MULTI_VARIABLE_DECLARATION", KtMultiDeclaration.class); - IElementType MULTI_VARIABLE_DECLARATION_ENTRY = new KtNodeType("MULTI_VARIABLE_DECLARATION_ENTRY", KtMultiDeclarationEntry.class); + IElementType DESTRUCTURING_DECLARATION = new KtNodeType("DESTRUCTURING_DECLARATION", KtDestructuringDeclaration.class); + IElementType DESTRUCTURING_DECLARATION_ENTRY = new KtNodeType("DESTRUCTURING_DECLARATION_ENTRY", KtDestructuringDeclarationEntry.class); KtNodeType TYPEDEF = new KtNodeType("TYPEDEF", KtTypedef.class); IElementType OBJECT_DECLARATION = KtStubElementTypes.OBJECT_DECLARATION; @@ -42,10 +42,10 @@ public interface KtNodeTypes { IElementType TYPE_PARAMETER_LIST = KtStubElementTypes.TYPE_PARAMETER_LIST; IElementType TYPE_PARAMETER = KtStubElementTypes.TYPE_PARAMETER; - IElementType DELEGATION_SPECIFIER_LIST = KtStubElementTypes.DELEGATION_SPECIFIER_LIST; - IElementType DELEGATOR_BY = KtStubElementTypes.DELEGATOR_BY; - IElementType DELEGATOR_SUPER_CALL = KtStubElementTypes.DELEGATOR_SUPER_CALL; - IElementType DELEGATOR_SUPER_CLASS = KtStubElementTypes.DELEGATOR_SUPER_CLASS; + IElementType SUPER_TYPE_LIST = KtStubElementTypes.SUPER_TYPE_LIST; + IElementType DELEGATED_SUPER_TYPE_ENTRY = KtStubElementTypes.DELEGATED_SUPER_TYPE_ENTRY; + IElementType SUPER_TYPE_CALL_ENTRY = KtStubElementTypes.SUPER_TYPE_CALL_ENTRY; + IElementType SUPER_TYPE_ENTRY = KtStubElementTypes.SUPER_TYPE_ENTRY; KtNodeType PROPERTY_DELEGATE = new KtNodeType("PROPERTY_DELEGATE", KtPropertyDelegate.class); IElementType CONSTRUCTOR_CALLEE = KtStubElementTypes.CONSTRUCTOR_CALLEE; IElementType VALUE_PARAMETER_LIST = KtStubElementTypes.VALUE_PARAMETER_LIST; @@ -63,7 +63,7 @@ public interface KtNodeTypes { IElementType TYPE_ARGUMENT_LIST = KtStubElementTypes.TYPE_ARGUMENT_LIST; KtNodeType VALUE_ARGUMENT_LIST = new KtNodeType("VALUE_ARGUMENT_LIST", KtValueArgumentList.class); KtNodeType VALUE_ARGUMENT = new KtNodeType("VALUE_ARGUMENT", KtValueArgument.class); - KtNodeType FUNCTION_LITERAL_ARGUMENT = new KtNodeType("FUNCTION_LITERAL_ARGUMENT", KtFunctionLiteralArgument.class); + KtNodeType LAMBDA_ARGUMENT = new KtNodeType("LAMBDA_ARGUMENT", KtLambdaArgument.class); KtNodeType VALUE_ARGUMENT_NAME = new KtNodeType("VALUE_ARGUMENT_NAME", KtValueArgumentName.class); IElementType TYPE_REFERENCE = KtStubElementTypes.TYPE_REFERENCE; @@ -116,7 +116,7 @@ public interface KtNodeTypes { KtNodeType LOOP_RANGE = new KtNodeType("LOOP_RANGE", KtContainerNode.class); KtNodeType BODY = new KtNodeType("BODY", KtContainerNode.class); KtNodeType BLOCK = new KtNodeType("BLOCK", KtBlockExpression.class); - KtNodeType FUNCTION_LITERAL_EXPRESSION = new KtNodeType("FUNCTION_LITERAL_EXPRESSION", KtFunctionLiteralExpression.class); + KtNodeType LAMBDA_EXPRESSION = new KtNodeType("LAMBDA_EXPRESSION", KtLambdaExpression.class); KtNodeType FUNCTION_LITERAL = new KtNodeType("FUNCTION_LITERAL", KtFunctionLiteral.class); KtNodeType ANNOTATED_EXPRESSION = new KtNodeType("ANNOTATED_EXPRESSION", KtAnnotatedExpression.class); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/KotlinControlFlowProcessor.java b/compiler/frontend/src/org/jetbrains/kotlin/cfg/KotlinControlFlowProcessor.java index fe9d4f17188..c2ce6d6e9a4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/KotlinControlFlowProcessor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/KotlinControlFlowProcessor.java @@ -880,18 +880,18 @@ public class KotlinControlFlowProcessor { private void declareLoopParameter(KtForExpression expression) { KtParameter loopParameter = expression.getLoopParameter(); - KtMultiDeclaration multiDeclaration = expression.getMultiParameter(); + KtDestructuringDeclaration multiDeclaration = expression.getDestructuringParameter(); if (loopParameter != null) { builder.declareParameter(loopParameter); } else if (multiDeclaration != null) { - visitMultiDeclaration(multiDeclaration, false); + visitDestructuringDeclaration(multiDeclaration, false); } } private void writeLoopParameterAssignment(KtForExpression expression) { KtParameter loopParameter = expression.getLoopParameter(); - KtMultiDeclaration multiDeclaration = expression.getMultiParameter(); + KtDestructuringDeclaration multiDeclaration = expression.getDestructuringParameter(); KtExpression loopRange = expression.getLoopRange(); PseudoValue value = builder.magic( @@ -905,7 +905,7 @@ public class KotlinControlFlowProcessor { generateInitializer(loopParameter, value); } else if (multiDeclaration != null) { - for (KtMultiDeclarationEntry entry : multiDeclaration.getEntries()) { + for (KtDestructuringDeclarationEntry entry : multiDeclaration.getEntries()) { generateInitializer(entry, value); } } @@ -1079,11 +1079,11 @@ public class KotlinControlFlowProcessor { } @Override - public void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression) { - mark(expression); - KtFunctionLiteral functionLiteral = expression.getFunctionLiteral(); + public void visitLambdaExpression(@NotNull KtLambdaExpression lambdaExpression) { + mark(lambdaExpression); + KtFunctionLiteral functionLiteral = lambdaExpression.getFunctionLiteral(); visitFunction(functionLiteral); - copyValue(functionLiteral, expression); + copyValue(functionLiteral, lambdaExpression); } @Override @@ -1161,14 +1161,14 @@ public class KotlinControlFlowProcessor { } @Override - public void visitMultiDeclaration(@NotNull KtMultiDeclaration declaration) { - visitMultiDeclaration(declaration, true); + public void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration declaration) { + visitDestructuringDeclaration(declaration, true); } - private void visitMultiDeclaration(@NotNull KtMultiDeclaration declaration, boolean generateWriteForEntries) { + private void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration declaration, boolean generateWriteForEntries) { KtExpression initializer = declaration.getInitializer(); generateInstructions(initializer); - for (KtMultiDeclarationEntry entry : declaration.getEntries()) { + for (KtDestructuringDeclarationEntry entry : declaration.getEntries()) { builder.declareVariable(entry); ResolvedCall resolvedCall = trace.get(BindingContext.COMPONENT_RESOLVED_CALL, entry); @@ -1348,7 +1348,7 @@ public class KotlinControlFlowProcessor { } private void generateHeaderDelegationSpecifiers(@NotNull KtClassOrObject classOrObject) { - for (KtDelegationSpecifier specifier : classOrObject.getDelegationSpecifiers()) { + for (KtSuperTypeListEntry specifier : classOrObject.getSuperTypeListEntries()) { generateInstructions(specifier); } } @@ -1414,7 +1414,7 @@ public class KotlinControlFlowProcessor { } @Override - public void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call) { + public void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call) { generateCallOrMarkUnresolved(call); } @@ -1439,19 +1439,19 @@ public class KotlinControlFlowProcessor { } @Override - public void visitDelegationByExpressionSpecifier(@NotNull KtDelegatorByExpressionSpecifier specifier) { + public void visitDelegatedSuperTypeEntry(@NotNull KtDelegatedSuperTypeEntry specifier) { KtExpression delegateExpression = specifier.getDelegateExpression(); generateInstructions(delegateExpression); createSyntheticValue(specifier, MagicKind.VALUE_CONSUMER, delegateExpression); } @Override - public void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier) { + public void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier) { // Do not generate UNSUPPORTED_ELEMENT here } @Override - public void visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list) { + public void visitSuperTypeList(@NotNull KtSuperTypeList list) { list.acceptChildren(this); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/KotlinFlowInformationProvider.java b/compiler/frontend/src/org/jetbrains/kotlin/cfg/KotlinFlowInformationProvider.java index 356b71c927e..48874f59e08 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/KotlinFlowInformationProvider.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/KotlinFlowInformationProvider.java @@ -633,7 +633,7 @@ public class KotlinFlowInformationProvider { report(Errors.VARIABLE_WITH_REDUNDANT_INITIALIZER.on(initializer, variableDescriptor), ctxt); } } - else if (element instanceof KtMultiDeclarationEntry) { + else if (element instanceof KtDestructuringDeclarationEntry) { report(VARIABLE_WITH_REDUNDANT_INITIALIZER.on(element, variableDescriptor), ctxt); } } @@ -661,8 +661,8 @@ public class KotlinFlowInformationProvider { && PseudocodeUtilsKt.getSideEffectFree(instruction)) { VariableContext ctxt = new VariableContext(instruction, reportedDiagnosticMap); report( - element instanceof KtFunctionLiteralExpression - ? Errors.UNUSED_LAMBDA_EXPRESSION.on((KtFunctionLiteralExpression) element) + element instanceof KtLambdaExpression + ? Errors.UNUSED_LAMBDA_EXPRESSION.on((KtLambdaExpression) element) : Errors.UNUSED_EXPRESSION.on(element), ctxt ); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/KotlinControlFlowInstructionsGenerator.java b/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/KotlinControlFlowInstructionsGenerator.java index 12702325304..21aa6d04e13 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/KotlinControlFlowInstructionsGenerator.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/KotlinControlFlowInstructionsGenerator.java @@ -426,7 +426,7 @@ public class KotlinControlFlowInstructionsGenerator extends KotlinControlFlowBui @NotNull @Override public InstructionWithValue createLambda(@NotNull KtFunction expression) { - return read(expression instanceof KtFunctionLiteral ? (KtFunctionLiteralExpression) expression.getParent() : expression); + return read(expression instanceof KtFunctionLiteral ? (KtLambdaExpression) expression.getParent() : expression); } @NotNull diff --git a/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/pseudocodeUtils.kt b/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/pseudocodeUtils.kt index 663edd0492e..82cbaea888e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/pseudocodeUtils.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/cfg/pseudocode/pseudocodeUtils.kt @@ -219,7 +219,7 @@ public fun getExpectedTypePredicate( } } - element is KtDelegatorByExpressionSpecifier -> + element is KtDelegatedSuperTypeEntry -> addSubtypesOf(bindingContext[TYPE, element.getTypeReference()]) } } @@ -260,7 +260,7 @@ fun Instruction.calcSideEffectFree(): Boolean { } else -> when (element) { - is KtConstantExpression, is KtFunctionLiteralExpression, is KtStringTemplateExpression -> true + is KtConstantExpression, is KtLambdaExpression, is KtStringTemplateExpression -> true else -> false } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/checkers/DebugInfoUtil.java b/compiler/frontend/src/org/jetbrains/kotlin/checkers/DebugInfoUtil.java index cd9d277b204..b63a3afeb99 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/checkers/DebugInfoUtil.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/checkers/DebugInfoUtil.java @@ -106,11 +106,11 @@ public class DebugInfoUtil { } @Override - public void visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration) { - for (KtMultiDeclarationEntry entry : multiDeclaration.getEntries()) { + public void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration destructuringDeclaration) { + for (KtDestructuringDeclarationEntry entry : destructuringDeclaration.getEntries()) { reportIfDynamicCall(entry, entry, COMPONENT_RESOLVED_CALL); } - super.visitMultiDeclaration(multiDeclaration); + super.visitDestructuringDeclaration(destructuringDeclaration); } @Override diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java index 76c73f03667..272c0dd4140 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/Errors.java @@ -78,8 +78,8 @@ public interface Errors { DiagnosticFactory2 EXPOSED_PARAMETER_TYPE = DiagnosticFactory2.create(ERROR); DiagnosticFactory2 EXPOSED_RECEIVER_TYPE = DiagnosticFactory2.create(ERROR); DiagnosticFactory2 EXPOSED_TYPE_PARAMETER_BOUND = DiagnosticFactory2.create(ERROR); - DiagnosticFactory2 EXPOSED_SUPER_CLASS = DiagnosticFactory2.create(ERROR); - DiagnosticFactory2 EXPOSED_SUPER_INTERFACE = DiagnosticFactory2.create(ERROR); + DiagnosticFactory2 EXPOSED_SUPER_CLASS = DiagnosticFactory2.create(ERROR); + DiagnosticFactory2 EXPOSED_SUPER_INTERFACE = DiagnosticFactory2.create(ERROR); DiagnosticFactory1> PLATFORM_CLASS_MAPPED_TO_KOTLIN = DiagnosticFactory1.create(WARNING); @@ -142,7 +142,7 @@ public interface Errors { // Annotations - DiagnosticFactory0 SUPERTYPES_FOR_ANNOTATION_CLASS = DiagnosticFactory0.create(ERROR); + DiagnosticFactory0 SUPERTYPES_FOR_ANNOTATION_CLASS = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 MISSING_VAL_ON_ANNOTATION_PARAMETER = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 ANNOTATION_CLASS_CONSTRUCTOR_CALL = DiagnosticFactory0.create(ERROR); DiagnosticFactory1 NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR); @@ -178,7 +178,7 @@ public interface Errors { DiagnosticFactory0 CYCLIC_INHERITANCE_HIERARCHY = DiagnosticFactory0.create(ERROR); - DiagnosticFactory0 SUPERTYPE_NOT_INITIALIZED = DiagnosticFactory0.create(ERROR); + DiagnosticFactory0 SUPERTYPE_NOT_INITIALIZED = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 DELEGATION_NOT_TO_INTERFACE = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 SUPERTYPE_NOT_A_CLASS_OR_INTERFACE = DiagnosticFactory0.create(ERROR); @@ -188,7 +188,7 @@ public interface Errors { DiagnosticFactory0 MANY_CLASSES_IN_SUPERTYPE_LIST = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 SUPERTYPE_APPEARS_TWICE = DiagnosticFactory0.create(ERROR); - DiagnosticFactory3> + DiagnosticFactory3> INCONSISTENT_TYPE_PARAMETER_VALUES = DiagnosticFactory3.create(ERROR); DiagnosticFactory3> INCONSISTENT_TYPE_PARAMETER_BOUNDS = DiagnosticFactory3.create(ERROR); @@ -207,7 +207,7 @@ public interface Errors { DiagnosticFactory0 CYCLIC_CONSTRUCTOR_DELEGATION_CALL = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 CONSTRUCTOR_IN_OBJECT = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE); - DiagnosticFactory0 SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR = DiagnosticFactory0.create(ERROR); + DiagnosticFactory0 SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED = DiagnosticFactory0.create(ERROR, PositioningStrategies.SECONDARY_CONSTRUCTOR_DELEGATION_CALL); @@ -231,7 +231,7 @@ public interface Errors { DiagnosticFactory0 SUPERTYPE_INITIALIZED_IN_INTERFACE = DiagnosticFactory0.create(ERROR); - DiagnosticFactory0 DELEGATION_IN_INTERFACE = DiagnosticFactory0.create(ERROR); + DiagnosticFactory0 DELEGATION_IN_INTERFACE = DiagnosticFactory0.create(ERROR); DiagnosticFactory0 INTERFACE_WITH_SUPERCLASS = DiagnosticFactory0.create(ERROR); @@ -532,7 +532,7 @@ public interface Errors { // Destructuring-declarations - DiagnosticFactory0 INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION = DiagnosticFactory0.create(ERROR, DEFAULT); + DiagnosticFactory0 INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION = DiagnosticFactory0.create(ERROR, DEFAULT); DiagnosticFactory2 COMPONENT_FUNCTION_MISSING = DiagnosticFactory2.create(ERROR, DEFAULT); DiagnosticFactory2>> COMPONENT_FUNCTION_AMBIGUITY = DiagnosticFactory2.create(ERROR, DEFAULT); DiagnosticFactory3 COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR, DEFAULT); @@ -626,7 +626,7 @@ public interface Errors { DiagnosticFactory2 UNUSED_VALUE = DiagnosticFactory2.create(WARNING, PositioningStrategies.UNUSED_VALUE); DiagnosticFactory1 UNUSED_CHANGED_VALUE = DiagnosticFactory1.create(WARNING); DiagnosticFactory0 UNUSED_EXPRESSION = DiagnosticFactory0.create(WARNING); - DiagnosticFactory0 UNUSED_LAMBDA_EXPRESSION = DiagnosticFactory0.create(WARNING); + DiagnosticFactory0 UNUSED_LAMBDA_EXPRESSION = DiagnosticFactory0.create(WARNING); DiagnosticFactory1 VAL_REASSIGNMENT = DiagnosticFactory1.create(ERROR); DiagnosticFactory1 SETTER_PROJECTED_OUT = DiagnosticFactory1.create(ERROR); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt index 737082b309d..17b00a88b12 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/diagnostics/PositioningStrategies.kt @@ -49,7 +49,7 @@ public object PositioningStrategies { is KtObjectLiteralExpression -> { val objectDeclaration = element.getObjectDeclaration() val objectKeyword = objectDeclaration.getObjectKeyword() - val delegationSpecifierList = objectDeclaration.getDelegationSpecifierList() + val delegationSpecifierList = objectDeclaration.getSuperTypeList() if (delegationSpecifierList == null) { return markElement(objectKeyword) } @@ -426,7 +426,7 @@ public object PositioningStrategies { @JvmField public val DELEGATOR_SUPER_CALL: PositioningStrategy = object: PositioningStrategy() { override fun mark(element: KtEnumEntry): List { - val specifiers = element.getDelegationSpecifiers() + val specifiers = element.getSuperTypeListEntries() return markElement(if (specifiers.isEmpty()) element else specifiers[0]) } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java index 98aac6e1aea..1c276f09da6 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinExpressionParsing.java @@ -545,7 +545,7 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing { break; } - argument.done(FUNCTION_LITERAL_ARGUMENT); + argument.done(LAMBDA_ARGUMENT); success = true; } @@ -1031,7 +1031,7 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing { if (declType != null) { // we do not attach preceding comments (non-doc) to local variables because they are likely commenting a few statements below closeDeclarationWithCommentBinders(decl, declType, - declType != KtNodeTypes.PROPERTY && declType != KtNodeTypes.MULTI_VARIABLE_DECLARATION); + declType != KtNodeTypes.PROPERTY && declType != KtNodeTypes.DESTRUCTURING_DECLARATION); return true; } else { @@ -1104,7 +1104,7 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing { myBuilder.restoreNewlinesState(); literal.done(FUNCTION_LITERAL); - literalExpression.done(FUNCTION_LITERAL_EXPRESSION); + literalExpression.done(LAMBDA_EXPRESSION); } private boolean rollbackOrDropAt(PsiBuilder.Marker rollbackMarker, IElementType dropAt) { @@ -1352,7 +1352,7 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing { if (at(LPAR)) { myJetParsing.parseMultiDeclarationName(TokenSet.create(IN_KEYWORD, LBRACE)); - parameter.done(MULTI_VARIABLE_DECLARATION); + parameter.done(DESTRUCTURING_DECLARATION); } else { expect(IDENTIFIER, "Expecting a variable name", TokenSet.create(COLON, IN_KEYWORD)); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java index 44a95f10b15..63b7dbec116 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/parsing/KotlinParsing.java @@ -960,7 +960,7 @@ public class KotlinParsing extends AbstractKotlinParsing { callee.done(CONSTRUCTOR_CALLEE); myExpressionParsing.parseValueArgumentList(); - delegatorSuperCall.done(DELEGATOR_SUPER_CALL); + delegatorSuperCall.done(SUPER_TYPE_CALL_ENTRY); initializerList.done(INITIALIZER_LIST); } if (at(LBRACE)) { @@ -1284,7 +1284,7 @@ public class KotlinParsing extends AbstractKotlinParsing { } } - return multiDeclaration ? MULTI_VARIABLE_DECLARATION : PROPERTY; + return multiDeclaration ? DESTRUCTURING_DECLARATION : PROPERTY; } /* @@ -1329,7 +1329,7 @@ public class KotlinParsing extends AbstractKotlinParsing { advance(); // COLON parseTypeRef(follow); } - property.done(MULTI_VARIABLE_DECLARATION_ENTRY); + property.done(DESTRUCTURING_DECLARATION_ENTRY); if (!at(COMMA)) break; advance(); // COMMA @@ -1637,7 +1637,7 @@ public class KotlinParsing extends AbstractKotlinParsing { advance(); // COMMA } - list.done(DELEGATION_SPECIFIER_LIST); + list.done(SUPER_TYPE_LIST); } /* @@ -1660,16 +1660,16 @@ public class KotlinParsing extends AbstractKotlinParsing { reference.drop(); advance(); // BY_KEYWORD createForByClause(myBuilder).myExpressionParsing.parseExpression(); - delegator.done(DELEGATOR_BY); + delegator.done(DELEGATED_SUPER_TYPE_ENTRY); } else if (at(LPAR)) { reference.done(CONSTRUCTOR_CALLEE); myExpressionParsing.parseValueArgumentList(); - delegator.done(DELEGATOR_SUPER_CALL); + delegator.done(SUPER_TYPE_CALL_ENTRY); } else { reference.drop(); - delegator.done(DELEGATOR_SUPER_CLASS); + delegator.done(SUPER_TYPE_ENTRY); } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/Call.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/Call.java index bc2da901100..ca1108930ac 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/Call.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/Call.java @@ -49,7 +49,7 @@ public interface Call { @ReadOnly @NotNull - List getFunctionLiteralArguments(); + List getFunctionLiteralArguments(); @ReadOnly @NotNull diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/DebugTextUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/DebugTextUtil.kt index 727597c6985..15ce6477a0d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/DebugTextUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/DebugTextUtil.kt @@ -16,9 +16,9 @@ package org.jetbrains.kotlin.psi.debugText -import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.lexer.KtTokens import com.intellij.openapi.diagnostic.Logger +import org.jetbrains.kotlin.lexer.KtTokens +import org.jetbrains.kotlin.psi.* // invoke this instead of getText() when you need debug text to identify some place in PSI without storing the element itself // this is need to avoid unnecessary file parses @@ -98,11 +98,11 @@ private object DebugTextBuildingVisitor : KtVisitor() { return render(constructorCalleeExpression, constructorCalleeExpression.getConstructorReferenceExpression()) } - override fun visitDelegationSpecifier(specifier: KtDelegationSpecifier, data: Unit?): String? { + override fun visitSuperTypeListEntry(specifier: KtSuperTypeListEntry, data: Unit?): String? { return render(specifier, specifier.getTypeReference()) } - override fun visitDelegationSpecifierList(list: KtDelegationSpecifierList, data: Unit?): String? { + override fun visitSuperTypeList(list: KtSuperTypeList, data: Unit?): String? { return renderChildren(list, ", ") } @@ -208,7 +208,7 @@ private object DebugTextBuildingVisitor : KtVisitor() { appendInn(klass.getTypeParameterList()) appendInn(klass.getPrimaryConstructorModifierList(), prefix = " ", suffix = " ") appendInn(klass.getPrimaryConstructorParameterList()) - appendInn(klass.getDelegationSpecifierList(), prefix = " : ") + appendInn(klass.getSuperTypeList(), prefix = " : ") } } @@ -239,7 +239,7 @@ private object DebugTextBuildingVisitor : KtVisitor() { appendInn(declaration.getModifierList(), suffix = " ") append("object ") appendInn(declaration.getNameAsName()) - appendInn(declaration.getDelegationSpecifierList(), prefix = " : ") + appendInn(declaration.getSuperTypeList(), prefix = " : ") } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtAnnotationEntry.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtAnnotationEntry.java index 330b32cb311..adece1135d1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtAnnotationEntry.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtAnnotationEntry.java @@ -75,7 +75,7 @@ public class KtAnnotationEntry extends KtElementImplStub getFunctionLiteralArguments() { + public List getLambdaArguments() { return Collections.emptyList(); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtCallElement.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtCallElement.java index 7ec499defa9..2e23989edf5 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtCallElement.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtCallElement.java @@ -32,7 +32,7 @@ public interface KtCallElement extends KtElement { List getValueArguments(); @NotNull - List getFunctionLiteralArguments(); + List getLambdaArguments(); @NotNull List getTypeArguments(); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtCallExpression.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtCallExpression.java index bd3bb2b8570..3ab2b4d2589 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtCallExpression.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtCallExpression.java @@ -60,8 +60,8 @@ public class KtCallExpression extends KtExpressionImpl implements KtCallElement, */ @Override @NotNull - public List getFunctionLiteralArguments() { - return findChildrenByType(KtNodeTypes.FUNCTION_LITERAL_ARGUMENT); + public List getLambdaArguments() { + return findChildrenByType(KtNodeTypes.LAMBDA_ARGUMENT); } @Override @@ -69,7 +69,7 @@ public class KtCallExpression extends KtExpressionImpl implements KtCallElement, public List getValueArguments() { KtValueArgumentList list = getValueArgumentList(); List valueArgumentsInParentheses = list != null ? list.getArguments() : Collections.emptyList(); - List functionLiteralArguments = getFunctionLiteralArguments(); + List functionLiteralArguments = getLambdaArguments(); if (functionLiteralArguments.isEmpty()) { return valueArgumentsInParentheses; } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtClassOrObject.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtClassOrObject.kt index 5ba03ed53d3..3a4f307c5c4 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtClassOrObject.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtClassOrObject.kt @@ -25,7 +25,6 @@ import com.intellij.psi.impl.CheckUtil import com.intellij.psi.impl.source.codeStyle.CodeEditUtil import com.intellij.psi.stubs.IStubElementType import com.intellij.psi.util.PsiTreeUtil -import org.jetbrains.kotlin.KtNodeTypes import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.stubs.KotlinClassOrObjectStub import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes @@ -35,26 +34,26 @@ abstract public class KtClassOrObject : public constructor(node: ASTNode) : super(node) public constructor(stub: KotlinClassOrObjectStub, nodeType: IStubElementType<*, *>) : super(stub, nodeType) - public fun getDelegationSpecifierList(): KtDelegationSpecifierList? = getStubOrPsiChild(KtStubElementTypes.DELEGATION_SPECIFIER_LIST) - open public fun getDelegationSpecifiers(): List = getDelegationSpecifierList()?.getDelegationSpecifiers().orEmpty() + public fun getSuperTypeList(): KtSuperTypeList? = getStubOrPsiChild(KtStubElementTypes.SUPER_TYPE_LIST) + open public fun getSuperTypeListEntries(): List = getSuperTypeList()?.getEntries().orEmpty() - public fun addDelegationSpecifier(delegationSpecifier: KtDelegationSpecifier): KtDelegationSpecifier { - getDelegationSpecifierList()?.let { - return EditCommaSeparatedListHelper.addItem(it, getDelegationSpecifiers(), delegationSpecifier) + public fun addSuperTypeListEntry(superTypeListEntry: KtSuperTypeListEntry): KtSuperTypeListEntry { + getSuperTypeList()?.let { + return EditCommaSeparatedListHelper.addItem(it, getSuperTypeListEntries(), superTypeListEntry) } val psiFactory = KtPsiFactory(this) - val specifierListToAdd = psiFactory.createDelegatorToSuperCall("A()").replace(delegationSpecifier).getParent() + val specifierListToAdd = psiFactory.createSuperTypeCallEntry("A()").replace(superTypeListEntry).getParent() val colon = addBefore(psiFactory.createColon(), getBody()) - return (addAfter(specifierListToAdd, colon) as KtDelegationSpecifierList).getDelegationSpecifiers().first() + return (addAfter(specifierListToAdd, colon) as KtSuperTypeList).getEntries().first() } - public fun removeDelegationSpecifier(delegationSpecifier: KtDelegationSpecifier) { - val specifierList = getDelegationSpecifierList() ?: return - assert(delegationSpecifier.getParent() === specifierList) + public fun removeSuperTypeListEntry(superTypeListEntry: KtSuperTypeListEntry) { + val specifierList = getSuperTypeList() ?: return + assert(superTypeListEntry.getParent() === specifierList) - if (specifierList.getDelegationSpecifiers().size() > 1) { - EditCommaSeparatedListHelper.removeItem(delegationSpecifier) + if (specifierList.getEntries().size() > 1) { + EditCommaSeparatedListHelper.removeItem(superTypeListEntry) } else { deleteChildRange(findChildByType(KtTokens.COLON) ?: specifierList, specifierList) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtConstructorDelegationCall.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtConstructorDelegationCall.java index 0f06533565e..02b54c7fce9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtConstructorDelegationCall.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtConstructorDelegationCall.java @@ -44,7 +44,7 @@ public class KtConstructorDelegationCall extends KtElementImpl implements KtCall @NotNull @Override - public List getFunctionLiteralArguments() { + public List getLambdaArguments() { return Collections.emptyList(); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatorByExpressionSpecifier.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatedSuperTypeEntry.java similarity index 74% rename from compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatorByExpressionSpecifier.java rename to compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatedSuperTypeEntry.java index 5315b65841c..b52122255da 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatorByExpressionSpecifier.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatedSuperTypeEntry.java @@ -22,18 +22,18 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub; import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; -public class KtDelegatorByExpressionSpecifier extends KtDelegationSpecifier { - public KtDelegatorByExpressionSpecifier(@NotNull ASTNode node) { +public class KtDelegatedSuperTypeEntry extends KtSuperTypeListEntry { + public KtDelegatedSuperTypeEntry(@NotNull ASTNode node) { super(node); } - public KtDelegatorByExpressionSpecifier(@NotNull KotlinPlaceHolderStub stub) { - super(stub, KtStubElementTypes.DELEGATOR_BY); + public KtDelegatedSuperTypeEntry(@NotNull KotlinPlaceHolderStub stub) { + super(stub, KtStubElementTypes.DELEGATED_SUPER_TYPE_ENTRY); } @Override public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitDelegationByExpressionSpecifier(this, data); + return visitor.visitDelegatedSuperTypeEntry(this, data); } @Nullable @IfNotParsed diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtMultiDeclaration.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclaration.java similarity index 82% rename from compiler/frontend/src/org/jetbrains/kotlin/psi/KtMultiDeclaration.java rename to compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclaration.java index 5cc99c77438..9c8804c5cf5 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtMultiDeclaration.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclaration.java @@ -29,19 +29,19 @@ import java.util.List; import static org.jetbrains.kotlin.lexer.KtTokens.*; -public class KtMultiDeclaration extends KtDeclarationImpl implements KtValVarKeywordOwner { - public KtMultiDeclaration(@NotNull ASTNode node) { +public class KtDestructuringDeclaration extends KtDeclarationImpl implements KtValVarKeywordOwner { + public KtDestructuringDeclaration(@NotNull ASTNode node) { super(node); } @Override public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitMultiDeclaration(this, data); + return visitor.visitDestructuringDeclaration(this, data); } @NotNull - public List getEntries() { - return findChildrenByType(KtNodeTypes.MULTI_VARIABLE_DECLARATION_ENTRY); + public List getEntries() { + return findChildrenByType(KtNodeTypes.DESTRUCTURING_DECLARATION_ENTRY); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtMultiDeclarationEntry.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclarationEntry.java similarity index 91% rename from compiler/frontend/src/org/jetbrains/kotlin/psi/KtMultiDeclarationEntry.java rename to compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclarationEntry.java index e184ab3dbf5..3fe4458826d 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtMultiDeclarationEntry.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDestructuringDeclarationEntry.java @@ -34,8 +34,8 @@ import java.util.List; import static org.jetbrains.kotlin.lexer.KtTokens.VAL_KEYWORD; import static org.jetbrains.kotlin.lexer.KtTokens.VAR_KEYWORD; -public class KtMultiDeclarationEntry extends KtNamedDeclarationNotStubbed implements KtVariableDeclaration { - public KtMultiDeclarationEntry(@NotNull ASTNode node) { +public class KtDestructuringDeclarationEntry extends KtNamedDeclarationNotStubbed implements KtVariableDeclaration { + public KtDestructuringDeclarationEntry(@NotNull ASTNode node) { super(node); } @@ -100,7 +100,7 @@ public class KtMultiDeclarationEntry extends KtNamedDeclarationNotStubbed implem @Override public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitMultiDeclarationEntry(this, data); + return visitor.visitDestructuringDeclarationEntry(this, data); } @Override @@ -122,7 +122,7 @@ public class KtMultiDeclarationEntry extends KtNamedDeclarationNotStubbed implem @NotNull private ASTNode getParentNode() { ASTNode parent = getNode().getTreeParent(); - assert parent.getElementType() == KtNodeTypes.MULTI_VARIABLE_DECLARATION; + assert parent.getElementType() == KtNodeTypes.DESTRUCTURING_DECLARATION; return parent; } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtEnumEntry.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtEnumEntry.java index 68ebc2bcc15..7e4a952e024 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtEnumEntry.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtEnumEntry.java @@ -20,11 +20,8 @@ import com.intellij.lang.ASTNode; import com.intellij.psi.PsiClass; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiEnumConstant; -import com.intellij.util.IncorrectOperationException; -import org.jetbrains.annotations.NonNls; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.kotlin.psi.stubs.KotlinClassOrObjectStub; import org.jetbrains.kotlin.psi.stubs.KotlinClassStub; import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; @@ -42,7 +39,7 @@ public class KtEnumEntry extends KtClass { @NotNull @Override - public List getDelegationSpecifiers() { + public List getSuperTypeListEntries() { KtInitializerList initializerList = getInitializerList(); if (initializerList == null) { return Collections.emptyList(); @@ -51,7 +48,7 @@ public class KtEnumEntry extends KtClass { } public boolean hasInitializer() { - return !getDelegationSpecifiers().isEmpty(); + return !getSuperTypeListEntries().isEmpty(); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtForExpression.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtForExpression.java index e49de373643..49e66113b29 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtForExpression.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtForExpression.java @@ -38,8 +38,8 @@ public class KtForExpression extends KtLoopExpression { } @Nullable - public KtMultiDeclaration getMultiParameter() { - return (KtMultiDeclaration) findChildByType(KtNodeTypes.MULTI_VARIABLE_DECLARATION); + public KtDestructuringDeclaration getDestructuringParameter() { + return (KtDestructuringDeclaration) findChildByType(KtNodeTypes.DESTRUCTURING_DECLARATION); } @Nullable @IfNotParsed diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtInitializerList.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtInitializerList.java index 4b1051693e1..9ce36b9b5ee 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtInitializerList.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtInitializerList.java @@ -39,7 +39,7 @@ public class KtInitializerList extends KtElementImplStub getInitializers() { - return Arrays.asList(getStubOrPsiChildren(KtStubElementTypes.DELEGATION_SPECIFIER_TYPES, KtDelegationSpecifier.ARRAY_FACTORY)); + public List getInitializers() { + return Arrays.asList(getStubOrPsiChildren(KtStubElementTypes.SUPER_TYPE_LIST_ENTRIES, KtSuperTypeListEntry.ARRAY_FACTORY)); } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtFunctionLiteralArgument.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtLambdaArgument.kt similarity index 72% rename from compiler/frontend/src/org/jetbrains/kotlin/psi/KtFunctionLiteralArgument.kt rename to compiler/frontend/src/org/jetbrains/kotlin/psi/KtLambdaArgument.kt index bb92c28babd..34d07fbb9ba 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtFunctionLiteralArgument.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtLambdaArgument.kt @@ -18,16 +18,16 @@ package org.jetbrains.kotlin.psi import com.intellij.lang.ASTNode -public class KtFunctionLiteralArgument(node: ASTNode) : KtValueArgument(node), FunctionLiteralArgument { +public class KtLambdaArgument(node: ASTNode) : KtValueArgument(node), LambdaArgument { - override fun getArgumentExpression() = super.getArgumentExpression()!! + override fun getArgumentExpression() = super.getArgumentExpression()!! - override fun getFunctionLiteral(): KtFunctionLiteralExpression = getArgumentExpression().unpackFunctionLiteral()!! + override fun getLambdaExpression(): KtLambdaExpression = getArgumentExpression().unpackFunctionLiteral()!! } -public fun KtExpression.unpackFunctionLiteral(allowParentheses: Boolean = false): KtFunctionLiteralExpression? { +public fun KtExpression.unpackFunctionLiteral(allowParentheses: Boolean = false): KtLambdaExpression? { return when (this) { - is KtFunctionLiteralExpression -> this + is KtLambdaExpression -> this is KtLabeledExpression -> baseExpression?.unpackFunctionLiteral(allowParentheses) is KtAnnotatedExpression -> baseExpression?.unpackFunctionLiteral(allowParentheses) is KtParenthesizedExpression -> if (allowParentheses) expression?.unpackFunctionLiteral(allowParentheses) else null diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtFunctionLiteralExpression.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtLambdaExpression.java similarity index 90% rename from compiler/frontend/src/org/jetbrains/kotlin/psi/KtFunctionLiteralExpression.java rename to compiler/frontend/src/org/jetbrains/kotlin/psi/KtLambdaExpression.java index fb3411a8fc2..f8781768371 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtFunctionLiteralExpression.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtLambdaExpression.java @@ -24,14 +24,14 @@ import org.jetbrains.kotlin.lexer.KtTokens; import java.util.List; -public class KtFunctionLiteralExpression extends KtExpressionImpl { - public KtFunctionLiteralExpression(@NotNull ASTNode node) { +public class KtLambdaExpression extends KtExpressionImpl { + public KtLambdaExpression(@NotNull ASTNode node) { super(node); } @Override public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitFunctionLiteralExpression(this, data); + return visitor.visitLambdaExpression(this, data); } @NotNull diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt index fb07d15d4b2..cb3ab3ea38a 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiFactory.kt @@ -204,8 +204,8 @@ public class KtPsiFactory(private val project: Project) { return getter } - public fun createMultiDeclaration(text: String): KtMultiDeclaration { - return (createFunction("fun foo() {$text}").bodyExpression as KtBlockExpression).statements.first() as KtMultiDeclaration + public fun createDestructuringDeclaration(text: String): KtDestructuringDeclaration { + return (createFunction("fun foo() {$text}").bodyExpression as KtBlockExpression).statements.first() as KtDestructuringDeclaration } public fun createDeclaration(text: String): TDeclaration { @@ -279,7 +279,7 @@ public class KtPsiFactory(private val project: Project) { } public fun createFunctionLiteralParameterList(text: String): KtParameterList { - return (createExpression("{ $text -> 0}") as KtFunctionLiteralExpression).getFunctionLiteral().getValueParameterList()!! + return (createExpression("{ $text -> 0}") as KtLambdaExpression).getFunctionLiteral().getValueParameterList()!! } public fun createEnumEntry(text: String): KtEnumEntry { @@ -395,15 +395,15 @@ public class KtPsiFactory(private val project: Project) { return argumentList.getArguments().single() } - public fun createDelegatorToSuperCall(text: String): KtDelegatorToSuperCall { - return createClass("class A: $text").getDelegationSpecifiers().first() as KtDelegatorToSuperCall + public fun createSuperTypeCallEntry(text: String): KtSuperTypeCallEntry { + return createClass("class A: $text").getSuperTypeListEntries().first() as KtSuperTypeCallEntry } - public fun createDelegatorToSuperClass(text: String): KtDelegatorToSuperClass { - return createClass("class A: $text").getDelegationSpecifiers().first() as KtDelegatorToSuperClass + public fun createSuperTypeEntry(text: String): KtSuperTypeEntry { + return createClass("class A: $text").getSuperTypeListEntries().first() as KtSuperTypeEntry } - public fun createConstructorDelegationCall(text: String): KtConstructorDelegationCall { + public fun creareDelegatedSuperTypeEntry(text: String): KtConstructorDelegationCall { val colonOrEmpty = if (text.isEmpty()) "" else ": " return createClass("class A { constructor()$colonOrEmpty$text {}").getSecondaryConstructors().first().getDelegationCall() } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java index 8e34f74b75b..7050d1af2a0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtPsiUtil.java @@ -298,8 +298,8 @@ public class KtPsiUtil { public static boolean isVariableNotParameterDeclaration(@NotNull KtDeclaration declaration) { if (!(declaration instanceof KtVariableDeclaration)) return false; if (declaration instanceof KtProperty) return true; - assert declaration instanceof KtMultiDeclarationEntry; - KtMultiDeclarationEntry multiDeclarationEntry = (KtMultiDeclarationEntry) declaration; + assert declaration instanceof KtDestructuringDeclarationEntry; + KtDestructuringDeclarationEntry multiDeclarationEntry = (KtDestructuringDeclarationEntry) declaration; return !(multiDeclarationEntry.getParent().getParent() instanceof KtForExpression); } @@ -819,7 +819,7 @@ public class KtPsiUtil { parent instanceof KtDotQualifiedExpression || parent instanceof KtCallExpression || parent instanceof KtArrayAccessExpression || - parent instanceof KtMultiDeclaration) { + parent instanceof KtDestructuringDeclaration) { if (parent instanceof KtLabeledExpression) { parent = parent.getParent(); @@ -835,7 +835,7 @@ public class KtPsiUtil { else if (parent instanceof KtValueArgument || parent instanceof KtValueArgumentList) { parent = parent.getParent(); } - else if (parent instanceof KtFunctionLiteralExpression || parent instanceof KtAnnotatedExpression) { + else if (parent instanceof KtLambdaExpression || parent instanceof KtAnnotatedExpression) { parent = parent.getParent(); } else { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSecondaryConstructor.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSecondaryConstructor.kt index bb59191aa36..983aa1ed61b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSecondaryConstructor.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSecondaryConstructor.kt @@ -48,6 +48,6 @@ public class KtSecondaryConstructor : KtConstructor { val delegationName = if (isThis) "this" else "super" - return addAfter(psiFactory.createConstructorDelegationCall(delegationName + "()"), colon) as KtConstructorDelegationCall + return addAfter(psiFactory.creareDelegatedSuperTypeEntry(delegationName + "()"), colon) as KtConstructorDelegationCall } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatorToSuperCall.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeCallEntry.java similarity index 83% rename from compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatorToSuperCall.java rename to compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeCallEntry.java index fa9cde1c2fe..8b5398bda8e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatorToSuperCall.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeCallEntry.java @@ -26,18 +26,18 @@ import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; import java.util.Collections; import java.util.List; -public class KtDelegatorToSuperCall extends KtDelegationSpecifier implements KtCallElement { - public KtDelegatorToSuperCall(@NotNull ASTNode node) { +public class KtSuperTypeCallEntry extends KtSuperTypeListEntry implements KtCallElement { + public KtSuperTypeCallEntry(@NotNull ASTNode node) { super(node); } - public KtDelegatorToSuperCall(@NotNull KotlinPlaceHolderStub stub) { - super(stub, KtStubElementTypes.DELEGATOR_SUPER_CALL); + public KtSuperTypeCallEntry(@NotNull KotlinPlaceHolderStub stub) { + super(stub, KtStubElementTypes.SUPER_TYPE_CALL_ENTRY); } @Override public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitDelegationToSuperCallSpecifier(this, data); + return visitor.visitSuperTypeCallEntry(this, data); } @NotNull @@ -61,7 +61,7 @@ public class KtDelegatorToSuperCall extends KtDelegationSpecifier implements KtC @NotNull @Override - public List getFunctionLiteralArguments() { + public List getLambdaArguments() { return Collections.emptyList(); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatorToSuperClass.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeEntry.java similarity index 72% rename from compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatorToSuperClass.java rename to compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeEntry.java index 0ff5e003965..8c19744bd29 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegatorToSuperClass.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeEntry.java @@ -21,17 +21,17 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub; import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; -public class KtDelegatorToSuperClass extends KtDelegationSpecifier { - public KtDelegatorToSuperClass(@NotNull ASTNode node) { +public class KtSuperTypeEntry extends KtSuperTypeListEntry { + public KtSuperTypeEntry(@NotNull ASTNode node) { super(node); } - public KtDelegatorToSuperClass(@NotNull KotlinPlaceHolderStub stub) { - super(stub, KtStubElementTypes.DELEGATOR_SUPER_CLASS); + public KtSuperTypeEntry(@NotNull KotlinPlaceHolderStub stub) { + super(stub, KtStubElementTypes.SUPER_TYPE_ENTRY); } @Override public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitDelegationToSuperClassSpecifier(this, data); + return visitor.visitSuperTypeEntry(this, data); } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegationSpecifierList.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeList.java similarity index 66% rename from compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegationSpecifierList.java rename to compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeList.java index 86b5e708f86..07434485416 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegationSpecifierList.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeList.java @@ -24,21 +24,21 @@ import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; import java.util.Arrays; import java.util.List; -public class KtDelegationSpecifierList extends KtElementImplStub> { - public KtDelegationSpecifierList(@NotNull ASTNode node) { +public class KtSuperTypeList extends KtElementImplStub> { + public KtSuperTypeList(@NotNull ASTNode node) { super(node); } - public KtDelegationSpecifierList(@NotNull KotlinPlaceHolderStub stub) { - super(stub, KtStubElementTypes.DELEGATION_SPECIFIER_LIST); + public KtSuperTypeList(@NotNull KotlinPlaceHolderStub stub) { + super(stub, KtStubElementTypes.SUPER_TYPE_LIST); } @Override public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitDelegationSpecifierList(this, data); + return visitor.visitSuperTypeList(this, data); } - public List getDelegationSpecifiers() { - return Arrays.asList(getStubOrPsiChildren(KtStubElementTypes.DELEGATION_SPECIFIER_TYPES, KtDelegationSpecifier.ARRAY_FACTORY)); + public List getEntries() { + return Arrays.asList(getStubOrPsiChildren(KtStubElementTypes.SUPER_TYPE_LIST_ENTRIES, KtSuperTypeListEntry.ARRAY_FACTORY)); } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegationSpecifier.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeListEntry.java similarity index 71% rename from compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegationSpecifier.java rename to compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeListEntry.java index 747a2b7a8cd..34bc6e82596 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtDelegationSpecifier.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtSuperTypeListEntry.java @@ -24,31 +24,31 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub; import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; -public class KtDelegationSpecifier extends KtElementImplStub> { +public class KtSuperTypeListEntry extends KtElementImplStub> { - private static final KtDelegationSpecifier[] EMPTY_ARRAY = new KtDelegationSpecifier[0]; + private static final KtSuperTypeListEntry[] EMPTY_ARRAY = new KtSuperTypeListEntry[0]; - public static ArrayFactory ARRAY_FACTORY = new ArrayFactory() { + public static ArrayFactory ARRAY_FACTORY = new ArrayFactory() { @NotNull @Override - public KtDelegationSpecifier[] create(int count) { - return count == 0 ? EMPTY_ARRAY : new KtDelegationSpecifier[count]; + public KtSuperTypeListEntry[] create(int count) { + return count == 0 ? EMPTY_ARRAY : new KtSuperTypeListEntry[count]; } }; - public KtDelegationSpecifier(@NotNull ASTNode node) { + public KtSuperTypeListEntry(@NotNull ASTNode node) { super(node); } - public KtDelegationSpecifier( - @NotNull KotlinPlaceHolderStub stub, + public KtSuperTypeListEntry( + @NotNull KotlinPlaceHolderStub stub, @NotNull IStubElementType nodeType) { super(stub, nodeType); } @Override public R accept(@NotNull KtVisitor visitor, D data) { - return visitor.visitDelegationSpecifier(this, data); + return visitor.visitSuperTypeListEntry(this, data); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java index 8ec07193fb2..ed9f5eeae9b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitor.java @@ -57,11 +57,11 @@ public class KtVisitor extends PsiElementVisitor { return visitNamedDeclaration(property, data); } - public R visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, D data) { + public R visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, D data) { return visitDeclaration(multiDeclaration, data); } - public R visitMultiDeclarationEntry(@NotNull KtMultiDeclarationEntry multiDeclarationEntry, D data) { + public R visitDestructuringDeclarationEntry(@NotNull KtDestructuringDeclarationEntry multiDeclarationEntry, D data) { return visitNamedDeclaration(multiDeclarationEntry, data); } @@ -134,24 +134,24 @@ public class KtVisitor extends PsiElementVisitor { return visitNamedDeclaration(parameter, data); } - public R visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list, D data) { + public R visitSuperTypeList(@NotNull KtSuperTypeList list, D data) { return visitKtElement(list, data); } - public R visitDelegationSpecifier(@NotNull KtDelegationSpecifier specifier, D data) { + public R visitSuperTypeListEntry(@NotNull KtSuperTypeListEntry specifier, D data) { return visitKtElement(specifier, data); } - public R visitDelegationByExpressionSpecifier(@NotNull KtDelegatorByExpressionSpecifier specifier, D data) { - return visitDelegationSpecifier(specifier, data); + public R visitDelegatedSuperTypeEntry(@NotNull KtDelegatedSuperTypeEntry specifier, D data) { + return visitSuperTypeListEntry(specifier, data); } - public R visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call, D data) { - return visitDelegationSpecifier(call, data); + public R visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call, D data) { + return visitSuperTypeListEntry(call, data); } - public R visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier, D data) { - return visitDelegationSpecifier(specifier, data); + public R visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier, D data) { + return visitSuperTypeListEntry(specifier, data); } public R visitConstructorDelegationCall(@NotNull KtConstructorDelegationCall call, D data) { @@ -258,7 +258,7 @@ public class KtVisitor extends PsiElementVisitor { return visitLoopExpression(expression, data); } - public R visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression, D data) { + public R visitLambdaExpression(@NotNull KtLambdaExpression expression, D data) { return visitExpression(expression, data); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java index 6da98d1571f..05c483ffb6b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoid.java @@ -53,12 +53,12 @@ public class KtVisitorVoid extends KtVisitor { super.visitProperty(property, null); } - public void visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration) { - super.visitMultiDeclaration(multiDeclaration, null); + public void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration destructuringDeclaration) { + super.visitDestructuringDeclaration(destructuringDeclaration, null); } - public void visitMultiDeclarationEntry(@NotNull KtMultiDeclarationEntry multiDeclarationEntry) { - super.visitMultiDeclarationEntry(multiDeclarationEntry, null); + public void visitDestructuringDeclarationEntry(@NotNull KtDestructuringDeclarationEntry multiDeclarationEntry) { + super.visitDestructuringDeclarationEntry(multiDeclarationEntry, null); } public void visitTypedef(@NotNull KtTypedef typedef) { @@ -121,24 +121,24 @@ public class KtVisitorVoid extends KtVisitor { super.visitParameter(parameter, null); } - public void visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list) { - super.visitDelegationSpecifierList(list, null); + public void visitSuperTypeList(@NotNull KtSuperTypeList list) { + super.visitSuperTypeList(list, null); } - public void visitDelegationSpecifier(@NotNull KtDelegationSpecifier specifier) { - super.visitDelegationSpecifier(specifier, null); + public void visitSuperTypeListEntry(@NotNull KtSuperTypeListEntry specifier) { + super.visitSuperTypeListEntry(specifier, null); } - public void visitDelegationByExpressionSpecifier(@NotNull KtDelegatorByExpressionSpecifier specifier) { - super.visitDelegationByExpressionSpecifier(specifier, null); + public void visitDelegatedSuperTypeEntry(@NotNull KtDelegatedSuperTypeEntry specifier) { + super.visitDelegatedSuperTypeEntry(specifier, null); } - public void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call) { - super.visitDelegationToSuperCallSpecifier(call, null); + public void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call) { + super.visitSuperTypeCallEntry(call, null); } - public void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier) { - super.visitDelegationToSuperClassSpecifier(specifier, null); + public void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier) { + super.visitSuperTypeEntry(specifier, null); } public void visitConstructorDelegationCall(@NotNull KtConstructorDelegationCall call) { @@ -245,8 +245,8 @@ public class KtVisitorVoid extends KtVisitor { super.visitDoWhileExpression(expression, null); } - public void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression) { - super.visitFunctionLiteralExpression(expression, null); + public void visitLambdaExpression(@NotNull KtLambdaExpression lambdaExpression) { + super.visitLambdaExpression(lambdaExpression, null); } public void visitAnnotatedExpression(@NotNull KtAnnotatedExpression expression) { @@ -487,14 +487,14 @@ public class KtVisitorVoid extends KtVisitor { } @Override - public final Void visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, Void data) { - visitMultiDeclaration(multiDeclaration); + public final Void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, Void data) { + visitDestructuringDeclaration(multiDeclaration); return null; } @Override - public final Void visitMultiDeclarationEntry(@NotNull KtMultiDeclarationEntry multiDeclarationEntry, Void data) { - visitMultiDeclarationEntry(multiDeclarationEntry); + public final Void visitDestructuringDeclarationEntry(@NotNull KtDestructuringDeclarationEntry multiDeclarationEntry, Void data) { + visitDestructuringDeclarationEntry(multiDeclarationEntry); return null; } @@ -589,34 +589,34 @@ public class KtVisitorVoid extends KtVisitor { } @Override - public final Void visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list, Void data) { - visitDelegationSpecifierList(list); + public final Void visitSuperTypeList(@NotNull KtSuperTypeList list, Void data) { + visitSuperTypeList(list); return null; } @Override - public final Void visitDelegationSpecifier(@NotNull KtDelegationSpecifier specifier, Void data) { - visitDelegationSpecifier(specifier); + public final Void visitSuperTypeListEntry(@NotNull KtSuperTypeListEntry specifier, Void data) { + visitSuperTypeListEntry(specifier); return null; } @Override - public final Void visitDelegationByExpressionSpecifier( - @NotNull KtDelegatorByExpressionSpecifier specifier, Void data + public final Void visitDelegatedSuperTypeEntry( + @NotNull KtDelegatedSuperTypeEntry specifier, Void data ) { - visitDelegationByExpressionSpecifier(specifier); + visitDelegatedSuperTypeEntry(specifier); return null; } @Override - public final Void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call, Void data) { - visitDelegationToSuperCallSpecifier(call); + public final Void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call, Void data) { + visitSuperTypeCallEntry(call); return null; } @Override - public final Void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier, Void data) { - visitDelegationToSuperClassSpecifier(specifier); + public final Void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier, Void data) { + visitSuperTypeEntry(specifier); return null; } @@ -777,8 +777,8 @@ public class KtVisitorVoid extends KtVisitor { } @Override - public final Void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression, Void data) { - visitFunctionLiteralExpression(expression); + public final Void visitLambdaExpression(@NotNull KtLambdaExpression expression, Void data) { + visitLambdaExpression(expression); return null; } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java index 8524b845ca3..78ac32823e7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/KtVisitorVoidWithParameter.java @@ -50,12 +50,12 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { super.visitProperty(property, data); } - public void visitMultiDeclarationVoid(@NotNull KtMultiDeclaration multiDeclaration, P data) { - super.visitMultiDeclaration(multiDeclaration, data); + public void visitDestructuringDeclarationVoid(@NotNull KtDestructuringDeclaration multiDeclaration, P data) { + super.visitDestructuringDeclaration(multiDeclaration, data); } - public void visitMultiDeclarationEntryVoid(@NotNull KtMultiDeclarationEntry multiDeclarationEntry, P data) { - super.visitMultiDeclarationEntry(multiDeclarationEntry, data); + public void visitDestructuringDeclarationEntryVoid(@NotNull KtDestructuringDeclarationEntry multiDeclarationEntry, P data) { + super.visitDestructuringDeclarationEntry(multiDeclarationEntry, data); } public void visitTypedefVoid(@NotNull KtTypedef typedef, P data) { @@ -118,27 +118,27 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { super.visitParameter(parameter, data); } - public void visitDelegationSpecifierListVoid(@NotNull KtDelegationSpecifierList list, P data) { - super.visitDelegationSpecifierList(list, data); + public void visitSuperTypeListVoid(@NotNull KtSuperTypeList list, P data) { + super.visitSuperTypeList(list, data); } - public void visitDelegationSpecifierVoid(@NotNull KtDelegationSpecifier specifier, P data) { - super.visitDelegationSpecifier(specifier, data); + public void visitSuperTypeListEntryVoid(@NotNull KtSuperTypeListEntry specifier, P data) { + super.visitSuperTypeListEntry(specifier, data); } - public void visitDelegationByExpressionSpecifierVoid(@NotNull KtDelegatorByExpressionSpecifier specifier, P data) { - super.visitDelegationByExpressionSpecifier(specifier, data); + public void visitDelegatedSuperTypeEntryVoid(@NotNull KtDelegatedSuperTypeEntry specifier, P data) { + super.visitDelegatedSuperTypeEntry(specifier, data); } - public void visitDelegationToSuperCallSpecifierVoid(@NotNull KtDelegatorToSuperCall call, P data) { - super.visitDelegationToSuperCallSpecifier(call, data); + public void visitSuperTypeCallEntryVoid(@NotNull KtSuperTypeCallEntry call, P data) { + super.visitSuperTypeCallEntry(call, data); } - public void visitDelegationToSuperClassSpecifierVoid(@NotNull KtDelegatorToSuperClass specifier, P data) { - super.visitDelegationToSuperClassSpecifier(specifier, data); + public void visitSuperTypeEntryVoid(@NotNull KtSuperTypeEntry specifier, P data) { + super.visitSuperTypeEntry(specifier, data); } - public void visitDelegationCallVoid(@NotNull KtConstructorDelegationCall call, P data) { + public void visitConstructorDelegationCallVoid(@NotNull KtConstructorDelegationCall call, P data) { super.visitConstructorDelegationCall(call, data); } @@ -242,8 +242,8 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { super.visitDoWhileExpression(expression, data); } - public void visitFunctionLiteralExpressionVoid(@NotNull KtFunctionLiteralExpression expression, P data) { - super.visitFunctionLiteralExpression(expression, data); + public void visitLambdaExpressionVoid(@NotNull KtLambdaExpression expression, P data) { + super.visitLambdaExpression(expression, data); } public void visitAnnotatedExpressionVoid(@NotNull KtAnnotatedExpression expression, P data) { @@ -460,14 +460,14 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { } @Override - public final Void visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, P data) { - visitMultiDeclarationVoid(multiDeclaration, data); + public final Void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, P data) { + visitDestructuringDeclarationVoid(multiDeclaration, data); return null; } @Override - public final Void visitMultiDeclarationEntry(@NotNull KtMultiDeclarationEntry multiDeclarationEntry, P data) { - visitMultiDeclarationEntryVoid(multiDeclarationEntry, data); + public final Void visitDestructuringDeclarationEntry(@NotNull KtDestructuringDeclarationEntry multiDeclarationEntry, P data) { + visitDestructuringDeclarationEntryVoid(multiDeclarationEntry, data); return null; } @@ -556,40 +556,40 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { } @Override - public final Void visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list, P data) { - visitDelegationSpecifierListVoid(list, data); + public final Void visitSuperTypeList(@NotNull KtSuperTypeList list, P data) { + visitSuperTypeListVoid(list, data); return null; } @Override - public final Void visitDelegationSpecifier(@NotNull KtDelegationSpecifier specifier, P data) { - visitDelegationSpecifierVoid(specifier, data); + public final Void visitSuperTypeListEntry(@NotNull KtSuperTypeListEntry specifier, P data) { + visitSuperTypeListEntryVoid(specifier, data); return null; } @Override - public final Void visitDelegationByExpressionSpecifier( - @NotNull KtDelegatorByExpressionSpecifier specifier, P data + public final Void visitDelegatedSuperTypeEntry( + @NotNull KtDelegatedSuperTypeEntry specifier, P data ) { - visitDelegationByExpressionSpecifierVoid(specifier, data); + visitDelegatedSuperTypeEntryVoid(specifier, data); return null; } @Override - public final Void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call, P data) { - visitDelegationToSuperCallSpecifierVoid(call, data); + public final Void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call, P data) { + visitSuperTypeCallEntryVoid(call, data); return null; } @Override - public final Void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier, P data) { - visitDelegationToSuperClassSpecifierVoid(specifier, data); + public final Void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier, P data) { + visitSuperTypeEntryVoid(specifier, data); return null; } @Override public final Void visitConstructorDelegationCall(@NotNull KtConstructorDelegationCall call, P data) { - visitDelegationCallVoid(call, data); + visitConstructorDelegationCallVoid(call, data); return null; } @@ -744,8 +744,8 @@ public class KtVisitorVoidWithParameter

extends KtVisitor { } @Override - public final Void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression, P data) { - visitFunctionLiteralExpressionVoid(expression, data); + public final Void visitLambdaExpression(@NotNull KtLambdaExpression expression, P data) { + visitLambdaExpressionVoid(expression, data); return null; } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/ValueArgument.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/ValueArgument.kt index ce8758cc193..1b213c931c5 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/ValueArgument.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/ValueArgument.kt @@ -36,8 +36,8 @@ public interface ValueArgument { public fun isExternal(): Boolean } -public interface FunctionLiteralArgument : ValueArgument { - public fun getFunctionLiteral(): KtFunctionLiteralExpression +public interface LambdaArgument : ValueArgument { + public fun getLambdaExpression(): KtLambdaExpression override fun getArgumentExpression(): KtExpression } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt index d9e3cdce383..55e985b0ba6 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/createByPattern.kt @@ -164,7 +164,7 @@ public fun createByPattern(pattern: String, vararg args: for ((pointer, n) in pointers) { var element = pointer.getElement()!! if (element is KtFunctionLiteral) { - element = element.getParent() as KtFunctionLiteralExpression + element = element.getParent() as KtLambdaExpression } (argumentTypes[n] as PsiElementPlaceholderArgumentType).replacePlaceholderElement(element, args[n]) } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/psiUtil/ktPsiUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/psi/psiUtil/ktPsiUtil.kt index e6b1fc9e8fe..8dc14346b61 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/psiUtil/ktPsiUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/psiUtil/ktPsiUtil.kt @@ -232,7 +232,7 @@ public fun StubBasedPsiElementBase() val result = ArrayList() @@ -351,11 +351,11 @@ public fun KtSimpleNameExpression.isPackageDirectiveExpression(): Boolean { return parent is KtPackageDirective || parent?.getParent() is KtPackageDirective } -public fun KtExpression.isFunctionLiteralOutsideParentheses(): Boolean { +public fun KtExpression.isLambdaOutsideParentheses(): Boolean { val parent = getParent() return when (parent) { - is KtFunctionLiteralArgument -> true - is KtLabeledExpression -> parent.isFunctionLiteralOutsideParentheses() + is KtLambdaArgument -> true + is KtLabeledExpression -> parent.isLambdaOutsideParentheses() else -> false } } @@ -387,7 +387,7 @@ public fun KtNamedDeclaration.getValueParameterList(): KtParameterList? { } } -public fun KtFunctionLiteralArgument.getFunctionLiteralArgumentName(bindingContext: BindingContext): Name? { +public fun KtLambdaArgument.getLambdaArgumentName(bindingContext: BindingContext): Name? { val callExpression = getParent() as KtCallExpression val resolvedCall = callExpression.getResolvedCall(bindingContext) return (resolvedCall?.getArgumentMapping(this) as? ArgumentMatch)?.valueParameter?.getName() diff --git a/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java b/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java index 2928819cf75..fd9596204f0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/psi/stubs/elements/KtStubElementTypes.java @@ -100,19 +100,19 @@ public interface KtStubElementTypes { KtPlaceHolderStubElementType TYPE_ARGUMENT_LIST = new KtPlaceHolderStubElementType("TYPE_ARGUMENT_LIST", KtTypeArgumentList.class); - KtPlaceHolderStubElementType DELEGATION_SPECIFIER_LIST = - new KtPlaceHolderStubElementType("DELEGATION_SPECIFIER_LIST", KtDelegationSpecifierList.class); + KtPlaceHolderStubElementType SUPER_TYPE_LIST = + new KtPlaceHolderStubElementType("SUPER_TYPE_LIST", KtSuperTypeList.class); KtPlaceHolderStubElementType INITIALIZER_LIST = new KtPlaceHolderStubElementType("INITIALIZER_LIST", KtInitializerList.class); - KtPlaceHolderStubElementType DELEGATOR_BY = - new KtPlaceHolderStubElementType("DELEGATOR_BY", KtDelegatorByExpressionSpecifier.class); + KtPlaceHolderStubElementType DELEGATED_SUPER_TYPE_ENTRY = + new KtPlaceHolderStubElementType("DELEGATED_SUPER_TYPE_ENTRY", KtDelegatedSuperTypeEntry.class); - KtPlaceHolderStubElementType DELEGATOR_SUPER_CALL = - new KtPlaceHolderStubElementType("DELEGATOR_SUPER_CALL", KtDelegatorToSuperCall.class); - KtPlaceHolderStubElementType DELEGATOR_SUPER_CLASS = - new KtPlaceHolderStubElementType("DELEGATOR_SUPER_CLASS", KtDelegatorToSuperClass.class); + KtPlaceHolderStubElementType SUPER_TYPE_CALL_ENTRY = + new KtPlaceHolderStubElementType("SUPER_TYPE_CALL_ENTRY", KtSuperTypeCallEntry.class); + KtPlaceHolderStubElementType SUPER_TYPE_ENTRY = + new KtPlaceHolderStubElementType("SUPER_TYPE_ENTRY", KtSuperTypeEntry.class); KtPlaceHolderStubElementType CONSTRUCTOR_CALLEE = new KtPlaceHolderStubElementType("CONSTRUCTOR_CALLEE", KtConstructorCalleeExpression.class); @@ -121,7 +121,7 @@ public interface KtStubElementTypes { TokenSet DECLARATION_TYPES = TokenSet.create(CLASS, OBJECT_DECLARATION, FUNCTION, PROPERTY, CLASS_INITIALIZER, SECONDARY_CONSTRUCTOR, ENUM_ENTRY); - TokenSet DELEGATION_SPECIFIER_TYPES = TokenSet.create(DELEGATOR_BY, DELEGATOR_SUPER_CALL, DELEGATOR_SUPER_CLASS); + TokenSet SUPER_TYPE_LIST_ENTRIES = TokenSet.create(DELEGATED_SUPER_TYPE_ENTRY, SUPER_TYPE_CALL_ENTRY, SUPER_TYPE_ENTRY); TokenSet TYPE_ELEMENT_TYPES = TokenSet.create(USER_TYPE, NULLABLE_TYPE, FUNCTION_TYPE, DYNAMIC_TYPE, SELF_TYPE); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt index bc8dd9a118a..e63860cdc4e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/AnnotationChecker.kt @@ -67,7 +67,7 @@ public class AnnotationChecker(private val additionalCheckers: Iterable (descriptor as? ClassDescriptor)?.let { TargetList(KotlinTarget.classActualTargets(it)) } ?: TargetLists.T_CLASSIFIER - is KtMultiDeclarationEntry -> TargetLists.T_LOCAL_VARIABLE + is KtDestructuringDeclarationEntry -> TargetLists.T_LOCAL_VARIABLE is KtProperty -> { if (annotated.isLocal) TargetLists.T_LOCAL_VARIABLE @@ -203,8 +203,8 @@ public class AnnotationChecker(private val additionalCheckers: Iterable if (annotated.projectionKind == KtProjectionKind.STAR) TargetLists.T_STAR_PROJECTION else TargetLists.T_TYPE_PROJECTION is KtAnonymousInitializer -> TargetLists.T_INITIALIZER - is KtMultiDeclaration -> TargetLists.T_DESTRUCTURING_DECLARATION - is KtFunctionLiteralExpression -> TargetLists.T_FUNCTION_LITERAL + is KtDestructuringDeclaration -> TargetLists.T_DESTRUCTURING_DECLARATION + is KtLambdaExpression -> TargetLists.T_FUNCTION_LITERAL is KtObjectLiteralExpression -> TargetLists.T_OBJECT_LITERAL is KtExpression -> TargetLists.T_EXPRESSION else -> TargetLists.EMPTY diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java index 9ebbde68efb..c7906e03ca2 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BindingContext.java @@ -125,7 +125,7 @@ public interface BindingContext { WritableSlice> DELEGATED_PROPERTY_PD_RESOLVED_CALL = Slices.createSimpleSlice(); - WritableSlice> COMPONENT_RESOLVED_CALL = Slices.createSimpleSlice(); + WritableSlice> COMPONENT_RESOLVED_CALL = Slices.createSimpleSlice(); WritableSlice> INDEXED_LVALUE_GET = Slices.createSimpleSlice(); WritableSlice> INDEXED_LVALUE_SET = Slices.createSimpleSlice(); @@ -189,9 +189,9 @@ public interface BindingContext { }; WritableSlice IS_UNINITIALIZED = Slices.createSimpleSetSlice(); - WritableSlice BLOCK = new Slices.SetSlice(DO_NOTHING) { + WritableSlice BLOCK = new Slices.SetSlice(DO_NOTHING) { @Override - public Boolean computeValue(SlicedMap map, KtFunctionLiteralExpression expression, Boolean isBlock, boolean valueNotFound) { + public Boolean computeValue(SlicedMap map, KtLambdaExpression expression, Boolean isBlock, boolean valueNotFound) { isBlock = valueNotFound ? false : isBlock; return isBlock && !expression.getFunctionLiteral().hasParameterSpecification(); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BodyResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BodyResolver.java index 2156e2a8c31..1f6f664a7d7 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/BodyResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/BodyResolver.java @@ -98,7 +98,7 @@ public class BodyResolver { } private void resolveBehaviorDeclarationBodies(@NotNull BodiesResolveContext c) { - resolveDelegationSpecifierLists(c); + resolveSuperTypeEntryLists(c); resolvePropertyDeclarationBodies(c); @@ -231,20 +231,20 @@ public class BodyResolver { functionAnalyzerExtension.process(c); } - private void resolveDelegationSpecifierLists(@NotNull BodiesResolveContext c) { + private void resolveSuperTypeEntryLists(@NotNull BodiesResolveContext c) { // TODO : Make sure the same thing is not initialized twice for (Map.Entry entry : c.getDeclaredClasses().entrySet()) { KtClassOrObject classOrObject = entry.getKey(); ClassDescriptorWithResolutionScopes descriptor = entry.getValue(); - resolveDelegationSpecifierList(c.getOuterDataFlowInfo(), classOrObject, descriptor, - descriptor.getUnsubstitutedPrimaryConstructor(), - descriptor.getScopeForConstructorHeaderResolution(), - descriptor.getScopeForMemberDeclarationResolution()); + resolveSuperTypeEntryList(c.getOuterDataFlowInfo(), classOrObject, descriptor, + descriptor.getUnsubstitutedPrimaryConstructor(), + descriptor.getScopeForConstructorHeaderResolution(), + descriptor.getScopeForMemberDeclarationResolution()); } } - public void resolveDelegationSpecifierList( + public void resolveSuperTypeEntryList( @NotNull final DataFlowInfo outerDataFlowInfo, @NotNull KtClassOrObject jetClass, @NotNull final ClassDescriptor descriptor, @@ -267,7 +267,7 @@ public class BodyResolver { } @Override - public void visitDelegationByExpressionSpecifier(@NotNull KtDelegatorByExpressionSpecifier specifier) { + public void visitDelegatedSuperTypeEntry(@NotNull KtDelegatedSuperTypeEntry specifier) { if (descriptor.getKind() == ClassKind.INTERFACE) { trace.report(DELEGATION_IN_INTERFACE.on(specifier)); } @@ -294,7 +294,7 @@ public class BodyResolver { } @Override - public void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call) { + public void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call) { KtValueArgumentList valueArgumentList = call.getValueArgumentList(); PsiElement elementToMark = valueArgumentList == null ? call : valueArgumentList; if (descriptor.getKind() == ClassKind.INTERFACE) { @@ -336,7 +336,7 @@ public class BodyResolver { } @Override - public void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier) { + public void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier) { KtTypeReference typeReference = specifier.getTypeReference(); KotlinType supertype = trace.getBindingContext().get(BindingContext.TYPE, typeReference); recordSupertype(typeReference, supertype); @@ -363,12 +363,12 @@ public class BodyResolver { } }; - for (KtDelegationSpecifier delegationSpecifier : jetClass.getDelegationSpecifiers()) { + for (KtSuperTypeListEntry delegationSpecifier : jetClass.getSuperTypeListEntries()) { delegationSpecifier.accept(visitor); } - if (DescriptorUtils.isAnnotationClass(descriptor) && jetClass.getDelegationSpecifierList() != null) { - trace.report(SUPERTYPES_FOR_ANNOTATION_CLASS.on(jetClass.getDelegationSpecifierList())); + if (DescriptorUtils.isAnnotationClass(descriptor) && jetClass.getSuperTypeList() != null) { + trace.report(SUPERTYPES_FOR_ANNOTATION_CLASS.on(jetClass.getSuperTypeList())); } if (primaryConstructorDelegationCall[0] != null && primaryConstructor != null) { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt index 2a15ba53d58..d016a02624c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DeclarationsChecker.kt @@ -149,7 +149,7 @@ class DeclarationsChecker( private fun checkTypesInClassHeader(classOrObject: KtClassOrObject) { fun KtTypeReference.type(): KotlinType? = trace.bindingContext.get(TYPE, this) - for (delegationSpecifier in classOrObject.getDelegationSpecifiers()) { + for (delegationSpecifier in classOrObject.getSuperTypeListEntries()) { val typeReference = delegationSpecifier.typeReference ?: continue typeReference.type()?.let { DescriptorResolver.checkBounds(typeReference, it, trace) } typeReference.checkNotEnumEntry(trace) @@ -212,7 +212,7 @@ class DeclarationsChecker( val containingDeclaration = typeParameterDescriptor.containingDeclaration as? ClassDescriptor ?: throw AssertionError("Not a class descriptor: " + typeParameterDescriptor.containingDeclaration) if (sourceElement is KtClassOrObject) { - val delegationSpecifierList = sourceElement.getDelegationSpecifierList() ?: continue + val delegationSpecifierList = sourceElement.getSuperTypeList() ?: continue trace.report(INCONSISTENT_TYPE_PARAMETER_VALUES.on( delegationSpecifierList, typeParameterDescriptor, containingDeclaration, conflictingTypes )) @@ -252,7 +252,7 @@ class DeclarationsChecker( private fun checkExposedSupertypes(klass: KtClassOrObject, classDescriptor: ClassDescriptor) { val classVisibility = classDescriptor.effectiveVisibility() val isInterface = classDescriptor.kind == ClassKind.INTERFACE - val delegationList = klass.getDelegationSpecifiers() + val delegationList = klass.getSuperTypeListEntries() classDescriptor.typeConstructor.supertypes.forEachIndexed { i, superType -> if (i >= delegationList.size) return val superDescriptor = TypeUtils.getClassDescriptor(superType) ?: return@forEachIndexed diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegationResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegationResolver.kt index 4966553cbb1..775d5012f2f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegationResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DelegationResolver.kt @@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.DELEGATION import org.jetbrains.kotlin.diagnostics.Errors.MANY_IMPL_MEMBER_NOT_IMPLEMENTED import org.jetbrains.kotlin.psi.KtClassOrObject -import org.jetbrains.kotlin.psi.KtDelegatorByExpressionSpecifier +import org.jetbrains.kotlin.psi.KtDelegatedSuperTypeEntry import org.jetbrains.kotlin.psi.KtTypeReference import org.jetbrains.kotlin.resolve.OverridingUtil.OverrideCompatibilityInfo.Result.OVERRIDABLE import org.jetbrains.kotlin.types.KotlinType @@ -37,8 +37,8 @@ class DelegationResolver private constructor( private fun generateDelegatedMembers(): Collection { val delegatedMembers = hashSetOf() - for (delegationSpecifier in classOrObject.getDelegationSpecifiers()) { - if (delegationSpecifier !is KtDelegatorByExpressionSpecifier) { + for (delegationSpecifier in classOrObject.getSuperTypeListEntries()) { + if (delegationSpecifier !is KtDelegatedSuperTypeEntry) { continue } val typeReference = delegationSpecifier.typeReference ?: continue diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DescriptorResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DescriptorResolver.java index 169facc8ebe..49549ee6d1b 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/DescriptorResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/DescriptorResolver.java @@ -109,8 +109,8 @@ public class DescriptorResolver { BindingTrace trace ) { List supertypes = Lists.newArrayList(); - List delegationSpecifiers = jetClass.getDelegationSpecifiers(); - Collection declaredSupertypes = resolveDelegationSpecifiers( + List delegationSpecifiers = jetClass.getSuperTypeListEntries(); + Collection declaredSupertypes = resolveSuperTypeListEntries( scope, delegationSpecifiers, typeResolver, trace, false); @@ -166,9 +166,9 @@ public class DescriptorResolver { return builtIns.getAnyType(); } - public Collection resolveDelegationSpecifiers( + public Collection resolveSuperTypeListEntries( LexicalScope extensibleScope, - List delegationSpecifiers, + List delegationSpecifiers, @NotNull TypeResolver resolver, BindingTrace trace, boolean checkBounds @@ -177,7 +177,7 @@ public class DescriptorResolver { return Collections.emptyList(); } Collection result = Lists.newArrayList(); - for (KtDelegationSpecifier delegationSpecifier : delegationSpecifiers) { + for (KtSuperTypeListEntry delegationSpecifier : delegationSpecifiers) { KtTypeReference typeReference = delegationSpecifier.getTypeReference(); if (typeReference != null) { KotlinType supertype = resolver.resolveType(extensibleScope, typeReference, trace, checkBounds); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt index 8db2c16656c..55c8491a07c 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/LazyTopDownAnalyzer.kt @@ -19,7 +19,6 @@ package org.jetbrains.kotlin.resolve import com.google.common.collect.HashMultimap import com.google.common.collect.Multimap import com.intellij.psi.PsiElement -import com.intellij.psi.util.PsiTreeUtil import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.diagnostics.Errors.* import org.jetbrains.kotlin.incremental.KotlinLookupLocation @@ -163,7 +162,7 @@ public class LazyTopDownAnalyzer( trace.report(UNSUPPORTED.on(typedef, "Typedefs are not supported")) } - override fun visitMultiDeclaration(multiDeclaration: KtMultiDeclaration) { + override fun visitDestructuringDeclaration(destructuringDeclaration: KtDestructuringDeclaration) { // Ignore: multi-declarations are only allowed locally } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/ModifiersChecker.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/ModifiersChecker.java index 1e649e96b9f..88d4919fb6f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/ModifiersChecker.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/ModifiersChecker.java @@ -192,10 +192,10 @@ public class ModifiersChecker { checkModifierListCommon(modifierListOwner, descriptor); } - public void checkModifiersForMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration) { + public void checkModifiersForDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration) { annotationChecker.check(multiDeclaration, trace, null); ModifierCheckerCore.INSTANCE.check(multiDeclaration, trace, null); - for (KtMultiDeclarationEntry multiEntry: multiDeclaration.getEntries()) { + for (KtDestructuringDeclarationEntry multiEntry: multiDeclaration.getEntries()) { annotationChecker.check(multiEntry, trace, null); ModifierCheckerCore.INSTANCE.check(multiEntry, trace, null); UnderscoreChecker.INSTANCE.checkNamed(multiEntry, trace); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/VarianceChecker.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/VarianceChecker.kt index 71250105b1f..65e6b1f6457 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/VarianceChecker.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/VarianceChecker.kt @@ -57,7 +57,7 @@ class VarianceChecker(private val trace: BindingTrace) { private fun checkClasses(c: TopDownAnalysisContext) { for (jetClassOrObject in c.getDeclaredClasses()!!.keySet()) { if (jetClassOrObject is KtClass) { - for (specifier in jetClassOrObject.getDelegationSpecifiers()) { + for (specifier in jetClassOrObject.getSuperTypeListEntries()) { specifier.getTypeReference()?.checkTypePosition(trace.getBindingContext(), OUT_VARIANCE, trace) } jetClassOrObject.checkTypeParameters(trace.getBindingContext(), OUT_VARIANCE, trace) diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/ArgumentTypeResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/ArgumentTypeResolver.java index c7dc1047d2a..e99836065e1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/ArgumentTypeResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/ArgumentTypeResolver.java @@ -30,22 +30,15 @@ import org.jetbrains.kotlin.resolve.TemporaryBindingTrace; import org.jetbrains.kotlin.resolve.TypeResolver; import org.jetbrains.kotlin.resolve.callableReferences.CallableReferencesResolutionUtilsKt; import org.jetbrains.kotlin.resolve.calls.callResolverUtil.ResolveArgumentsMode; -import org.jetbrains.kotlin.resolve.calls.callUtil.CallUtilKt; import org.jetbrains.kotlin.resolve.calls.context.CallResolutionContext; import org.jetbrains.kotlin.resolve.calls.context.CheckArgumentTypesMode; import org.jetbrains.kotlin.resolve.calls.context.ResolutionContext; import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderImplKt; import org.jetbrains.kotlin.resolve.calls.model.MutableDataFlowInfoForArguments; import org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults; -import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowInfo; -import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValue; -import org.jetbrains.kotlin.resolve.calls.smartcasts.DataFlowValueFactory; import org.jetbrains.kotlin.resolve.constants.IntegerValueTypeConstructor; import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator; import org.jetbrains.kotlin.resolve.scopes.LexicalScope; -import org.jetbrains.kotlin.resolve.scopes.receivers.QualifierReceiver; -import org.jetbrains.kotlin.resolve.scopes.receivers.Receiver; -import org.jetbrains.kotlin.resolve.scopes.receivers.ReceiverValue; import org.jetbrains.kotlin.types.FunctionPlaceholders; import org.jetbrains.kotlin.types.FunctionPlaceholdersKt; import org.jetbrains.kotlin.types.KotlinType; @@ -117,7 +110,7 @@ public class ArgumentTypeResolver { for (ValueArgument valueArgument : context.call.getValueArguments()) { KtExpression argumentExpression = valueArgument.getArgumentExpression(); - if (argumentExpression != null && !(argumentExpression instanceof KtFunctionLiteralExpression)) { + if (argumentExpression != null && !(argumentExpression instanceof KtLambdaExpression)) { checkArgumentTypeWithNoCallee(context, argumentExpression); } } @@ -173,8 +166,8 @@ public class ArgumentTypeResolver { @NotNull KtExpression expression, @NotNull ResolutionContext context ) { KtExpression deparenthesizedExpression = getLastElementDeparenthesized(expression, context.statementFilter); - if (deparenthesizedExpression instanceof KtFunctionLiteralExpression) { - return ((KtFunctionLiteralExpression) deparenthesizedExpression).getFunctionLiteral(); + if (deparenthesizedExpression instanceof KtLambdaExpression) { + return ((KtLambdaExpression) deparenthesizedExpression).getFunctionLiteral(); } if (deparenthesizedExpression instanceof KtFunction) { return (KtFunction) deparenthesizedExpression; diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallExpressionResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallExpressionResolver.java index f5c008a1ce4..9869d9cacc0 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallExpressionResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallExpressionResolver.java @@ -24,7 +24,6 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.kotlin.builtins.KotlinBuiltIns; import org.jetbrains.kotlin.descriptors.*; -import org.jetbrains.kotlin.lexer.KtTokens; import org.jetbrains.kotlin.psi.*; import org.jetbrains.kotlin.resolve.*; import org.jetbrains.kotlin.resolve.bindingContextUtil.BindingContextUtilsKt; @@ -222,7 +221,7 @@ public class CallExpressionResolver { if (result[0]) { FunctionDescriptor functionDescriptor = resolvedCall != null ? resolvedCall.getResultingDescriptor() : null; temporaryForFunction.commit(); - if (callExpression.getValueArgumentList() == null && callExpression.getFunctionLiteralArguments().isEmpty()) { + if (callExpression.getValueArgumentList() == null && callExpression.getLambdaArguments().isEmpty()) { // there are only type arguments boolean hasValueParameters = functionDescriptor == null || functionDescriptor.getValueParameters().size() > 0; context.trace.report(FUNCTION_CALL_EXPECTED.on(callExpression, callExpression, hasValueParameters)); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java index 87d11a073f0..b2a969ae214 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolver.java @@ -330,8 +330,8 @@ public class CallResolver { // Here we handle the case where the callee expression must be something of type function, e.g. (foo.bar())(1, 2) KotlinType expectedType = NO_EXPECTED_TYPE; - if (calleeExpression instanceof KtFunctionLiteralExpression) { - int parameterNumber = ((KtFunctionLiteralExpression) calleeExpression).getValueParameters().size(); + if (calleeExpression instanceof KtLambdaExpression) { + int parameterNumber = ((KtLambdaExpression) calleeExpression).getValueParameters().size(); List parameterTypes = new ArrayList(parameterNumber); for (int i = 0; i < parameterNumber; i++) { parameterTypes.add(NO_EXPECTED_TYPE); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolverUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolverUtil.kt index f6a3fb54df2..d07f5ffb0ea 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolverUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallResolverUtil.kt @@ -117,7 +117,7 @@ public fun isOrOverridesSynthesized(descriptor: CallableMemberDescriptor): Boole fun isConventionCall(call: Call): Boolean { if (call is CallTransformer.CallForImplicitInvoke) return true val callElement = call.callElement - if (callElement is KtArrayAccessExpression || callElement is KtMultiDeclarationEntry) return true + if (callElement is KtArrayAccessExpression || callElement is KtDestructuringDeclarationEntry) return true val calleeExpression = call.calleeExpression as? KtOperationReferenceExpression ?: return false return calleeExpression.getNameForConventionalOperation() != null } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallTransformer.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallTransformer.java index bad87fb2d32..4b1247ca780 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallTransformer.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/CallTransformer.java @@ -113,7 +113,7 @@ public class CallTransformer { @NotNull @Override - public List getFunctionLiteralArguments() { + public List getFunctionLiteralArguments() { return Collections.emptyList(); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/ValueArgumentsToParametersMapper.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/ValueArgumentsToParametersMapper.java index 24de37be5b7..47226c9f101 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/ValueArgumentsToParametersMapper.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/ValueArgumentsToParametersMapper.java @@ -256,10 +256,10 @@ public class ValueArgumentsToParametersMapper { D candidate = candidateCall.getCandidateDescriptor(); List valueParameters = candidate.getValueParameters(); - List functionLiteralArguments = call.getFunctionLiteralArguments(); + List functionLiteralArguments = call.getFunctionLiteralArguments(); if (!functionLiteralArguments.isEmpty()) { - FunctionLiteralArgument functionLiteralArgument = functionLiteralArguments.get(0); - KtExpression possiblyLabeledFunctionLiteral = functionLiteralArgument.getArgumentExpression(); + LambdaArgument lambdaArgument = functionLiteralArguments.get(0); + KtExpression possiblyLabeledFunctionLiteral = lambdaArgument.getArgumentExpression(); if (valueParameters.isEmpty()) { report(TOO_MANY_ARGUMENTS.on(possiblyLabeledFunctionLiteral, candidate)); @@ -277,7 +277,7 @@ public class ValueArgumentsToParametersMapper { setStatus(WEAK_ERROR); } else { - putVararg(valueParameterDescriptor, functionLiteralArgument); + putVararg(valueParameterDescriptor, lambdaArgument); } } } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategyForImplicitConstructorDelegationCall.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategyForImplicitConstructorDelegationCall.kt index 430022c8058..36d8821e5c9 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategyForImplicitConstructorDelegationCall.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/TracingStrategyForImplicitConstructorDelegationCall.kt @@ -22,7 +22,7 @@ import org.jetbrains.kotlin.diagnostics.Errors.UNRESOLVED_REFERENCE import org.jetbrains.kotlin.diagnostics.Errors.UNRESOLVED_REFERENCE_WRONG_RECEIVER import org.jetbrains.kotlin.psi.Call import org.jetbrains.kotlin.psi.KtConstructorDelegationCall -import org.jetbrains.kotlin.psi.KtFunctionLiteralArgument +import org.jetbrains.kotlin.psi.KtLambdaArgument import org.jetbrains.kotlin.psi.KtSecondaryConstructor import org.jetbrains.kotlin.resolve.BindingContext.CALL import org.jetbrains.kotlin.resolve.BindingContext.REFERENCE_TARGET diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/dynamicCalls.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/dynamicCalls.kt index 4951f3fff88..c2929e18fa6 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/dynamicCalls.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/tasks/dynamicCalls.kt @@ -172,7 +172,7 @@ class DynamicCallableDescriptors(private val builtIns: KotlinBuiltIns) { )) } - fun getFunctionType(funLiteralExpr: KtFunctionLiteralExpression): KotlinType { + fun getFunctionType(funLiteralExpr: KtLambdaExpression): KotlinType { val funLiteral = funLiteralExpr.getFunctionLiteral() val receiverType = funLiteral.getReceiverTypeReference()?.let { dynamicType } @@ -189,7 +189,7 @@ class DynamicCallableDescriptors(private val builtIns: KotlinBuiltIns) { val argExpression = KtPsiUtil.deparenthesize(arg.getArgumentExpression()) when { - argExpression is KtFunctionLiteralExpression -> { + argExpression is KtLambdaExpression -> { outType = getFunctionType(argExpression) varargElementType = null } @@ -210,7 +210,7 @@ class DynamicCallableDescriptors(private val builtIns: KotlinBuiltIns) { if (hasSpreadOperator) { for (funLiteralArg in call.getFunctionLiteralArguments()) { - addParameter(funLiteralArg, getFunctionType(funLiteralArg.getFunctionLiteral()), null) + addParameter(funLiteralArg, getFunctionType(funLiteralArg.getLambdaExpression()), null) } break diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/CallMaker.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/CallMaker.java index df865e923c6..79db1297a33 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/CallMaker.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/CallMaker.java @@ -164,7 +164,7 @@ public class CallMaker { @NotNull @Override - public List getFunctionLiteralArguments() { + public List getFunctionLiteralArguments() { return Collections.emptyList(); } @NotNull @@ -304,8 +304,8 @@ public class CallMaker { @Override @NotNull - public List getFunctionLiteralArguments() { - return callElement.getFunctionLiteralArguments(); + public List getFunctionLiteralArguments() { + return callElement.getLambdaArguments(); } @Override diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/DelegatingCall.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/DelegatingCall.java index 3dd5c891670..ac8d54a97a1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/DelegatingCall.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/DelegatingCall.java @@ -73,7 +73,7 @@ public class DelegatingCall implements Call { @Override @NotNull - public List getFunctionLiteralArguments() { + public List getFunctionLiteralArguments() { return delegate.getFunctionLiteralArguments(); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/callUtil.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/callUtil.kt index d4d5f6ad414..6127e4c1726 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/callUtil.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/calls/util/callUtil.kt @@ -87,14 +87,14 @@ public fun KtCallElement.getValueArgumentsInParentheses(): List = public fun Call.getValueArgumentListOrElement(): KtElement = getValueArgumentList() ?: getCalleeExpression() ?: getCallElement() @Suppress("UNCHECKED_CAST") -private fun List.filterArgsInParentheses() = filter { it !is KtFunctionLiteralArgument } as List +private fun List.filterArgsInParentheses() = filter { it !is KtLambdaArgument } as List public fun Call.getValueArgumentForExpression(expression: KtExpression): ValueArgument? { fun KtElement.deparenthesizeStructurally(): KtElement? { val deparenthesized = if (this is KtExpression) KtPsiUtil.deparenthesizeOnce(this) else this return when { deparenthesized != this -> deparenthesized - this is KtFunctionLiteralExpression -> this.getFunctionLiteral() + this is KtLambdaExpression -> this.getFunctionLiteral() this is KtFunctionLiteral -> this.getBodyExpression() else -> null } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/AbstractPsiBasedDeclarationProvider.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/AbstractPsiBasedDeclarationProvider.kt index 7e8311565af..d21633c6b6e 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/AbstractPsiBasedDeclarationProvider.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/declarations/AbstractPsiBasedDeclarationProvider.kt @@ -54,7 +54,7 @@ public abstract class AbstractPsiBasedDeclarationProvider(storageManager: Storag val scriptInfo = JetScriptInfo(declaration) classesAndObjects.put(scriptInfo.script.nameAsName, scriptInfo) } - else if (declaration is KtParameter || declaration is KtTypedef || declaration is KtMultiDeclaration) { + else if (declaration is KtParameter || declaration is KtTypedef || declaration is KtDestructuringDeclaration) { // Do nothing, just put it into allDeclarations is enough } else { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/AbstractLazyMemberScope.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/AbstractLazyMemberScope.kt index a3937e41353..d6d5d53832a 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/AbstractLazyMemberScope.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/AbstractLazyMemberScope.kt @@ -159,7 +159,7 @@ protected constructor( result.addAll(classDescriptors(name)) } } - else if (declaration is KtTypedef || declaration is KtMultiDeclaration) { + else if (declaration is KtTypedef || declaration is KtDestructuringDeclaration) { // Do nothing for typedefs as they are not supported. // MultiDeclarations are not supported on global level too. } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java index 9656ef60529..029dbc6ce3f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/lazy/descriptors/LazyClassDescriptor.java @@ -641,7 +641,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes PsiElement elementToMark = null; if (psiElement instanceof KtClassOrObject) { KtClassOrObject classOrObject = (KtClassOrObject) psiElement; - for (KtDelegationSpecifier delegationSpecifier : classOrObject.getDelegationSpecifiers()) { + for (KtSuperTypeListEntry delegationSpecifier : classOrObject.getSuperTypeListEntries()) { KtTypeReference typeReference = delegationSpecifier.getTypeReference(); if (typeReference == null) continue; KotlinType supertype = trace.get(TYPE, typeReference); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/DeprecatedSymbolValidator.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/DeprecatedSymbolValidator.kt index 65077024705..41d277a3b40 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/DeprecatedSymbolValidator.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/DeprecatedSymbolValidator.kt @@ -55,7 +55,7 @@ public class DeprecatedSymbolValidator : SymbolUsageValidator { return // Do not check types in calls to super constructor in extends list, rely on call message - val superExpression = KtStubbedPsiUtil.getPsiOrStubParent(element, javaClass(), true) + val superExpression = KtStubbedPsiUtil.getPsiOrStubParent(element, javaClass(), true) if (superExpression != null && superExpression.getCalleeExpression().getConstructorReferenceExpression() == element) return diff --git a/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/OperatorValidator.kt b/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/OperatorValidator.kt index 3f46d1b60e2..c1fea8a61b1 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/OperatorValidator.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/resolve/validation/OperatorValidator.kt @@ -49,7 +49,7 @@ public class OperatorValidator : SymbolUsageValidator { } fun isMultiDeclaration(): Boolean { - return (resolvedCall != null) && (call?.callElement is KtMultiDeclarationEntry) + return (resolvedCall != null) && (call?.callElement is KtDestructuringDeclarationEntry) } fun isConventionOperator(): Boolean { diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/AssignedVariablesSearcher.kt b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/AssignedVariablesSearcher.kt index ea728096140..57fe7ae58ec 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/AssignedVariablesSearcher.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/AssignedVariablesSearcher.kt @@ -46,10 +46,10 @@ abstract class AssignedVariablesSearcher: KtTreeVisitorVoid() { currentDeclaration = previous } - override fun visitFunctionLiteralExpression(functionLiteralExpression: KtFunctionLiteralExpression) { + override fun visitLambdaExpression(lambdaExpression: KtLambdaExpression) { val previous = currentDeclaration - currentDeclaration = functionLiteralExpression.functionLiteral - super.visitFunctionLiteralExpression(functionLiteralExpression) + currentDeclaration = lambdaExpression.functionLiteral + super.visitLambdaExpression(lambdaExpression) currentDeclaration = previous } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java index d4313ad85b3..f1760f99164 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/BasicExpressionTypingVisitor.java @@ -743,9 +743,9 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor { expression.getObjectDeclaration()); temporaryTrace.commit(); DataFlowInfo resultFlowInfo = context.dataFlowInfo; - for (KtDelegationSpecifier specifier : expression.getObjectDeclaration().getDelegationSpecifiers()) { - if (specifier instanceof KtDelegatorToSuperCall) { - KtDelegatorToSuperCall delegator = (KtDelegatorToSuperCall) specifier; + for (KtSuperTypeListEntry specifier : expression.getObjectDeclaration().getSuperTypeListEntries()) { + if (specifier instanceof KtSuperTypeCallEntry) { + KtSuperTypeCallEntry delegator = (KtSuperTypeCallEntry) specifier; KotlinTypeInfo delegatorTypeInfo = context.trace.get(EXPRESSION_TYPE_INFO, delegator.getCalleeExpression()); if (delegatorTypeInfo != null) { resultFlowInfo = resultFlowInfo.and(delegatorTypeInfo.getDataFlowInfo()); diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java index f12cc12b929..24c473cad16 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingUtils.java @@ -246,7 +246,7 @@ public class ControlStructureTypingUtils { @NotNull @Override - public List getFunctionLiteralArguments() { + public List getFunctionLiteralArguments() { return Collections.emptyList(); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingVisitor.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingVisitor.java index 59fcbfdc470..0fddfac08d5 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingVisitor.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ControlStructureTypingVisitor.java @@ -313,7 +313,7 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor { // .and it with entrance data flow information, because do-while body is executed at least once // See KT-6283 KotlinTypeInfo bodyTypeInfo; - if (body instanceof KtFunctionLiteralExpression) { + if (body instanceof KtLambdaExpression) { // As a matter of fact, function literal is always unused at this point bodyTypeInfo = facade.getTypeInfo(body, context.replaceScope(context.scope)); } @@ -397,15 +397,15 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor { loopScope.addVariableDescriptor(variableDescriptor); } else { - KtMultiDeclaration multiParameter = expression.getMultiParameter(); + KtDestructuringDeclaration multiParameter = expression.getDestructuringParameter(); if (multiParameter != null && loopRange != null) { KotlinType elementType = expectedParameterType == null ? ErrorUtils.createErrorType("Loop range has no type") : expectedParameterType; TransientReceiver iteratorNextAsReceiver = new TransientReceiver(elementType); components.annotationResolver.resolveAnnotationsWithArguments(loopScope, multiParameter.getModifierList(), context.trace); - components.multiDeclarationResolver.defineLocalVariablesFromMultiDeclaration( + components.destructuringDeclarationResolver.defineLocalVariablesFromMultiDeclaration( loopScope, multiParameter, iteratorNextAsReceiver, loopRange, context ); - components.modifiersChecker.withTrace(context.trace).checkModifiersForMultiDeclaration(multiParameter); + components.modifiersChecker.withTrace(context.trace).checkModifiersForDestructuringDeclaration(multiParameter); components.modifiersChecker.withTrace(context.trace).checkParameterHasNoValOrVar(multiParameter, VAL_OR_VAR_ON_LOOP_MULTI_PARAMETER); components.identifierChecker.checkDeclaration(multiParameter, context.trace); } @@ -538,7 +538,7 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor { } if (expression.getTargetLabel() == null) { - while (parentDeclaration instanceof KtMultiDeclaration) { + while (parentDeclaration instanceof KtDestructuringDeclaration) { //TODO: It's hacking fix for KT-5100: Strange "Return is not allowed here" for multi-declaration initializer with elvis expression parentDeclaration = PsiTreeUtil.getParentOfType(parentDeclaration, KtDeclaration.class); } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/MultiDeclarationResolver.kt b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DestructuringDeclarationResolver.kt similarity index 90% rename from compiler/frontend/src/org/jetbrains/kotlin/types/expressions/MultiDeclarationResolver.kt rename to compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DestructuringDeclarationResolver.kt index 89f991b2fcf..ff0d427f90f 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/MultiDeclarationResolver.kt +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/DestructuringDeclarationResolver.kt @@ -17,9 +17,9 @@ package org.jetbrains.kotlin.types.expressions import org.jetbrains.kotlin.diagnostics.Errors +import org.jetbrains.kotlin.psi.KtDestructuringDeclaration +import org.jetbrains.kotlin.psi.KtDestructuringDeclarationEntry import org.jetbrains.kotlin.psi.KtExpression -import org.jetbrains.kotlin.psi.KtMultiDeclaration -import org.jetbrains.kotlin.psi.KtMultiDeclarationEntry import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.DescriptorResolver import org.jetbrains.kotlin.resolve.TypeResolver @@ -32,7 +32,7 @@ import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.TypeUtils import org.jetbrains.kotlin.types.checker.KotlinTypeChecker -public class MultiDeclarationResolver( +public class DestructuringDeclarationResolver( private val fakeCallResolver: FakeCallResolver, private val descriptorResolver: DescriptorResolver, private val typeResolver: TypeResolver, @@ -40,12 +40,12 @@ public class MultiDeclarationResolver( ) { public fun defineLocalVariablesFromMultiDeclaration( writableScope: LexicalWritableScope, - multiDeclaration: KtMultiDeclaration, + destructuringDeclaration: KtDestructuringDeclaration, receiver: ReceiverValue, reportErrorsOn: KtExpression, context: ExpressionTypingContext ) { - for ((componentIndex, entry) in multiDeclaration.getEntries().withIndex()) { + for ((componentIndex, entry) in destructuringDeclaration.getEntries().withIndex()) { val componentName = createComponentName(componentIndex + 1) val expectedType = getExpectedTypeForComponent(context, entry) @@ -80,7 +80,7 @@ public class MultiDeclarationResolver( } } - private fun getExpectedTypeForComponent(context: ExpressionTypingContext, entry: KtMultiDeclarationEntry): KotlinType { + private fun getExpectedTypeForComponent(context: ExpressionTypingContext, entry: KtDestructuringDeclarationEntry): KotlinType { val entryTypeRef = entry.getTypeReference() ?: return TypeUtils.NO_EXPECTED_TYPE return typeResolver.resolveType(context.scope, entryTypeRef, context.trace, true) } diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingComponents.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingComponents.java index 268f3f8f0cb..884ce7827ac 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingComponents.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingComponents.java @@ -49,7 +49,7 @@ public class ExpressionTypingComponents { /*package*/ TypeResolver typeResolver; /*package*/ AnnotationResolver annotationResolver; /*package*/ ValueParameterResolver valueParameterResolver; - /*package*/ MultiDeclarationResolver multiDeclarationResolver; + /*package*/ DestructuringDeclarationResolver destructuringDeclarationResolver; /*package*/ ConstantExpressionEvaluator constantExpressionEvaluator; /*package*/ ModifiersChecker modifiersChecker; /*package*/ DataFlowAnalyzer dataFlowAnalyzer; @@ -142,8 +142,8 @@ public class ExpressionTypingComponents { } @Inject - public void setMultiDeclarationResolver(MultiDeclarationResolver multiDeclarationResolver) { - this.multiDeclarationResolver = multiDeclarationResolver; + public void setDestructuringDeclarationResolver(DestructuringDeclarationResolver destructuringDeclarationResolver) { + this.destructuringDeclarationResolver = destructuringDeclarationResolver; } @NotNull diff --git a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorDispatcher.java b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorDispatcher.java index 4a03022422a..e607da5f070 100644 --- a/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorDispatcher.java +++ b/compiler/frontend/src/org/jetbrains/kotlin/types/expressions/ExpressionTypingVisitorDispatcher.java @@ -229,8 +229,8 @@ public abstract class ExpressionTypingVisitorDispatcher extends KtVisitor PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -52,24 +52,24 @@ JetFile: CallWithManyClosures.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('f') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -87,8 +87,8 @@ JetFile: CallWithManyClosures.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('f') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -109,8 +109,8 @@ JetFile: CallWithManyClosures.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -131,24 +131,24 @@ JetFile: CallWithManyClosures.kt PsiElement(IDENTIFIER)('f') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -172,24 +172,24 @@ JetFile: CallWithManyClosures.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -221,24 +221,24 @@ JetFile: CallWithManyClosures.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/CallsInWhen.txt b/compiler/testData/psi/CallsInWhen.txt index e5cce93858d..8110c9055be 100644 --- a/compiler/testData/psi/CallsInWhen.txt +++ b/compiler/testData/psi/CallsInWhen.txt @@ -148,7 +148,7 @@ JetFile: CallsInWhen.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiElement(DOT)('.') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -167,7 +167,7 @@ JetFile: CallsInWhen.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiElement(DOT)('.') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -189,7 +189,7 @@ JetFile: CallsInWhen.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('a') PsiElement(DOT)('.') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/Constructors.txt b/compiler/testData/psi/Constructors.txt index 949532f3f0a..cc4a646ac76 100644 --- a/compiler/testData/psi/Constructors.txt +++ b/compiler/testData/psi/Constructors.txt @@ -27,8 +27,8 @@ JetFile: Constructors.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -52,8 +52,8 @@ JetFile: Constructors.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -78,8 +78,8 @@ JetFile: Constructors.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -108,8 +108,8 @@ JetFile: Constructors.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/DynamicSoftKeyword.txt b/compiler/testData/psi/DynamicSoftKeyword.txt index 036470a4a92..f53e6ed1b95 100644 --- a/compiler/testData/psi/DynamicSoftKeyword.txt +++ b/compiler/testData/psi/DynamicSoftKeyword.txt @@ -29,8 +29,8 @@ JetFile: DynamicSoftKeyword.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE DYNAMIC_TYPE PsiElement(dynamic)('dynamic') diff --git a/compiler/testData/psi/EmptyName.txt b/compiler/testData/psi/EmptyName.txt index e8ae2165a8f..8f6c51dc881 100644 --- a/compiler/testData/psi/EmptyName.txt +++ b/compiler/testData/psi/EmptyName.txt @@ -133,17 +133,17 @@ JetFile: EmptyName.kt BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(BAD_CHARACTER)('`') PsiErrorElement:Expecting a name PsiElement(BAD_CHARACTER)('`') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('y') PsiElement(RPAR)(')') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/EnumMissingName.txt b/compiler/testData/psi/EnumMissingName.txt index e822f91743c..1d913db7bd3 100644 --- a/compiler/testData/psi/EnumMissingName.txt +++ b/compiler/testData/psi/EnumMissingName.txt @@ -34,7 +34,7 @@ JetFile: EnumMissingName.kt ENUM_ENTRY PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -51,7 +51,7 @@ JetFile: EnumMissingName.kt ENUM_ENTRY PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -68,7 +68,7 @@ JetFile: EnumMissingName.kt ENUM_ENTRY PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/EnumShortCommas.txt b/compiler/testData/psi/EnumShortCommas.txt index f122fdda890..27068eb00ed 100644 --- a/compiler/testData/psi/EnumShortCommas.txt +++ b/compiler/testData/psi/EnumShortCommas.txt @@ -32,7 +32,7 @@ JetFile: EnumShortCommas.kt ENUM_ENTRY PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -49,7 +49,7 @@ JetFile: EnumShortCommas.kt ENUM_ENTRY PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -66,7 +66,7 @@ JetFile: EnumShortCommas.kt ENUM_ENTRY PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/EnumShortWithOverload.txt b/compiler/testData/psi/EnumShortWithOverload.txt index e2f59a863cd..8d89128ee40 100644 --- a/compiler/testData/psi/EnumShortWithOverload.txt +++ b/compiler/testData/psi/EnumShortWithOverload.txt @@ -32,7 +32,7 @@ JetFile: EnumShortWithOverload.kt ENUM_ENTRY PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -82,7 +82,7 @@ JetFile: EnumShortWithOverload.kt ENUM_ENTRY PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -132,7 +132,7 @@ JetFile: EnumShortWithOverload.kt ENUM_ENTRY PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/Enums.txt b/compiler/testData/psi/Enums.txt index 4251b46fce4..b7d2fc0f741 100644 --- a/compiler/testData/psi/Enums.txt +++ b/compiler/testData/psi/Enums.txt @@ -32,7 +32,7 @@ JetFile: Enums.kt ENUM_ENTRY PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -49,7 +49,7 @@ JetFile: Enums.kt ENUM_ENTRY PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -66,7 +66,7 @@ JetFile: Enums.kt ENUM_ENTRY PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/ForWithMultiDecl.txt b/compiler/testData/psi/ForWithMultiDecl.txt index 5786264a36b..80bc628f413 100644 --- a/compiler/testData/psi/ForWithMultiDecl.txt +++ b/compiler/testData/psi/ForWithMultiDecl.txt @@ -18,9 +18,9 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -40,13 +40,13 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -66,9 +66,9 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -78,7 +78,7 @@ JetFile: ForWithMultiDecl.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -104,9 +104,9 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -116,7 +116,7 @@ JetFile: ForWithMultiDecl.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -136,13 +136,13 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -168,11 +168,11 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -192,15 +192,15 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -220,11 +220,11 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -234,7 +234,7 @@ JetFile: ForWithMultiDecl.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -260,11 +260,11 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -274,7 +274,7 @@ JetFile: ForWithMultiDecl.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -294,15 +294,15 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -328,11 +328,11 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -352,15 +352,15 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -380,11 +380,11 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -394,7 +394,7 @@ JetFile: ForWithMultiDecl.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -420,11 +420,11 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -434,7 +434,7 @@ JetFile: ForWithMultiDecl.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -454,15 +454,15 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -488,9 +488,9 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiErrorElement:Expecting ')' @@ -511,9 +511,9 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiErrorElement:Expecting a name @@ -537,9 +537,9 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -564,9 +564,9 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -595,12 +595,12 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') PsiErrorElement:Expecting a name PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -626,9 +626,9 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -651,7 +651,7 @@ JetFile: ForWithMultiDecl.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') PsiErrorElement:Expecting a name diff --git a/compiler/testData/psi/FunctionCalls.txt b/compiler/testData/psi/FunctionCalls.txt index 5200fb77ed3..1bfe8745a06 100644 --- a/compiler/testData/psi/FunctionCalls.txt +++ b/compiler/testData/psi/FunctionCalls.txt @@ -64,8 +64,8 @@ JetFile: FunctionCalls.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('i') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -77,7 +77,7 @@ JetFile: FunctionCalls.kt PsiElement(IDENTIFIER)('j') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -89,8 +89,8 @@ JetFile: FunctionCalls.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('k') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -110,8 +110,8 @@ JetFile: FunctionCalls.kt PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -132,7 +132,7 @@ JetFile: FunctionCalls.kt PsiElement(RPAR)(')') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -160,8 +160,8 @@ JetFile: FunctionCalls.kt PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -190,7 +190,7 @@ JetFile: FunctionCalls.kt PsiElement(RPAR)(')') PsiElement(SEMICOLON)(';') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') diff --git a/compiler/testData/psi/FunctionExpressions.txt b/compiler/testData/psi/FunctionExpressions.txt index 6cd6044526e..0f18e745348 100644 --- a/compiler/testData/psi/FunctionExpressions.txt +++ b/compiler/testData/psi/FunctionExpressions.txt @@ -765,8 +765,8 @@ JetFile: FunctionExpressions.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -857,8 +857,8 @@ JetFile: FunctionExpressions.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -890,8 +890,8 @@ JetFile: FunctionExpressions.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/FunctionLiterals.txt b/compiler/testData/psi/FunctionLiterals.txt index aa4dc70a2d8..a00ce7724f6 100644 --- a/compiler/testData/psi/FunctionLiterals.txt +++ b/compiler/testData/psi/FunctionLiterals.txt @@ -14,14 +14,14 @@ JetFile: FunctionLiterals.kt BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -29,7 +29,7 @@ JetFile: FunctionLiterals.kt PsiElement(IDENTIFIER)('foo') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -43,7 +43,7 @@ JetFile: FunctionLiterals.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -61,7 +61,7 @@ JetFile: FunctionLiterals.kt PsiElement(INTEGER_LITERAL)('1') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -81,7 +81,7 @@ JetFile: FunctionLiterals.kt PsiElement(IDENTIFIER)('f') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -105,7 +105,7 @@ JetFile: FunctionLiterals.kt PsiElement(IDENTIFIER)('f') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -135,7 +135,7 @@ JetFile: FunctionLiterals.kt PsiElement(IDENTIFIER)('f') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST diff --git a/compiler/testData/psi/FunctionLiterals_ERR.txt b/compiler/testData/psi/FunctionLiterals_ERR.txt index 9227af58835..c3d72c4389e 100644 --- a/compiler/testData/psi/FunctionLiterals_ERR.txt +++ b/compiler/testData/psi/FunctionLiterals_ERR.txt @@ -14,7 +14,7 @@ JetFile: FunctionLiterals_ERR.kt BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -27,7 +27,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -44,7 +44,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -65,7 +65,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -89,7 +89,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -108,7 +108,7 @@ JetFile: FunctionLiterals_ERR.kt PsiWhiteSpace(' ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -128,7 +128,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -159,7 +159,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -192,7 +192,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -216,7 +216,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -248,7 +248,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -273,7 +273,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('f') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -297,7 +297,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('f') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -316,7 +316,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('f') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -334,7 +334,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('f') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -356,7 +356,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -377,7 +377,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -398,7 +398,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('f') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -416,7 +416,7 @@ JetFile: FunctionLiterals_ERR.kt PsiWhiteSpace(' ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -438,7 +438,7 @@ JetFile: FunctionLiterals_ERR.kt PsiWhiteSpace(' ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -457,7 +457,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(RPAR)(')') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -472,7 +472,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -488,7 +488,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -510,7 +510,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -536,7 +536,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -556,7 +556,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -577,7 +577,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -606,7 +606,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -635,7 +635,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -664,7 +664,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -680,7 +680,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -696,7 +696,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -716,7 +716,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -736,7 +736,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -756,7 +756,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -782,7 +782,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -812,7 +812,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -836,7 +836,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(IDENTIFIER)('a') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -877,7 +877,7 @@ JetFile: FunctionLiterals_ERR.kt PsiElement(INTEGER_LITERAL)('1') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -898,7 +898,7 @@ JetFile: FunctionLiterals_ERR.kt PsiWhiteSpace(' ') PsiElement(object)('object') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -942,7 +942,7 @@ JetFile: FunctionLiterals_ERR.kt PsiWhiteSpace(' ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -980,7 +980,7 @@ JetFile: FunctionLiterals_ERR.kt PsiWhiteSpace(' ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/IncompleteFunctionLiteral.txt b/compiler/testData/psi/IncompleteFunctionLiteral.txt index d14e453c431..b5660461c7e 100644 --- a/compiler/testData/psi/IncompleteFunctionLiteral.txt +++ b/compiler/testData/psi/IncompleteFunctionLiteral.txt @@ -14,7 +14,7 @@ JetFile: IncompleteFunctionLiteral.kt BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST diff --git a/compiler/testData/psi/Labels.txt b/compiler/testData/psi/Labels.txt index 48b2efdfa09..49969470ab1 100644 --- a/compiler/testData/psi/Labels.txt +++ b/compiler/testData/psi/Labels.txt @@ -187,13 +187,13 @@ JetFile: Labels.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('filter') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT LABELED_EXPRESSION LABEL_QUALIFIER LABEL PsiElement(IDENTIFIER)('f') PsiElement(AT)('@') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -231,11 +231,11 @@ JetFile: Labels.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('filter') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION PsiErrorElement:Expected annotation identifier after '@' PsiElement(AT)('@') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') diff --git a/compiler/testData/psi/MultiVariableDeclarations.txt b/compiler/testData/psi/MultiVariableDeclarations.txt index 013ff8fcdf9..1cf3b77b5ea 100644 --- a/compiler/testData/psi/MultiVariableDeclarations.txt +++ b/compiler/testData/psi/MultiVariableDeclarations.txt @@ -14,11 +14,11 @@ JetFile: MultiVariableDeclarations.kt BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -27,11 +27,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -46,15 +46,15 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -63,11 +63,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -77,7 +77,7 @@ JetFile: MultiVariableDeclarations.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -92,11 +92,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -106,7 +106,7 @@ JetFile: MultiVariableDeclarations.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -115,15 +115,15 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -138,11 +138,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -151,11 +151,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -170,15 +170,15 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -187,11 +187,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -201,7 +201,7 @@ JetFile: MultiVariableDeclarations.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -216,11 +216,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -230,7 +230,7 @@ JetFile: MultiVariableDeclarations.kt PsiElement(IDENTIFIER)('Int') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -239,15 +239,15 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(var)('var') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(COLON)(':') PsiWhiteSpace(' ') @@ -262,7 +262,7 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') @@ -275,14 +275,14 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') PsiErrorElement:Expecting a name PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -291,11 +291,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiErrorElement:Expecting a name @@ -308,15 +308,15 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiErrorElement:Expecting a name PsiElement(COLON)(':') @@ -332,15 +332,15 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiErrorElement:Expecting a name PsiElement(COLON)(':') @@ -360,15 +360,15 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiErrorElement:Expecting a name PsiElement(EQ)('=') @@ -376,15 +376,15 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiErrorElement:Expecting ')' @@ -394,11 +394,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiErrorElement:Expecting a name PsiElement(INTEGER_LITERAL)('1') PsiElement(RPAR)(')') @@ -408,7 +408,7 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Receiver type is not allowed on a destructuring declaration @@ -418,7 +418,7 @@ JetFile: MultiVariableDeclarations.kt PsiElement(IDENTIFIER)('T') PsiElement(DOT)('.') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -427,11 +427,11 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiErrorElement:Type annotations are not allowed on destructuring declarations @@ -447,7 +447,7 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Receiver type is not allowed on a destructuring declaration @@ -457,7 +457,7 @@ JetFile: MultiVariableDeclarations.kt PsiElement(IDENTIFIER)('T') PsiElement(DOT)('.') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(RPAR)(')') PsiErrorElement:Type annotations are not allowed on destructuring declarations @@ -475,16 +475,16 @@ JetFile: MultiVariableDeclarations.kt PsiWhiteSpace('\n') PsiElement(RBRACE)('}') PsiWhiteSpace('\n\n') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Destructuring declarations are only allowed for local variables/values PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -493,7 +493,7 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Receiver type is not allowed on a destructuring declaration @@ -504,11 +504,11 @@ JetFile: MultiVariableDeclarations.kt PsiElement(DOT)('.') PsiErrorElement:Destructuring declarations are only allowed for local variables/values PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -517,16 +517,16 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Destructuring declarations are only allowed for local variables/values PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiErrorElement:Type annotations are not allowed on destructuring declarations @@ -549,16 +549,16 @@ JetFile: MultiVariableDeclarations.kt CLASS_BODY PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Destructuring declarations are only allowed for local variables/values PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -567,7 +567,7 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Receiver type is not allowed on a destructuring declaration @@ -578,11 +578,11 @@ JetFile: MultiVariableDeclarations.kt PsiElement(DOT)('.') PsiErrorElement:Destructuring declarations are only allowed for local variables/values PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -591,16 +591,16 @@ JetFile: MultiVariableDeclarations.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Destructuring declarations are only allowed for local variables/values PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('a') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('b') PsiElement(RPAR)(')') PsiErrorElement:Type annotations are not allowed on destructuring declarations diff --git a/compiler/testData/psi/NewlinesInParentheses.txt b/compiler/testData/psi/NewlinesInParentheses.txt index b77bcb144d0..d7d3b5d5f2f 100644 --- a/compiler/testData/psi/NewlinesInParentheses.txt +++ b/compiler/testData/psi/NewlinesInParentheses.txt @@ -94,7 +94,7 @@ JetFile: NewlinesInParentheses.kt PsiWhiteSpace(' ') PARENTHESIZED PsiElement(LPAR)('(') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -120,7 +120,7 @@ JetFile: NewlinesInParentheses.kt PARENTHESIZED PsiElement(LPAR)('(') BINARY_EXPRESSION - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -177,7 +177,7 @@ JetFile: NewlinesInParentheses.kt PsiElement(IDENTIFIER)('b') INDICES PsiElement(LBRACKET)('[') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -206,7 +206,7 @@ JetFile: NewlinesInParentheses.kt INDICES PsiElement(LBRACKET)('[') BINARY_EXPRESSION - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/NonTypeBeforeDotInBaseClass.txt b/compiler/testData/psi/NonTypeBeforeDotInBaseClass.txt index 97293c7e161..3b915e26ad8 100644 --- a/compiler/testData/psi/NonTypeBeforeDotInBaseClass.txt +++ b/compiler/testData/psi/NonTypeBeforeDotInBaseClass.txt @@ -21,8 +21,8 @@ JetFile: NonTypeBeforeDotInBaseClass.kt PsiElement(IDENTIFIER)('ClassC') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE PsiErrorElement:Type expected PsiElement(super)('super') diff --git a/compiler/testData/psi/ObjectLiteralAsStatement.txt b/compiler/testData/psi/ObjectLiteralAsStatement.txt index c14aebf3451..61c6dcecc9d 100644 --- a/compiler/testData/psi/ObjectLiteralAsStatement.txt +++ b/compiler/testData/psi/ObjectLiteralAsStatement.txt @@ -38,8 +38,8 @@ JetFile: ObjectLiteralAsStatement.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/SimpleClassMembers.txt b/compiler/testData/psi/SimpleClassMembers.txt index 6564e65be28..b0e90da90bf 100644 --- a/compiler/testData/psi/SimpleClassMembers.txt +++ b/compiler/testData/psi/SimpleClassMembers.txt @@ -120,8 +120,8 @@ JetFile: SimpleClassMembers.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -142,15 +142,15 @@ JetFile: SimpleClassMembers.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Fooo') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_BY + DELEGATED_SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -176,15 +176,15 @@ JetFile: SimpleClassMembers.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Fooo') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_BY + DELEGATED_SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -196,7 +196,7 @@ JetFile: SimpleClassMembers.kt PsiElement(IDENTIFIER)('foo') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -313,8 +313,8 @@ JetFile: SimpleClassMembers.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -335,15 +335,15 @@ JetFile: SimpleClassMembers.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Fooo') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_BY + DELEGATED_SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -369,15 +369,15 @@ JetFile: SimpleClassMembers.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Fooo') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_BY + DELEGATED_SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -389,7 +389,7 @@ JetFile: SimpleClassMembers.kt PsiElement(IDENTIFIER)('foo') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/SimpleExpressions.txt b/compiler/testData/psi/SimpleExpressions.txt index 902ad4bd58b..5def66b3ceb 100644 --- a/compiler/testData/psi/SimpleExpressions.txt +++ b/compiler/testData/psi/SimpleExpressions.txt @@ -471,8 +471,8 @@ JetFile: SimpleExpressions.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/SoftKeywords.txt b/compiler/testData/psi/SoftKeywords.txt index 0a0d1a8b375..ac8c2893f15 100644 --- a/compiler/testData/psi/SoftKeywords.txt +++ b/compiler/testData/psi/SoftKeywords.txt @@ -140,8 +140,8 @@ JetFile: SoftKeywords.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_BY + SUPER_TYPE_LIST + DELEGATED_SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/StringTemplates.txt b/compiler/testData/psi/StringTemplates.txt index 3a7b8cbb765..2b638ec1c0a 100644 --- a/compiler/testData/psi/StringTemplates.txt +++ b/compiler/testData/psi/StringTemplates.txt @@ -292,8 +292,8 @@ JetFile: StringTemplates.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('map') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -322,8 +322,8 @@ JetFile: StringTemplates.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('map') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -357,8 +357,8 @@ JetFile: StringTemplates.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('map') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -377,8 +377,8 @@ JetFile: StringTemplates.kt CALL_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('buzz') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/TripleDot.txt b/compiler/testData/psi/TripleDot.txt index 24480f955f5..0d997aea8d7 100644 --- a/compiler/testData/psi/TripleDot.txt +++ b/compiler/testData/psi/TripleDot.txt @@ -38,7 +38,7 @@ JetFile: TripleDot.kt PsiElement(INTEGER_LITERAL)('2') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n ') diff --git a/compiler/testData/psi/When.txt b/compiler/testData/psi/When.txt index c3f79f49ebe..a9ea0c34d49 100644 --- a/compiler/testData/psi/When.txt +++ b/compiler/testData/psi/When.txt @@ -30,7 +30,7 @@ JetFile: When.kt PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/annotation/TypeAnnotations.txt b/compiler/testData/psi/annotation/TypeAnnotations.txt index 61bdb4e78c7..f267a3b719e 100644 --- a/compiler/testData/psi/annotation/TypeAnnotations.txt +++ b/compiler/testData/psi/annotation/TypeAnnotations.txt @@ -110,8 +110,8 @@ JetFile: TypeAnnotations.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE ANNOTATION PsiElement(AT)('@') @@ -129,7 +129,7 @@ JetFile: TypeAnnotations.kt PsiElement(IDENTIFIER)('B') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_BY + DELEGATED_SUPER_TYPE_ENTRY TYPE_REFERENCE ANNOTATION PsiElement(AT)('@') @@ -159,7 +159,7 @@ JetFile: TypeAnnotations.kt PsiElement(IDENTIFIER)('F') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE ANNOTATION @@ -181,7 +181,7 @@ JetFile: TypeAnnotations.kt PsiElement(RPAR)(')') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE ANNOTATION PsiElement(AT)('@') diff --git a/compiler/testData/psi/annotation/at/annotationValueArgumentsAmbiguity.txt b/compiler/testData/psi/annotation/at/annotationValueArgumentsAmbiguity.txt index b0f2f676df7..08926abc0a2 100644 --- a/compiler/testData/psi/annotation/at/annotationValueArgumentsAmbiguity.txt +++ b/compiler/testData/psi/annotation/at/annotationValueArgumentsAmbiguity.txt @@ -26,7 +26,7 @@ JetFile: annotationValueArgumentsAmbiguity.kt VALUE_ARGUMENT_LIST PsiElement(LPAR)('(') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -75,7 +75,7 @@ JetFile: annotationValueArgumentsAmbiguity.kt PsiWhiteSpace(' ') PARENTHESIZED PsiElement(LPAR)('(') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/annotation/at/enumEntries.txt b/compiler/testData/psi/annotation/at/enumEntries.txt index cc919bd2aa0..bf38095ac21 100644 --- a/compiler/testData/psi/annotation/at/enumEntries.txt +++ b/compiler/testData/psi/annotation/at/enumEntries.txt @@ -43,7 +43,7 @@ JetFile: enumEntries.kt PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('X') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -66,7 +66,7 @@ JetFile: enumEntries.kt PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Y') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -98,7 +98,7 @@ JetFile: enumEntries.kt PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('Z') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/annotation/at/primaryConstructor.txt b/compiler/testData/psi/annotation/at/primaryConstructor.txt index 5fa62350c15..dcca353daee 100644 --- a/compiler/testData/psi/annotation/at/primaryConstructor.txt +++ b/compiler/testData/psi/annotation/at/primaryConstructor.txt @@ -64,8 +64,8 @@ JetFile: primaryConstructor.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/annotation/at/validExpressions.txt b/compiler/testData/psi/annotation/at/validExpressions.txt index 9c962ce7c36..c3dbe3ce8f2 100644 --- a/compiler/testData/psi/annotation/at/validExpressions.txt +++ b/compiler/testData/psi/annotation/at/validExpressions.txt @@ -351,7 +351,7 @@ JetFile: validExpressions.kt LABEL PsiElement(IDENTIFIER)('l') PsiElement(AT)('@') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') diff --git a/compiler/testData/psi/annotation/forParameters.txt b/compiler/testData/psi/annotation/forParameters.txt index e8ab0e6562b..f180c4a74ec 100644 --- a/compiler/testData/psi/annotation/forParameters.txt +++ b/compiler/testData/psi/annotation/forParameters.txt @@ -93,13 +93,13 @@ JetFile: forParameters.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('x') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') @@ -143,9 +143,9 @@ JetFile: forParameters.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY MODIFIER_LIST ANNOTATION PsiElement(AT)('@') @@ -161,7 +161,7 @@ JetFile: forParameters.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('x') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -253,7 +253,7 @@ JetFile: forParameters.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION MODIFIER_LIST ANNOTATION_ENTRY PsiElement(AT)('@') @@ -267,11 +267,11 @@ JetFile: forParameters.kt PsiElement(RPAR)(')') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('x') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY MODIFIER_LIST ANNOTATION_ENTRY PsiElement(AT)('@') @@ -377,7 +377,7 @@ JetFile: forParameters.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') @@ -392,11 +392,11 @@ JetFile: forParameters.kt PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('x') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY MODIFIER_LIST ANNOTATION_ENTRY PsiElement(AT)('@') diff --git a/compiler/testData/psi/annotation/lambda.txt b/compiler/testData/psi/annotation/lambda.txt index 2ef9a899f91..8ca15cbec5d 100644 --- a/compiler/testData/psi/annotation/lambda.txt +++ b/compiler/testData/psi/annotation/lambda.txt @@ -18,7 +18,7 @@ JetFile: lambda.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION ANNOTATION_ENTRY PsiElement(AT)('@') @@ -28,7 +28,7 @@ JetFile: lambda.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -56,8 +56,8 @@ JetFile: lambda.kt PsiElement(IDENTIFIER)('ann') PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -80,7 +80,7 @@ JetFile: lambda.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION ANNOTATION_ENTRY PsiElement(AT)('@') @@ -101,7 +101,7 @@ JetFile: lambda.kt PsiElement(IDENTIFIER)('ann') PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -125,7 +125,7 @@ JetFile: lambda.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION ANNOTATION_ENTRY PsiElement(AT)('@') @@ -135,7 +135,7 @@ JetFile: lambda.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -159,7 +159,7 @@ JetFile: lambda.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION ANNOTATION PsiElement(AT)('@') @@ -172,7 +172,7 @@ JetFile: lambda.kt PsiElement(IDENTIFIER)('ann') PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -196,7 +196,7 @@ JetFile: lambda.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION ANNOTATION_ENTRY PsiElement(AT)('@') @@ -217,7 +217,7 @@ JetFile: lambda.kt PsiElement(IDENTIFIER)('ann') PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -249,7 +249,7 @@ JetFile: lambda.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -336,7 +336,7 @@ JetFile: lambda.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n ') diff --git a/compiler/testData/psi/annotation/lambdaRecovery.txt b/compiler/testData/psi/annotation/lambdaRecovery.txt index 394503c7e59..271d2142cd0 100644 --- a/compiler/testData/psi/annotation/lambdaRecovery.txt +++ b/compiler/testData/psi/annotation/lambdaRecovery.txt @@ -22,7 +22,7 @@ JetFile: lambdaRecovery.kt PsiWhiteSpace(' ') PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -43,12 +43,12 @@ JetFile: lambdaRecovery.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION PsiErrorElement:Expected annotation identifier after '@' PsiElement(AT)('@') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -69,7 +69,7 @@ JetFile: lambdaRecovery.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('bar') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION PsiErrorElement:Expected annotation identifier after '@' PsiElement(AT)('@') @@ -85,7 +85,7 @@ JetFile: lambdaRecovery.kt PsiElement(IDENTIFIER)('ann') PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -113,12 +113,12 @@ JetFile: lambdaRecovery.kt PsiElement(RBRACKET)(']') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION PsiErrorElement:Expected annotation identifier after '@' PsiElement(AT)('@') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -142,12 +142,12 @@ JetFile: lambdaRecovery.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION PsiErrorElement:Expected annotation identifier after '@' PsiElement(AT)('@') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -171,7 +171,7 @@ JetFile: lambdaRecovery.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION ANNOTATION PsiElement(AT)('@') @@ -183,7 +183,7 @@ JetFile: lambdaRecovery.kt PsiErrorElement:Expected annotation identifier after '@' PsiElement(AT)('@') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -210,7 +210,7 @@ JetFile: lambdaRecovery.kt PsiErrorElement:Expected annotation identifier after '@' PsiElement(AT)('@') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -241,8 +241,8 @@ JetFile: lambdaRecovery.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -300,8 +300,8 @@ JetFile: lambdaRecovery.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('ann') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n ') diff --git a/compiler/testData/psi/annotation/modifiersMigration/newModifiers.txt b/compiler/testData/psi/annotation/modifiersMigration/newModifiers.txt index 5e713b5fae3..0921e3b6511 100644 --- a/compiler/testData/psi/annotation/modifiersMigration/newModifiers.txt +++ b/compiler/testData/psi/annotation/modifiersMigration/newModifiers.txt @@ -182,8 +182,8 @@ JetFile: newModifiers.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('data') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n ') @@ -201,8 +201,8 @@ JetFile: newModifiers.kt PsiElement(IDENTIFIER)('data') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n\n ') diff --git a/compiler/testData/psi/annotation/multiDeclaration.txt b/compiler/testData/psi/annotation/multiDeclaration.txt index 486776b1d84..e5b43ec4775 100644 --- a/compiler/testData/psi/annotation/multiDeclaration.txt +++ b/compiler/testData/psi/annotation/multiDeclaration.txt @@ -14,15 +14,15 @@ JetFile: multiDeclaration.kt BLOCK PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('x') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY MODIFIER_LIST PsiElement(private)('private') PsiWhiteSpace(' ') @@ -55,11 +55,11 @@ JetFile: multiDeclaration.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('pair') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY MODIFIER_LIST ANNOTATION PsiElement(AT)('@') @@ -75,7 +75,7 @@ JetFile: multiDeclaration.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('x') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -84,7 +84,7 @@ JetFile: multiDeclaration.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('pair') PsiWhiteSpace('\n\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION MODIFIER_LIST ANNOTATION_ENTRY PsiElement(AT)('@') @@ -97,7 +97,7 @@ JetFile: multiDeclaration.kt PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY MODIFIER_LIST ANNOTATION_ENTRY PsiElement(AT)('@') @@ -110,7 +110,7 @@ JetFile: multiDeclaration.kt PsiElement(IDENTIFIER)('x') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('y') PsiElement(RPAR)(')') PsiWhiteSpace(' ') @@ -119,7 +119,7 @@ JetFile: multiDeclaration.kt INTEGER_CONSTANT PsiElement(INTEGER_LITERAL)('1') PsiWhiteSpace('\n ') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION MODIFIER_LIST ANNOTATION_ENTRY PsiElement(AT)('@') @@ -132,7 +132,7 @@ JetFile: multiDeclaration.kt PsiElement(val)('val') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY MODIFIER_LIST ANNOTATION_ENTRY PsiElement(AT)('@') @@ -145,7 +145,7 @@ JetFile: multiDeclaration.kt PsiElement(IDENTIFIER)('x') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('y') PsiErrorElement:Expecting ')' diff --git a/compiler/testData/psi/annotation/oldAnnotationsRecovery.txt b/compiler/testData/psi/annotation/oldAnnotationsRecovery.txt index ee2fc7ca528..27a4a9f73fe 100644 --- a/compiler/testData/psi/annotation/oldAnnotationsRecovery.txt +++ b/compiler/testData/psi/annotation/oldAnnotationsRecovery.txt @@ -48,7 +48,7 @@ JetFile: oldAnnotationsRecovery.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') diff --git a/compiler/testData/psi/annotation/targeted/onParam/recovery.txt b/compiler/testData/psi/annotation/targeted/onParam/recovery.txt index e71b1dd22d9..794733fbf06 100644 --- a/compiler/testData/psi/annotation/targeted/onParam/recovery.txt +++ b/compiler/testData/psi/annotation/targeted/onParam/recovery.txt @@ -28,8 +28,8 @@ JetFile: recovery.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/AnonymousObjects.txt b/compiler/testData/psi/examples/AnonymousObjects.txt index c86781f801c..cc2dd449ab5 100644 --- a/compiler/testData/psi/examples/AnonymousObjects.txt +++ b/compiler/testData/psi/examples/AnonymousObjects.txt @@ -26,8 +26,8 @@ JetFile: AnonymousObjects.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/examples/BinaryTree.txt b/compiler/testData/psi/examples/BinaryTree.txt index 27e44f466e6..aa17bff61b5 100644 --- a/compiler/testData/psi/examples/BinaryTree.txt +++ b/compiler/testData/psi/examples/BinaryTree.txt @@ -15,8 +15,8 @@ JetFile: BinaryTree.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -1723,8 +1723,8 @@ JetFile: BinaryTree.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/BitArith.txt b/compiler/testData/psi/examples/BitArith.txt index 165fa9cee51..6d02148bf8d 100644 --- a/compiler/testData/psi/examples/BitArith.txt +++ b/compiler/testData/psi/examples/BitArith.txt @@ -526,8 +526,8 @@ JetFile: BitArith.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/Builder.txt b/compiler/testData/psi/examples/Builder.txt index ae9cb3d70d5..33811173669 100644 --- a/compiler/testData/psi/examples/Builder.txt +++ b/compiler/testData/psi/examples/Builder.txt @@ -17,8 +17,8 @@ JetFile: Builder.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -51,8 +51,8 @@ JetFile: Builder.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('library') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -96,8 +96,8 @@ JetFile: Builder.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('library') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -128,8 +128,8 @@ JetFile: Builder.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('each') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -168,8 +168,8 @@ JetFile: Builder.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('module') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -262,8 +262,8 @@ JetFile: Builder.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -342,8 +342,8 @@ JetFile: Builder.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/Color.txt b/compiler/testData/psi/examples/Color.txt index 2f6b1ab6b3b..e2af0351935 100644 --- a/compiler/testData/psi/examples/Color.txt +++ b/compiler/testData/psi/examples/Color.txt @@ -58,7 +58,7 @@ JetFile: Color.kt ENUM_ENTRY PsiElement(IDENTIFIER)('RED') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -85,7 +85,7 @@ JetFile: Color.kt ENUM_ENTRY PsiElement(IDENTIFIER)('GREEN') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -112,7 +112,7 @@ JetFile: Color.kt ENUM_ENTRY PsiElement(IDENTIFIER)('BLUE') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/examples/FunctionsAndTypes.txt b/compiler/testData/psi/examples/FunctionsAndTypes.txt index cf1c9a1fbc3..a88cb3b0206 100644 --- a/compiler/testData/psi/examples/FunctionsAndTypes.txt +++ b/compiler/testData/psi/examples/FunctionsAndTypes.txt @@ -450,7 +450,7 @@ JetFile: FunctionsAndTypes.kt PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -485,7 +485,7 @@ JetFile: FunctionsAndTypes.kt PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -513,7 +513,7 @@ JetFile: FunctionsAndTypes.kt PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -555,7 +555,7 @@ JetFile: FunctionsAndTypes.kt PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/examples/Graph.txt b/compiler/testData/psi/examples/Graph.txt index 6f9b2725797..7c599ca09f9 100644 --- a/compiler/testData/psi/examples/Graph.txt +++ b/compiler/testData/psi/examples/Graph.txt @@ -426,8 +426,8 @@ JetFile: Graph.kt CALL_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('filter') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -449,8 +449,8 @@ JetFile: Graph.kt CALL_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('map') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -534,8 +534,8 @@ JetFile: Graph.kt CALL_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foreach') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -690,8 +690,8 @@ JetFile: Graph.kt CALL_EXPRESSION REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foreach') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -818,8 +818,8 @@ JetFile: Graph.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foreach') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -929,8 +929,8 @@ JetFile: Graph.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('foreach') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/examples/LINQ.txt b/compiler/testData/psi/examples/LINQ.txt index 7f3016c6b31..c1675c2a75b 100644 --- a/compiler/testData/psi/examples/LINQ.txt +++ b/compiler/testData/psi/examples/LINQ.txt @@ -23,7 +23,7 @@ JetFile: LINQ.kt OPERATION_REFERENCE PsiElement(IDENTIFIER)('filter') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -38,7 +38,7 @@ JetFile: LINQ.kt OPERATION_REFERENCE PsiElement(IDENTIFIER)('map') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -53,7 +53,7 @@ JetFile: LINQ.kt OPERATION_REFERENCE PsiElement(IDENTIFIER)('aggregate') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST diff --git a/compiler/testData/psi/examples/Queue.txt b/compiler/testData/psi/examples/Queue.txt index aa42984d54f..28f4131ce7f 100644 --- a/compiler/testData/psi/examples/Queue.txt +++ b/compiler/testData/psi/examples/Queue.txt @@ -15,8 +15,8 @@ JetFile: Queue.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/Stack.txt b/compiler/testData/psi/examples/Stack.txt index 00362aa7d0c..1a6771fcdf4 100644 --- a/compiler/testData/psi/examples/Stack.txt +++ b/compiler/testData/psi/examples/Stack.txt @@ -15,8 +15,8 @@ JetFile: Stack.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/With.txt b/compiler/testData/psi/examples/With.txt index 19ba0b54479..71dcd432c8c 100644 --- a/compiler/testData/psi/examples/With.txt +++ b/compiler/testData/psi/examples/With.txt @@ -100,8 +100,8 @@ JetFile: With.kt PsiElement(IDENTIFIER)('out') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -145,7 +145,7 @@ JetFile: With.kt PsiElement(IDENTIFIER)('out') PsiElement(DOT)('.') CALL_EXPRESSION - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') diff --git a/compiler/testData/psi/examples/array/MutableArray.txt b/compiler/testData/psi/examples/array/MutableArray.txt index 523be805049..c7e6aafa998 100644 --- a/compiler/testData/psi/examples/array/MutableArray.txt +++ b/compiler/testData/psi/examples/array/MutableArray.txt @@ -29,8 +29,8 @@ JetFile: MutableArray.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -95,8 +95,8 @@ JetFile: MutableArray.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -161,8 +161,8 @@ JetFile: MutableArray.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -177,7 +177,7 @@ JetFile: MutableArray.kt PsiElement(GT)('>') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/collections/ArrayList.txt b/compiler/testData/psi/examples/collections/ArrayList.txt index 5f1cdfc794a..cbda98826b2 100644 --- a/compiler/testData/psi/examples/collections/ArrayList.txt +++ b/compiler/testData/psi/examples/collections/ArrayList.txt @@ -15,8 +15,8 @@ JetFile: ArrayList.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -148,8 +148,8 @@ JetFile: ArrayList.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/examples/collections/HashMap.txt b/compiler/testData/psi/examples/collections/HashMap.txt index 55fb3159964..f92c08bde34 100644 --- a/compiler/testData/psi/examples/collections/HashMap.txt +++ b/compiler/testData/psi/examples/collections/HashMap.txt @@ -104,8 +104,8 @@ JetFile: HashMap.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -318,8 +318,8 @@ JetFile: HashMap.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -471,8 +471,8 @@ JetFile: HashMap.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -593,8 +593,8 @@ JetFile: HashMap.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -735,8 +735,8 @@ JetFile: HashMap.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -911,8 +911,8 @@ JetFile: HashMap.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/collections/IList.txt b/compiler/testData/psi/examples/collections/IList.txt index 3934abef790..3b65b399f0c 100644 --- a/compiler/testData/psi/examples/collections/IList.txt +++ b/compiler/testData/psi/examples/collections/IList.txt @@ -21,8 +21,8 @@ JetFile: IList.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -37,7 +37,7 @@ JetFile: IList.kt PsiElement(GT)('>') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/collections/IMutableIterable.txt b/compiler/testData/psi/examples/collections/IMutableIterable.txt index 1d5b5bcf3c8..8e400408d30 100644 --- a/compiler/testData/psi/examples/collections/IMutableIterable.txt +++ b/compiler/testData/psi/examples/collections/IMutableIterable.txt @@ -21,8 +21,8 @@ JetFile: IMutableIterable.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/collections/IMutableIterator.txt b/compiler/testData/psi/examples/collections/IMutableIterator.txt index fdb00fcd9c6..b6caccb5934 100644 --- a/compiler/testData/psi/examples/collections/IMutableIterator.txt +++ b/compiler/testData/psi/examples/collections/IMutableIterator.txt @@ -21,8 +21,8 @@ JetFile: IMutableIterator.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/collections/IMutableList.txt b/compiler/testData/psi/examples/collections/IMutableList.txt index 2ae24555f11..ae1b6966f9e 100644 --- a/compiler/testData/psi/examples/collections/IMutableList.txt +++ b/compiler/testData/psi/examples/collections/IMutableList.txt @@ -18,8 +18,8 @@ JetFile: IMutableList.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -34,7 +34,7 @@ JetFile: IMutableList.kt PsiElement(GT)('>') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/collections/IMutableSet.txt b/compiler/testData/psi/examples/collections/IMutableSet.txt index 6c83adbc412..5739d8d5448 100644 --- a/compiler/testData/psi/examples/collections/IMutableSet.txt +++ b/compiler/testData/psi/examples/collections/IMutableSet.txt @@ -18,8 +18,8 @@ JetFile: IMutableSet.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -34,7 +34,7 @@ JetFile: IMutableSet.kt PsiElement(GT)('>') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/collections/ISet.txt b/compiler/testData/psi/examples/collections/ISet.txt index 624008fe583..d6a49ab4022 100644 --- a/compiler/testData/psi/examples/collections/ISet.txt +++ b/compiler/testData/psi/examples/collections/ISet.txt @@ -18,8 +18,8 @@ JetFile: ISet.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -34,7 +34,7 @@ JetFile: ISet.kt PsiElement(GT)('>') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/collections/LinkedList.txt b/compiler/testData/psi/examples/collections/LinkedList.txt index 978aa3bf4a7..cd07f8065dc 100644 --- a/compiler/testData/psi/examples/collections/LinkedList.txt +++ b/compiler/testData/psi/examples/collections/LinkedList.txt @@ -15,8 +15,8 @@ JetFile: LinkedList.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/io/IOSamples.txt b/compiler/testData/psi/examples/io/IOSamples.txt index 839c4c6b969..94da5617923 100644 --- a/compiler/testData/psi/examples/io/IOSamples.txt +++ b/compiler/testData/psi/examples/io/IOSamples.txt @@ -100,8 +100,8 @@ JetFile: IOSamples.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -205,8 +205,8 @@ JetFile: IOSamples.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -221,7 +221,7 @@ JetFile: IOSamples.kt PsiElement(GT)('>') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -448,8 +448,8 @@ JetFile: IOSamples.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -464,7 +464,7 @@ JetFile: IOSamples.kt PsiElement(GT)('>') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/priorityqueues/BinaryHeap.txt b/compiler/testData/psi/examples/priorityqueues/BinaryHeap.txt index acb0acf3977..3c892842296 100644 --- a/compiler/testData/psi/examples/priorityqueues/BinaryHeap.txt +++ b/compiler/testData/psi/examples/priorityqueues/BinaryHeap.txt @@ -15,8 +15,8 @@ JetFile: BinaryHeap.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt b/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt index f5f0b3c4407..1aa82526fb9 100644 --- a/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt +++ b/compiler/testData/psi/examples/priorityqueues/PriorityQueueAsPushPop.txt @@ -36,8 +36,8 @@ JetFile: PriorityQueueAsPushPop.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/examples/util/Comparison.txt b/compiler/testData/psi/examples/util/Comparison.txt index 72b81fef28c..f187e856c95 100644 --- a/compiler/testData/psi/examples/util/Comparison.txt +++ b/compiler/testData/psi/examples/util/Comparison.txt @@ -318,7 +318,7 @@ JetFile: Comparison.kt PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST diff --git a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.txt b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.txt index 7dce320c5fd..e616c7c36e2 100644 --- a/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.txt +++ b/compiler/testData/psi/functionReceivers/PropertiesWithFunctionReceiversRecovery.txt @@ -369,7 +369,7 @@ JetFile: PropertiesWithFunctionReceiversRecovery.kt PsiErrorElement:Expecting '.' before a property name PsiWhiteSpace('\n') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(val)('val') PsiWhiteSpace(' ') PsiErrorElement:Receiver type is not allowed on a destructuring declaration diff --git a/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt index a785bbcead7..ccc93bb87ef 100644 --- a/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt +++ b/compiler/testData/psi/greatSyntacticShift/functionLiterals.txt @@ -61,7 +61,7 @@ JetFile: functionLiterals.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -71,7 +71,7 @@ JetFile: functionLiterals.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -87,7 +87,7 @@ JetFile: functionLiterals.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -98,7 +98,7 @@ JetFile: functionLiterals.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK @@ -109,7 +109,7 @@ JetFile: functionLiterals.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -124,7 +124,7 @@ JetFile: functionLiterals.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -141,7 +141,7 @@ JetFile: functionLiterals.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -162,7 +162,7 @@ JetFile: functionLiterals.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') VALUE_PARAMETER_LIST @@ -179,7 +179,7 @@ JetFile: functionLiterals.kt PsiElement(COMMA)(',') PsiWhiteSpace(' ') VALUE_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/newLabels/basic.txt b/compiler/testData/psi/newLabels/basic.txt index 23248227313..c8a1d25a8f1 100644 --- a/compiler/testData/psi/newLabels/basic.txt +++ b/compiler/testData/psi/newLabels/basic.txt @@ -22,14 +22,14 @@ JetFile: basic.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('filter') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT LABELED_EXPRESSION LABEL_QUALIFIER LABEL PsiElement(IDENTIFIER)('b') PsiElement(AT)('@') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') @@ -42,14 +42,14 @@ JetFile: basic.kt PsiWhiteSpace('\n ') PsiElement(RBRACE)('}') PsiWhiteSpace('\n ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT LABELED_EXPRESSION LABEL_QUALIFIER LABEL PsiElement(IDENTIFIER)('c') PsiElement(AT)('@') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') diff --git a/compiler/testData/psi/newLabels/oldSyntaxExpressions.txt b/compiler/testData/psi/newLabels/oldSyntaxExpressions.txt index 34c69b9fa9e..9deef9ce9df 100644 --- a/compiler/testData/psi/newLabels/oldSyntaxExpressions.txt +++ b/compiler/testData/psi/newLabels/oldSyntaxExpressions.txt @@ -56,7 +56,7 @@ JetFile: oldSyntaxExpressions.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('filter') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION ANNOTATION_ENTRY PsiElement(AT)('@') @@ -66,7 +66,7 @@ JetFile: oldSyntaxExpressions.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('f') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace('\n ') diff --git a/compiler/testData/psi/newLabels/recovery.txt b/compiler/testData/psi/newLabels/recovery.txt index dc4d8256728..df55033d683 100644 --- a/compiler/testData/psi/newLabels/recovery.txt +++ b/compiler/testData/psi/newLabels/recovery.txt @@ -29,7 +29,7 @@ JetFile: recovery.kt PsiErrorElement:Expected annotation identifier after '@' PsiElement(AT)('@') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -52,12 +52,12 @@ JetFile: recovery.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('filter') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT + LAMBDA_ARGUMENT ANNOTATED_EXPRESSION PsiErrorElement:Expected annotation identifier after '@' PsiElement(AT)('@') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -90,7 +90,7 @@ JetFile: recovery.kt PsiElement(INTEGER_LITERAL)('100') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') @@ -176,7 +176,7 @@ JetFile: recovery.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/primaryConstructor/nestedClassAmbiguity.txt b/compiler/testData/psi/primaryConstructor/nestedClassAmbiguity.txt index 469dbcce0a2..08914920908 100644 --- a/compiler/testData/psi/primaryConstructor/nestedClassAmbiguity.txt +++ b/compiler/testData/psi/primaryConstructor/nestedClassAmbiguity.txt @@ -103,8 +103,8 @@ JetFile: nestedClassAmbiguity.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE PsiErrorElement:Type expected @@ -158,8 +158,8 @@ JetFile: nestedClassAmbiguity.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE PsiErrorElement:Type expected diff --git a/compiler/testData/psi/primaryConstructor/recovery.txt b/compiler/testData/psi/primaryConstructor/recovery.txt index 8341c1afb46..67416a1b816 100644 --- a/compiler/testData/psi/primaryConstructor/recovery.txt +++ b/compiler/testData/psi/primaryConstructor/recovery.txt @@ -122,8 +122,8 @@ JetFile: recovery.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -212,8 +212,8 @@ JetFile: recovery.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/primaryConstructor/recoveryNestedClassAmbiguity.txt b/compiler/testData/psi/primaryConstructor/recoveryNestedClassAmbiguity.txt index 5fb71694bd3..77fc3378769 100644 --- a/compiler/testData/psi/primaryConstructor/recoveryNestedClassAmbiguity.txt +++ b/compiler/testData/psi/primaryConstructor/recoveryNestedClassAmbiguity.txt @@ -190,8 +190,8 @@ JetFile: recoveryNestedClassAmbiguity.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/testData/psi/primaryConstructor/valid.txt b/compiler/testData/psi/primaryConstructor/valid.txt index cfd3c774c55..41d1dd422e8 100644 --- a/compiler/testData/psi/primaryConstructor/valid.txt +++ b/compiler/testData/psi/primaryConstructor/valid.txt @@ -42,8 +42,8 @@ JetFile: valid.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_LIST + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -54,7 +54,7 @@ JetFile: valid.kt PsiElement(RPAR)(')') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/propertyDelegate/BracketsInDelegate.txt b/compiler/testData/psi/propertyDelegate/BracketsInDelegate.txt index c78faf4993b..8b4605a7805 100644 --- a/compiler/testData/psi/propertyDelegate/BracketsInDelegate.txt +++ b/compiler/testData/psi/propertyDelegate/BracketsInDelegate.txt @@ -15,8 +15,8 @@ JetFile: BracketsInDelegate.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('A') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') BLOCK diff --git a/compiler/testData/psi/recovery/BrokenFunctionSuperType.txt b/compiler/testData/psi/recovery/BrokenFunctionSuperType.txt index ac0b9b4348b..7ae7f3daf95 100644 --- a/compiler/testData/psi/recovery/BrokenFunctionSuperType.txt +++ b/compiler/testData/psi/recovery/BrokenFunctionSuperType.txt @@ -10,8 +10,8 @@ JetFile: BrokenFunctionSuperType.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE FUNCTION_TYPE VALUE_PARAMETER_LIST diff --git a/compiler/testData/psi/recovery/InvalidCharInSingleLineLambda.txt b/compiler/testData/psi/recovery/InvalidCharInSingleLineLambda.txt index b9525326b80..b4cc9668733 100644 --- a/compiler/testData/psi/recovery/InvalidCharInSingleLineLambda.txt +++ b/compiler/testData/psi/recovery/InvalidCharInSingleLineLambda.txt @@ -20,8 +20,8 @@ JetFile: InvalidCharInSingleLineLambda.kt REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('x') PsiWhiteSpace(' ') - FUNCTION_LITERAL_ARGUMENT - FUNCTION_LITERAL_EXPRESSION + LAMBDA_ARGUMENT + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/recovery/SameLineStatementRecovery.txt b/compiler/testData/psi/recovery/SameLineStatementRecovery.txt index e575beeee42..59c4795c9cd 100644 --- a/compiler/testData/psi/recovery/SameLineStatementRecovery.txt +++ b/compiler/testData/psi/recovery/SameLineStatementRecovery.txt @@ -628,7 +628,7 @@ JetFile: SameLineStatementRecovery.kt PsiElement(LPAR)('(') PsiElement(RPAR)(')') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/recovery/WithWithoutInAndMultideclaration.txt b/compiler/testData/psi/recovery/WithWithoutInAndMultideclaration.txt index b010d7c44ca..59480137c7d 100644 --- a/compiler/testData/psi/recovery/WithWithoutInAndMultideclaration.txt +++ b/compiler/testData/psi/recovery/WithWithoutInAndMultideclaration.txt @@ -18,13 +18,13 @@ JetFile: WithWithoutInAndMultideclaration.kt PsiElement(for)('for') PsiWhiteSpace(' ') PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION + DESTRUCTURING_DECLARATION PsiElement(LPAR)('(') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('i') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - MULTI_VARIABLE_DECLARATION_ENTRY + DESTRUCTURING_DECLARATION_ENTRY PsiElement(IDENTIFIER)('j') PsiElement(RPAR)(')') PsiErrorElement:Expecting 'in' diff --git a/compiler/testData/psi/recovery/kt5102.txt b/compiler/testData/psi/recovery/kt5102.txt index 42f728bdc5d..d78de9750ce 100644 --- a/compiler/testData/psi/recovery/kt5102.txt +++ b/compiler/testData/psi/recovery/kt5102.txt @@ -32,8 +32,8 @@ JetFile: kt5102.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt b/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt index 4d78788b60d..a299b055068 100644 --- a/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt +++ b/compiler/testData/psi/recovery/objects/declarations/ConstructorModifiers.txt @@ -48,8 +48,8 @@ JetFile: ConstructorModifiers.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt b/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt index f724cace0f6..dcd28193853 100644 --- a/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt +++ b/compiler/testData/psi/recovery/objects/declarations/EmptyParentheses.txt @@ -36,8 +36,8 @@ JetFile: EmptyParentheses.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/declarations/Everything.txt b/compiler/testData/psi/recovery/objects/declarations/Everything.txt index fb04ad89c41..de80f55755e 100644 --- a/compiler/testData/psi/recovery/objects/declarations/Everything.txt +++ b/compiler/testData/psi/recovery/objects/declarations/Everything.txt @@ -46,15 +46,15 @@ JetFile: Everything.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Bar') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt b/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt index c9d44799d81..e9efa3af329 100644 --- a/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt +++ b/compiler/testData/psi/recovery/objects/declarations/ParametersInParentheses.txt @@ -90,8 +90,8 @@ JetFile: ParametersInParentheses.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt b/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt index 3919fc38291..0740b1f2183 100644 --- a/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt +++ b/compiler/testData/psi/recovery/objects/declarations/TypeParametersAndParentheses.txt @@ -74,8 +74,8 @@ JetFile: TypeParametersAndParentheses.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/declarations/TypeParameterss.txt b/compiler/testData/psi/recovery/objects/declarations/TypeParameterss.txt index 35adffa8b04..6970291e5a9 100644 --- a/compiler/testData/psi/recovery/objects/declarations/TypeParameterss.txt +++ b/compiler/testData/psi/recovery/objects/declarations/TypeParameterss.txt @@ -54,8 +54,8 @@ JetFile: TypeParameterss.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/declarations/Where.txt b/compiler/testData/psi/recovery/objects/declarations/Where.txt index ac9f13f6752..c1d39c1e3fb 100644 --- a/compiler/testData/psi/recovery/objects/declarations/Where.txt +++ b/compiler/testData/psi/recovery/objects/declarations/Where.txt @@ -31,8 +31,8 @@ JetFile: Where.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -90,8 +90,8 @@ JetFile: Where.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -124,8 +124,8 @@ JetFile: Where.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt index e7a876a36d9..98a45344878 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt +++ b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiers.txt @@ -47,8 +47,8 @@ JetFile: ConstructorModifiers.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt index e3ab00863a3..4596f8de2d5 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt +++ b/compiler/testData/psi/recovery/objects/expressions/ConstructorModifiersAndName.txt @@ -53,8 +53,8 @@ JetFile: ConstructorModifiersAndName.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/expressions/EmptyParentheses.txt b/compiler/testData/psi/recovery/objects/expressions/EmptyParentheses.txt index f0ea1c91778..554e25edb31 100644 --- a/compiler/testData/psi/recovery/objects/expressions/EmptyParentheses.txt +++ b/compiler/testData/psi/recovery/objects/expressions/EmptyParentheses.txt @@ -39,8 +39,8 @@ JetFile: EmptyParentheses.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/expressions/Everything.txt b/compiler/testData/psi/recovery/objects/expressions/Everything.txt index 5e29e903780..9df352f6322 100644 --- a/compiler/testData/psi/recovery/objects/expressions/Everything.txt +++ b/compiler/testData/psi/recovery/objects/expressions/Everything.txt @@ -52,15 +52,15 @@ JetFile: Everything.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION PsiElement(IDENTIFIER)('Bar') PsiElement(COMMA)(',') PsiWhiteSpace(' ') - DELEGATOR_SUPER_CLASS + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/expressions/InFunction.txt b/compiler/testData/psi/recovery/objects/expressions/InFunction.txt index e940015fca1..36038ca2ba1 100644 --- a/compiler/testData/psi/recovery/objects/expressions/InFunction.txt +++ b/compiler/testData/psi/recovery/objects/expressions/InFunction.txt @@ -57,8 +57,8 @@ JetFile: InFunction.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/expressions/ParametersInParentheses.txt b/compiler/testData/psi/recovery/objects/expressions/ParametersInParentheses.txt index 3475a4e2eb1..24b3118dee3 100644 --- a/compiler/testData/psi/recovery/objects/expressions/ParametersInParentheses.txt +++ b/compiler/testData/psi/recovery/objects/expressions/ParametersInParentheses.txt @@ -75,8 +75,8 @@ JetFile: ParametersInParentheses.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/expressions/TypeParametersAndParentheses.txt b/compiler/testData/psi/recovery/objects/expressions/TypeParametersAndParentheses.txt index cbf4f6b96bf..55241eb92b9 100644 --- a/compiler/testData/psi/recovery/objects/expressions/TypeParametersAndParentheses.txt +++ b/compiler/testData/psi/recovery/objects/expressions/TypeParametersAndParentheses.txt @@ -67,8 +67,8 @@ JetFile: TypeParametersAndParentheses.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/expressions/TypeParameterss.txt b/compiler/testData/psi/recovery/objects/expressions/TypeParameterss.txt index 4725342ce14..1ff9475e663 100644 --- a/compiler/testData/psi/recovery/objects/expressions/TypeParameterss.txt +++ b/compiler/testData/psi/recovery/objects/expressions/TypeParameterss.txt @@ -51,8 +51,8 @@ JetFile: TypeParameterss.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/objects/expressions/Where.txt b/compiler/testData/psi/recovery/objects/expressions/Where.txt index d3a4abe0e3d..42d5607180e 100644 --- a/compiler/testData/psi/recovery/objects/expressions/Where.txt +++ b/compiler/testData/psi/recovery/objects/expressions/Where.txt @@ -50,8 +50,8 @@ JetFile: Where.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -129,8 +129,8 @@ JetFile: Where.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION @@ -173,8 +173,8 @@ JetFile: Where.kt PsiWhiteSpace(' ') PsiElement(COLON)(':') PsiWhiteSpace(' ') - DELEGATION_SPECIFIER_LIST - DELEGATOR_SUPER_CLASS + SUPER_TYPE_LIST + SUPER_TYPE_ENTRY TYPE_REFERENCE USER_TYPE REFERENCE_EXPRESSION diff --git a/compiler/testData/psi/recovery/unnamedParameter/firstInLambda.txt b/compiler/testData/psi/recovery/unnamedParameter/firstInLambda.txt index a512ae0f493..09f339554e1 100644 --- a/compiler/testData/psi/recovery/unnamedParameter/firstInLambda.txt +++ b/compiler/testData/psi/recovery/unnamedParameter/firstInLambda.txt @@ -10,7 +10,7 @@ JetFile: firstInLambda.kt PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/recovery/unnamedParameter/secondInLambda.txt b/compiler/testData/psi/recovery/unnamedParameter/secondInLambda.txt index 2fec8492bcd..ae5d592b7e1 100644 --- a/compiler/testData/psi/recovery/unnamedParameter/secondInLambda.txt +++ b/compiler/testData/psi/recovery/unnamedParameter/secondInLambda.txt @@ -10,7 +10,7 @@ JetFile: secondInLambda.kt PsiWhiteSpace(' ') PsiElement(EQ)('=') PsiWhiteSpace(' ') - FUNCTION_LITERAL_EXPRESSION + LAMBDA_EXPRESSION FUNCTION_LITERAL PsiElement(LBRACE)('{') PsiWhiteSpace(' ') diff --git a/compiler/testData/psi/secondaryConstructors/enumParsing.txt b/compiler/testData/psi/secondaryConstructors/enumParsing.txt index 2ae229502cf..0dfe087e2e5 100644 --- a/compiler/testData/psi/secondaryConstructors/enumParsing.txt +++ b/compiler/testData/psi/secondaryConstructors/enumParsing.txt @@ -17,7 +17,7 @@ JetFile: enumParsing.kt ENUM_ENTRY PsiElement(IDENTIFIER)('abc1') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE @@ -42,7 +42,7 @@ JetFile: enumParsing.kt ENUM_ENTRY PsiElement(IDENTIFIER)('abc2') INITIALIZER_LIST - DELEGATOR_SUPER_CALL + SUPER_TYPE_CALL_ENTRY CONSTRUCTOR_CALLEE TYPE_REFERENCE USER_TYPE diff --git a/compiler/tests/org/jetbrains/kotlin/renderer/AbstractFunctionDescriptorInExpressionRendererTest.kt b/compiler/tests/org/jetbrains/kotlin/renderer/AbstractFunctionDescriptorInExpressionRendererTest.kt index 1adb536a731..211ec6e6d8e 100644 --- a/compiler/tests/org/jetbrains/kotlin/renderer/AbstractFunctionDescriptorInExpressionRendererTest.kt +++ b/compiler/tests/org/jetbrains/kotlin/renderer/AbstractFunctionDescriptorInExpressionRendererTest.kt @@ -22,7 +22,7 @@ import com.intellij.testFramework.UsefulTestCase import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.descriptors.impl.FunctionExpressionDescriptor -import org.jetbrains.kotlin.psi.KtFunctionLiteralExpression +import org.jetbrains.kotlin.psi.KtLambdaExpression import org.jetbrains.kotlin.psi.KtNamedFunction import org.jetbrains.kotlin.psi.KtPsiFactory import org.jetbrains.kotlin.psi.KtTreeVisitorVoid @@ -47,9 +47,9 @@ abstract public class AbstractFunctionDescriptorInExpressionRendererTest : Kotli function.acceptChildren(this) descriptors.addIfNotNull(bindingContext.get(BindingContext.FUNCTION, function) as? FunctionExpressionDescriptor) } - override fun visitFunctionLiteralExpression(expression: KtFunctionLiteralExpression) { - expression.acceptChildren(this) - descriptors.add(bindingContext.get(BindingContext.FUNCTION, expression.getFunctionLiteral())!!) + override fun visitLambdaExpression(lambdaExpression: KtLambdaExpression) { + lambdaExpression.acceptChildren(this) + descriptors.add(bindingContext.get(BindingContext.FUNCTION, lambdaExpression.getFunctionLiteral())!!) } }) diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/util/ShadowedDeclarationsFilter.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/util/ShadowedDeclarationsFilter.kt index b96f5ea93fb..f3b02209799 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/util/ShadowedDeclarationsFilter.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/util/ShadowedDeclarationsFilter.kt @@ -177,7 +177,7 @@ public class ShadowedDeclarationsFilter( override fun getValueArguments() = arguments - override fun getFunctionLiteralArguments() = emptyList() + override fun getFunctionLiteralArguments() = emptyList() override fun getTypeArguments() = emptyList() diff --git a/idea/ide-common/src/org/jetbrains/kotlin/idea/util/Utils.kt b/idea/ide-common/src/org/jetbrains/kotlin/idea/util/Utils.kt index 9305b1f733d..c04896a7f2c 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/idea/util/Utils.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/idea/util/Utils.kt @@ -20,7 +20,7 @@ import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.* public fun KtFunctionLiteral.findLabelAndCall(): Pair { - val literalParent = (this.getParent() as KtFunctionLiteralExpression).getParent() + val literalParent = (this.getParent() as KtLambdaExpression).getParent() fun KtValueArgument.callExpression(): KtCallExpression? { val parent = getParent() diff --git a/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt b/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt index 4107a9ebf31..c0ed815e6af 100644 --- a/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt +++ b/idea/ide-common/src/org/jetbrains/kotlin/resolve/lazy/PartialBodyResolveFilter.kt @@ -90,7 +90,7 @@ class PartialBodyResolveFilter( statementMarks.mark(statement, MarkLevel.NEED_REFERENCE_RESOLVE) } } - else if (statement is KtMultiDeclaration) { + else if (statement is KtDestructuringDeclaration) { if (statement.getEntries().any { val name = it.getName() name != null && nameFilter(name) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinResolveCache.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinResolveCache.kt index d8f1ce21bd7..724edff844e 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinResolveCache.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/caches/resolve/KotlinResolveCache.kt @@ -119,7 +119,7 @@ private object KotlinResolveDataProvider { // TODO: Non-analyzable so far, add more granular analysis javaClass(), javaClass(), - javaClass(), + javaClass(), javaClass(), javaClass() ) @@ -133,7 +133,7 @@ private object KotlinResolveDataProvider { val analyzableElement = when (topmostElement) { is KtAnnotationEntry, is KtTypeConstraint, - is KtDelegationSpecifierList, + is KtSuperTypeList, is KtTypeParameter, is KtParameter -> PsiTreeUtil.getParentOfType(topmostElement, javaClass(), javaClass()) else -> topmostElement diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClassClsStubBuilder.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClassClsStubBuilder.kt index f55e19dc589..5388909acde 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClassClsStubBuilder.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/decompiler/stubBuilder/ClassClsStubBuilder.kt @@ -24,8 +24,8 @@ import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.name.ClassId import org.jetbrains.kotlin.psi.KtClassBody -import org.jetbrains.kotlin.psi.KtDelegationSpecifierList -import org.jetbrains.kotlin.psi.KtDelegatorToSuperClass +import org.jetbrains.kotlin.psi.KtSuperTypeEntry +import org.jetbrains.kotlin.psi.KtSuperTypeList import org.jetbrains.kotlin.psi.stubs.elements.KtClassElementType import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes import org.jetbrains.kotlin.psi.stubs.impl.KotlinClassStubImpl @@ -144,11 +144,11 @@ private class ClassClsStubBuilder( if (supertypeIds.isEmpty()) return val delegationSpecifierListStub = - KotlinPlaceHolderStubImpl(classOrObjectStub, KtStubElementTypes.DELEGATION_SPECIFIER_LIST) + KotlinPlaceHolderStubImpl(classOrObjectStub, KtStubElementTypes.SUPER_TYPE_LIST) classProto.supertypes(c.typeTable).forEach { type -> - val superClassStub = KotlinPlaceHolderStubImpl( - delegationSpecifierListStub, KtStubElementTypes.DELEGATOR_SUPER_CLASS + val superClassStub = KotlinPlaceHolderStubImpl( + delegationSpecifierListStub, KtStubElementTypes.SUPER_TYPE_ENTRY ) typeStubBuilder.createTypeReferenceStub(superClassStub, type) } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/KotlinFindUsagesProvider.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/KotlinFindUsagesProvider.kt index 968b10ab7ed..f93540117bf 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/KotlinFindUsagesProvider.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/KotlinFindUsagesProvider.kt @@ -35,7 +35,7 @@ public class KotlinFindUsagesProvider : FindUsagesProvider { is KtClass -> "class" is KtParameter -> "parameter" is KtProperty -> if (element.isLocal()) "variable" else "property" - is KtMultiDeclarationEntry -> "variable" + is KtDestructuringDeclarationEntry -> "variable" is KtTypeParameter -> "type parameter" is KtSecondaryConstructor -> "constructor" is KtObjectDeclaration -> "object" diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/UsageTypeUtils.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/UsageTypeUtils.kt index 5fe26ce85b4..468a79e5d1f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/UsageTypeUtils.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/findUsages/UsageTypeUtils.kt @@ -34,7 +34,7 @@ public object UsageTypeUtils { public fun getUsageType(element: PsiElement?): UsageTypeEnum? { when (element) { is KtForExpression -> return IMPLICIT_ITERATION - is KtMultiDeclaration -> return READ + is KtDestructuringDeclaration -> return READ is KtPropertyDelegate -> return PROPERTY_DELEGATION is KtStringTemplateExpression -> return USAGE_IN_STRING_LITERAL } @@ -83,8 +83,8 @@ public object UsageTypeUtils { || refExpr.getParentOfTypeAndBranch(){ getBoundTypeReference() } != null -> TYPE_CONSTRAINT - refExpr is KtDelegationSpecifier - || refExpr.getParentOfTypeAndBranch(){ getTypeReference() } != null -> + refExpr is KtSuperTypeListEntry + || refExpr.getParentOfTypeAndBranch(){ getTypeReference() } != null -> SUPER_TYPE refExpr.getParentOfTypeAndBranch(){ getTypeReference() } != null -> @@ -120,7 +120,7 @@ public object UsageTypeUtils { } fun getVariableUsageType(): UsageTypeEnum? { - if (refExpr.getParentOfTypeAndBranch(){ getDelegateExpression() } != null) { + if (refExpr.getParentOfTypeAndBranch(){ getDelegateExpression() } != null) { return DELEGATE } @@ -158,7 +158,7 @@ public object UsageTypeUtils { } return when { - refExpr.getParentOfTypeAndBranch(){ getTypeReference() } != null -> + refExpr.getParentOfTypeAndBranch(){ getTypeReference() } != null -> SUPER_TYPE descriptor is ConstructorDescriptor diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/FunctionsHighlightingVisitor.java b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/FunctionsHighlightingVisitor.java index 9dee08a0516..a4017fcb760 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/FunctionsHighlightingVisitor.java +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/FunctionsHighlightingVisitor.java @@ -47,7 +47,7 @@ public class FunctionsHighlightingVisitor extends AfterAnalysisHighlightingVisit } @Override - public void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call) { + public void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call) { KtConstructorCalleeExpression calleeExpression = call.getCalleeExpression(); KtTypeReference typeRef = calleeExpression.getTypeReference(); if (typeRef != null) { @@ -59,7 +59,7 @@ public class FunctionsHighlightingVisitor extends AfterAnalysisHighlightingVisit } } } - super.visitDelegationToSuperCallSpecifier(call); + super.visitSuperTypeCallEntry(call); } @Override diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/KotlinSuppressableWarningProblemGroup.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/KotlinSuppressableWarningProblemGroup.kt index 377367568dd..705b25218ab 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/KotlinSuppressableWarningProblemGroup.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/KotlinSuppressableWarningProblemGroup.kt @@ -54,7 +54,7 @@ fun createSuppressWarningActions(element: PsiElement, diagnosticFactory: Diagnos var current: PsiElement? = element var suppressAtStatementAllowed = true while (current != null) { - if (current is KtDeclaration && current !is KtMultiDeclaration) { + if (current is KtDeclaration && current !is KtDestructuringDeclaration) { val declaration = current val kind = DeclarationKindDetector.detect(declaration) if (kind != null) { @@ -64,7 +64,7 @@ fun createSuppressWarningActions(element: PsiElement, diagnosticFactory: Diagnos } else if (current is KtExpression && suppressAtStatementAllowed) { // Add suppress action at first statement - if (current.parent is KtBlockExpression || current.parent is KtMultiDeclaration) { + if (current.parent is KtBlockExpression || current.parent is KtDestructuringDeclaration) { val kind = if (current.parent is KtBlockExpression) "statement" else "initializer" actions.add(KotlinSuppressIntentionAction(current, diagnosticFactory, AnnotationHostKind(kind, "", true))) @@ -89,8 +89,8 @@ private object DeclarationKindDetector : KtVisitor() override fun visitProperty(d: KtProperty, data: Unit?) = detect(d, d.getValOrVarKeyword().getText()!!) - override fun visitMultiDeclaration(d: KtMultiDeclaration, data: Unit?) = detect(d, d.getValOrVarKeyword()?.getText() ?: "val", - name = d.getEntries().map { it.getName()!! }.joinToString(", ", "(", ")")) + override fun visitDestructuringDeclaration(d: KtDestructuringDeclaration, data: Unit?) = detect(d, d.getValOrVarKeyword()?.getText() ?: "val", + name = d.getEntries().map { it.getName()!! }.joinToString(", ", "(", ")")) override fun visitTypeParameter(d: KtTypeParameter, data: Unit?) = detect(d, "type parameter", newLineNeeded = false) diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/SoftKeywordsHighlightingVisitor.java b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/SoftKeywordsHighlightingVisitor.java index d16f63df47a..34b74205971 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/SoftKeywordsHighlightingVisitor.java +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/highlighter/SoftKeywordsHighlightingVisitor.java @@ -25,7 +25,7 @@ import com.intellij.psi.tree.IElementType; import org.jetbrains.annotations.NotNull; import org.jetbrains.kotlin.lexer.KtTokens; import org.jetbrains.kotlin.psi.KtFunctionLiteral; -import org.jetbrains.kotlin.psi.KtFunctionLiteralExpression; +import org.jetbrains.kotlin.psi.KtLambdaExpression; import org.jetbrains.kotlin.psi.KtVisitorVoid; class SoftKeywordsHighlightingVisitor extends KtVisitorVoid { @@ -53,9 +53,9 @@ class SoftKeywordsHighlightingVisitor extends KtVisitorVoid { } @Override - public void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression) { + public void visitLambdaExpression(@NotNull KtLambdaExpression lambdaExpression) { if (ApplicationManager.getApplication().isUnitTestMode()) return; - KtFunctionLiteral functionLiteral = expression.getFunctionLiteral(); + KtFunctionLiteral functionLiteral = lambdaExpression.getFunctionLiteral(); holder.createInfoAnnotation(functionLiteral.getLBrace(), null).setTextAttributes(KotlinHighlightingColors.FUNCTION_LITERAL_BRACES_AND_ARROW); PsiElement closingBrace = functionLiteral.getRBrace(); if (closingBrace != null) { diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/OperatorToFunctionIntention.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/OperatorToFunctionIntention.kt index 5946e31bb18..664d83a9056 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/OperatorToFunctionIntention.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/intentions/OperatorToFunctionIntention.kt @@ -73,7 +73,7 @@ public class OperatorToFunctionIntention : SelfTargetingIntention( private fun isApplicableCall(element: KtCallExpression, caretOffset: Int): Boolean { val lbrace = (element.getValueArgumentList()?.getLeftParenthesis() - ?: element.getFunctionLiteralArguments().firstOrNull()?.getFunctionLiteral()?.getLeftCurlyBrace() + ?: element.getLambdaArguments().firstOrNull()?.getLambdaExpression()?.getLeftCurlyBrace() ?: return false) as PsiElement if (!lbrace.getTextRange().containsOffset(caretOffset)) return false @@ -82,7 +82,7 @@ public class OperatorToFunctionIntention : SelfTargetingIntention( if (descriptor is FunctionDescriptor && descriptor.getName() == OperatorNameConventions.INVOKE) { if (element.getParent() is KtDotQualifiedExpression && element.getCalleeExpression()?.getText() == OperatorNameConventions.INVOKE.asString()) return false - return element.getValueArgumentList() != null || element.getFunctionLiteralArguments().isNotEmpty() + return element.getValueArgumentList() != null || element.getLambdaArguments().isNotEmpty() } return false } @@ -196,7 +196,7 @@ public class OperatorToFunctionIntention : SelfTargetingIntention( val callee = element.getCalleeExpression()!! val arguments = element.getValueArgumentList() val argumentString = arguments?.getText()?.removeSurrounding("(", ")") - val funcLitArgs = element.getFunctionLiteralArguments() + val funcLitArgs = element.getLambdaArguments() val calleeText = callee.getText() val transformation = "$calleeText.${OperatorNameConventions.INVOKE.asString()}" + (if (argumentString == null) "" else "($argumentString)") diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/ResolveElementCache.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/ResolveElementCache.kt index b6da0b6405e..5069b5592ce 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/ResolveElementCache.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/project/ResolveElementCache.kt @@ -209,7 +209,7 @@ public class ResolveElementCache( javaClass(), javaClass(), javaClass(), - javaClass(), + javaClass(), javaClass(), javaClass(), javaClass(), @@ -269,7 +269,7 @@ public class ResolveElementCache( is KtProperty -> propertyAdditionalResolve(resolveSession, resolveElement, file, createStatementFilter()) - is KtDelegationSpecifierList -> delegationSpecifierAdditionalResolve(resolveSession, resolveElement, resolveElement.getParent() as KtClassOrObject, file) + is KtSuperTypeList -> delegationSpecifierAdditionalResolve(resolveSession, resolveElement, resolveElement.getParent() as KtClassOrObject, file) is KtInitializerList -> delegationSpecifierAdditionalResolve(resolveSession, resolveElement, resolveElement.getParent() as KtEnumEntry, file) @@ -401,12 +401,12 @@ public class ResolveElementCache( ForceResolveUtil.forceResolveAllContents(descriptor.getTypeConstructor().getSupertypes()) val bodyResolver = createBodyResolver(resolveSession, trace, file, StatementFilter.NONE) - bodyResolver.resolveDelegationSpecifierList(DataFlowInfo.EMPTY, - classOrObject, - descriptor, - descriptor.unsubstitutedPrimaryConstructor, - descriptor.scopeForConstructorHeaderResolution, - descriptor.scopeForMemberDeclarationResolution) + bodyResolver.resolveSuperTypeEntryList(DataFlowInfo.EMPTY, + classOrObject, + descriptor, + descriptor.getUnsubstitutedPrimaryConstructor(), + descriptor.scopeForConstructorHeaderResolution, + descriptor.getScopeForMemberDeclarationResolution()) return trace } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KotlinReferenceContributor.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KotlinReferenceContributor.kt index f63c45b2b83..42da33c1e04 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KotlinReferenceContributor.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KotlinReferenceContributor.kt @@ -61,8 +61,8 @@ public class KotlinReferenceContributor() : PsiReferenceContributor() { KtPropertyDelegationMethodsReference(it) } - registerProvider(javaClass()) { - KtMultiDeclarationReference(it) + registerProvider(javaClass()) { + KtDestructuringDeclarationReference(it) } registerProvider(javaClass()) { diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtMultiDeclarationReference.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtDestructuringDeclarationReference.kt similarity index 91% rename from idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtMultiDeclarationReference.kt rename to idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtDestructuringDeclarationReference.kt index 7384b3bb681..65a9fd7911f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtMultiDeclarationReference.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtDestructuringDeclarationReference.kt @@ -16,16 +16,16 @@ package org.jetbrains.kotlin.idea.references -import org.jetbrains.kotlin.psi.KtMultiDeclaration -import org.jetbrains.kotlin.resolve.BindingContext -import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import com.intellij.openapi.util.TextRange import com.intellij.psi.PsiElement import com.intellij.util.IncorrectOperationException import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor +import org.jetbrains.kotlin.descriptors.DeclarationDescriptor import org.jetbrains.kotlin.idea.caches.resolve.analyze +import org.jetbrains.kotlin.psi.KtDestructuringDeclaration +import org.jetbrains.kotlin.resolve.BindingContext -class KtMultiDeclarationReference(element: KtMultiDeclaration) : KtMultiReference(element) { +class KtDestructuringDeclarationReference(element: KtDestructuringDeclaration) : KtMultiReference(element) { override fun getTargetDescriptors(context: BindingContext): Collection { return expression.getEntries().mapNotNull { entry -> context.get(BindingContext.COMPONENT_RESOLVED_CALL, entry)?.getCandidateDescriptor() diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtInvokeFunctionReference.java b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtInvokeFunctionReference.java index 6ecd4dc9cf6..28c391b0bc2 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtInvokeFunctionReference.java +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/KtInvokeFunctionReference.java @@ -83,9 +83,9 @@ public class KtInvokeFunctionReference extends KtSimpleReference functionLiteralArguments = getExpression().getFunctionLiteralArguments(); - for (KtFunctionLiteralArgument functionLiteralArgument : functionLiteralArguments) { - KtFunctionLiteralExpression functionLiteralExpression = functionLiteralArgument.getFunctionLiteral(); + List functionLiteralArguments = getExpression().getLambdaArguments(); + for (KtLambdaArgument functionLiteralArgument : functionLiteralArguments) { + KtLambdaExpression functionLiteralExpression = functionLiteralArgument.getLambdaExpression(); list.add(getRange(functionLiteralExpression.getLeftCurlyBrace())); ASTNode rightCurlyBrace = functionLiteralExpression.getRightCurlyBrace(); if (rightCurlyBrace != null) { diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/referenceUtil.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/referenceUtil.kt index 49220fa6b32..0cefed9b380 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/referenceUtil.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/references/referenceUtil.kt @@ -77,7 +77,7 @@ public fun PsiReference.matchesTarget(candidateTarget: PsiElement): Boolean { is KtInvokeFunctionReference -> { if (candidateTarget !is KtNamedFunction) return false } - is KtMultiDeclarationReference -> { + is KtDestructuringDeclarationReference -> { if (candidateTarget !is KtNamedFunction && candidateTarget !is KtParameter) return false } } diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/utils.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/utils.kt index e376bbdd7ec..f04c862b57f 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/utils.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/search/usagesSearch/utils.kt @@ -169,8 +169,8 @@ private fun processClassDelegationCallsToSpecifiedConstructor( if (!klass.isEnum()) return true for (declaration in klass.declarations) { if (declaration is KtEnumEntry) { - val delegationCall = declaration.getDelegationSpecifiers().firstOrNull() - if (delegationCall is KtDelegatorToSuperCall && constructor == delegationCall.calleeExpression.getConstructorCallDescriptor()) { + val delegationCall = declaration.getSuperTypeListEntries().firstOrNull() + if (delegationCall is KtSuperTypeCallEntry && constructor == delegationCall.calleeExpression.getConstructorCallDescriptor()) { if (!process(delegationCall)) return false } } diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/confidence/UnfocusedPossibleFunctionParameter.java b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/confidence/UnfocusedPossibleFunctionParameter.java index bd6d96dd7c2..146ea4487e7 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/confidence/UnfocusedPossibleFunctionParameter.java +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/confidence/UnfocusedPossibleFunctionParameter.java @@ -34,8 +34,8 @@ public class UnfocusedPossibleFunctionParameter extends CompletionConfidence { // 2. The same but for the case when first expression is additionally surrounded with brackets PsiElement position = parameters.getPosition(); - KtFunctionLiteralExpression functionLiteral = PsiTreeUtil.getParentOfType( - position, KtFunctionLiteralExpression.class); + KtLambdaExpression functionLiteral = PsiTreeUtil.getParentOfType( + position, KtLambdaExpression.class); if (functionLiteral != null) { PsiElement expectedReference = position.getParent(); diff --git a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/SmartCompletionSession.kt b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/SmartCompletionSession.kt index 27c17d729b9..4ca2d3eae98 100644 --- a/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/SmartCompletionSession.kt +++ b/idea/idea-completion/src/org/jetbrains/kotlin/idea/completion/smart/SmartCompletionSession.kt @@ -29,7 +29,7 @@ import org.jetbrains.kotlin.idea.core.ExpectedInfos import org.jetbrains.kotlin.idea.core.completion.DeclarationLookupObject import org.jetbrains.kotlin.idea.util.CallTypeAndReceiver import org.jetbrains.kotlin.load.java.descriptors.SamConstructorDescriptorKindExclude -import org.jetbrains.kotlin.psi.FunctionLiteralArgument +import org.jetbrains.kotlin.psi.LambdaArgument import org.jetbrains.kotlin.psi.KtCodeFragment import org.jetbrains.kotlin.psi.ValueArgumentName import org.jetbrains.kotlin.resolve.BindingContext @@ -177,8 +177,8 @@ class SmartCompletionSession( val callTypeAndReceiver = CallTypeAndReceiver.detect(nameExpression) as? CallTypeAndReceiver.INFIX ?: return val call = callTypeAndReceiver.receiver.getCall(bindingContext) if (call != null && call.getFunctionLiteralArguments().isEmpty()) { - val dummyArgument = object : FunctionLiteralArgument { - override fun getFunctionLiteral() = throw UnsupportedOperationException() + val dummyArgument = object : LambdaArgument { + override fun getLambdaExpression() = throw UnsupportedOperationException() override fun getArgumentExpression() = throw UnsupportedOperationException() override fun getArgumentName(): ValueArgumentName? = null override fun isNamed() = false diff --git a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/ExpectedInfos.kt b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/ExpectedInfos.kt index fae4db1cf39..9a14be0020d 100644 --- a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/ExpectedInfos.kt +++ b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/ExpectedInfos.kt @@ -170,9 +170,9 @@ class ExpectedInfos( } private fun calculateForFunctionLiteralArgument(expressionWithType: KtExpression): Collection? { - val functionLiteralArgument = expressionWithType.getParent() as? KtFunctionLiteralArgument + val functionLiteralArgument = expressionWithType.getParent() as? KtLambdaArgument val callExpression = functionLiteralArgument?.getParent() as? KtCallExpression ?: return null - val literalArgument = callExpression.getFunctionLiteralArguments().firstOrNull() ?: return null + val literalArgument = callExpression.getLambdaArguments().firstOrNull() ?: return null if (literalArgument.getArgumentExpression() != expressionWithType) return null return calculateForArgument(callExpression, literalArgument) } @@ -228,7 +228,7 @@ class ExpectedInfos( val arguments = call.getValueArguments().subList(0, argumentIndex) override fun getValueArguments() = arguments - override fun getFunctionLiteralArguments() = emptyList() + override fun getFunctionLiteralArguments() = emptyList() override fun getValueArgumentList() = null } @@ -276,7 +276,7 @@ class ExpectedInfos( } val argumentName = argument.getArgumentName()?.asName - val isFunctionLiteralArgument = argument is FunctionLiteralArgument + val isFunctionLiteralArgument = argument is LambdaArgument val callType = call.callType val isArrayAccess = callType == Call.CallType.ARRAY_GET_METHOD || callType == Call.CallType.ARRAY_SET_METHOD @@ -471,7 +471,7 @@ class ExpectedInfos( val functionLiteral = block.parent as? KtFunctionLiteral if (functionLiteral != null) { - val literalExpression = functionLiteral.parent as KtFunctionLiteralExpression + val literalExpression = functionLiteral.parent as KtLambdaExpression return calculate(literalExpression) .mapNotNull { it.fuzzyType } .filter { KotlinBuiltIns.isExactFunctionOrExtensionFunctionType(it.type) } diff --git a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/Utils.kt b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/Utils.kt index 629efd5cde6..fda647fedaf 100644 --- a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/Utils.kt +++ b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/Utils.kt @@ -57,7 +57,7 @@ public fun Call.mapArgumentsToParameters(targetDescriptor: CallableDescriptor): var positionalArgumentIndex: Int? = 0 for (argument in getValueArguments()) { - if (argument is FunctionLiteralArgument) { + if (argument is LambdaArgument) { map[argument] = parameters.last() } else { diff --git a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/psiModificationUtils.kt b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/psiModificationUtils.kt index 5b8bbd959f5..96895ab9a71 100644 --- a/idea/idea-core/src/org/jetbrains/kotlin/idea/core/psiModificationUtils.kt +++ b/idea/idea-core/src/org/jetbrains/kotlin/idea/core/psiModificationUtils.kt @@ -26,7 +26,7 @@ import org.jetbrains.kotlin.lexer.KtModifierKeywordToken import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.name.Name import org.jetbrains.kotlin.psi.* -import org.jetbrains.kotlin.psi.psiUtil.getFunctionLiteralArgumentName +import org.jetbrains.kotlin.psi.psiUtil.getLambdaArgumentName import org.jetbrains.kotlin.psi.psiUtil.visibilityModifierType import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.OverridingUtil @@ -44,16 +44,16 @@ public inline fun PsiElement.replaced(newElement: T): T @Suppress("UNCHECKED_CAST") public fun T.copied(): T = copy() as T -public fun KtFunctionLiteralArgument.moveInsideParentheses(bindingContext: BindingContext): KtCallExpression { +public fun KtLambdaArgument.moveInsideParentheses(bindingContext: BindingContext): KtCallExpression { return moveInsideParenthesesAndReplaceWith(this.getArgumentExpression(), bindingContext) } -public fun KtFunctionLiteralArgument.moveInsideParenthesesAndReplaceWith( +public fun KtLambdaArgument.moveInsideParenthesesAndReplaceWith( replacement: KtExpression, bindingContext: BindingContext -): KtCallExpression = moveInsideParenthesesAndReplaceWith(replacement, getFunctionLiteralArgumentName(bindingContext)) +): KtCallExpression = moveInsideParenthesesAndReplaceWith(replacement, getLambdaArgumentName(bindingContext)) -public fun KtFunctionLiteralArgument.moveInsideParenthesesAndReplaceWith( +public fun KtLambdaArgument.moveInsideParenthesesAndReplaceWith( replacement: KtExpression, functionLiteralArgumentName: Name? ): KtCallExpression { @@ -68,7 +68,7 @@ public fun KtFunctionLiteralArgument.moveInsideParenthesesAndReplaceWith( psiFactory.createArgument(replacement) } - val functionLiteralArgument = newCallExpression.getFunctionLiteralArguments().firstOrNull()!! + val functionLiteralArgument = newCallExpression.getLambdaArguments().firstOrNull()!! val valueArgumentList = newCallExpression.getValueArgumentList() ?: psiFactory.createCallArguments("()") valueArgumentList.addArgument(argument) @@ -84,14 +84,14 @@ public fun KtFunctionLiteralArgument.moveInsideParenthesesAndReplaceWith( } public fun KtCallExpression.moveFunctionLiteralOutsideParentheses() { - assert(getFunctionLiteralArguments().isEmpty()) + assert(getLambdaArguments().isEmpty()) val argumentList = getValueArgumentList()!! val argument = argumentList.getArguments().last() val expression = argument.getArgumentExpression()!! assert(expression.unpackFunctionLiteral() != null) val dummyCall = KtPsiFactory(this).createExpressionByPattern("foo()$0:'{}'", expression) as KtCallExpression - val functionLiteralArgument = dummyCall.getFunctionLiteralArguments().single() + val functionLiteralArgument = dummyCall.getLambdaArguments().single() this.add(functionLiteralArgument) if (argumentList.getArguments().size() > 1) { argumentList.removeArgument(argument) diff --git a/idea/src/org/jetbrains/kotlin/idea/actions/generate/KotlinGenerateSecondaryConstructorAction.kt b/idea/src/org/jetbrains/kotlin/idea/actions/generate/KotlinGenerateSecondaryConstructorAction.kt index fbe484104f2..45f0b86649f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/actions/generate/KotlinGenerateSecondaryConstructorAction.kt +++ b/idea/src/org/jetbrains/kotlin/idea/actions/generate/KotlinGenerateSecondaryConstructorAction.kt @@ -182,7 +182,7 @@ class KotlinGenerateSecondaryConstructorAction : KotlinGenerateMemberActionBase< delegationCallArguments.add(if (isVararg) "*$paramName" else paramName) } - val delegationCall = psiFactory.createConstructorDelegationCall(delegationCallArguments.joinToString(prefix = "super(", postfix = ")")) + val delegationCall = psiFactory.creareDelegatedSuperTypeEntry(delegationCallArguments.joinToString(prefix = "super(", postfix = ")")) constructor.replaceImplicitDelegationCallWithExplicit(false).replace(delegationCall) } diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/surroundWith/statement/KotlinFunctionLiteralSurrounder.java b/idea/src/org/jetbrains/kotlin/idea/codeInsight/surroundWith/statement/KotlinFunctionLiteralSurrounder.java index e6033baa064..6388efa20c4 100644 --- a/idea/src/org/jetbrains/kotlin/idea/codeInsight/surroundWith/statement/KotlinFunctionLiteralSurrounder.java +++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/surroundWith/statement/KotlinFunctionLiteralSurrounder.java @@ -43,7 +43,7 @@ public class KotlinFunctionLiteralSurrounder extends KotlinStatementsSurrounder callExpression = (KtCallExpression) container.addAfter(callExpression, statements[statements.length - 1]); container.addBefore(psiFactory.createWhiteSpace(), callExpression); - KtFunctionLiteralExpression bodyExpression = callExpression.getFunctionLiteralArguments().get(0).getFunctionLiteral(); + KtLambdaExpression bodyExpression = callExpression.getLambdaArguments().get(0).getLambdaExpression(); assert bodyExpression != null : "Body expression should exists for " + callExpression.getText(); KtBlockExpression blockExpression = bodyExpression.getBodyExpression(); assert blockExpression != null : "JetBlockExpression should exists for " + callExpression.getText(); diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinLambdaUnwrapper.java b/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinLambdaUnwrapper.java index c3c48b0279b..d263d048035 100644 --- a/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinLambdaUnwrapper.java +++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/unwrap/KotlinLambdaUnwrapper.java @@ -27,7 +27,7 @@ public class KotlinLambdaUnwrapper extends KotlinUnwrapRemoveBase { super(key); } - private static KtElement getLambdaEnclosingElement(@NotNull KtFunctionLiteralExpression lambda) { + private static KtElement getLambdaEnclosingElement(@NotNull KtLambdaExpression lambda) { PsiElement parent = lambda.getParent(); if (parent instanceof KtValueArgument) { @@ -47,11 +47,11 @@ public class KotlinLambdaUnwrapper extends KotlinUnwrapRemoveBase { @Override public boolean isApplicableTo(PsiElement e) { - if (!(e instanceof KtFunctionLiteralExpression)) return false; + if (!(e instanceof KtLambdaExpression)) return false; - KtFunctionLiteralExpression lambda = (KtFunctionLiteralExpression) e; + KtLambdaExpression lambda = (KtLambdaExpression) e; KtBlockExpression body = lambda.getBodyExpression(); - KtElement enclosingElement = getLambdaEnclosingElement((KtFunctionLiteralExpression) e); + KtElement enclosingElement = getLambdaEnclosingElement((KtLambdaExpression) e); if (body == null || enclosingElement == null) return false; @@ -60,7 +60,7 @@ public class KotlinLambdaUnwrapper extends KotlinUnwrapRemoveBase { @Override protected void doUnwrap(PsiElement element, Context context) throws IncorrectOperationException { - KtFunctionLiteralExpression lambda = (KtFunctionLiteralExpression) element; + KtLambdaExpression lambda = (KtLambdaExpression) element; KtBlockExpression body = lambda.getBodyExpression(); KtElement enclosingExpression = getLambdaEnclosingElement(lambda); diff --git a/idea/src/org/jetbrains/kotlin/idea/codeInsight/upDownMover/KotlinExpressionMover.java b/idea/src/org/jetbrains/kotlin/idea/codeInsight/upDownMover/KotlinExpressionMover.java index 87ce6811d28..7828d76c4a3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/codeInsight/upDownMover/KotlinExpressionMover.java +++ b/idea/src/org/jetbrains/kotlin/idea/codeInsight/upDownMover/KotlinExpressionMover.java @@ -227,10 +227,10 @@ public class KotlinExpressionMover extends AbstractKotlinUpDownMover { (KtCallExpression) KtPsiUtil.getOutermostDescendantElement(element, down, IS_CALL_EXPRESSION); if (callExpression == null) return null; - List functionLiterals = callExpression.getFunctionLiteralArguments(); + List functionLiterals = callExpression.getLambdaArguments(); if (functionLiterals.isEmpty()) return null; - return functionLiterals.get(0).getFunctionLiteral().getBodyExpression(); + return functionLiterals.get(0).getLambdaExpression().getBodyExpression(); } @Nullable diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinFrameExtraVariablesProvider.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinFrameExtraVariablesProvider.kt index b3dece55ca2..a3570ff90e5 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinFrameExtraVariablesProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/KotlinFrameExtraVariablesProvider.kt @@ -188,7 +188,7 @@ private class VariablesCollector( // Do not show expressions used in anonymous objects } - override fun visitFunctionLiteralExpression(expression: KtFunctionLiteralExpression) { + override fun visitLambdaExpression(lambdaExpression: KtLambdaExpression) { // Do not show expressions used in lambdas } } \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt index d562ea490ca..4097fa9a0be 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/evaluate/extractFunctionForDebuggerUtil.kt @@ -299,5 +299,5 @@ private fun wrapInRunFun(expression: KtExpression): PsiElement? { // Increment modification tracker to clear ResolveCache after changes in function body (PsiManager.getInstance(expression.project).modificationTracker as PsiModificationTrackerImpl).incCounter() - return replacedBody.functionLiteralArguments.first().getFunctionLiteral().bodyExpression?.firstChild + return replacedBody.lambdaArguments.first().getLambdaExpression().bodyExpression?.firstChild } diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSmartStepIntoHandler.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSmartStepIntoHandler.kt index b291382704c..9dc892bc2b5 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSmartStepIntoHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSmartStepIntoHandler.kt @@ -65,8 +65,8 @@ public class KotlinSmartStepIntoHandler : JvmSmartStepIntoHandler() { // TODO support class initializers, local functions, delegated properties with specified type, setter for properties element.accept(object: KtTreeVisitorVoid() { - override fun visitFunctionLiteralExpression(expression: KtFunctionLiteralExpression) { - recordFunctionLiteral(expression.functionLiteral) + override fun visitLambdaExpression(lambdaExpression: KtLambdaExpression) { + recordFunctionLiteral(lambdaExpression.functionLiteral) } override fun visitNamedFunction(function: KtNamedFunction) { @@ -91,7 +91,7 @@ public class KotlinSmartStepIntoHandler : JvmSmartStepIntoHandler() { return false } - private fun getArgumentExpression(it: ValueArgument) = (it.getArgumentExpression() as? KtFunctionLiteralExpression)?.functionLiteral ?: it.getArgumentExpression() + private fun getArgumentExpression(it: ValueArgument) = (it.getArgumentExpression() as? KtLambdaExpression)?.functionLiteral ?: it.getArgumentExpression() override fun visitObjectLiteralExpression(expression: KtObjectLiteralExpression) { // skip calls in object declarations diff --git a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt index 04f515dbe50..e0b87b89ff3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/debugger/stepping/KotlinSteppingCommandProvider.kt @@ -234,7 +234,7 @@ public class KotlinSteppingCommandProvider: JvmSteppingCommandProvider() { } } - private fun getArgumentExpression(it: ValueArgument) = (it.getArgumentExpression() as? KtFunctionLiteralExpression)?.functionLiteral ?: it.getArgumentExpression() + private fun getArgumentExpression(it: ValueArgument) = (it.getArgumentExpression() as? KtLambdaExpression)?.functionLiteral ?: it.getArgumentExpression() private fun getInlineFunctionCallsIfAny(sourcePosition: SourcePosition): List { val file = sourcePosition.file as? KtFile ?: return emptyList() @@ -400,7 +400,7 @@ private fun SuspendContextImpl.getNextPositionWithFilter( } private fun getInlineArgumentIfAny(elementAt: PsiElement?): KtFunctionLiteral? { - val functionLiteralExpression = elementAt?.getParentOfType(false) ?: return null + val functionLiteralExpression = elementAt?.getParentOfType(false) ?: return null val context = functionLiteralExpression.analyze(BodyResolveMode.PARTIAL) if (!InlineUtil.isInlinedArgument(functionLiteralExpression.functionLiteral, context, false)) return null diff --git a/idea/src/org/jetbrains/kotlin/idea/editor/fixers/KotlinForConditionFixer.kt b/idea/src/org/jetbrains/kotlin/idea/editor/fixers/KotlinForConditionFixer.kt index b3f8422947e..e555eaaa752 100644 --- a/idea/src/org/jetbrains/kotlin/idea/editor/fixers/KotlinForConditionFixer.kt +++ b/idea/src/org/jetbrains/kotlin/idea/editor/fixers/KotlinForConditionFixer.kt @@ -23,7 +23,7 @@ public class KotlinForConditionFixer: MissingConditionFixer() { override val keyword = "for" override fun getElement(element: PsiElement?) = element as? KtForExpression override fun getCondition(element: KtForExpression) = - element.getLoopRange() ?: element.getLoopParameter() ?: element.getMultiParameter() + element.getLoopRange() ?: element.getLoopParameter() ?: element.getDestructuringParameter() override fun getLeftParenthesis(element: KtForExpression) = element.getLeftParenthesis() override fun getRightParenthesis(element: KtForExpression) = element.getRightParenthesis() override fun getBody(element: KtForExpression) = element.getBody() diff --git a/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinDeclarationSelectioner.kt b/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinDeclarationSelectioner.kt index 44cb8ada0a0..71c7be2630f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinDeclarationSelectioner.kt +++ b/idea/src/org/jetbrains/kotlin/idea/editor/wordSelection/KotlinDeclarationSelectioner.kt @@ -25,7 +25,7 @@ import java.util.ArrayList import org.jetbrains.kotlin.psi.psiUtil.siblings import com.intellij.psi.PsiComment import com.intellij.psi.PsiWhiteSpace -import org.jetbrains.kotlin.psi.KtMultiDeclaration +import org.jetbrains.kotlin.psi.KtDestructuringDeclaration import org.jetbrains.kotlin.psi.psiUtil.endOffset import org.jetbrains.kotlin.psi.psiUtil.startOffset @@ -34,7 +34,7 @@ public class KotlinDeclarationSelectioner : ExtendWordSelectionHandlerBase() { = e is KtDeclaration override fun select(e: PsiElement, editorText: CharSequence, cursorOffset: Int, editor: Editor): List? { - if (e is KtMultiDeclaration) { + if (e is KtDestructuringDeclaration) { return selectMultiDeclaration(editorText, e) } @@ -58,7 +58,7 @@ public class KotlinDeclarationSelectioner : ExtendWordSelectionHandlerBase() { return result } - private fun selectMultiDeclaration(editorText: CharSequence, e: KtMultiDeclaration): ArrayList { + private fun selectMultiDeclaration(editorText: CharSequence, e: KtDestructuringDeclaration): ArrayList { val result = ArrayList() val lpar = e.lPar val rpar = e.rPar diff --git a/idea/src/org/jetbrains/kotlin/idea/findUsages/KotlinElementDescriptionProvider.kt b/idea/src/org/jetbrains/kotlin/idea/findUsages/KotlinElementDescriptionProvider.kt index 118600a56ff..74fef07f14e 100644 --- a/idea/src/org/jetbrains/kotlin/idea/findUsages/KotlinElementDescriptionProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/findUsages/KotlinElementDescriptionProvider.kt @@ -43,7 +43,7 @@ public class KotlinElementDescriptionProvider : ElementDescriptionProvider { is KtProperty -> if (targetElement.isLocal()) "variable" else "property" is KtTypeParameter -> "type parameter" is KtParameter -> "parameter" - is KtMultiDeclarationEntry -> "variable" + is KtDestructuringDeclarationEntry -> "variable" else -> null } diff --git a/idea/src/org/jetbrains/kotlin/idea/formatter/KotlinBlock.java b/idea/src/org/jetbrains/kotlin/idea/formatter/KotlinBlock.java index 6cb60ab3851..068d27c572b 100644 --- a/idea/src/org/jetbrains/kotlin/idea/formatter/KotlinBlock.java +++ b/idea/src/org/jetbrains/kotlin/idea/formatter/KotlinBlock.java @@ -294,7 +294,7 @@ public class KotlinBlock extends AbstractBlock { return NodeAlignmentStrategy.fromTypes(AlignmentStrategy.wrap( createAlignment(jetCommonSettings.ALIGN_MULTILINE_BINARY_OPERATION, getAlignment()))); } - else if (parentType == DELEGATION_SPECIFIER_LIST || parentType == INITIALIZER_LIST) { + else if (parentType == SUPER_TYPE_LIST || parentType == INITIALIZER_LIST) { return NodeAlignmentStrategy.fromTypes(AlignmentStrategy.wrap( createAlignment(jetCommonSettings.ALIGN_MULTILINE_EXTENDS_LIST, getAlignment()))); } @@ -396,7 +396,7 @@ public class KotlinBlock extends AbstractBlock { .set(Indent.getNormalIndent()), strategy("Indent for parts") - .in(PROPERTY, FUN, MULTI_VARIABLE_DECLARATION) + .in(PROPERTY, FUN, DESTRUCTURING_DECLARATION) .notForType(BLOCK, FUN_KEYWORD, VAL_KEYWORD, VAR_KEYWORD) .set(Indent.getContinuationWithoutFirstIndent()), @@ -405,7 +405,7 @@ public class KotlinBlock extends AbstractBlock { .set(Indent.getContinuationWithoutFirstIndent(false)), strategy("Delegation list") - .in(DELEGATION_SPECIFIER_LIST, INITIALIZER_LIST) + .in(SUPER_TYPE_LIST, INITIALIZER_LIST) .set(Indent.getContinuationIndent(false)), strategy("Indices") diff --git a/idea/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt b/idea/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt index 7c31c7a6590..52ca56c630f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt +++ b/idea/src/org/jetbrains/kotlin/idea/formatter/kotlinSpacingRules.kt @@ -199,10 +199,10 @@ fun createSpacingBuilder(settings: CodeStyleSettings): KotlinSpacingBuilder { betweenInside(WHEN_KEYWORD, LPAR, WHEN).spacing(1, 1, 0, false, 0) betweenInside(LPAR, VALUE_PARAMETER, FOR).spaces(0) - betweenInside(LPAR, MULTI_VARIABLE_DECLARATION, FOR).spaces(0) + betweenInside(LPAR, DESTRUCTURING_DECLARATION, FOR).spaces(0) betweenInside(LOOP_RANGE, RPAR, FOR).spaces(0) - val TYPE_COLON_ELEMENTS = TokenSet.create(PROPERTY, FUN, VALUE_PARAMETER, MULTI_VARIABLE_DECLARATION_ENTRY, FUNCTION_LITERAL) + val TYPE_COLON_ELEMENTS = TokenSet.create(PROPERTY, FUN, VALUE_PARAMETER, DESTRUCTURING_DECLARATION_ENTRY, FUNCTION_LITERAL) beforeInside(COLON, TYPE_COLON_ELEMENTS) { spaceIf(jetSettings.SPACE_BEFORE_TYPE_COLON) } afterInside(COLON, TYPE_COLON_ELEMENTS) { spaceIf(jetSettings.SPACE_AFTER_TYPE_COLON) } @@ -215,9 +215,9 @@ fun createSpacingBuilder(settings: CodeStyleSettings): KotlinSpacingBuilder { aroundInside(ARROW, FUNCTION_TYPE).spaceIf(jetSettings.SPACE_AROUND_FUNCTION_TYPE_ARROW) - between(VALUE_ARGUMENT_LIST, FUNCTION_LITERAL_ARGUMENT).spaces(1) - betweenInside(REFERENCE_EXPRESSION, FUNCTION_LITERAL_ARGUMENT, CALL_EXPRESSION).spaces(1) - betweenInside(TYPE_ARGUMENT_LIST, FUNCTION_LITERAL_ARGUMENT, CALL_EXPRESSION).spaces(1) + between(VALUE_ARGUMENT_LIST, LAMBDA_ARGUMENT).spaces(1) + betweenInside(REFERENCE_EXPRESSION, LAMBDA_ARGUMENT, CALL_EXPRESSION).spaces(1) + betweenInside(TYPE_ARGUMENT_LIST, LAMBDA_ARGUMENT, CALL_EXPRESSION).spaces(1) } custom { diff --git a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeMethodsTreeStructure.java b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeMethodsTreeStructure.java index 83b85209823..b128e62ab51 100644 --- a/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeMethodsTreeStructure.java +++ b/idea/src/org/jetbrains/kotlin/idea/hierarchy/calls/KotlinCalleeMethodsTreeStructure.java @@ -63,7 +63,7 @@ public class KotlinCalleeMethodsTreeStructure extends KotlinCallTreeStructure { } } else { KtClassOrObject classOrObject = (KtClassOrObject) rootElement; - for (KtDelegationSpecifier specifier : classOrObject.getDelegationSpecifiers()) { + for (KtSuperTypeListEntry specifier : classOrObject.getSuperTypeListEntries()) { if (specifier instanceof KtCallElement) { elementsToAnalyze.add(specifier); } diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/EqualsOrHashCodeInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/EqualsOrHashCodeInspection.kt index 30d981b0672..5cfea153913 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/EqualsOrHashCodeInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/EqualsOrHashCodeInspection.kt @@ -77,7 +77,7 @@ class EqualsOrHashCodeInspection : AbstractKotlinInspection() { when (classDescriptor.kind) { ClassKind.OBJECT -> { - if (classOrObject.getDelegationSpecifiers().isNotEmpty()) return + if (classOrObject.getSuperTypeListEntries().isNotEmpty()) return holder.registerProblem(nameIdentifier, "equals()/hashCode() in object declaration", DeleteEqualsAndHashCodeFix) } ClassKind.CLASS -> { diff --git a/idea/src/org/jetbrains/kotlin/idea/inspections/RedundantSamConstructorInspection.kt b/idea/src/org/jetbrains/kotlin/idea/inspections/RedundantSamConstructorInspection.kt index 3f0cbe47ad2..e94d670ff3c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/inspections/RedundantSamConstructorInspection.kt +++ b/idea/src/org/jetbrains/kotlin/idea/inspections/RedundantSamConstructorInspection.kt @@ -204,7 +204,7 @@ public class RedundantSamConstructorInspection : AbstractKotlinInspection() { = argument.toCallExpression()?.samConstructorValueArgument() != null private fun KtCallExpression.samConstructorValueArgument(): KtValueArgument? { - return valueArguments.singleOrNull()?.check { it.getArgumentExpression() is KtFunctionLiteralExpression } + return valueArguments.singleOrNull()?.check { it.getArgumentExpression() is KtLambdaExpression } } private fun ValueArgument.toCallExpression(): KtCallExpression? { diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/AddForLoopIndicesIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/AddForLoopIndicesIntention.kt index 0a1fd878072..8e244f65afa 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/AddForLoopIndicesIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/AddForLoopIndicesIntention.kt @@ -62,7 +62,7 @@ public class AddForLoopIndicesIntention : SelfTargetingRangeIntention " $2:'{}'" else -> "($2)" } val replacement = KtPsiFactory(element).createExpressionByPattern(pattern, element.getLeft()!!, element.getOperationReference().getText(), argument) diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/MoveLambdaInsideParenthesesIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/MoveLambdaInsideParenthesesIntention.kt index a878f067083..dc081acf52a 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/MoveLambdaInsideParenthesesIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/MoveLambdaInsideParenthesesIntention.kt @@ -21,16 +21,16 @@ import com.intellij.openapi.editor.Editor import org.jetbrains.kotlin.idea.caches.resolve.analyze import org.jetbrains.kotlin.idea.caches.resolve.analyzeFully import org.jetbrains.kotlin.idea.core.moveInsideParentheses -import org.jetbrains.kotlin.psi.KtFunctionLiteralArgument +import org.jetbrains.kotlin.psi.KtLambdaArgument import org.jetbrains.kotlin.psi.psiUtil.containsInside -public class MoveLambdaInsideParenthesesIntention : SelfTargetingIntention(javaClass(), "Move lambda argument into parentheses"), LowPriorityAction { - override fun isApplicableTo(element: KtFunctionLiteralArgument, caretOffset: Int): Boolean { - val body = element.getFunctionLiteral().getBodyExpression() ?: return true +public class MoveLambdaInsideParenthesesIntention : SelfTargetingIntention(javaClass(), "Move lambda argument into parentheses"), LowPriorityAction { + override fun isApplicableTo(element: KtLambdaArgument, caretOffset: Int): Boolean { + val body = element.getLambdaExpression().getBodyExpression() ?: return true return !body.getTextRange().containsInside(caretOffset) } - override fun applyTo(element: KtFunctionLiteralArgument, editor: Editor) { + override fun applyTo(element: KtLambdaArgument, editor: Editor) { element.moveInsideParentheses(element.analyze()) } } diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/MoveLambdaOutsideParenthesesIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/MoveLambdaOutsideParenthesesIntention.kt index 351a93abbb9..72ece6d998a 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/MoveLambdaOutsideParenthesesIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/MoveLambdaOutsideParenthesesIntention.kt @@ -31,7 +31,7 @@ import org.jetbrains.kotlin.resolve.lazy.BodyResolveMode public class MoveLambdaOutsideParenthesesIntention : SelfTargetingIntention(javaClass(), "Move lambda argument out of parentheses") { override fun isApplicableTo(element: KtCallExpression, caretOffset: Int): Boolean { - if (element.getFunctionLiteralArguments().isNotEmpty()) return false + if (element.getLambdaArguments().isNotEmpty()) return false val argument = element.getValueArguments().lastOrNull() ?: return false val expression = argument.getArgumentExpression() ?: return false val functionLiteral = expression.unpackFunctionLiteral() ?: return false diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/ObjectLiteralToLambdaIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/ObjectLiteralToLambdaIntention.kt index d523a74f8f6..05c1045d500 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/ObjectLiteralToLambdaIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/ObjectLiteralToLambdaIntention.kt @@ -118,7 +118,7 @@ class ObjectLiteralToLambdaIntention : SelfTargetingRangeIntention(javaClass(), "Remove explicit lambda parameter types (may break code)") { - override fun isApplicableTo(element: KtFunctionLiteralExpression, caretOffset: Int): Boolean { +public class RemoveExplicitLambdaParameterTypesIntention : SelfTargetingIntention(javaClass(), "Remove explicit lambda parameter types (may break code)") { + override fun isApplicableTo(element: KtLambdaExpression, caretOffset: Int): Boolean { if (element.getValueParameters().none { it.getTypeReference() != null }) return false val arrow = element.getFunctionLiteral().getArrow() ?: return false return caretOffset <= arrow.endOffset } - override fun applyTo(element: KtFunctionLiteralExpression, editor: Editor) { + override fun applyTo(element: KtLambdaExpression, editor: Editor) { val oldParameterList = element.getFunctionLiteral().getValueParameterList()!! val parameterString = oldParameterList.getParameters().map { it.getName() }.joinToString(", ") diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/RemoveForLoopIndicesIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/RemoveForLoopIndicesIntention.kt index 20a2c875c02..d24244108ce 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/RemoveForLoopIndicesIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/RemoveForLoopIndicesIntention.kt @@ -45,7 +45,7 @@ public class RemoveForLoopIndicesIntention : SelfTargetingRangeIntention }") as KtFunctionLiteralExpression + val newExpr = KtPsiFactory(element).createExpression("{ it -> }") as KtLambdaExpression functionLiteral.addRangeAfter( newExpr.getFunctionLiteral().getValueParameterList(), newExpr.getFunctionLiteral().getArrow()!!, diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/SpecifyExplicitLambdaSignatureIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/SpecifyExplicitLambdaSignatureIntention.kt index 0b703ba05be..21898e7b49e 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/SpecifyExplicitLambdaSignatureIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/SpecifyExplicitLambdaSignatureIntention.kt @@ -22,14 +22,14 @@ import com.intellij.psi.PsiWhiteSpace import org.jetbrains.kotlin.idea.caches.resolve.analyze import org.jetbrains.kotlin.idea.util.IdeDescriptorRenderers import org.jetbrains.kotlin.idea.util.ShortenReferences -import org.jetbrains.kotlin.psi.KtFunctionLiteralExpression +import org.jetbrains.kotlin.psi.KtLambdaExpression import org.jetbrains.kotlin.psi.KtPsiFactory import org.jetbrains.kotlin.psi.psiUtil.endOffset import org.jetbrains.kotlin.resolve.BindingContext -public class SpecifyExplicitLambdaSignatureIntention : SelfTargetingIntention(javaClass(), "Specify explicit lambda signature"), LowPriorityAction { +public class SpecifyExplicitLambdaSignatureIntention : SelfTargetingIntention(javaClass(), "Specify explicit lambda signature"), LowPriorityAction { - override fun isApplicableTo(element: KtFunctionLiteralExpression, caretOffset: Int): Boolean { + override fun isApplicableTo(element: KtLambdaExpression, caretOffset: Int): Boolean { val arrow = element.getFunctionLiteral().getArrow() if (arrow != null) { if (caretOffset > arrow.endOffset) return false @@ -43,7 +43,7 @@ public class SpecifyExplicitLambdaSignatureIntention : SelfTargetingIntention = emptyList() - override fun getFunctionLiteralArguments(): List = emptyList() + override fun getFunctionLiteralArguments(): List = emptyList() } val bindingTrace = DelegatingBindingTrace(bindingContext, "Temporary trace") diff --git a/idea/src/org/jetbrains/kotlin/idea/intentions/conventionNameCalls/ReplaceContainsIntention.kt b/idea/src/org/jetbrains/kotlin/idea/intentions/conventionNameCalls/ReplaceContainsIntention.kt index e253dabb84a..5567dc24133 100644 --- a/idea/src/org/jetbrains/kotlin/idea/intentions/conventionNameCalls/ReplaceContainsIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/intentions/conventionNameCalls/ReplaceContainsIntention.kt @@ -61,7 +61,7 @@ public class ReplaceContainsIntention : SelfTargetingRangeIntention() + override fun getFunctionLiteralArguments() = emptyList() override fun getValueArgumentList() = null } } diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeFunctionLiteralReturnTypeFix.java b/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeFunctionLiteralReturnTypeFix.java index c60a423602c..d1033f8f576 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeFunctionLiteralReturnTypeFix.java +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeFunctionLiteralReturnTypeFix.java @@ -48,12 +48,12 @@ import java.util.List; import static org.jetbrains.kotlin.idea.project.PlatformKt.getPlatform; -public class ChangeFunctionLiteralReturnTypeFix extends KotlinQuickFixAction { +public class ChangeFunctionLiteralReturnTypeFix extends KotlinQuickFixAction { private final KotlinType type; private final KtTypeReference functionLiteralReturnTypeRef; private IntentionAction appropriateQuickFix = null; - public ChangeFunctionLiteralReturnTypeFix(@NotNull KtFunctionLiteralExpression functionLiteralExpression, @NotNull KotlinType type) { + public ChangeFunctionLiteralReturnTypeFix(@NotNull KtLambdaExpression functionLiteralExpression, @NotNull KotlinType type) { super(functionLiteralExpression); this.type = type; functionLiteralReturnTypeRef = functionLiteralExpression.getFunctionLiteral().getTypeReference(); @@ -150,8 +150,8 @@ public class ChangeFunctionLiteralReturnTypeFix extends KotlinQuickFixAction resolvedCall = context.get(BindingContext.COMPONENT_RESOLVED_CALL, entry); if (resolvedCall == null) return null; diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeVariableTypeFix.java b/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeVariableTypeFix.java index ef1cd60f2aa..7f940e8f20f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeVariableTypeFix.java +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/ChangeVariableTypeFix.java @@ -114,8 +114,8 @@ public class ChangeVariableTypeFix extends KotlinQuickFixAction resolvedCall = context.get(BindingContext.COMPONENT_RESOLVED_CALL, entry); if (resolvedCall == null) return null; diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt index 2752ce8d51a..a490e513a95 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/QuickFixRegistrar.kt @@ -259,8 +259,8 @@ public class QuickFixRegistrar : QuickFixContributor { NO_VALUE_FOR_PARAMETER.registerFactory(CreateConstructorFromDelegationCallActionFactory) TOO_MANY_ARGUMENTS.registerFactory(CreateConstructorFromDelegationCallActionFactory) - NO_VALUE_FOR_PARAMETER.registerFactory(CreateConstructorFromDelegatorToSuperCallActionFactory) - TOO_MANY_ARGUMENTS.registerFactory(CreateConstructorFromDelegatorToSuperCallActionFactory) + NO_VALUE_FOR_PARAMETER.registerFactory(CreateConstructorFromSuperTypeCallActionFactory) + TOO_MANY_ARGUMENTS.registerFactory(CreateConstructorFromSuperTypeCallActionFactory) UNRESOLVED_REFERENCE_WRONG_RECEIVER.registerFactory(CreateClassFromConstructorCallActionFactory) UNRESOLVED_REFERENCE.registerFactory(CreateClassFromConstructorCallActionFactory) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/RemoveSupertypeFix.java b/idea/src/org/jetbrains/kotlin/idea/quickfix/RemoveSupertypeFix.java index 9bcdc1942ce..8c168552e42 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/RemoveSupertypeFix.java +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/RemoveSupertypeFix.java @@ -27,13 +27,13 @@ import org.jetbrains.kotlin.diagnostics.Diagnostic; import org.jetbrains.kotlin.idea.KotlinBundle; import org.jetbrains.kotlin.idea.core.quickfix.QuickFixUtil; import org.jetbrains.kotlin.lexer.KtTokens; -import org.jetbrains.kotlin.psi.KtDelegationSpecifier; +import org.jetbrains.kotlin.psi.KtSuperTypeListEntry; import org.jetbrains.kotlin.psi.KtFile; -public class RemoveSupertypeFix extends KotlinQuickFixAction { - private final KtDelegationSpecifier superClass; +public class RemoveSupertypeFix extends KotlinQuickFixAction { + private final KtSuperTypeListEntry superClass; - public RemoveSupertypeFix(@NotNull KtDelegationSpecifier superClass) { + public RemoveSupertypeFix(@NotNull KtSuperTypeListEntry superClass) { super(superClass); this.superClass = superClass; } @@ -67,8 +67,8 @@ public class RemoveSupertypeFix extends KotlinQuickFixAction createAction(Diagnostic diagnostic) { - KtDelegationSpecifier superClass = QuickFixUtil.getParentElementOfType(diagnostic, KtDelegationSpecifier.class); + public KotlinQuickFixAction createAction(Diagnostic diagnostic) { + KtSuperTypeListEntry superClass = QuickFixUtil.getParentElementOfType(diagnostic, KtSuperTypeListEntry.class); if (superClass == null) return null; return new RemoveSupertypeFix(superClass); } diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/SuperClassNotInitialized.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/SuperClassNotInitialized.kt index 19e6ddbcb22..42ccf0138b0 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/SuperClassNotInitialized.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/SuperClassNotInitialized.kt @@ -49,7 +49,7 @@ public object SuperClassNotInitialized : KotlinIntentionActionsFactory() { private val DISPLAY_MAX_PARAMS = 5 override fun doCreateActions(diagnostic: Diagnostic): List { - val delegator = diagnostic.getPsiElement() as KtDelegatorToSuperClass + val delegator = diagnostic.getPsiElement() as KtSuperTypeEntry val classOrObjectDeclaration = delegator.getParent().getParent() as? KtClassOrObject ?: return emptyList() val typeRef = delegator.getTypeReference() ?: return emptyList() @@ -103,16 +103,16 @@ public object SuperClassNotInitialized : KotlinIntentionActionsFactory() { } private class AddParenthesisFix( - element: KtDelegatorToSuperClass, + element: KtSuperTypeEntry, val putCaretIntoParenthesis: Boolean - ) : KotlinQuickFixAction(element), HighPriorityAction { + ) : KotlinQuickFixAction(element), HighPriorityAction { override fun getFamilyName() = "Change to constructor invocation" //TODO? override fun getText() = getFamilyName() override fun invoke(project: Project, editor: Editor?, file: KtFile) { - val newSpecifier = element.replaced(KtPsiFactory(project).createDelegatorToSuperCall(element.getText() + "()")) + val newSpecifier = element.replaced(KtPsiFactory(project).createSuperTypeCallEntry(element.getText() + "()")) if (putCaretIntoParenthesis) { if (editor != null) { @@ -127,16 +127,16 @@ public object SuperClassNotInitialized : KotlinIntentionActionsFactory() { } private class AddParametersFix( - element: KtDelegatorToSuperClass, + element: KtSuperTypeEntry, private val classDeclaration: KtClass, private val parametersToAdd: Collection, private val argumentText: String, private val text: String - ) : KotlinQuickFixAction(element) { + ) : KotlinQuickFixAction(element) { companion object { fun create( - element: KtDelegatorToSuperClass, + element: KtSuperTypeEntry, classDeclaration: KtClass, superConstructor: ConstructorDescriptor, text: String @@ -191,7 +191,7 @@ public object SuperClassNotInitialized : KotlinIntentionActionsFactory() { typeRefsToShorten.add(newParameter.typeReference!!) } - val delegatorCall = factory.createDelegatorToSuperCall(element.text + "(" + argumentText + ")") + val delegatorCall = factory.createSuperTypeCallEntry(element.text + "(" + argumentText + ")") element.replace(delegatorCall) ShortenReferences.DEFAULT.process(typeRefsToShorten) diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt index 751bb8b05eb..499a4ac6dbc 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/CallableBuilder.kt @@ -733,7 +733,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) { expression = TypeExpression.ForTypeReference(candidates) } is KtClassOrObject -> { - elementToReplace = declaration.getDelegationSpecifiers().firstOrNull() + elementToReplace = declaration.getSuperTypeListEntries().firstOrNull() expression = TypeExpression.ForDelegationSpecifier(candidates) } else -> throw AssertionError("Unexpected declaration kind: ${declaration.getText()}") @@ -1033,7 +1033,7 @@ class CallableBuilder(val config: CallableBuilderConfiguration) { internal fun KtNamedDeclaration.getReturnTypeReference(): KtTypeReference? { return when (this) { is KtCallableDeclaration -> getTypeReference() - is KtClassOrObject -> getDelegationSpecifiers().firstOrNull()?.getTypeReference() + is KtClassOrObject -> getSuperTypeListEntries().firstOrNull()?.getTypeReference() else -> throw AssertionError("Unexpected declaration kind: ${getText()}") } } diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt index 546f7012f11..c08020e780f 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/callableBuilder/typeUtils.kt @@ -148,7 +148,7 @@ fun KtExpression.guessTypes( val constraint = parent arrayOf(context[BindingContext.TYPE, constraint.getBoundTypeReference()]!!) } - this is KtMultiDeclarationEntry -> { + this is KtDestructuringDeclarationEntry -> { // expression is on the lhs of a multi-declaration val typeRef = getTypeReference() if (typeRef != null) { diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateComponentFunctionActionFactory.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateComponentFunctionActionFactory.kt index 30a3140c7d8..b2e691a02ac 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateComponentFunctionActionFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateComponentFunctionActionFactory.kt @@ -23,18 +23,18 @@ import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.Callab import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.FunctionInfo import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.TypeInfo import org.jetbrains.kotlin.psi.KtForExpression -import org.jetbrains.kotlin.psi.KtMultiDeclaration +import org.jetbrains.kotlin.psi.KtDestructuringDeclaration import org.jetbrains.kotlin.resolve.dataClassUtils.getComponentIndex import org.jetbrains.kotlin.resolve.dataClassUtils.isComponentLike import org.jetbrains.kotlin.types.Variance -object CreateComponentFunctionActionFactory : CreateCallableMemberFromUsageFactory() { - override fun getElementOfInterest(diagnostic: Diagnostic): KtMultiDeclaration? { - QuickFixUtil.getParentElementOfType(diagnostic, javaClass())?.let { return it } - return QuickFixUtil.getParentElementOfType(diagnostic, javaClass())?.multiParameter +object CreateComponentFunctionActionFactory : CreateCallableMemberFromUsageFactory() { + override fun getElementOfInterest(diagnostic: Diagnostic): KtDestructuringDeclaration? { + QuickFixUtil.getParentElementOfType(diagnostic, javaClass())?.let { return it } + return QuickFixUtil.getParentElementOfType(diagnostic, javaClass())?.destructuringParameter } - override fun createCallableInfo(element: KtMultiDeclaration, diagnostic: Diagnostic): CallableInfo? { + override fun createCallableInfo(element: KtDestructuringDeclaration, diagnostic: Diagnostic): CallableInfo? { val diagnosticWithParameters = Errors.COMPONENT_FUNCTION_MISSING.cast(diagnostic) val name = diagnosticWithParameters.a diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateConstructorFromDelegatorToSuperCallActionFactory.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateConstructorFromSuperTypeCallActionFactory.kt similarity index 86% rename from idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateConstructorFromDelegatorToSuperCallActionFactory.kt rename to idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateConstructorFromSuperTypeCallActionFactory.kt index 96f009ff325..81243bd7ac0 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateConstructorFromDelegatorToSuperCallActionFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateConstructorFromSuperTypeCallActionFactory.kt @@ -17,7 +17,6 @@ package org.jetbrains.kotlin.idea.quickfix.createFromUsage.createCallable import com.intellij.psi.PsiClass -import org.jetbrains.kotlin.builtins.KotlinBuiltIns import org.jetbrains.kotlin.descriptors.ClassDescriptor import org.jetbrains.kotlin.descriptors.ClassKind import org.jetbrains.kotlin.diagnostics.Diagnostic @@ -29,18 +28,18 @@ import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.Parame import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.SecondaryConstructorInfo import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.TypeInfo import org.jetbrains.kotlin.psi.KtClass -import org.jetbrains.kotlin.psi.KtDelegatorToSuperCall +import org.jetbrains.kotlin.psi.KtSuperTypeCallEntry import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.descriptorUtil.builtIns import org.jetbrains.kotlin.types.Variance -object CreateConstructorFromDelegatorToSuperCallActionFactory : CreateCallableMemberFromUsageFactory() { - override fun getElementOfInterest(diagnostic: Diagnostic): KtDelegatorToSuperCall? { - return diagnostic.psiElement.getStrictParentOfType() +object CreateConstructorFromSuperTypeCallActionFactory : CreateCallableMemberFromUsageFactory() { + override fun getElementOfInterest(diagnostic: Diagnostic): KtSuperTypeCallEntry? { + return diagnostic.psiElement.getStrictParentOfType() } - override fun createCallableInfo(element: KtDelegatorToSuperCall, diagnostic: Diagnostic): CallableInfo? { + override fun createCallableInfo(element: KtSuperTypeCallEntry, diagnostic: Diagnostic): CallableInfo? { val typeReference = element.calleeExpression.typeReference ?: return null val project = element.project diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateIteratorFunctionActionFactory.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateIteratorFunctionActionFactory.kt index e0c037ffd5e..73ad3939e7a 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateIteratorFunctionActionFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateIteratorFunctionActionFactory.kt @@ -41,7 +41,7 @@ object CreateIteratorFunctionActionFactory : CreateCallableMemberFromUsageFactor override fun createCallableInfo(element: KtForExpression, diagnostic: Diagnostic): CallableInfo? { val file = diagnostic.psiFile as? KtFile ?: return null val iterableExpr = element.loopRange ?: return null - val variableExpr: KtExpression = ((element.loopParameter ?: element.multiParameter) ?: return null) as KtExpression + val variableExpr: KtExpression = ((element.loopParameter ?: element.destructuringParameter) ?: return null) as KtExpression val iterableType = TypeInfo(iterableExpr, Variance.IN_VARIANCE) val (bindingContext, moduleDescriptor) = file.analyzeFullyAndGetResult() diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateNextFunctionActionFactory.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateNextFunctionActionFactory.kt index 2cfbd6882d1..28a6acc8e20 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateNextFunctionActionFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createCallable/CreateNextFunctionActionFactory.kt @@ -37,7 +37,7 @@ object CreateNextFunctionActionFactory : CreateCallableMemberFromUsageFactory() { override fun getElementOfInterest(diagnostic: Diagnostic): KtCallElement? { @@ -37,7 +35,7 @@ public object CreateClassFromCallWithConstructorCalleeActionFactory : CreateClas val callElement = PsiTreeUtil.getParentOfType( diagElement, javaClass(), - javaClass() + javaClass() ) as? KtCallElement ?: return null val callee = callElement.calleeExpression as? KtConstructorCalleeExpression ?: return null diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createClass/CreateClassFromTypeReferenceActionFactory.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createClass/CreateClassFromTypeReferenceActionFactory.kt index 11eb29daf8d..3f880e82a78 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createClass/CreateClassFromTypeReferenceActionFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createClass/CreateClassFromTypeReferenceActionFactory.kt @@ -23,7 +23,7 @@ import org.jetbrains.kotlin.idea.caches.resolve.analyzeAndGetResult import org.jetbrains.kotlin.idea.core.quickfix.QuickFixUtil import org.jetbrains.kotlin.idea.quickfix.createFromUsage.callableBuilder.TypeInfo import org.jetbrains.kotlin.psi.KtConstructorCalleeExpression -import org.jetbrains.kotlin.psi.KtDelegatorToSuperClass +import org.jetbrains.kotlin.psi.KtSuperTypeEntry import org.jetbrains.kotlin.psi.KtFile import org.jetbrains.kotlin.psi.KtUserType import org.jetbrains.kotlin.resolve.BindingContext @@ -39,7 +39,7 @@ public object CreateClassFromTypeReferenceActionFactory : CreateClassFromUsageFa val typeRefParent = element.parent?.parent if (typeRefParent is KtConstructorCalleeExpression) return Collections.emptyList() - val interfaceExpected = typeRefParent is KtDelegatorToSuperClass + val interfaceExpected = typeRefParent is KtSuperTypeEntry val isQualifier = (element.parent as? KtUserType)?.let { it.qualifier == element } ?: false diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createVariable/CreateParameterByRefActionFactory.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createVariable/CreateParameterByRefActionFactory.kt index 6eb4fde5bb3..cb4eddf0a5e 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createVariable/CreateParameterByRefActionFactory.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/createFromUsage/createVariable/CreateParameterByRefActionFactory.kt @@ -83,7 +83,7 @@ object CreateParameterByRefActionFactory : CreateParameterFromUsageFactory chooseContainingClass(it) it is KtAnonymousInitializer -> it.parent?.parent as? KtClass - it is KtDelegationSpecifier -> { + it is KtSuperTypeListEntry -> { val klass = it.getStrictParentOfType() if (klass is KtClass && !klass.isInterface() && klass !is KtEnumEntry) klass else null } diff --git a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/CallableUsageReplacementStrategy.kt b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/CallableUsageReplacementStrategy.kt index 50cca9a401f..36dce4f1362 100644 --- a/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/CallableUsageReplacementStrategy.kt +++ b/idea/src/org/jetbrains/kotlin/idea/quickfix/replaceWith/CallableUsageReplacementStrategy.kt @@ -342,7 +342,7 @@ private fun argumentForParameter( val valueArgument = resolvedArgument.valueArgument!! val expression = valueArgument.getArgumentExpression()!! expression.mark(USER_CODE_KEY) - if (valueArgument is FunctionLiteralArgument) { + if (valueArgument is LambdaArgument) { expression.mark(WAS_FUNCTION_LITERAL_ARGUMENT_KEY) } return Argument(expression, bindingContext.getType(expression), isNamed = valueArgument.isNamed()) @@ -464,7 +464,7 @@ private fun introduceNamedArguments(result: KtElement) { val argumentsToMakeNamed = callExpression.valueArguments.dropWhile { !it[MAKE_ARGUMENT_NAMED_KEY] } for (argument in argumentsToMakeNamed) { if (argument.isNamed()) continue - if (argument is KtFunctionLiteralArgument) continue + if (argument is KtLambdaArgument) continue val argumentMatch = resolvedCall.getArgumentMapping(argument) as ArgumentMatch val name = argumentMatch.valueParameter.name //TODO: not always correct for vararg's @@ -499,7 +499,7 @@ private fun dropArgumentsForDefaultValues(result: KtElement) { argumentList.removeArgument(argument) if (argumentList.arguments.isEmpty()) { val callExpression = argumentList.parent as KtCallExpression - if (callExpression.functionLiteralArguments.isNotEmpty()) { + if (callExpression.lambdaArguments.isNotEmpty()) { argumentList.delete() } } @@ -570,12 +570,12 @@ private fun restoreFunctionLiteralArguments(expression: KtElement) { assert(expr.unpackFunctionLiteral() != null) val argument = expr.parent as? KtValueArgument ?: return - if (argument is KtFunctionLiteralArgument) return + if (argument is KtLambdaArgument) return if (argument.isNamed()) return val argumentList = argument.parent as? KtValueArgumentList ?: return if (argument != argumentList.arguments.last()) return val callExpression = argumentList.parent as? KtCallExpression ?: return - if (callExpression.functionLiteralArguments.isNotEmpty()) return + if (callExpression.lambdaArguments.isNotEmpty()) return val resolvedCall = callExpression.getResolvedCall(callExpression.analyze(BodyResolveMode.PARTIAL)) ?: return if (!resolvedCall.isReallySuccess()) return diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/KotlinRefactoringSupportProvider.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/KotlinRefactoringSupportProvider.kt index ac079574b15..58a411d8f73 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/KotlinRefactoringSupportProvider.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/KotlinRefactoringSupportProvider.kt @@ -54,7 +54,7 @@ public class KotlinRefactoringSupportProvider : RefactoringSupportProvider() { is KtProperty -> { if (element.isLocal()) return true } - is KtMultiDeclarationEntry -> return true + is KtDestructuringDeclarationEntry -> return true is KtFunction -> { if (element.isLocal() && element.nameIdentifier != null) return true } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureHandler.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureHandler.kt index a49794bbb44..106704aad63 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureHandler.kt @@ -101,7 +101,7 @@ public class KotlinChangeSignatureHandler : ChangeSignatureHandler { val call: KtCallElement? = PsiTreeUtil.getParentOfType(element, javaClass(), - javaClass(), + javaClass(), javaClass()) val calleeExpr = call?.let { val callee = it.getCalleeExpression() diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureUsageProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureUsageProcessor.kt index da2bf30f61e..57b4aeef826 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureUsageProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/KotlinChangeSignatureUsageProcessor.kt @@ -249,8 +249,8 @@ class KotlinChangeSignatureUsageProcessor : ChangeSignatureUsageProcessor { parent is KtUserType && parent.parent is KtTypeReference -> { parent = parent.parent.parent - if (parent is KtConstructorCalleeExpression && parent.parent is KtDelegatorToSuperCall) - result.add(KotlinFunctionCallUsage(parent.parent as KtDelegatorToSuperCall, functionUsageInfo)) + if (parent is KtConstructorCalleeExpression && parent.parent is KtSuperTypeCallEntry) + result.add(KotlinFunctionCallUsage(parent.parent as KtSuperTypeCallEntry, functionUsageInfo)) } element is KtSimpleNameExpression && (functionPsi is KtProperty || functionPsi is KtParameter) -> @@ -293,7 +293,7 @@ class KotlinChangeSignatureUsageProcessor : ChangeSignatureUsageProcessor { if (functionPsi is KtClass && functionPsi.isEnum()) { for (declaration in functionPsi.declarations) { - if (declaration is KtEnumEntry && declaration.getDelegationSpecifiers().isEmpty()) { + if (declaration is KtEnumEntry && declaration.getSuperTypeListEntries().isEmpty()) { result.add(KotlinEnumEntryWithoutSuperCallUsage(declaration)) } } @@ -302,7 +302,7 @@ class KotlinChangeSignatureUsageProcessor : ChangeSignatureUsageProcessor { functionPsi.processDelegationCallConstructorUsages(functionPsi.useScope) { when (it) { is KtConstructorDelegationCall -> result.add(KotlinConstructorDelegationCallUsage(it, changeInfo)) - is KtDelegatorToSuperCall -> result.add(KotlinFunctionCallUsage(it, functionUsageInfo)) + is KtSuperTypeCallEntry -> result.add(KotlinFunctionCallUsage(it, functionUsageInfo)) } true } @@ -404,7 +404,7 @@ class KotlinChangeSignatureUsageProcessor : ChangeSignatureUsageProcessor { if (arguments.size != 1) continue val argExpression = arguments[0].getArgumentExpression() - if (argExpression !is KtFunctionLiteralExpression) continue + if (argExpression !is KtLambdaExpression) continue val context = callExpression.analyze(BodyResolveMode.FULL) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/changeSignatureUtils.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/changeSignatureUtils.kt index 38d5db97c94..4ee59f7a65c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/changeSignatureUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/changeSignatureUtils.kt @@ -34,8 +34,8 @@ import org.jetbrains.kotlin.types.substitutions.getCallableSubstitutor fun KtNamedDeclaration.getDeclarationBody(): KtElement? { return when { - this is KtClassOrObject -> getDelegationSpecifierList() - this is KtPrimaryConstructor -> getContainingClassOrObject().getDelegationSpecifierList() + this is KtClassOrObject -> getSuperTypeList() + this is KtPrimaryConstructor -> getContainingClassOrObject().getSuperTypeList() this is KtSecondaryConstructor -> getDelegationCall() this is KtNamedFunction -> getBodyExpression() else -> null diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinCallableDefinitionUsage.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinCallableDefinitionUsage.kt index 9482e1cbf50..7b49cdcf673 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinCallableDefinitionUsage.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinCallableDefinitionUsage.kt @@ -89,7 +89,7 @@ class KotlinCallableDefinitionUsage( val functionLiteral = DescriptorToSourceUtils.descriptorToDeclaration(callableDescriptor) as KtFunctionLiteral? assert(functionLiteral != null) { "No declaration found for " + callableDescriptor } - val parent = functionLiteral!!.parent as? KtFunctionLiteralExpression ?: return false + val parent = functionLiteral!!.parent as? KtLambdaExpression ?: return false return parent.analyze(BodyResolveMode.PARTIAL)[BindingContext.EXPECTED_EXPRESSION_TYPE, parent] != null } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinConstructorDelegationCallUsage.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinConstructorDelegationCallUsage.kt index 2fc8205d1e9..f904912239b 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinConstructorDelegationCallUsage.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinConstructorDelegationCallUsage.kt @@ -41,7 +41,7 @@ public class KotlinConstructorDelegationCallUsage( if (changeInfo.getNewParametersCount() == 0 && !isThisCall && !elementToWorkWith.isImplicit()) { (elementToWorkWith.getParent() as? KtSecondaryConstructor)?.getColon()?.delete() - elementToWorkWith.replace(KtPsiFactory(element).createConstructorDelegationCall("")) + elementToWorkWith.replace(KtPsiFactory(element).creareDelegatedSuperTypeEntry("")) } return result diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinEnumEntryWithoutSuperCallUsage.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinEnumEntryWithoutSuperCallUsage.kt index f91f6afa085..f3bf89f4df0 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinEnumEntryWithoutSuperCallUsage.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinEnumEntryWithoutSuperCallUsage.kt @@ -28,7 +28,7 @@ public class KotlinEnumEntryWithoutSuperCallUsage(enumEntry: KtEnumEntry) : Kotl val delegatorToSuperCall = (element.addAfter( psiFactory.createEnumEntryInitializerList(), element.nameIdentifier - ) as KtInitializerList).initializers[0] as KtDelegatorToSuperCall + ) as KtInitializerList).initializers[0] as KtSuperTypeCallEntry return KotlinFunctionCallUsage(delegatorToSuperCall, changeInfo.methodDescriptor.originalPrimaryCallable) .processUsage(changeInfo, delegatorToSuperCall, allUsages) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinFunctionCallUsage.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinFunctionCallUsage.kt index bcb4927c345..d109f0a1428 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinFunctionCallUsage.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/changeSignature/usages/KotlinFunctionCallUsage.kt @@ -74,7 +74,7 @@ class KotlinFunctionCallUsage( } } - if (changeInfo.getNewParametersCount() == 0 && element is KtDelegatorToSuperCall) { + if (changeInfo.getNewParametersCount() == 0 && element is KtSuperTypeCallEntry) { val enumEntry = element.getStrictParentOfType() if (enumEntry != null && enumEntry.initializerList == element.parent) { val initializerList = enumEntry.initializerList @@ -87,11 +87,11 @@ class KotlinFunctionCallUsage( private fun shouldSkipUsage(element: KtCallElement): Boolean { // TODO: We probable need more clever processing of invalid calls, but for now default to Java-like behaviour - if (resolvedCall == null && element !is KtDelegatorToSuperCall) return true + if (resolvedCall == null && element !is KtSuperTypeCallEntry) return true if (resolvedCall == null || resolvedCall.isReallySuccess()) return false // TODO: investigate why arguments are not recorded for enum constructor call - if (element is KtDelegatorToSuperCall && element.parent.parent is KtEnumEntry) return false + if (element is KtSuperTypeCallEntry && element.parent.parent is KtEnumEntry) return false if (!resolvedCall.call.valueArguments.all{ resolvedCall.getArgumentMapping(it) is ArgumentMatch }) return true @@ -202,7 +202,7 @@ class KotlinFunctionCallUsage( if (needSeparateVariable(argumentExpression) && PsiTreeUtil.getNonStrictParentOfType(element, KtConstructorDelegationCall::class.java, - KtDelegationSpecifier::class.java, + KtSuperTypeListEntry::class.java, KtParameter::class.java) == null) { KotlinIntroduceVariableHandler.doRefactoring(project, null, argumentExpression, listOf(argumentExpression)) { @@ -358,7 +358,7 @@ class KotlinFunctionCallUsage( val valueArgument = resolvedArgument.valueArgument val newValueArgument: KtValueArgument = when { valueArgument == null -> argInfo.getArgumentByDefaultValue(element, allUsages, psiFactory) - valueArgument is KtFunctionLiteralArgument -> psiFactory.createArgument(valueArgument.getArgumentExpression(), name) + valueArgument is KtLambdaArgument -> psiFactory.createArgument(valueArgument.getArgumentExpression(), name) valueArgument is KtValueArgument && valueArgument.getArgumentName()?.asName == name -> valueArgument else -> psiFactory.createArgument(valueArgument.getArgumentExpression(), name) } @@ -386,10 +386,10 @@ class KotlinFunctionCallUsage( val lastNewArgument = newArgumentList.arguments.lastOrNull() val oldLastResolvedArgument = getResolvedValueArgument(lastNewParameter?.oldIndex ?: -1) as? ExpressionValueArgument val lambdaArgumentNotTouched = - lastOldArgument is KtFunctionLiteralArgument && oldLastResolvedArgument?.valueArgument == lastOldArgument + lastOldArgument is KtLambdaArgument && oldLastResolvedArgument?.valueArgument == lastOldArgument val newLambdaArgumentAddedLast = lastNewParameter != null && lastNewParameter.isNewParameter - && lastNewParameter.defaultValueForCall is KtFunctionLiteralExpression + && lastNewParameter.defaultValueForCall is KtLambdaExpression && lastNewArgument != null && !lastNewArgument.isNamed() @@ -397,7 +397,7 @@ class KotlinFunctionCallUsage( newArgumentList.removeArgument(newArgumentList.arguments.last()) } else { - val lambdaArguments = element.functionLiteralArguments + val lambdaArguments = element.lambdaArguments if (lambdaArguments.isNotEmpty()) { element.deleteChildRange(lambdaArguments.first(), lambdaArguments.last()) } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/inline/KotlinInlineValHandler.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/inline/KotlinInlineValHandler.kt index 2bd3efbc9d9..9fd52b182b1 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/inline/KotlinInlineValHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/inline/KotlinInlineValHandler.kt @@ -228,11 +228,11 @@ class KotlinInlineValHandler : InlineActionHandler() { } private fun needToAddParameterTypes( - functionLiteralExpression: KtFunctionLiteralExpression, + lambdaExpression: KtLambdaExpression, resolutionFacade: ResolutionFacade ): Boolean { - val functionLiteral = functionLiteralExpression.functionLiteral - val context = resolutionFacade.analyze(functionLiteralExpression, BodyResolveMode.PARTIAL) + val functionLiteral = lambdaExpression.functionLiteral + val context = resolutionFacade.analyze(lambdaExpression, BodyResolveMode.PARTIAL) return context.diagnostics.any { diagnostic -> val factory = diagnostic.factory val element = diagnostic.psiElement diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractableCodeDescriptor.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractableCodeDescriptor.kt index da0ba920c34..add064a561b 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractableCodeDescriptor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/ExtractableCodeDescriptor.kt @@ -106,7 +106,7 @@ abstract class WrapInWithReplacement : Replacement { val call = (e as? KtSimpleNameExpression)?.getQualifiedElement() ?: return e val replacingExpression = KtPsiFactory(e).createExpressionByPattern("with($0) { $1 }", argumentText, call) val replace = call.replace(replacingExpression) - return (replace as KtCallExpression).functionLiteralArguments.first().getFunctionLiteral().bodyExpression!!.statements.first() + return (replace as KtCallExpression).lambdaArguments.first().getLambdaExpression().bodyExpression!!.statements.first() } } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractableAnalysisUtil.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractableAnalysisUtil.kt index b87a335b250..c272724a0c9 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractableAnalysisUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractableAnalysisUtil.kt @@ -731,7 +731,7 @@ internal fun KtNamedDeclaration.getGeneratedBody() = // We assume lazy property here with delegate expression 'by Delegates.lazy { body }' property.delegateExpression?.let { val call = it.getCalleeExpressionIfAny()?.parent as? KtCallExpression - call?.functionLiteralArguments?.singleOrNull()?.getFunctionLiteral()?.bodyExpression + call?.lambdaArguments?.singleOrNull()?.getLambdaExpression()?.bodyExpression } } } ?: throw AssertionError("Couldn't get block body for this declaration: ${getElementTextWithContext()}") diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractorUtil.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractorUtil.kt index df37f2e03c8..9aff40f6830 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractorUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/extractorUtil.kt @@ -240,8 +240,8 @@ private fun makeCall( arguments: List) { fun insertCall(anchor: PsiElement, wrappedCall: KtExpression): KtExpression? { val firstExpression = rangeToReplace.elements.firstOrNull { it is KtExpression } as? KtExpression - if (firstExpression?.isFunctionLiteralOutsideParentheses() ?: false) { - val functionLiteralArgument = firstExpression?.getStrictParentOfType()!! + if (firstExpression?.isLambdaOutsideParentheses() ?: false) { + val functionLiteralArgument = firstExpression?.getStrictParentOfType()!! return functionLiteralArgument.moveInsideParenthesesAndReplaceWith(wrappedCall, extractableDescriptor.originalContext) } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/inferParameterInfo.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/inferParameterInfo.kt index 010aa243daf..03e098dbd44 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/inferParameterInfo.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/extractionEngine/inferParameterInfo.kt @@ -194,7 +194,7 @@ private fun ExtractionData.extractReceiver( else { val extractThis = (hasThisReceiver && refInfo.smartCast == null) || thisExpr != null val extractOrdinaryParameter = - originalDeclaration is KtMultiDeclarationEntry || + originalDeclaration is KtDestructuringDeclarationEntry || originalDeclaration is KtProperty || originalDeclaration is KtParameter diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceParameter/KotlinIntroduceParameterHandler.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceParameter/KotlinIntroduceParameterHandler.kt index 45c0357a618..53daf987fa3 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceParameter/KotlinIntroduceParameterHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceParameter/KotlinIntroduceParameterHandler.kt @@ -265,7 +265,7 @@ public open class KotlinIntroduceParameterHandler( fun() { val isTestMode = ApplicationManager.getApplication().isUnitTestMode() val haveLambdaArgumentsToReplace = occurrencesToReplace.any { - it.elements.any { it is KtFunctionLiteralExpression && it.parent is KtFunctionLiteralArgument } + it.elements.any { it is KtLambdaExpression && it.parent is KtLambdaArgument } } val inplaceIsAvailable = editor.settings.isVariableInplaceRenameEnabled && !isTestMode @@ -291,9 +291,9 @@ public open class KotlinIntroduceParameterHandler( val replacingExpression = psiFactory.createExpression(newParameterName) val substringInfo = expressionToReplace.extractableSubstringInfo val result = when { - expressionToReplace.isFunctionLiteralOutsideParentheses() -> { + expressionToReplace.isLambdaOutsideParentheses() -> { expressionToReplace - .getStrictParentOfType()!! + .getStrictParentOfType()!! .moveInsideParenthesesAndReplaceWith(replacingExpression, context) } substringInfo != null -> substringInfo.replaceWith(replacingExpression) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.kt index 3edbc0a24d2..794873140b6 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.kt @@ -114,8 +114,8 @@ object KotlinIntroduceVariableHandler : KotlinIntroduceHandlerBase() { val replacement = psiFactory.createExpression(nameSuggestions.single().first()) val substringInfo = expressionToReplace.extractableSubstringInfo var result = when { - expressionToReplace.isFunctionLiteralOutsideParentheses() -> { - val functionLiteralArgument = expressionToReplace.getStrictParentOfType()!! + expressionToReplace.isLambdaOutsideParentheses() -> { + val functionLiteralArgument = expressionToReplace.getStrictParentOfType()!! val newCallExpression = functionLiteralArgument.moveInsideParenthesesAndReplaceWith(replacement, bindingContext) newCallExpression.valueArguments.last().getArgumentExpression()!! } @@ -144,7 +144,7 @@ object KotlinIntroduceVariableHandler : KotlinIntroduceHandlerBase() { componentFunctions.indices.joinTo(this, prefix = "val (", postfix = ")") { nameSuggestions[it].first() } append(" = ") append(initializer.text) - }.let { psiFactory.createMultiDeclaration(it) } + }.let { psiFactory.createDestructuringDeclaration(it) } } else { buildString { @@ -408,7 +408,7 @@ object KotlinIntroduceVariableHandler : KotlinIntroduceHandlerBase() { private fun executeMultiDeclarationTemplate( project: Project, editor: Editor, - declaration: KtMultiDeclaration, + declaration: KtDestructuringDeclaration, suggestedNames: List>) { StartMarkAction.canStart(project)?.let { return } @@ -590,7 +590,7 @@ object KotlinIntroduceVariableHandler : KotlinIntroduceHandlerBase() { ).startInplaceIntroduceTemplate() } - is KtMultiDeclaration -> { + is KtDestructuringDeclaration -> { executeMultiDeclarationTemplate(project, editor, property, suggestedNames) } @@ -660,7 +660,7 @@ object KotlinIntroduceVariableHandler : KotlinIntroduceHandlerBase() { var container = firstContainer do { var lambda: KtExpression = container.getNonStrictParentOfType()!! - if (lambda is KtFunctionLiteral) lambda = lambda.parent as? KtFunctionLiteralExpression ?: return@apply + if (lambda is KtFunctionLiteral) lambda = lambda.parent as? KtLambdaExpression ?: return@apply if (!isResolvableNextTo(lambda)) return@apply container = lambda.getContainer() ?: return@apply add(lambda to container) diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt index aad555663a5..0d911475685 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/jetRefactoringUtil.kt @@ -330,11 +330,11 @@ public fun KtElement.getContextForContainingDeclarationBody(): BindingContext? { val bodyElement = when (enclosingDeclaration) { is KtDeclarationWithBody -> enclosingDeclaration.getBodyExpression() is KtWithExpressionInitializer -> enclosingDeclaration.getInitializer() - is KtMultiDeclaration -> enclosingDeclaration.getInitializer() + is KtDestructuringDeclaration -> enclosingDeclaration.getInitializer() is KtParameter -> enclosingDeclaration.getDefaultValue() is KtAnonymousInitializer -> enclosingDeclaration.body is KtClass -> { - val delegationSpecifierList = enclosingDeclaration.getDelegationSpecifierList() + val delegationSpecifierList = enclosingDeclaration.getSuperTypeList() if (delegationSpecifierList.isAncestor(this)) this else null } else -> null diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/memberInfo/KotlinMemberInfoStorage.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/memberInfo/KotlinMemberInfoStorage.kt index 7b321a31b9d..cbb0365ff82 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/memberInfo/KotlinMemberInfoStorage.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/memberInfo/KotlinMemberInfoStorage.kt @@ -80,8 +80,8 @@ public class KotlinMemberInfoStorage( && myFilter.includeMember(it) } .mapTo(temp) { KotlinMemberInfo(it as KtNamedDeclaration) } if (aClass == myClass) { - aClass.getDelegationSpecifiers() - .filterIsInstance() + aClass.getSuperTypeListEntries() + .filterIsInstance() .map { val type = context[BindingContext.TYPE, it.typeReference] val classDescriptor = type?.constructor?.declarationDescriptor as? ClassDescriptor diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/move/MoveJavaInnerClassKotlinUsagesHandler.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/move/MoveJavaInnerClassKotlinUsagesHandler.kt index c418a788497..ee8f461647e 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/move/MoveJavaInnerClassKotlinUsagesHandler.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/move/MoveJavaInnerClassKotlinUsagesHandler.kt @@ -53,7 +53,7 @@ public class MoveJavaInnerClassKotlinUsagesHandler: MoveInnerClassUsagesHandler argumentList.replace(psiFactory.createCallArguments(newArguments.joinToString(prefix = "(", postfix = ")"))) } else { - innerCall.getFunctionLiteralArguments().firstOrNull()?.let { lambdaArg -> + innerCall.getLambdaArguments().firstOrNull()?.let { lambdaArg -> val anchor = PsiTreeUtil.skipSiblingsBackward(lambdaArg, javaClass()) innerCall.addAfter(psiFactory.createCallArguments("(${outerCall.getText()})"), anchor) } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/JavaToKotlinPreconversionPullUpHelper.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/JavaToKotlinPreconversionPullUpHelper.kt index 7e27adadbaa..cce472bd3d2 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/JavaToKotlinPreconversionPullUpHelper.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/JavaToKotlinPreconversionPullUpHelper.kt @@ -114,7 +114,7 @@ public class JavaToKotlinPreconversionPullUpHelper( if (getCurrentSuperInterfaceCount() == superInterfaceCount) return val typeText = RefactoringUtil.findReferenceToClass(dummyTargetClass.implementsList, member as PsiClass)?.j2kText() ?: return - targetClass.addDelegationSpecifier(psiFactory.createDelegatorToSuperClass(typeText)) + targetClass.addSuperTypeListEntry(psiFactory.createSuperTypeEntry(typeText)) return } diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpHelper.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpHelper.kt index ad2d7ede2d0..14f739903d9 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpHelper.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/KotlinPullUpHelper.kt @@ -198,7 +198,7 @@ class KotlinPullUpHelper( } } - override fun visitDelegationToSuperCallSpecifier(specifier: KtDelegatorToSuperCall) { + override fun visitSuperTypeCallEntry(specifier: KtSuperTypeCallEntry) { val constructorRef = specifier.calleeExpression.constructorReferenceExpression ?: return val containingClass = specifier.getStrictParentOfType() ?: return val callingConstructorElement = containingClass.getPrimaryConstructor() ?: containingClass @@ -326,11 +326,11 @@ class KotlinPullUpHelper( private fun moveSuperInterface(member: KtClass, substitutor: PsiSubstitutor) { val classDescriptor = data.memberDescriptors[member] as? ClassDescriptor ?: return - val currentSpecifier = data.sourceClass.getDelegatorToSuperClassByDescriptor(classDescriptor, data.sourceClassContext) ?: return + val currentSpecifier = data.sourceClass.getSuperTypeEntryByDescriptor(classDescriptor, data.sourceClassContext) ?: return when (data.targetClass) { is KtClass -> { - data.sourceClass.removeDelegationSpecifier(currentSpecifier) - addDelegatorToSuperClass(currentSpecifier, data.targetClass, data.targetClassDescriptor, data.sourceClassContext, data.sourceToTargetClassSubstitutor) + data.sourceClass.removeSuperTypeListEntry(currentSpecifier) + addSuperTypeEntry(currentSpecifier, data.targetClass, data.targetClassDescriptor, data.sourceClassContext, data.sourceToTargetClassSubstitutor) } is PsiClass -> { @@ -343,7 +343,7 @@ class KotlinPullUpHelper( ?: return val superTypeForTarget = substitutor.substitute(elementFactory.createType(superRef)) - data.sourceClass.removeDelegationSpecifier(currentSpecifier) + data.sourceClass.removeSuperTypeListEntry(currentSpecifier) if (DescriptorUtils.isSubclass(data.targetClassDescriptor, classDescriptor)) return @@ -523,8 +523,8 @@ class KotlinPullUpHelper( } as? KtBlockExpression } - fun KtClassOrObject.getDelegatorToSuperCall(): KtDelegatorToSuperCall? { - return getDelegationSpecifiers().singleOrNull { it is KtDelegatorToSuperCall } as? KtDelegatorToSuperCall + fun KtClassOrObject.getDelegatorToSuperCall(): KtSuperTypeCallEntry? { + return getSuperTypeListEntries().singleOrNull { it is KtSuperTypeCallEntry } as? KtSuperTypeCallEntry } fun addUsedParameters(constructorElement: KtElement, info: InitializerInfo) { diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/pullUpUtils.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/pullUpUtils.kt index 1583e0c167e..3cb6a8e93a4 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/pullUpUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/pullUp/pullUpUtils.kt @@ -88,12 +88,12 @@ fun KtClass.makeAbstract() { } } -fun KtClassOrObject.getDelegatorToSuperClassByDescriptor( +fun KtClassOrObject.getSuperTypeEntryByDescriptor( descriptor: ClassDescriptor, context: BindingContext -): KtDelegatorToSuperClass? { - return getDelegationSpecifiers() - .filterIsInstance() +): KtSuperTypeEntry? { + return getSuperTypeListEntries() + .filterIsInstance() .firstOrNull { val referencedType = context[BindingContext.TYPE, it.typeReference] referencedType?.constructor?.declarationDescriptor == descriptor @@ -141,8 +141,8 @@ fun makeAbstract(member: KtCallableDeclaration, } } -fun addDelegatorToSuperClass( - delegator: KtDelegatorToSuperClass, +fun addSuperTypeEntry( + delegator: KtSuperTypeEntry, targetClass: KtClassOrObject, targetClassDescriptor: ClassDescriptor, context: BindingContext, @@ -157,6 +157,6 @@ fun addDelegatorToSuperClass( if (!(typeInTargetClass != null && !typeInTargetClass.isError)) return val renderedType = IdeDescriptorRenderers.SOURCE_CODE.renderType(typeInTargetClass) - val newSpecifier = KtPsiFactory(targetClass).createDelegatorToSuperClass(renderedType) - targetClass.addDelegationSpecifier(newSpecifier).addToShorteningWaitSet() + val newSpecifier = KtPsiFactory(targetClass).createSuperTypeEntry(renderedType) + targetClass.addSuperTypeListEntry(newSpecifier).addToShorteningWaitSet() } \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/pushDown/KotlinPushDownProcessor.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/pushDown/KotlinPushDownProcessor.kt index 6069594d1c1..e7f989d15ad 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/pushDown/KotlinPushDownProcessor.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/pushDown/KotlinPushDownProcessor.kt @@ -164,11 +164,11 @@ public class KotlinPushDownProcessor( is KtClassOrObject -> { if (memberInfo.overrides != null) { - context.sourceClass.getDelegatorToSuperClassByDescriptor( + context.sourceClass.getSuperTypeEntryByDescriptor( memberDescriptor as ClassDescriptor, context.sourceClassContext )?.let { - addDelegatorToSuperClass(it, targetClass, targetClassDescriptor, context.sourceClassContext, substitutor) + addSuperTypeEntry(it, targetClass, targetClassDescriptor, context.sourceClassContext, substitutor) } continue@members } @@ -205,11 +205,11 @@ public class KotlinPushDownProcessor( } is KtClassOrObject -> { if (memberInfo.overrides != null) { - context.sourceClass.getDelegatorToSuperClassByDescriptor( + context.sourceClass.getSuperTypeEntryByDescriptor( memberDescriptor as ClassDescriptor, context.sourceClassContext )?.let { - context.sourceClass.removeDelegationSpecifier(it) + context.sourceClass.removeSuperTypeListEntry(it) } } else { diff --git a/idea/src/org/jetbrains/kotlin/idea/refactoring/safeDelete/KotlinJavaSafeDeleteDelegate.kt b/idea/src/org/jetbrains/kotlin/idea/refactoring/safeDelete/KotlinJavaSafeDeleteDelegate.kt index 23b651adfbb..7d89e6c29af 100644 --- a/idea/src/org/jetbrains/kotlin/idea/refactoring/safeDelete/KotlinJavaSafeDeleteDelegate.kt +++ b/idea/src/org/jetbrains/kotlin/idea/refactoring/safeDelete/KotlinJavaSafeDeleteDelegate.kt @@ -74,7 +74,7 @@ public class KotlinJavaSafeDeleteDelegate : JavaSafeDeleteDelegate { if (parameterIndex < argCount) { usages.add(SafeDeleteValueArgumentListUsageInfo((args.get(parameterIndex) as KtValueArgument), parameter)) } else { - val lambdaArgs = callExpression.getFunctionLiteralArguments() + val lambdaArgs = callExpression.getLambdaArguments() val lambdaIndex = parameterIndex - argCount if (lambdaIndex < lambdaArgs.size()) { usages.add(SafeDeleteReferenceSimpleDeleteUsageInfo(lambdaArgs.get(lambdaIndex), parameter, true)) diff --git a/idea/src/org/jetbrains/kotlin/idea/testIntegration/KotlinCreateTestIntention.kt b/idea/src/org/jetbrains/kotlin/idea/testIntegration/KotlinCreateTestIntention.kt index 7777dc17b0d..ce67a87d3f9 100644 --- a/idea/src/org/jetbrains/kotlin/idea/testIntegration/KotlinCreateTestIntention.kt +++ b/idea/src/org/jetbrains/kotlin/idea/testIntegration/KotlinCreateTestIntention.kt @@ -65,7 +65,7 @@ class KotlinCreateTestIntention : SelfTargetingRangeIntention { - val (orderInsensitive, orderSensitive) = cls.getDelegationSpecifiers().partition { it is KtDelegatorToSuperClass } + fun getDelegationOrderInfo(cls: KtClassOrObject): OrderInfo { + val (orderInsensitive, orderSensitive) = cls.getSuperTypeListEntries().partition { it is KtSuperTypeEntry } return OrderInfo(orderSensitive, orderInsensitive) } @@ -666,8 +665,8 @@ public class KotlinPsiUnifier( e1 !is KtElement, e2 !is KtElement -> null - e1 is KtMultiDeclaration && e2 is KtMultiDeclaration -> - if (matchMultiDeclarations(e1, e2)) null else UNMATCHED + e1 is KtDestructuringDeclaration && e2 is KtDestructuringDeclaration -> + if (matchDestructuringDeclarations(e1, e2)) null else UNMATCHED e1 is KtAnonymousInitializer && e2 is KtAnonymousInitializer -> null diff --git a/idea/testData/decompiler/builtIns/Int.stubs b/idea/testData/decompiler/builtIns/Int.stubs index a1460b61766..f2b2bce9e6b 100644 --- a/idea/testData/decompiler/builtIns/Int.stubs +++ b/idea/testData/decompiler/builtIns/Int.stubs @@ -7,14 +7,14 @@ PsiJetFileStubImpl[package=kotlin] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[private] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=Number] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -30,8 +30,8 @@ PsiJetFileStubImpl[package=kotlin] CLASS_BODY: OBJECT_DECLARATION:[fqName=kotlin.Int.Companion, isCompanion=true, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Companion, superNames=[IntegerConstants]] MODIFIER_LIST:[public companion] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/decompiler/stubBuilder/AnnotationClass/AnnotationClass.txt b/idea/testData/decompiler/stubBuilder/AnnotationClass/AnnotationClass.txt index cf8bc0020c3..2edc0a2b737 100644 --- a/idea/testData/decompiler/stubBuilder/AnnotationClass/AnnotationClass.txt +++ b/idea/testData/decompiler/stubBuilder/AnnotationClass/AnnotationClass.txt @@ -21,8 +21,8 @@ PsiJetFileStubImpl[package=test.a] USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=String] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt b/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt index a4233655fad..3bbefb5f534 100644 --- a/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt +++ b/idea/testData/decompiler/stubBuilder/ClassObject/ClassObject.txt @@ -117,8 +117,8 @@ PsiJetFileStubImpl[package=test.class_object] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -130,8 +130,8 @@ PsiJetFileStubImpl[package=test.class_object] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[private] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/decompiler/stubBuilder/Delegation/Delegation.txt b/idea/testData/decompiler/stubBuilder/Delegation/Delegation.txt index 5670e5c966f..5d14dca4e98 100644 --- a/idea/testData/decompiler/stubBuilder/Delegation/Delegation.txt +++ b/idea/testData/decompiler/stubBuilder/Delegation/Delegation.txt @@ -16,8 +16,8 @@ PsiJetFileStubImpl[package=] TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=A] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=T] diff --git a/idea/testData/decompiler/stubBuilder/DependencyOnNestedClasses/DependencyOnNestedClasses.txt b/idea/testData/decompiler/stubBuilder/DependencyOnNestedClasses/DependencyOnNestedClasses.txt index d8a7fd21464..f34edaa3a30 100644 --- a/idea/testData/decompiler/stubBuilder/DependencyOnNestedClasses/DependencyOnNestedClasses.txt +++ b/idea/testData/decompiler/stubBuilder/DependencyOnNestedClasses/DependencyOnNestedClasses.txt @@ -7,8 +7,8 @@ PsiJetFileStubImpl[package=test] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/decompiler/stubBuilder/Enum/Enum.txt b/idea/testData/decompiler/stubBuilder/Enum/Enum.txt index d6b31eaabb4..062e3b9a96c 100644 --- a/idea/testData/decompiler/stubBuilder/Enum/Enum.txt +++ b/idea/testData/decompiler/stubBuilder/Enum/Enum.txt @@ -15,8 +15,8 @@ PsiJetFileStubImpl[package=a.b.c.test.enum] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[private] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/decompiler/stubBuilder/InheritingClasses/InheritingClasses.txt b/idea/testData/decompiler/stubBuilder/InheritingClasses/InheritingClasses.txt index 6e3351334bc..23eb8c5bd77 100644 --- a/idea/testData/decompiler/stubBuilder/InheritingClasses/InheritingClasses.txt +++ b/idea/testData/decompiler/stubBuilder/InheritingClasses/InheritingClasses.txt @@ -19,8 +19,8 @@ PsiJetFileStubImpl[package=a] USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=Int] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -71,8 +71,8 @@ PsiJetFileStubImpl[package=a] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -125,8 +125,8 @@ PsiJetFileStubImpl[package=a] MODIFIER_LIST:[public] TYPE_PARAMETER_LIST: TYPE_PARAMETER:[fqName=null, isInVariance=false, isOutVariance=false, name=T] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -150,8 +150,8 @@ PsiJetFileStubImpl[package=a] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -159,7 +159,7 @@ PsiJetFileStubImpl[package=a] REFERENCE_EXPRESSION:[referencedName=a] REFERENCE_EXPRESSION:[referencedName=InheritingClasses] REFERENCE_EXPRESSION:[referencedName=B] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -167,7 +167,7 @@ PsiJetFileStubImpl[package=a] REFERENCE_EXPRESSION:[referencedName=a] REFERENCE_EXPRESSION:[referencedName=InheritingClasses] REFERENCE_EXPRESSION:[referencedName=C] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -182,7 +182,7 @@ PsiJetFileStubImpl[package=a] USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=Int] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -214,8 +214,8 @@ PsiJetFileStubImpl[package=a] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -231,8 +231,8 @@ PsiJetFileStubImpl[package=a] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -242,7 +242,7 @@ PsiJetFileStubImpl[package=a] REFERENCE_EXPRESSION:[referencedName=InheritingClasses] REFERENCE_EXPRESSION:[referencedName=InheritAny] REFERENCE_EXPRESSION:[referencedName=SomeTrait] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -264,14 +264,14 @@ PsiJetFileStubImpl[package=a] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=Any] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -287,8 +287,8 @@ PsiJetFileStubImpl[package=a] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -298,13 +298,13 @@ PsiJetFileStubImpl[package=a] REFERENCE_EXPRESSION:[referencedName=InheritingClasses] REFERENCE_EXPRESSION:[referencedName=InheritAny] REFERENCE_EXPRESSION:[referencedName=SomeTrait2] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=kotlin] REFERENCE_EXPRESSION:[referencedName=Any] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -320,8 +320,8 @@ PsiJetFileStubImpl[package=a] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: FUNCTION_TYPE: VALUE_PARAMETER_LIST: diff --git a/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt b/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt index 9df272a14db..873b9bbc56c 100644 --- a/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt +++ b/idea/testData/decompiler/stubBuilder/Modifiers/Modifiers.txt @@ -112,8 +112,8 @@ PsiJetFileStubImpl[package=test] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt b/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt index 384fb97707b..a144988d260 100644 --- a/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt +++ b/idea/testData/decompiler/stubBuilder/NamedCompanionObject/NamedCompanionObject.txt @@ -115,8 +115,8 @@ PsiJetFileStubImpl[package=test] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -128,8 +128,8 @@ PsiJetFileStubImpl[package=test] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[private] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/decompiler/stubBuilder/Objects/Objects.txt b/idea/testData/decompiler/stubBuilder/Objects/Objects.txt index 004bcf5ac81..b12af893c25 100644 --- a/idea/testData/decompiler/stubBuilder/Objects/Objects.txt +++ b/idea/testData/decompiler/stubBuilder/Objects/Objects.txt @@ -21,8 +21,8 @@ PsiJetFileStubImpl[package=] REFERENCE_EXPRESSION:[referencedName=Unit] OBJECT_DECLARATION:[fqName=Objects.InnerObject, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=InnerObject, superNames=[A]] MODIFIER_LIST:[private] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=A] @@ -50,8 +50,8 @@ PsiJetFileStubImpl[package=] CLASS_BODY: OBJECT_DECLARATION:[fqName=Objects.OtherObject, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=OtherObject, superNames=[NestedClass]] MODIFIER_LIST:[public] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/decompiler/stubBuilder/Sealed/Sealed.txt b/idea/testData/decompiler/stubBuilder/Sealed/Sealed.txt index 2afcff17bed..5454b652a54 100644 --- a/idea/testData/decompiler/stubBuilder/Sealed/Sealed.txt +++ b/idea/testData/decompiler/stubBuilder/Sealed/Sealed.txt @@ -13,8 +13,8 @@ PsiJetFileStubImpl[package=test] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] @@ -23,8 +23,8 @@ PsiJetFileStubImpl[package=test] CLASS_BODY: OBJECT_DECLARATION:[fqName=test.Sealed.Top, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=false, name=Top, superNames=[Sealed]] MODIFIER_LIST:[public] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/decompiler/stubBuilder/TypeBoundsAndDelegationSpecifiers/TypeBoundsAndDelegationSpecifiers.txt b/idea/testData/decompiler/stubBuilder/TypeBoundsAndDelegationSpecifiers/TypeBoundsAndDelegationSpecifiers.txt index 985353bad73..2b8e82ffd53 100644 --- a/idea/testData/decompiler/stubBuilder/TypeBoundsAndDelegationSpecifiers/TypeBoundsAndDelegationSpecifiers.txt +++ b/idea/testData/decompiler/stubBuilder/TypeBoundsAndDelegationSpecifiers/TypeBoundsAndDelegationSpecifiers.txt @@ -21,14 +21,14 @@ PsiJetFileStubImpl[package=test] PRIMARY_CONSTRUCTOR: MODIFIER_LIST:[public] VALUE_PARAMETER_LIST: - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_LIST: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=test] REFERENCE_EXPRESSION:[referencedName=A] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] USER_TYPE:[isAbsoluteInRootPackage=false] diff --git a/idea/testData/stubs/AnonymousObject.expected b/idea/testData/stubs/AnonymousObject.expected index 502024cdc45..7eb5568ad57 100644 --- a/idea/testData/stubs/AnonymousObject.expected +++ b/idea/testData/stubs/AnonymousObject.expected @@ -5,13 +5,13 @@ PsiJetFileStubImpl[package=] CLASS:[fqName=T, isEnumEntry=false, isInterface=true, isLocal=false, isTopLevel=true, name=T, superNames=[]] PROPERTY:[fqName=obj, hasDelegate=false, hasDelegateExpression=false, hasInitializer=true, hasReturnTypeRef=false, isExtension=false, isTopLevel=true, isVar=false, name=obj] OBJECT_DECLARATION:[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=true, isTopLevel=false, name=null, superNames=[A, T]] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CALL: + SUPER_TYPE_LIST: + SUPER_TYPE_CALL_ENTRY: CONSTRUCTOR_CALLEE: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=A] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=T] diff --git a/idea/testData/stubs/LocalClass.expected b/idea/testData/stubs/LocalClass.expected index 71393d39bc9..064b5d42b07 100644 --- a/idea/testData/stubs/LocalClass.expected +++ b/idea/testData/stubs/LocalClass.expected @@ -6,13 +6,13 @@ PsiJetFileStubImpl[package=] FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] VALUE_PARAMETER_LIST: CLASS:[fqName=null, isEnumEntry=false, isInterface=false, isLocal=true, isTopLevel=false, name=Test, superNames=[A, T]] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CALL: + SUPER_TYPE_LIST: + SUPER_TYPE_CALL_ENTRY: CONSTRUCTOR_CALLEE: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=A] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=T] diff --git a/idea/testData/stubs/LocalClassInLocalFunction.expected b/idea/testData/stubs/LocalClassInLocalFunction.expected index 71393d39bc9..064b5d42b07 100644 --- a/idea/testData/stubs/LocalClassInLocalFunction.expected +++ b/idea/testData/stubs/LocalClassInLocalFunction.expected @@ -6,13 +6,13 @@ PsiJetFileStubImpl[package=] FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] VALUE_PARAMETER_LIST: CLASS:[fqName=null, isEnumEntry=false, isInterface=false, isLocal=true, isTopLevel=false, name=Test, superNames=[A, T]] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CALL: + SUPER_TYPE_LIST: + SUPER_TYPE_CALL_ENTRY: CONSTRUCTOR_CALLEE: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=A] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=T] diff --git a/idea/testData/stubs/LocalNamedObject.expected b/idea/testData/stubs/LocalNamedObject.expected index cb70662e95b..cc5e34c4e3b 100644 --- a/idea/testData/stubs/LocalNamedObject.expected +++ b/idea/testData/stubs/LocalNamedObject.expected @@ -6,13 +6,13 @@ PsiJetFileStubImpl[package=] FUN:[fqName=foo, hasBlockBody=true, hasBody=true, hasTypeParameterListBeforeFunctionName=false, isExtension=false, isTopLevel=true, name=foo] VALUE_PARAMETER_LIST: OBJECT_DECLARATION:[fqName=null, isCompanion=false, isLocal=true, isObjectLiteral=false, isTopLevel=false, name=O, superNames=[A, T]] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CALL: + SUPER_TYPE_LIST: + SUPER_TYPE_CALL_ENTRY: CONSTRUCTOR_CALLEE: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=A] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=T] diff --git a/idea/testData/stubs/NamedObject.expected b/idea/testData/stubs/NamedObject.expected index c0cdd9b763c..c27721bc813 100644 --- a/idea/testData/stubs/NamedObject.expected +++ b/idea/testData/stubs/NamedObject.expected @@ -4,13 +4,13 @@ PsiJetFileStubImpl[package=] CLASS:[fqName=A, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=A, superNames=[]] CLASS:[fqName=T, isEnumEntry=false, isInterface=true, isLocal=false, isTopLevel=true, name=T, superNames=[]] OBJECT_DECLARATION:[fqName=Test, isCompanion=false, isLocal=false, isObjectLiteral=false, isTopLevel=true, name=Test, superNames=[A, T]] - DELEGATION_SPECIFIER_LIST: - DELEGATOR_SUPER_CALL: + SUPER_TYPE_LIST: + SUPER_TYPE_CALL_ENTRY: CONSTRUCTOR_CALLEE: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=A] - DELEGATOR_SUPER_CLASS: + SUPER_TYPE_ENTRY: TYPE_REFERENCE: USER_TYPE:[isAbsoluteInRootPackage=false] REFERENCE_EXPRESSION:[referencedName=T] diff --git a/idea/tests/org/jetbrains/kotlin/search/KotlinReferencesSearchTest.kt b/idea/tests/org/jetbrains/kotlin/search/KotlinReferencesSearchTest.kt index 75f13a405ce..5ba5e64aaec 100644 --- a/idea/tests/org/jetbrains/kotlin/search/KotlinReferencesSearchTest.kt +++ b/idea/tests/org/jetbrains/kotlin/search/KotlinReferencesSearchTest.kt @@ -20,7 +20,7 @@ import com.intellij.psi.PsiElement import com.intellij.psi.PsiReference import com.intellij.psi.search.searches.ReferencesSearch import com.intellij.testFramework.fixtures.JavaCodeInsightTestFixture -import org.jetbrains.kotlin.idea.references.KtMultiDeclarationReference +import org.jetbrains.kotlin.idea.references.KtDestructuringDeclarationReference import org.jetbrains.kotlin.idea.test.PluginTestCaseBase import org.jetbrains.kotlin.psi.KtFunction import org.jetbrains.kotlin.psi.KtParameter @@ -46,7 +46,7 @@ public class KotlinReferencesSearchTest(): AbstractSearcherTest() { Assert.assertEquals(3, refs.size()) Assert.assertEquals("n", refs[0].getCanonicalText()) Assert.assertEquals("component1", refs[1].getCanonicalText()) - Assert.assertTrue(refs[2] is KtMultiDeclarationReference) + Assert.assertTrue(refs[2] is KtDestructuringDeclarationReference) } // workaround for KT-9788 AssertionError from backand when we read field from inline function diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/DelegationTranslator.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/DelegationTranslator.kt index 593019f02e5..4935db826f8 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/DelegationTranslator.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/declaration/DelegationTranslator.kt @@ -33,8 +33,8 @@ import org.jetbrains.kotlin.js.translate.utils.TranslationUtils.simpleReturnFunc import org.jetbrains.kotlin.js.translate.utils.TranslationUtils.translateFunctionAsEcma5PropertyDescriptor import org.jetbrains.kotlin.js.translate.utils.generateDelegateCall import org.jetbrains.kotlin.psi.KtClassOrObject -import org.jetbrains.kotlin.psi.KtDelegationSpecifier -import org.jetbrains.kotlin.psi.KtDelegatorByExpressionSpecifier +import org.jetbrains.kotlin.psi.KtSuperTypeListEntry +import org.jetbrains.kotlin.psi.KtDelegatedSuperTypeEntry import org.jetbrains.kotlin.resolve.DescriptorUtils import java.util.* @@ -47,10 +47,10 @@ public class DelegationTranslator( BindingUtils.getClassDescriptor(context.bindingContext(), classDeclaration); private val delegationBySpecifiers = - classDeclaration.getDelegationSpecifiers().filterIsInstance(); + classDeclaration.getSuperTypeListEntries().filterIsInstance(); private class Field (val name: String, val generateField: Boolean) - private val fields = HashMap() + private val fields = HashMap() init { for (specifier in delegationBySpecifiers) { @@ -88,8 +88,8 @@ public class DelegationTranslator( } } - private fun getSuperClass(specifier: KtDelegationSpecifier): ClassDescriptor = - CodegenUtil.getSuperClassByDelegationSpecifier(specifier, bindingContext()) + private fun getSuperClass(specifier: KtSuperTypeListEntry): ClassDescriptor = + CodegenUtil.getSuperClassBySuperTypeListEntry(specifier, bindingContext()) private fun generateDelegates(toClass: ClassDescriptor, field: Field, properties: MutableList) { for ((descriptor, overriddenDescriptor) in CodegenUtilKt.getDelegates(classDescriptor, toClass)) { diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/MultiDeclarationTranslator.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/DestructuringDeclarationTranslator.java similarity index 84% rename from js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/MultiDeclarationTranslator.java rename to js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/DestructuringDeclarationTranslator.java index 3813f41ee8b..90367133e32 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/MultiDeclarationTranslator.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/DestructuringDeclarationTranslator.java @@ -28,8 +28,8 @@ import org.jetbrains.kotlin.js.translate.callTranslator.CallTranslator; import org.jetbrains.kotlin.js.translate.context.TranslationContext; import org.jetbrains.kotlin.js.translate.general.AbstractTranslator; import org.jetbrains.kotlin.js.translate.reference.CallExpressionTranslator; -import org.jetbrains.kotlin.psi.KtMultiDeclaration; -import org.jetbrains.kotlin.psi.KtMultiDeclarationEntry; +import org.jetbrains.kotlin.psi.KtDestructuringDeclaration; +import org.jetbrains.kotlin.psi.KtDestructuringDeclarationEntry; import org.jetbrains.kotlin.resolve.BindingContext; import org.jetbrains.kotlin.resolve.BindingContextUtils; import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall; @@ -39,28 +39,28 @@ import java.util.List; import static org.jetbrains.kotlin.js.translate.utils.InlineUtils.setInlineCallMetadata; -public class MultiDeclarationTranslator extends AbstractTranslator { +public class DestructuringDeclarationTranslator extends AbstractTranslator { // if multiObjectName was init, initializer must be null @NotNull public static JsVars translate( - @NotNull KtMultiDeclaration multiDeclaration, + @NotNull KtDestructuringDeclaration multiDeclaration, @NotNull JsName multiObjectName, @Nullable JsExpression initializer, @NotNull TranslationContext context ) { - return new MultiDeclarationTranslator(multiDeclaration, multiObjectName, initializer, context).translate(); + return new DestructuringDeclarationTranslator(multiDeclaration, multiObjectName, initializer, context).translate(); } @NotNull - private final KtMultiDeclaration multiDeclaration; + private final KtDestructuringDeclaration multiDeclaration; @NotNull private final JsName multiObjectName; @Nullable private final JsExpression initializer; - private MultiDeclarationTranslator( - @NotNull KtMultiDeclaration multiDeclaration, + private DestructuringDeclarationTranslator( + @NotNull KtDestructuringDeclaration multiDeclaration, @NotNull JsName multiObjectName, @Nullable JsExpression initializer, @NotNull TranslationContext context @@ -78,7 +78,7 @@ public class MultiDeclarationTranslator extends AbstractTranslator { } JsNameRef multiObjNameRef = multiObjectName.makeRef(); - for (KtMultiDeclarationEntry entry : multiDeclaration.getEntries()) { + for (KtDestructuringDeclarationEntry entry : multiDeclaration.getEntries()) { ResolvedCall entryInitCall = context().bindingContext().get(BindingContext.COMPONENT_RESOLVED_CALL, entry); assert entryInitCall != null : "Entry init call must be not null"; JsExpression entryInitializer = CallTranslator.translate(context(), entryInitCall, multiObjNameRef); diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/ExpressionVisitor.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/ExpressionVisitor.java index 0e4de84eaca..6b29738eaca 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/ExpressionVisitor.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/ExpressionVisitor.java @@ -123,11 +123,11 @@ public final class ExpressionVisitor extends TranslatorVisitor { } @Override - public JsNode visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, @NotNull TranslationContext context) { + public JsNode visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, @NotNull TranslationContext context) { KtExpression jetInitializer = multiDeclaration.getInitializer(); assert jetInitializer != null : "Initializer for multi declaration must be not null"; JsExpression initializer = Translation.translateAsExpression(jetInitializer, context); - return MultiDeclarationTranslator.translate(multiDeclaration, context.scope().declareTemporary(), initializer, context); + return DestructuringDeclarationTranslator.translate(multiDeclaration, context.scope().declareTemporary(), initializer, context); } @Override @@ -409,7 +409,7 @@ public final class ExpressionVisitor extends TranslatorVisitor { @Override @NotNull - public JsNode visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression, @NotNull TranslationContext context) { + public JsNode visitLambdaExpression(@NotNull KtLambdaExpression expression, @NotNull TranslationContext context) { return new LiteralFunctionTranslator(context).translate(expression.getFunctionLiteral()); } diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/FunctionTranslator.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/FunctionTranslator.java index 08b9b998919..c4786e351e1 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/FunctionTranslator.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/FunctionTranslator.java @@ -28,7 +28,7 @@ import org.jetbrains.kotlin.js.translate.context.TranslationContext; import org.jetbrains.kotlin.js.translate.general.AbstractTranslator; import org.jetbrains.kotlin.js.translate.utils.TranslationUtils; import org.jetbrains.kotlin.psi.KtDeclarationWithBody; -import org.jetbrains.kotlin.psi.KtFunctionLiteralExpression; +import org.jetbrains.kotlin.psi.KtLambdaExpression; import org.jetbrains.kotlin.resolve.DescriptorUtils; import org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt; @@ -160,6 +160,6 @@ public final class FunctionTranslator extends AbstractTranslator { } private boolean isExtensionFunction() { - return DescriptorUtils.isExtension(descriptor) && !(functionDeclaration instanceof KtFunctionLiteralExpression); + return DescriptorUtils.isExtension(descriptor) && !(functionDeclaration instanceof KtLambdaExpression); } } diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/LoopTranslator.kt b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/LoopTranslator.kt index 0dad7e92508..65aac2aa7d7 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/LoopTranslator.kt +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/expression/LoopTranslator.kt @@ -23,7 +23,7 @@ import org.jetbrains.kotlin.descriptors.FunctionDescriptor import org.jetbrains.kotlin.js.translate.callTranslator.CallTranslator import org.jetbrains.kotlin.js.translate.context.TemporaryVariable import org.jetbrains.kotlin.js.translate.context.TranslationContext -import org.jetbrains.kotlin.js.translate.expression.MultiDeclarationTranslator +import org.jetbrains.kotlin.js.translate.expression.DestructuringDeclarationTranslator import org.jetbrains.kotlin.js.translate.general.Translation import org.jetbrains.kotlin.js.translate.intrinsic.functions.factories.CompositeFIF import org.jetbrains.kotlin.js.translate.utils.BindingUtils.getHasNextCallable @@ -38,7 +38,7 @@ import org.jetbrains.kotlin.js.translate.utils.TranslationUtils import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.psi.KtBinaryExpression import org.jetbrains.kotlin.psi.KtForExpression -import org.jetbrains.kotlin.psi.KtMultiDeclaration +import org.jetbrains.kotlin.psi.KtDestructuringDeclaration import org.jetbrains.kotlin.psi.KtWhileExpressionBase import org.jetbrains.kotlin.resolve.DescriptorUtils.getClassDescriptorForType import org.jetbrains.kotlin.resolve.calls.model.ResolvedCall @@ -115,14 +115,14 @@ public fun translateForExpression(expression: KtForExpression, context: Translat getClassDescriptorForType(rangeType).getName().asString() == "IntArray" } - val multiParameter: KtMultiDeclaration? = expression.getMultiParameter(); + val destructuringParameter: KtDestructuringDeclaration? = expression.getDestructuringParameter(); fun declareParameter(): JsName { val loopParameter = getLoopParameter(expression) if (loopParameter != null) { return context.getNameForElement(loopParameter) } - assert(multiParameter != null) { "If loopParameter is null, multi parameter must be not null ${expression.getText()}" } + assert(destructuringParameter != null) { "If loopParameter is null, multi parameter must be not null ${expression.getText()}" } return context.scope().declareTemporary() } @@ -130,15 +130,15 @@ public fun translateForExpression(expression: KtForExpression, context: Translat fun translateBody(itemValue: JsExpression?): JsStatement? { val realBody = expression.getBody()?.let { Translation.translateAsStatementAndMergeInBlockIfNeeded(it, context) } - if (itemValue == null && multiParameter == null) { + if (itemValue == null && destructuringParameter == null) { return realBody } else { val currentVarInit = - if (multiParameter == null) + if (destructuringParameter == null) newVar(parameterName, itemValue) else - MultiDeclarationTranslator.translate(multiParameter, parameterName, itemValue, context) + DestructuringDeclarationTranslator.translate(destructuringParameter, parameterName, itemValue, context) if (realBody == null) return JsBlock(currentVarInit) diff --git a/js/js.translator/src/org/jetbrains/kotlin/js/translate/initializer/ClassInitializerTranslator.java b/js/js.translator/src/org/jetbrains/kotlin/js/translate/initializer/ClassInitializerTranslator.java index 22d48430304..df9c13ef6a2 100644 --- a/js/js.translator/src/org/jetbrains/kotlin/js/translate/initializer/ClassInitializerTranslator.java +++ b/js/js.translator/src/org/jetbrains/kotlin/js/translate/initializer/ClassInitializerTranslator.java @@ -158,9 +158,9 @@ public final class ClassInitializerTranslator extends AbstractTranslator { @Nullable private ResolvedCall getSuperCall() { - for (KtDelegationSpecifier specifier : classDeclaration.getDelegationSpecifiers()) { - if (specifier instanceof KtDelegatorToSuperCall) { - KtDelegatorToSuperCall superCall = (KtDelegatorToSuperCall) specifier; + for (KtSuperTypeListEntry specifier : classDeclaration.getSuperTypeListEntries()) { + if (specifier instanceof KtSuperTypeCallEntry) { + KtSuperTypeCallEntry superCall = (KtSuperTypeCallEntry) specifier; //noinspection unchecked return (ResolvedCall) CallUtilKt.getResolvedCallWithAssert(superCall, bindingContext()); }