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
This commit is contained in:
Dmitry Jemerov
2015-12-09 19:30:38 +01:00
parent ef4b3c99f4
commit 009e3f9cd7
302 changed files with 1375 additions and 1391 deletions
@@ -140,7 +140,7 @@ public class CodegenUtil {
} }
@NotNull @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()); KotlinType superType = bindingContext.get(BindingContext.TYPE, specifier.getTypeReference());
assert superType != null : "superType should not be null: " + specifier.getText(); assert superType != null : "superType should not be null: " + specifier.getText();
@@ -668,7 +668,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}); });
} }
else { else {
KtMultiDeclaration multiParameter = forExpression.getMultiParameter(); KtDestructuringDeclaration multiParameter = forExpression.getDestructuringParameter();
assert multiParameter != null; assert multiParameter != null;
// E tmp<e> = tmp<iterator>.next() // E tmp<e> = tmp<iterator>.next()
@@ -686,15 +686,15 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
assignToLoopParameter(); assignToLoopParameter();
if (forExpression.getLoopParameter() == null) { if (forExpression.getLoopParameter() == null) {
KtMultiDeclaration multiParameter = forExpression.getMultiParameter(); KtDestructuringDeclaration multiParameter = forExpression.getDestructuringParameter();
assert multiParameter != null; assert multiParameter != null;
generateMultiVariables(multiParameter.getEntries()); generateMultiVariables(multiParameter.getEntries());
} }
} }
private void generateMultiVariables(List<KtMultiDeclarationEntry> entries) { private void generateMultiVariables(List<KtDestructuringDeclarationEntry> entries) {
for (KtMultiDeclarationEntry variableDeclaration : entries) { for (KtDestructuringDeclarationEntry variableDeclaration : entries) {
final VariableDescriptor componentDescriptor = bindingContext.get(VARIABLE, variableDeclaration); final VariableDescriptor componentDescriptor = bindingContext.get(VARIABLE, variableDeclaration);
@SuppressWarnings("ConstantConditions") final Type componentAsmType = asmType(componentDescriptor.getReturnType()); @SuppressWarnings("ConstantConditions") final Type componentAsmType = asmType(componentDescriptor.getReturnType());
@@ -1331,7 +1331,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
} }
@Override @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))) { if (Boolean.TRUE.equals(bindingContext.get(BLOCK, expression))) {
return gen(expression.getFunctionLiteral().getBodyExpression()); return gen(expression.getFunctionLiteral().getBodyExpression());
} }
@@ -1568,9 +1568,9 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
private void putDescriptorIntoFrameMap(@NotNull KtElement statement) { private void putDescriptorIntoFrameMap(@NotNull KtElement statement) {
if (statement instanceof KtMultiDeclaration) { if (statement instanceof KtDestructuringDeclaration) {
KtMultiDeclaration multiDeclaration = (KtMultiDeclaration) statement; KtDestructuringDeclaration multiDeclaration = (KtDestructuringDeclaration) statement;
for (KtMultiDeclarationEntry entry : multiDeclaration.getEntries()) { for (KtDestructuringDeclarationEntry entry : multiDeclaration.getEntries()) {
putLocalVariableIntoFrameMap(entry); putLocalVariableIntoFrameMap(entry);
} }
} }
@@ -1608,9 +1608,9 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
@NotNull Label blockEnd, @NotNull Label blockEnd,
@NotNull List<Function<StackValue, Void>> leaveTasks @NotNull List<Function<StackValue, Void>> leaveTasks
) { ) {
if (statement instanceof KtMultiDeclaration) { if (statement instanceof KtDestructuringDeclaration) {
KtMultiDeclaration multiDeclaration = (KtMultiDeclaration) statement; KtDestructuringDeclaration multiDeclaration = (KtDestructuringDeclaration) statement;
for (KtMultiDeclarationEntry entry : multiDeclaration.getEntries()) { for (KtDestructuringDeclarationEntry entry : multiDeclaration.getEntries()) {
addLeaveTaskToRemoveLocalVariableFromFrameMap(entry, blockEnd, leaveTasks); addLeaveTaskToRemoveLocalVariableFromFrameMap(entry, blockEnd, leaveTasks);
} }
} }
@@ -2250,8 +2250,8 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
final SamType samType = bindingContext.get(SAM_VALUE, probablyParenthesizedExpression); final SamType samType = bindingContext.get(SAM_VALUE, probablyParenthesizedExpression);
if (samType == null || expression == null) return null; if (samType == null || expression == null) return null;
if (expression instanceof KtFunctionLiteralExpression) { if (expression instanceof KtLambdaExpression) {
return genClosure(((KtFunctionLiteralExpression) expression).getFunctionLiteral(), samType); return genClosure(((KtLambdaExpression) expression).getFunctionLiteral(), samType);
} }
if (expression instanceof KtNamedFunction) { if (expression instanceof KtNamedFunction) {
@@ -3274,7 +3274,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
} }
@Override @Override
public StackValue visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, StackValue receiver) { public StackValue visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, StackValue receiver) {
KtExpression initializer = multiDeclaration.getInitializer(); KtExpression initializer = multiDeclaration.getInitializer();
if (initializer == null) return StackValue.none(); if (initializer == null) return StackValue.none();
@@ -3291,7 +3291,7 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
v.store(tempVarIndex, initializerAsmType); v.store(tempVarIndex, initializerAsmType);
StackValue.Local local = StackValue.local(tempVarIndex, initializerAsmType); StackValue.Local local = StackValue.local(tempVarIndex, initializerAsmType);
for (KtMultiDeclarationEntry variableDeclaration : multiDeclaration.getEntries()) { for (KtDestructuringDeclarationEntry variableDeclaration : multiDeclaration.getEntries()) {
ResolvedCall<FunctionDescriptor> resolvedCall = bindingContext.get(COMPONENT_RESOLVED_CALL, variableDeclaration); ResolvedCall<FunctionDescriptor> resolvedCall = bindingContext.get(COMPONENT_RESOLVED_CALL, variableDeclaration);
assert resolvedCall != null : "Resolved call is null for " + variableDeclaration.getText(); assert resolvedCall != null : "Resolved call is null for " + variableDeclaration.getText();
Call call = makeFakeCall(initializerAsReceiver); Call call = makeFakeCall(initializerAsReceiver);
@@ -371,7 +371,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
generateCompanionObjectBackingFieldCopies(); generateCompanionObjectBackingFieldCopies();
DelegationFieldsInfo delegationFieldsInfo = getDelegationFieldsInfo(myClass.getDelegationSpecifiers()); DelegationFieldsInfo delegationFieldsInfo = getDelegationFieldsInfo(myClass.getSuperTypeListEntries());
try { try {
lookupConstructorExpressionsInClosureIfPresent(); lookupConstructorExpressionsInClosureIfPresent();
generatePrimaryConstructor(delegationFieldsInfo); generatePrimaryConstructor(delegationFieldsInfo);
@@ -1012,9 +1012,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
} }
} }
for (KtDelegationSpecifier specifier : myClass.getDelegationSpecifiers()) { for (KtSuperTypeListEntry specifier : myClass.getSuperTypeListEntries()) {
if (specifier instanceof KtDelegatorByExpressionSpecifier) { if (specifier instanceof KtDelegatedSuperTypeEntry) {
genCallToDelegatorByExpressionSpecifier(iv, codegen, (KtDelegatorByExpressionSpecifier) specifier, fieldsInfo); genCallToDelegatorByExpressionSpecifier(iv, codegen, (KtDelegatedSuperTypeEntry) specifier, fieldsInfo);
} }
} }
@@ -1153,41 +1153,41 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
return StackValue.field(type, classAsmType, name, false, StackValue.none()); return StackValue.field(type, classAsmType, name, false, StackValue.none());
} }
} }
private final Map<KtDelegatorByExpressionSpecifier, Field> fields = new HashMap<KtDelegatorByExpressionSpecifier, Field>(); private final Map<KtDelegatedSuperTypeEntry, Field> fields = new HashMap<KtDelegatedSuperTypeEntry, Field>();
@NotNull @NotNull
public Field getInfo(KtDelegatorByExpressionSpecifier specifier) { public Field getInfo(KtDelegatedSuperTypeEntry specifier) {
return fields.get(specifier); return fields.get(specifier);
} }
private void addField(KtDelegatorByExpressionSpecifier specifier, PropertyDescriptor propertyDescriptor) { private void addField(KtDelegatedSuperTypeEntry specifier, PropertyDescriptor propertyDescriptor) {
fields.put(specifier, fields.put(specifier,
new Field(typeMapper.mapType(propertyDescriptor), propertyDescriptor.getName().asString(), false)); 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)); fields.put(specifier, new Field(type, name, true));
} }
} }
@NotNull @NotNull
private DelegationFieldsInfo getDelegationFieldsInfo(@NotNull List<KtDelegationSpecifier> delegationSpecifiers) { private DelegationFieldsInfo getDelegationFieldsInfo(@NotNull List<KtSuperTypeListEntry> delegationSpecifiers) {
DelegationFieldsInfo result = new DelegationFieldsInfo(); DelegationFieldsInfo result = new DelegationFieldsInfo();
int n = 0; int n = 0;
for (KtDelegationSpecifier specifier : delegationSpecifiers) { for (KtSuperTypeListEntry specifier : delegationSpecifiers) {
if (specifier instanceof KtDelegatorByExpressionSpecifier) { if (specifier instanceof KtDelegatedSuperTypeEntry) {
KtExpression expression = ((KtDelegatorByExpressionSpecifier) specifier).getDelegateExpression(); KtExpression expression = ((KtDelegatedSuperTypeEntry) specifier).getDelegateExpression();
PropertyDescriptor propertyDescriptor = CodegenUtil.getDelegatePropertyIfAny(expression, descriptor, bindingContext); PropertyDescriptor propertyDescriptor = CodegenUtil.getDelegatePropertyIfAny(expression, descriptor, bindingContext);
if (CodegenUtil.isFinalPropertyWithBackingField(propertyDescriptor, bindingContext)) { if (CodegenUtil.isFinalPropertyWithBackingField(propertyDescriptor, bindingContext)) {
result.addField((KtDelegatorByExpressionSpecifier) specifier, propertyDescriptor); result.addField((KtDelegatedSuperTypeEntry) specifier, propertyDescriptor);
} }
else { else {
KotlinType expressionType = expression != null ? bindingContext.getType(expression) : null; KotlinType expressionType = expression != null ? bindingContext.getType(expression) : null;
Type asmType = Type asmType =
expressionType != null ? typeMapper.mapType(expressionType) : typeMapper.mapType(getSuperClass(specifier)); expressionType != null ? typeMapper.mapType(expressionType) : typeMapper.mapType(getSuperClass(specifier));
result.addField((KtDelegatorByExpressionSpecifier) specifier, asmType, "$delegate_" + n); result.addField((KtDelegatedSuperTypeEntry) specifier, asmType, "$delegate_" + n);
} }
n++; n++;
} }
@@ -1196,14 +1196,14 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
} }
@NotNull @NotNull
private ClassDescriptor getSuperClass(@NotNull KtDelegationSpecifier specifier) { private ClassDescriptor getSuperClass(@NotNull KtSuperTypeListEntry specifier) {
return CodegenUtil.getSuperClassByDelegationSpecifier(specifier, bindingContext); return CodegenUtil.getSuperClassBySuperTypeListEntry(specifier, bindingContext);
} }
private void genCallToDelegatorByExpressionSpecifier( private void genCallToDelegatorByExpressionSpecifier(
InstructionAdapter iv, InstructionAdapter iv,
ExpressionCodegen codegen, ExpressionCodegen codegen,
KtDelegatorByExpressionSpecifier specifier, KtDelegatedSuperTypeEntry specifier,
DelegationFieldsInfo fieldsInfo DelegationFieldsInfo fieldsInfo
) { ) {
KtExpression expression = specifier.getDelegateExpression(); KtExpression expression = specifier.getDelegateExpression();
@@ -1303,9 +1303,9 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
} }
} }
for (KtDelegationSpecifier specifier : myClass.getDelegationSpecifiers()) { for (KtSuperTypeListEntry specifier : myClass.getSuperTypeListEntries()) {
if (specifier instanceof KtDelegatorByExpressionSpecifier) { if (specifier instanceof KtDelegatedSuperTypeEntry) {
KtExpression delegateExpression = ((KtDelegatorByExpressionSpecifier) specifier).getDelegateExpression(); KtExpression delegateExpression = ((KtDelegatedSuperTypeEntry) specifier).getDelegateExpression();
assert delegateExpression != null; assert delegateExpression != null;
delegateExpression.accept(visitor); delegateExpression.accept(visitor);
} }
@@ -1620,7 +1620,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
iv.aconst(enumEntry.getName()); iv.aconst(enumEntry.getName());
iv.iconst(ordinal); iv.iconst(ordinal);
List<KtDelegationSpecifier> delegationSpecifiers = enumEntry.getDelegationSpecifiers(); List<KtSuperTypeListEntry> delegationSpecifiers = enumEntry.getSuperTypeListEntries();
if (delegationSpecifiers.size() == 1 && !enumEntryNeedSubclass(bindingContext, enumEntry)) { if (delegationSpecifiers.size() == 1 && !enumEntryNeedSubclass(bindingContext, enumEntry)) {
ResolvedCall<?> resolvedCall = CallUtilKt.getResolvedCallWithAssert(delegationSpecifiers.get(0), bindingContext); ResolvedCall<?> resolvedCall = CallUtilKt.getResolvedCallWithAssert(delegationSpecifiers.get(0), bindingContext);
@@ -1638,11 +1638,11 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
} }
private void generateDelegates(DelegationFieldsInfo delegationFieldsInfo) { private void generateDelegates(DelegationFieldsInfo delegationFieldsInfo) {
for (KtDelegationSpecifier specifier : myClass.getDelegationSpecifiers()) { for (KtSuperTypeListEntry specifier : myClass.getSuperTypeListEntries()) {
if (specifier instanceof KtDelegatorByExpressionSpecifier) { if (specifier instanceof KtDelegatedSuperTypeEntry) {
DelegationFieldsInfo.Field field = delegationFieldsInfo.getInfo((KtDelegatorByExpressionSpecifier) specifier); DelegationFieldsInfo.Field field = delegationFieldsInfo.getInfo((KtDelegatedSuperTypeEntry) specifier);
generateDelegateField(field); generateDelegateField(field);
KtExpression delegateExpression = ((KtDelegatorByExpressionSpecifier) specifier).getDelegateExpression(); KtExpression delegateExpression = ((KtDelegatedSuperTypeEntry) specifier).getDelegateExpression();
KotlinType delegateExpressionType = delegateExpression != null ? bindingContext.getType(delegateExpression) : null; KotlinType delegateExpressionType = delegateExpression != null ? bindingContext.getType(delegateExpression) : null;
generateDelegates(getSuperClass(specifier), delegateExpressionType, field); generateDelegates(getSuperClass(specifier), delegateExpressionType, field);
} }
@@ -129,7 +129,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
if (element instanceof KtObjectDeclaration && if (element instanceof KtObjectDeclaration &&
element.getParent() instanceof KtObjectLiteralExpression && 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. // 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 // To reach outer context, we should call getContainingDeclaration() twice
// TODO: this is probably not entirely correct, mostly because DECLARATION_TO_DESCRIPTOR can return null // TODO: this is probably not entirely correct, mostly because DECLARATION_TO_DESCRIPTOR can return null
@@ -178,7 +178,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
@Override @Override
public void visitEnumEntry(@NotNull KtEnumEntry enumEntry) { public void visitEnumEntry(@NotNull KtEnumEntry enumEntry) {
if (enumEntry.getDeclarations().isEmpty()) { if (enumEntry.getDeclarations().isEmpty()) {
for (KtDelegationSpecifier specifier : enumEntry.getDelegationSpecifiers()) { for (KtSuperTypeListEntry specifier : enumEntry.getSuperTypeListEntries()) {
specifier.accept(this); specifier.accept(this);
} }
return; return;
@@ -248,7 +248,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
String name = inventAnonymousClassName(); String name = inventAnonymousClassName();
recordClosure(classDescriptor, name); recordClosure(classDescriptor, name);
KtDelegationSpecifierList delegationSpecifierList = object.getDelegationSpecifierList(); KtSuperTypeList delegationSpecifierList = object.getSuperTypeList();
if (delegationSpecifierList != null) { if (delegationSpecifierList != null) {
delegationSpecifierList.accept(this); delegationSpecifierList.accept(this);
} }
@@ -264,8 +264,8 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
} }
@Override @Override
public void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression) { public void visitLambdaExpression(@NotNull KtLambdaExpression lambdaExpression) {
KtFunctionLiteral functionLiteral = expression.getFunctionLiteral(); KtFunctionLiteral functionLiteral = lambdaExpression.getFunctionLiteral();
FunctionDescriptor functionDescriptor = FunctionDescriptor functionDescriptor =
(FunctionDescriptor) bindingContext.get(DECLARATION_TO_DESCRIPTOR, functionLiteral); (FunctionDescriptor) bindingContext.get(DECLARATION_TO_DESCRIPTOR, functionLiteral);
// working around a problem with shallow analysis // working around a problem with shallow analysis
@@ -278,7 +278,7 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
classStack.push(classDescriptor); classStack.push(classDescriptor);
nameStack.push(name); nameStack.push(name);
super.visitFunctionLiteralExpression(expression); super.visitLambdaExpression(lambdaExpression);
nameStack.pop(); nameStack.pop();
classStack.pop(); classStack.pop();
} }
@@ -432,8 +432,8 @@ class CodegenAnnotatingVisitor extends KtVisitorVoid {
} }
@Override @Override
public void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call) { public void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call) {
super.visitDelegationToSuperCallSpecifier(call); super.visitSuperTypeCallEntry(call);
checkSamCall(call); checkSamCall(call);
} }
@@ -546,7 +546,7 @@ public class InlineCodegen extends CallGenerator {
} }
protected static boolean isInlinableParameterExpression(KtExpression deparenthesized) { protected static boolean isInlinableParameterExpression(KtExpression deparenthesized) {
return deparenthesized instanceof KtFunctionLiteralExpression || return deparenthesized instanceof KtLambdaExpression ||
deparenthesized instanceof KtNamedFunction || deparenthesized instanceof KtNamedFunction ||
deparenthesized instanceof KtCallableReferenceExpression; deparenthesized instanceof KtCallableReferenceExpression;
} }
@@ -25,7 +25,7 @@ import org.jetbrains.kotlin.codegen.state.JetTypeMapper;
import org.jetbrains.kotlin.descriptors.ClassDescriptor; import org.jetbrains.kotlin.descriptors.ClassDescriptor;
import org.jetbrains.kotlin.descriptors.FunctionDescriptor; import org.jetbrains.kotlin.descriptors.FunctionDescriptor;
import org.jetbrains.kotlin.psi.KtExpression; 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.BindingContext;
import org.jetbrains.kotlin.resolve.jvm.AsmTypes; import org.jetbrains.kotlin.resolve.jvm.AsmTypes;
import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature; import org.jetbrains.kotlin.resolve.jvm.jvmSignature.JvmMethodSignature;
@@ -61,8 +61,8 @@ public class LambdaInfo implements CapturedParamOwner, LabelOwner {
private final Type closureClassType; private final Type closureClassType;
LambdaInfo(@NotNull KtExpression expr, @NotNull JetTypeMapper typeMapper) { LambdaInfo(@NotNull KtExpression expr, @NotNull JetTypeMapper typeMapper) {
this.expression = expr instanceof KtFunctionLiteralExpression ? this.expression = expr instanceof KtLambdaExpression ?
((KtFunctionLiteralExpression) expr).getFunctionLiteral() : expr; ((KtLambdaExpression) expr).getFunctionLiteral() : expr;
this.typeMapper = typeMapper; this.typeMapper = typeMapper;
BindingContext bindingContext = typeMapper.getBindingContext(); BindingContext bindingContext = typeMapper.getBindingContext();
@@ -49,7 +49,7 @@ import org.jetbrains.kotlin.platform.JavaToKotlinClassMap;
import org.jetbrains.kotlin.psi.KtExpression; import org.jetbrains.kotlin.psi.KtExpression;
import org.jetbrains.kotlin.psi.KtFile; import org.jetbrains.kotlin.psi.KtFile;
import org.jetbrains.kotlin.psi.KtFunctionLiteral; 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.*;
import org.jetbrains.kotlin.resolve.annotations.AnnotationUtilKt; import org.jetbrains.kotlin.resolve.annotations.AnnotationUtilKt;
import org.jetbrains.kotlin.resolve.calls.model.DefaultValueArgument; import org.jetbrains.kotlin.resolve.calls.model.DefaultValueArgument;
@@ -898,7 +898,7 @@ public class JetTypeMapper {
PsiElement element = DescriptorToSourceUtils.getSourceFromDescriptor(descriptor); PsiElement element = DescriptorToSourceUtils.getSourceFromDescriptor(descriptor);
if (element instanceof KtFunctionLiteral) { if (element instanceof KtFunctionLiteral) {
PsiElement expression = element.getParent(); PsiElement expression = element.getParent();
if (expression instanceof KtFunctionLiteralExpression) { if (expression instanceof KtLambdaExpression) {
SamType samType = bindingContext.get(SAM_VALUE, (KtExpression) expression); SamType samType = bindingContext.get(SAM_VALUE, (KtExpression) expression);
if (samType != null) { if (samType != null) {
return samType.getAbstractMethod().getName().asString(); return samType.getAbstractMethod().getName().asString();
@@ -33,7 +33,7 @@ object JvmSimpleNameBacktickChecker : IdentifierChecker {
} }
override fun checkDeclaration(declaration: KtDeclaration, diagnosticHolder: DiagnosticSink) { override fun checkDeclaration(declaration: KtDeclaration, diagnosticHolder: DiagnosticSink) {
if (declaration is KtMultiDeclaration) { if (declaration is KtDestructuringDeclaration) {
declaration.entries.forEach { checkNamed(it, diagnosticHolder) } declaration.entries.forEach { checkNamed(it, diagnosticHolder) }
} }
if (declaration is KtCallableDeclaration) { if (declaration is KtCallableDeclaration) {
@@ -28,8 +28,8 @@ public interface KtNodeTypes {
IElementType CLASS = KtStubElementTypes.CLASS; IElementType CLASS = KtStubElementTypes.CLASS;
IElementType FUN = KtStubElementTypes.FUNCTION; IElementType FUN = KtStubElementTypes.FUNCTION;
IElementType PROPERTY = KtStubElementTypes.PROPERTY; IElementType PROPERTY = KtStubElementTypes.PROPERTY;
IElementType MULTI_VARIABLE_DECLARATION = new KtNodeType("MULTI_VARIABLE_DECLARATION", KtMultiDeclaration.class); IElementType DESTRUCTURING_DECLARATION = new KtNodeType("DESTRUCTURING_DECLARATION", KtDestructuringDeclaration.class);
IElementType MULTI_VARIABLE_DECLARATION_ENTRY = new KtNodeType("MULTI_VARIABLE_DECLARATION_ENTRY", KtMultiDeclarationEntry.class); IElementType DESTRUCTURING_DECLARATION_ENTRY = new KtNodeType("DESTRUCTURING_DECLARATION_ENTRY", KtDestructuringDeclarationEntry.class);
KtNodeType TYPEDEF = new KtNodeType("TYPEDEF", KtTypedef.class); KtNodeType TYPEDEF = new KtNodeType("TYPEDEF", KtTypedef.class);
IElementType OBJECT_DECLARATION = KtStubElementTypes.OBJECT_DECLARATION; IElementType OBJECT_DECLARATION = KtStubElementTypes.OBJECT_DECLARATION;
@@ -42,10 +42,10 @@ public interface KtNodeTypes {
IElementType TYPE_PARAMETER_LIST = KtStubElementTypes.TYPE_PARAMETER_LIST; IElementType TYPE_PARAMETER_LIST = KtStubElementTypes.TYPE_PARAMETER_LIST;
IElementType TYPE_PARAMETER = KtStubElementTypes.TYPE_PARAMETER; IElementType TYPE_PARAMETER = KtStubElementTypes.TYPE_PARAMETER;
IElementType DELEGATION_SPECIFIER_LIST = KtStubElementTypes.DELEGATION_SPECIFIER_LIST; IElementType SUPER_TYPE_LIST = KtStubElementTypes.SUPER_TYPE_LIST;
IElementType DELEGATOR_BY = KtStubElementTypes.DELEGATOR_BY; IElementType DELEGATED_SUPER_TYPE_ENTRY = KtStubElementTypes.DELEGATED_SUPER_TYPE_ENTRY;
IElementType DELEGATOR_SUPER_CALL = KtStubElementTypes.DELEGATOR_SUPER_CALL; IElementType SUPER_TYPE_CALL_ENTRY = KtStubElementTypes.SUPER_TYPE_CALL_ENTRY;
IElementType DELEGATOR_SUPER_CLASS = KtStubElementTypes.DELEGATOR_SUPER_CLASS; IElementType SUPER_TYPE_ENTRY = KtStubElementTypes.SUPER_TYPE_ENTRY;
KtNodeType PROPERTY_DELEGATE = new KtNodeType("PROPERTY_DELEGATE", KtPropertyDelegate.class); KtNodeType PROPERTY_DELEGATE = new KtNodeType("PROPERTY_DELEGATE", KtPropertyDelegate.class);
IElementType CONSTRUCTOR_CALLEE = KtStubElementTypes.CONSTRUCTOR_CALLEE; IElementType CONSTRUCTOR_CALLEE = KtStubElementTypes.CONSTRUCTOR_CALLEE;
IElementType VALUE_PARAMETER_LIST = KtStubElementTypes.VALUE_PARAMETER_LIST; IElementType VALUE_PARAMETER_LIST = KtStubElementTypes.VALUE_PARAMETER_LIST;
@@ -63,7 +63,7 @@ public interface KtNodeTypes {
IElementType TYPE_ARGUMENT_LIST = KtStubElementTypes.TYPE_ARGUMENT_LIST; IElementType TYPE_ARGUMENT_LIST = KtStubElementTypes.TYPE_ARGUMENT_LIST;
KtNodeType VALUE_ARGUMENT_LIST = new KtNodeType("VALUE_ARGUMENT_LIST", KtValueArgumentList.class); KtNodeType VALUE_ARGUMENT_LIST = new KtNodeType("VALUE_ARGUMENT_LIST", KtValueArgumentList.class);
KtNodeType VALUE_ARGUMENT = new KtNodeType("VALUE_ARGUMENT", KtValueArgument.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); KtNodeType VALUE_ARGUMENT_NAME = new KtNodeType("VALUE_ARGUMENT_NAME", KtValueArgumentName.class);
IElementType TYPE_REFERENCE = KtStubElementTypes.TYPE_REFERENCE; IElementType TYPE_REFERENCE = KtStubElementTypes.TYPE_REFERENCE;
@@ -116,7 +116,7 @@ public interface KtNodeTypes {
KtNodeType LOOP_RANGE = new KtNodeType("LOOP_RANGE", KtContainerNode.class); KtNodeType LOOP_RANGE = new KtNodeType("LOOP_RANGE", KtContainerNode.class);
KtNodeType BODY = new KtNodeType("BODY", KtContainerNode.class); KtNodeType BODY = new KtNodeType("BODY", KtContainerNode.class);
KtNodeType BLOCK = new KtNodeType("BLOCK", KtBlockExpression.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 FUNCTION_LITERAL = new KtNodeType("FUNCTION_LITERAL", KtFunctionLiteral.class);
KtNodeType ANNOTATED_EXPRESSION = new KtNodeType("ANNOTATED_EXPRESSION", KtAnnotatedExpression.class); KtNodeType ANNOTATED_EXPRESSION = new KtNodeType("ANNOTATED_EXPRESSION", KtAnnotatedExpression.class);
@@ -880,18 +880,18 @@ public class KotlinControlFlowProcessor {
private void declareLoopParameter(KtForExpression expression) { private void declareLoopParameter(KtForExpression expression) {
KtParameter loopParameter = expression.getLoopParameter(); KtParameter loopParameter = expression.getLoopParameter();
KtMultiDeclaration multiDeclaration = expression.getMultiParameter(); KtDestructuringDeclaration multiDeclaration = expression.getDestructuringParameter();
if (loopParameter != null) { if (loopParameter != null) {
builder.declareParameter(loopParameter); builder.declareParameter(loopParameter);
} }
else if (multiDeclaration != null) { else if (multiDeclaration != null) {
visitMultiDeclaration(multiDeclaration, false); visitDestructuringDeclaration(multiDeclaration, false);
} }
} }
private void writeLoopParameterAssignment(KtForExpression expression) { private void writeLoopParameterAssignment(KtForExpression expression) {
KtParameter loopParameter = expression.getLoopParameter(); KtParameter loopParameter = expression.getLoopParameter();
KtMultiDeclaration multiDeclaration = expression.getMultiParameter(); KtDestructuringDeclaration multiDeclaration = expression.getDestructuringParameter();
KtExpression loopRange = expression.getLoopRange(); KtExpression loopRange = expression.getLoopRange();
PseudoValue value = builder.magic( PseudoValue value = builder.magic(
@@ -905,7 +905,7 @@ public class KotlinControlFlowProcessor {
generateInitializer(loopParameter, value); generateInitializer(loopParameter, value);
} }
else if (multiDeclaration != null) { else if (multiDeclaration != null) {
for (KtMultiDeclarationEntry entry : multiDeclaration.getEntries()) { for (KtDestructuringDeclarationEntry entry : multiDeclaration.getEntries()) {
generateInitializer(entry, value); generateInitializer(entry, value);
} }
} }
@@ -1079,11 +1079,11 @@ public class KotlinControlFlowProcessor {
} }
@Override @Override
public void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression) { public void visitLambdaExpression(@NotNull KtLambdaExpression lambdaExpression) {
mark(expression); mark(lambdaExpression);
KtFunctionLiteral functionLiteral = expression.getFunctionLiteral(); KtFunctionLiteral functionLiteral = lambdaExpression.getFunctionLiteral();
visitFunction(functionLiteral); visitFunction(functionLiteral);
copyValue(functionLiteral, expression); copyValue(functionLiteral, lambdaExpression);
} }
@Override @Override
@@ -1161,14 +1161,14 @@ public class KotlinControlFlowProcessor {
} }
@Override @Override
public void visitMultiDeclaration(@NotNull KtMultiDeclaration declaration) { public void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration declaration) {
visitMultiDeclaration(declaration, true); visitDestructuringDeclaration(declaration, true);
} }
private void visitMultiDeclaration(@NotNull KtMultiDeclaration declaration, boolean generateWriteForEntries) { private void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration declaration, boolean generateWriteForEntries) {
KtExpression initializer = declaration.getInitializer(); KtExpression initializer = declaration.getInitializer();
generateInstructions(initializer); generateInstructions(initializer);
for (KtMultiDeclarationEntry entry : declaration.getEntries()) { for (KtDestructuringDeclarationEntry entry : declaration.getEntries()) {
builder.declareVariable(entry); builder.declareVariable(entry);
ResolvedCall<FunctionDescriptor> resolvedCall = trace.get(BindingContext.COMPONENT_RESOLVED_CALL, entry); ResolvedCall<FunctionDescriptor> resolvedCall = trace.get(BindingContext.COMPONENT_RESOLVED_CALL, entry);
@@ -1348,7 +1348,7 @@ public class KotlinControlFlowProcessor {
} }
private void generateHeaderDelegationSpecifiers(@NotNull KtClassOrObject classOrObject) { private void generateHeaderDelegationSpecifiers(@NotNull KtClassOrObject classOrObject) {
for (KtDelegationSpecifier specifier : classOrObject.getDelegationSpecifiers()) { for (KtSuperTypeListEntry specifier : classOrObject.getSuperTypeListEntries()) {
generateInstructions(specifier); generateInstructions(specifier);
} }
} }
@@ -1414,7 +1414,7 @@ public class KotlinControlFlowProcessor {
} }
@Override @Override
public void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call) { public void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call) {
generateCallOrMarkUnresolved(call); generateCallOrMarkUnresolved(call);
} }
@@ -1439,19 +1439,19 @@ public class KotlinControlFlowProcessor {
} }
@Override @Override
public void visitDelegationByExpressionSpecifier(@NotNull KtDelegatorByExpressionSpecifier specifier) { public void visitDelegatedSuperTypeEntry(@NotNull KtDelegatedSuperTypeEntry specifier) {
KtExpression delegateExpression = specifier.getDelegateExpression(); KtExpression delegateExpression = specifier.getDelegateExpression();
generateInstructions(delegateExpression); generateInstructions(delegateExpression);
createSyntheticValue(specifier, MagicKind.VALUE_CONSUMER, delegateExpression); createSyntheticValue(specifier, MagicKind.VALUE_CONSUMER, delegateExpression);
} }
@Override @Override
public void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier) { public void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier) {
// Do not generate UNSUPPORTED_ELEMENT here // Do not generate UNSUPPORTED_ELEMENT here
} }
@Override @Override
public void visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list) { public void visitSuperTypeList(@NotNull KtSuperTypeList list) {
list.acceptChildren(this); list.acceptChildren(this);
} }
@@ -633,7 +633,7 @@ public class KotlinFlowInformationProvider {
report(Errors.VARIABLE_WITH_REDUNDANT_INITIALIZER.on(initializer, variableDescriptor), ctxt); 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); report(VARIABLE_WITH_REDUNDANT_INITIALIZER.on(element, variableDescriptor), ctxt);
} }
} }
@@ -661,8 +661,8 @@ public class KotlinFlowInformationProvider {
&& PseudocodeUtilsKt.getSideEffectFree(instruction)) { && PseudocodeUtilsKt.getSideEffectFree(instruction)) {
VariableContext ctxt = new VariableContext(instruction, reportedDiagnosticMap); VariableContext ctxt = new VariableContext(instruction, reportedDiagnosticMap);
report( report(
element instanceof KtFunctionLiteralExpression element instanceof KtLambdaExpression
? Errors.UNUSED_LAMBDA_EXPRESSION.on((KtFunctionLiteralExpression) element) ? Errors.UNUSED_LAMBDA_EXPRESSION.on((KtLambdaExpression) element)
: Errors.UNUSED_EXPRESSION.on(element), : Errors.UNUSED_EXPRESSION.on(element),
ctxt ctxt
); );
@@ -426,7 +426,7 @@ public class KotlinControlFlowInstructionsGenerator extends KotlinControlFlowBui
@NotNull @NotNull
@Override @Override
public InstructionWithValue createLambda(@NotNull KtFunction expression) { 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 @NotNull
@@ -219,7 +219,7 @@ public fun getExpectedTypePredicate(
} }
} }
element is KtDelegatorByExpressionSpecifier -> element is KtDelegatedSuperTypeEntry ->
addSubtypesOf(bindingContext[TYPE, element.getTypeReference()]) addSubtypesOf(bindingContext[TYPE, element.getTypeReference()])
} }
} }
@@ -260,7 +260,7 @@ fun Instruction.calcSideEffectFree(): Boolean {
} }
else -> when (element) { else -> when (element) {
is KtConstantExpression, is KtFunctionLiteralExpression, is KtStringTemplateExpression -> true is KtConstantExpression, is KtLambdaExpression, is KtStringTemplateExpression -> true
else -> false else -> false
} }
} }
@@ -106,11 +106,11 @@ public class DebugInfoUtil {
} }
@Override @Override
public void visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration) { public void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration destructuringDeclaration) {
for (KtMultiDeclarationEntry entry : multiDeclaration.getEntries()) { for (KtDestructuringDeclarationEntry entry : destructuringDeclaration.getEntries()) {
reportIfDynamicCall(entry, entry, COMPONENT_RESOLVED_CALL); reportIfDynamicCall(entry, entry, COMPONENT_RESOLVED_CALL);
} }
super.visitMultiDeclaration(multiDeclaration); super.visitDestructuringDeclaration(destructuringDeclaration);
} }
@Override @Override
@@ -78,8 +78,8 @@ public interface Errors {
DiagnosticFactory2<KtParameter, EffectiveVisibility, EffectiveVisibility> EXPOSED_PARAMETER_TYPE = DiagnosticFactory2.create(ERROR); DiagnosticFactory2<KtParameter, EffectiveVisibility, EffectiveVisibility> EXPOSED_PARAMETER_TYPE = DiagnosticFactory2.create(ERROR);
DiagnosticFactory2<KtTypeReference, EffectiveVisibility, EffectiveVisibility> EXPOSED_RECEIVER_TYPE = DiagnosticFactory2.create(ERROR); DiagnosticFactory2<KtTypeReference, EffectiveVisibility, EffectiveVisibility> EXPOSED_RECEIVER_TYPE = DiagnosticFactory2.create(ERROR);
DiagnosticFactory2<KtTypeParameter, EffectiveVisibility, EffectiveVisibility> EXPOSED_TYPE_PARAMETER_BOUND = DiagnosticFactory2.create(ERROR); DiagnosticFactory2<KtTypeParameter, EffectiveVisibility, EffectiveVisibility> EXPOSED_TYPE_PARAMETER_BOUND = DiagnosticFactory2.create(ERROR);
DiagnosticFactory2<KtDelegationSpecifier, EffectiveVisibility, EffectiveVisibility> EXPOSED_SUPER_CLASS = DiagnosticFactory2.create(ERROR); DiagnosticFactory2<KtSuperTypeListEntry, EffectiveVisibility, EffectiveVisibility> EXPOSED_SUPER_CLASS = DiagnosticFactory2.create(ERROR);
DiagnosticFactory2<KtDelegationSpecifier, EffectiveVisibility, EffectiveVisibility> EXPOSED_SUPER_INTERFACE = DiagnosticFactory2.create(ERROR); DiagnosticFactory2<KtSuperTypeListEntry, EffectiveVisibility, EffectiveVisibility> EXPOSED_SUPER_INTERFACE = DiagnosticFactory2.create(ERROR);
DiagnosticFactory1<KtElement, Collection<ClassDescriptor>> PLATFORM_CLASS_MAPPED_TO_KOTLIN = DiagnosticFactory1.create(WARNING); DiagnosticFactory1<KtElement, Collection<ClassDescriptor>> PLATFORM_CLASS_MAPPED_TO_KOTLIN = DiagnosticFactory1.create(WARNING);
@@ -142,7 +142,7 @@ public interface Errors {
// Annotations // Annotations
DiagnosticFactory0<KtDelegationSpecifierList> SUPERTYPES_FOR_ANNOTATION_CLASS = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtSuperTypeList> SUPERTYPES_FOR_ANNOTATION_CLASS = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtParameter> MISSING_VAL_ON_ANNOTATION_PARAMETER = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtParameter> MISSING_VAL_ON_ANNOTATION_PARAMETER = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtCallExpression> ANNOTATION_CLASS_CONSTRUCTOR_CALL = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtCallExpression> ANNOTATION_CLASS_CONSTRUCTOR_CALL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory1<KtAnnotationEntry, DeclarationDescriptor> NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR); DiagnosticFactory1<KtAnnotationEntry, DeclarationDescriptor> NOT_AN_ANNOTATION_CLASS = DiagnosticFactory1.create(ERROR);
@@ -178,7 +178,7 @@ public interface Errors {
DiagnosticFactory0<PsiElement> CYCLIC_INHERITANCE_HIERARCHY = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<PsiElement> CYCLIC_INHERITANCE_HIERARCHY = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtDelegatorToSuperClass> SUPERTYPE_NOT_INITIALIZED = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtSuperTypeEntry> SUPERTYPE_NOT_INITIALIZED = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtTypeReference> DELEGATION_NOT_TO_INTERFACE = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtTypeReference> DELEGATION_NOT_TO_INTERFACE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtTypeReference> SUPERTYPE_NOT_A_CLASS_OR_INTERFACE = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtTypeReference> SUPERTYPE_NOT_A_CLASS_OR_INTERFACE = DiagnosticFactory0.create(ERROR);
@@ -188,7 +188,7 @@ public interface Errors {
DiagnosticFactory0<KtTypeReference> MANY_CLASSES_IN_SUPERTYPE_LIST = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtTypeReference> MANY_CLASSES_IN_SUPERTYPE_LIST = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtTypeReference> SUPERTYPE_APPEARS_TWICE = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtTypeReference> SUPERTYPE_APPEARS_TWICE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory3<KtDelegationSpecifierList, TypeParameterDescriptor, ClassDescriptor, Collection<KotlinType>> DiagnosticFactory3<KtSuperTypeList, TypeParameterDescriptor, ClassDescriptor, Collection<KotlinType>>
INCONSISTENT_TYPE_PARAMETER_VALUES = DiagnosticFactory3.create(ERROR); INCONSISTENT_TYPE_PARAMETER_VALUES = DiagnosticFactory3.create(ERROR);
DiagnosticFactory3<KtTypeParameter, TypeParameterDescriptor, ClassDescriptor, Collection<KotlinType>> DiagnosticFactory3<KtTypeParameter, TypeParameterDescriptor, ClassDescriptor, Collection<KotlinType>>
INCONSISTENT_TYPE_PARAMETER_BOUNDS = DiagnosticFactory3.create(ERROR); INCONSISTENT_TYPE_PARAMETER_BOUNDS = DiagnosticFactory3.create(ERROR);
@@ -207,7 +207,7 @@ public interface Errors {
DiagnosticFactory0<KtConstructorDelegationReferenceExpression> CYCLIC_CONSTRUCTOR_DELEGATION_CALL = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtConstructorDelegationReferenceExpression> CYCLIC_CONSTRUCTOR_DELEGATION_CALL = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtDeclaration> CONSTRUCTOR_IN_OBJECT = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE); DiagnosticFactory0<KtDeclaration> CONSTRUCTOR_IN_OBJECT = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
DiagnosticFactory0<KtDelegatorToSuperCall> SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtSuperTypeCallEntry> SUPERTYPE_INITIALIZED_WITHOUT_PRIMARY_CONSTRUCTOR = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtConstructorDelegationCall> PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED = DiagnosticFactory0<KtConstructorDelegationCall> PRIMARY_CONSTRUCTOR_DELEGATION_CALL_EXPECTED =
DiagnosticFactory0.create(ERROR, PositioningStrategies.SECONDARY_CONSTRUCTOR_DELEGATION_CALL); DiagnosticFactory0.create(ERROR, PositioningStrategies.SECONDARY_CONSTRUCTOR_DELEGATION_CALL);
@@ -231,7 +231,7 @@ public interface Errors {
DiagnosticFactory0<PsiElement> SUPERTYPE_INITIALIZED_IN_INTERFACE = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<PsiElement> SUPERTYPE_INITIALIZED_IN_INTERFACE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<KtDelegatorByExpressionSpecifier> DELEGATION_IN_INTERFACE = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<KtDelegatedSuperTypeEntry> DELEGATION_IN_INTERFACE = DiagnosticFactory0.create(ERROR);
DiagnosticFactory0<PsiElement> INTERFACE_WITH_SUPERCLASS = DiagnosticFactory0.create(ERROR); DiagnosticFactory0<PsiElement> INTERFACE_WITH_SUPERCLASS = DiagnosticFactory0.create(ERROR);
@@ -532,7 +532,7 @@ public interface Errors {
// Destructuring-declarations // Destructuring-declarations
DiagnosticFactory0<KtMultiDeclaration> INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION = DiagnosticFactory0.create(ERROR, DEFAULT); DiagnosticFactory0<KtDestructuringDeclaration> INITIALIZER_REQUIRED_FOR_DESTRUCTURING_DECLARATION = DiagnosticFactory0.create(ERROR, DEFAULT);
DiagnosticFactory2<KtExpression, Name, KotlinType> COMPONENT_FUNCTION_MISSING = DiagnosticFactory2.create(ERROR, DEFAULT); DiagnosticFactory2<KtExpression, Name, KotlinType> COMPONENT_FUNCTION_MISSING = DiagnosticFactory2.create(ERROR, DEFAULT);
DiagnosticFactory2<KtExpression, Name, Collection<? extends ResolvedCall<?>>> COMPONENT_FUNCTION_AMBIGUITY = DiagnosticFactory2.create(ERROR, DEFAULT); DiagnosticFactory2<KtExpression, Name, Collection<? extends ResolvedCall<?>>> COMPONENT_FUNCTION_AMBIGUITY = DiagnosticFactory2.create(ERROR, DEFAULT);
DiagnosticFactory3<KtExpression, Name, KotlinType, KotlinType> COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR, DEFAULT); DiagnosticFactory3<KtExpression, Name, KotlinType, KotlinType> COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR, DEFAULT);
@@ -626,7 +626,7 @@ public interface Errors {
DiagnosticFactory2<KtBinaryExpression, KtElement, DeclarationDescriptor> UNUSED_VALUE = DiagnosticFactory2.create(WARNING, PositioningStrategies.UNUSED_VALUE); DiagnosticFactory2<KtBinaryExpression, KtElement, DeclarationDescriptor> UNUSED_VALUE = DiagnosticFactory2.create(WARNING, PositioningStrategies.UNUSED_VALUE);
DiagnosticFactory1<KtElement, KtElement> UNUSED_CHANGED_VALUE = DiagnosticFactory1.create(WARNING); DiagnosticFactory1<KtElement, KtElement> UNUSED_CHANGED_VALUE = DiagnosticFactory1.create(WARNING);
DiagnosticFactory0<KtElement> UNUSED_EXPRESSION = DiagnosticFactory0.create(WARNING); DiagnosticFactory0<KtElement> UNUSED_EXPRESSION = DiagnosticFactory0.create(WARNING);
DiagnosticFactory0<KtFunctionLiteralExpression> UNUSED_LAMBDA_EXPRESSION = DiagnosticFactory0.create(WARNING); DiagnosticFactory0<KtLambdaExpression> UNUSED_LAMBDA_EXPRESSION = DiagnosticFactory0.create(WARNING);
DiagnosticFactory1<KtExpression, DeclarationDescriptor> VAL_REASSIGNMENT = DiagnosticFactory1.create(ERROR); DiagnosticFactory1<KtExpression, DeclarationDescriptor> VAL_REASSIGNMENT = DiagnosticFactory1.create(ERROR);
DiagnosticFactory1<KtExpression, DeclarationDescriptor> SETTER_PROJECTED_OUT = DiagnosticFactory1.create(ERROR); DiagnosticFactory1<KtExpression, DeclarationDescriptor> SETTER_PROJECTED_OUT = DiagnosticFactory1.create(ERROR);
@@ -49,7 +49,7 @@ public object PositioningStrategies {
is KtObjectLiteralExpression -> { is KtObjectLiteralExpression -> {
val objectDeclaration = element.getObjectDeclaration() val objectDeclaration = element.getObjectDeclaration()
val objectKeyword = objectDeclaration.getObjectKeyword() val objectKeyword = objectDeclaration.getObjectKeyword()
val delegationSpecifierList = objectDeclaration.getDelegationSpecifierList() val delegationSpecifierList = objectDeclaration.getSuperTypeList()
if (delegationSpecifierList == null) { if (delegationSpecifierList == null) {
return markElement(objectKeyword) return markElement(objectKeyword)
} }
@@ -426,7 +426,7 @@ public object PositioningStrategies {
@JvmField public val DELEGATOR_SUPER_CALL: PositioningStrategy<KtEnumEntry> = object: PositioningStrategy<KtEnumEntry>() { @JvmField public val DELEGATOR_SUPER_CALL: PositioningStrategy<KtEnumEntry> = object: PositioningStrategy<KtEnumEntry>() {
override fun mark(element: KtEnumEntry): List<TextRange> { override fun mark(element: KtEnumEntry): List<TextRange> {
val specifiers = element.getDelegationSpecifiers() val specifiers = element.getSuperTypeListEntries()
return markElement(if (specifiers.isEmpty()) element else specifiers[0]) return markElement(if (specifiers.isEmpty()) element else specifiers[0])
} }
} }
@@ -545,7 +545,7 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing {
break; break;
} }
argument.done(FUNCTION_LITERAL_ARGUMENT); argument.done(LAMBDA_ARGUMENT);
success = true; success = true;
} }
@@ -1031,7 +1031,7 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing {
if (declType != null) { if (declType != null) {
// we do not attach preceding comments (non-doc) to local variables because they are likely commenting a few statements below // we do not attach preceding comments (non-doc) to local variables because they are likely commenting a few statements below
closeDeclarationWithCommentBinders(decl, declType, closeDeclarationWithCommentBinders(decl, declType,
declType != KtNodeTypes.PROPERTY && declType != KtNodeTypes.MULTI_VARIABLE_DECLARATION); declType != KtNodeTypes.PROPERTY && declType != KtNodeTypes.DESTRUCTURING_DECLARATION);
return true; return true;
} }
else { else {
@@ -1104,7 +1104,7 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing {
myBuilder.restoreNewlinesState(); myBuilder.restoreNewlinesState();
literal.done(FUNCTION_LITERAL); literal.done(FUNCTION_LITERAL);
literalExpression.done(FUNCTION_LITERAL_EXPRESSION); literalExpression.done(LAMBDA_EXPRESSION);
} }
private boolean rollbackOrDropAt(PsiBuilder.Marker rollbackMarker, IElementType dropAt) { private boolean rollbackOrDropAt(PsiBuilder.Marker rollbackMarker, IElementType dropAt) {
@@ -1352,7 +1352,7 @@ public class KotlinExpressionParsing extends AbstractKotlinParsing {
if (at(LPAR)) { if (at(LPAR)) {
myJetParsing.parseMultiDeclarationName(TokenSet.create(IN_KEYWORD, LBRACE)); myJetParsing.parseMultiDeclarationName(TokenSet.create(IN_KEYWORD, LBRACE));
parameter.done(MULTI_VARIABLE_DECLARATION); parameter.done(DESTRUCTURING_DECLARATION);
} }
else { else {
expect(IDENTIFIER, "Expecting a variable name", TokenSet.create(COLON, IN_KEYWORD)); expect(IDENTIFIER, "Expecting a variable name", TokenSet.create(COLON, IN_KEYWORD));
@@ -960,7 +960,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
callee.done(CONSTRUCTOR_CALLEE); callee.done(CONSTRUCTOR_CALLEE);
myExpressionParsing.parseValueArgumentList(); myExpressionParsing.parseValueArgumentList();
delegatorSuperCall.done(DELEGATOR_SUPER_CALL); delegatorSuperCall.done(SUPER_TYPE_CALL_ENTRY);
initializerList.done(INITIALIZER_LIST); initializerList.done(INITIALIZER_LIST);
} }
if (at(LBRACE)) { 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 advance(); // COLON
parseTypeRef(follow); parseTypeRef(follow);
} }
property.done(MULTI_VARIABLE_DECLARATION_ENTRY); property.done(DESTRUCTURING_DECLARATION_ENTRY);
if (!at(COMMA)) break; if (!at(COMMA)) break;
advance(); // COMMA advance(); // COMMA
@@ -1637,7 +1637,7 @@ public class KotlinParsing extends AbstractKotlinParsing {
advance(); // COMMA advance(); // COMMA
} }
list.done(DELEGATION_SPECIFIER_LIST); list.done(SUPER_TYPE_LIST);
} }
/* /*
@@ -1660,16 +1660,16 @@ public class KotlinParsing extends AbstractKotlinParsing {
reference.drop(); reference.drop();
advance(); // BY_KEYWORD advance(); // BY_KEYWORD
createForByClause(myBuilder).myExpressionParsing.parseExpression(); createForByClause(myBuilder).myExpressionParsing.parseExpression();
delegator.done(DELEGATOR_BY); delegator.done(DELEGATED_SUPER_TYPE_ENTRY);
} }
else if (at(LPAR)) { else if (at(LPAR)) {
reference.done(CONSTRUCTOR_CALLEE); reference.done(CONSTRUCTOR_CALLEE);
myExpressionParsing.parseValueArgumentList(); myExpressionParsing.parseValueArgumentList();
delegator.done(DELEGATOR_SUPER_CALL); delegator.done(SUPER_TYPE_CALL_ENTRY);
} }
else { else {
reference.drop(); reference.drop();
delegator.done(DELEGATOR_SUPER_CLASS); delegator.done(SUPER_TYPE_ENTRY);
} }
} }
@@ -49,7 +49,7 @@ public interface Call {
@ReadOnly @ReadOnly
@NotNull @NotNull
List<? extends FunctionLiteralArgument> getFunctionLiteralArguments(); List<? extends LambdaArgument> getFunctionLiteralArguments();
@ReadOnly @ReadOnly
@NotNull @NotNull
@@ -16,9 +16,9 @@
package org.jetbrains.kotlin.psi.debugText package org.jetbrains.kotlin.psi.debugText
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.lexer.KtTokens
import com.intellij.openapi.diagnostic.Logger 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 // 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 // this is need to avoid unnecessary file parses
@@ -98,11 +98,11 @@ private object DebugTextBuildingVisitor : KtVisitor<String, Unit>() {
return render(constructorCalleeExpression, constructorCalleeExpression.getConstructorReferenceExpression()) 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()) return render(specifier, specifier.getTypeReference())
} }
override fun visitDelegationSpecifierList(list: KtDelegationSpecifierList, data: Unit?): String? { override fun visitSuperTypeList(list: KtSuperTypeList, data: Unit?): String? {
return renderChildren(list, ", ") return renderChildren(list, ", ")
} }
@@ -208,7 +208,7 @@ private object DebugTextBuildingVisitor : KtVisitor<String, Unit>() {
appendInn(klass.getTypeParameterList()) appendInn(klass.getTypeParameterList())
appendInn(klass.getPrimaryConstructorModifierList(), prefix = " ", suffix = " ") appendInn(klass.getPrimaryConstructorModifierList(), prefix = " ", suffix = " ")
appendInn(klass.getPrimaryConstructorParameterList()) appendInn(klass.getPrimaryConstructorParameterList())
appendInn(klass.getDelegationSpecifierList(), prefix = " : ") appendInn(klass.getSuperTypeList(), prefix = " : ")
} }
} }
@@ -239,7 +239,7 @@ private object DebugTextBuildingVisitor : KtVisitor<String, Unit>() {
appendInn(declaration.getModifierList(), suffix = " ") appendInn(declaration.getModifierList(), suffix = " ")
append("object ") append("object ")
appendInn(declaration.getNameAsName()) appendInn(declaration.getNameAsName())
appendInn(declaration.getDelegationSpecifierList(), prefix = " : ") appendInn(declaration.getSuperTypeList(), prefix = " : ")
} }
} }
@@ -75,7 +75,7 @@ public class KtAnnotationEntry extends KtElementImplStub<KotlinAnnotationEntrySt
@NotNull @NotNull
@Override @Override
public List<KtFunctionLiteralArgument> getFunctionLiteralArguments() { public List<KtLambdaArgument> getLambdaArguments() {
return Collections.emptyList(); return Collections.emptyList();
} }
@@ -32,7 +32,7 @@ public interface KtCallElement extends KtElement {
List<? extends ValueArgument> getValueArguments(); List<? extends ValueArgument> getValueArguments();
@NotNull @NotNull
List<KtFunctionLiteralArgument> getFunctionLiteralArguments(); List<KtLambdaArgument> getLambdaArguments();
@NotNull @NotNull
List<KtTypeProjection> getTypeArguments(); List<KtTypeProjection> getTypeArguments();
@@ -60,8 +60,8 @@ public class KtCallExpression extends KtExpressionImpl implements KtCallElement,
*/ */
@Override @Override
@NotNull @NotNull
public List<KtFunctionLiteralArgument> getFunctionLiteralArguments() { public List<KtLambdaArgument> getLambdaArguments() {
return findChildrenByType(KtNodeTypes.FUNCTION_LITERAL_ARGUMENT); return findChildrenByType(KtNodeTypes.LAMBDA_ARGUMENT);
} }
@Override @Override
@@ -69,7 +69,7 @@ public class KtCallExpression extends KtExpressionImpl implements KtCallElement,
public List<KtValueArgument> getValueArguments() { public List<KtValueArgument> getValueArguments() {
KtValueArgumentList list = getValueArgumentList(); KtValueArgumentList list = getValueArgumentList();
List<KtValueArgument> valueArgumentsInParentheses = list != null ? list.getArguments() : Collections.<KtValueArgument>emptyList(); List<KtValueArgument> valueArgumentsInParentheses = list != null ? list.getArguments() : Collections.<KtValueArgument>emptyList();
List<KtFunctionLiteralArgument> functionLiteralArguments = getFunctionLiteralArguments(); List<KtLambdaArgument> functionLiteralArguments = getLambdaArguments();
if (functionLiteralArguments.isEmpty()) { if (functionLiteralArguments.isEmpty()) {
return valueArgumentsInParentheses; return valueArgumentsInParentheses;
} }
@@ -25,7 +25,6 @@ import com.intellij.psi.impl.CheckUtil
import com.intellij.psi.impl.source.codeStyle.CodeEditUtil import com.intellij.psi.impl.source.codeStyle.CodeEditUtil
import com.intellij.psi.stubs.IStubElementType import com.intellij.psi.stubs.IStubElementType
import com.intellij.psi.util.PsiTreeUtil import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.kotlin.KtNodeTypes
import org.jetbrains.kotlin.lexer.KtTokens import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.stubs.KotlinClassOrObjectStub import org.jetbrains.kotlin.psi.stubs.KotlinClassOrObjectStub
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes
@@ -35,26 +34,26 @@ abstract public class KtClassOrObject :
public constructor(node: ASTNode) : super(node) public constructor(node: ASTNode) : super(node)
public constructor(stub: KotlinClassOrObjectStub<out KtClassOrObject>, nodeType: IStubElementType<*, *>) : super(stub, nodeType) public constructor(stub: KotlinClassOrObjectStub<out KtClassOrObject>, nodeType: IStubElementType<*, *>) : super(stub, nodeType)
public fun getDelegationSpecifierList(): KtDelegationSpecifierList? = getStubOrPsiChild(KtStubElementTypes.DELEGATION_SPECIFIER_LIST) public fun getSuperTypeList(): KtSuperTypeList? = getStubOrPsiChild(KtStubElementTypes.SUPER_TYPE_LIST)
open public fun getDelegationSpecifiers(): List<KtDelegationSpecifier> = getDelegationSpecifierList()?.getDelegationSpecifiers().orEmpty() open public fun getSuperTypeListEntries(): List<KtSuperTypeListEntry> = getSuperTypeList()?.getEntries().orEmpty()
public fun addDelegationSpecifier(delegationSpecifier: KtDelegationSpecifier): KtDelegationSpecifier { public fun addSuperTypeListEntry(superTypeListEntry: KtSuperTypeListEntry): KtSuperTypeListEntry {
getDelegationSpecifierList()?.let { getSuperTypeList()?.let {
return EditCommaSeparatedListHelper.addItem(it, getDelegationSpecifiers(), delegationSpecifier) return EditCommaSeparatedListHelper.addItem(it, getSuperTypeListEntries(), superTypeListEntry)
} }
val psiFactory = KtPsiFactory(this) 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()) 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) { public fun removeSuperTypeListEntry(superTypeListEntry: KtSuperTypeListEntry) {
val specifierList = getDelegationSpecifierList() ?: return val specifierList = getSuperTypeList() ?: return
assert(delegationSpecifier.getParent() === specifierList) assert(superTypeListEntry.getParent() === specifierList)
if (specifierList.getDelegationSpecifiers().size() > 1) { if (specifierList.getEntries().size() > 1) {
EditCommaSeparatedListHelper.removeItem<KtElement>(delegationSpecifier) EditCommaSeparatedListHelper.removeItem<KtElement>(superTypeListEntry)
} }
else { else {
deleteChildRange(findChildByType<PsiElement>(KtTokens.COLON) ?: specifierList, specifierList) deleteChildRange(findChildByType<PsiElement>(KtTokens.COLON) ?: specifierList, specifierList)
@@ -44,7 +44,7 @@ public class KtConstructorDelegationCall extends KtElementImpl implements KtCall
@NotNull @NotNull
@Override @Override
public List<KtFunctionLiteralArgument> getFunctionLiteralArguments() { public List<KtLambdaArgument> getLambdaArguments() {
return Collections.emptyList(); return Collections.emptyList();
} }
@@ -22,18 +22,18 @@ import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub; import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes;
public class KtDelegatorByExpressionSpecifier extends KtDelegationSpecifier { public class KtDelegatedSuperTypeEntry extends KtSuperTypeListEntry {
public KtDelegatorByExpressionSpecifier(@NotNull ASTNode node) { public KtDelegatedSuperTypeEntry(@NotNull ASTNode node) {
super(node); super(node);
} }
public KtDelegatorByExpressionSpecifier(@NotNull KotlinPlaceHolderStub<? extends KtDelegationSpecifier> stub) { public KtDelegatedSuperTypeEntry(@NotNull KotlinPlaceHolderStub<? extends KtSuperTypeListEntry> stub) {
super(stub, KtStubElementTypes.DELEGATOR_BY); super(stub, KtStubElementTypes.DELEGATED_SUPER_TYPE_ENTRY);
} }
@Override @Override
public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) {
return visitor.visitDelegationByExpressionSpecifier(this, data); return visitor.visitDelegatedSuperTypeEntry(this, data);
} }
@Nullable @IfNotParsed @Nullable @IfNotParsed
@@ -29,19 +29,19 @@ import java.util.List;
import static org.jetbrains.kotlin.lexer.KtTokens.*; import static org.jetbrains.kotlin.lexer.KtTokens.*;
public class KtMultiDeclaration extends KtDeclarationImpl implements KtValVarKeywordOwner { public class KtDestructuringDeclaration extends KtDeclarationImpl implements KtValVarKeywordOwner {
public KtMultiDeclaration(@NotNull ASTNode node) { public KtDestructuringDeclaration(@NotNull ASTNode node) {
super(node); super(node);
} }
@Override @Override
public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) {
return visitor.visitMultiDeclaration(this, data); return visitor.visitDestructuringDeclaration(this, data);
} }
@NotNull @NotNull
public List<KtMultiDeclarationEntry> getEntries() { public List<KtDestructuringDeclarationEntry> getEntries() {
return findChildrenByType(KtNodeTypes.MULTI_VARIABLE_DECLARATION_ENTRY); return findChildrenByType(KtNodeTypes.DESTRUCTURING_DECLARATION_ENTRY);
} }
@Nullable @Nullable
@@ -34,8 +34,8 @@ import java.util.List;
import static org.jetbrains.kotlin.lexer.KtTokens.VAL_KEYWORD; import static org.jetbrains.kotlin.lexer.KtTokens.VAL_KEYWORD;
import static org.jetbrains.kotlin.lexer.KtTokens.VAR_KEYWORD; import static org.jetbrains.kotlin.lexer.KtTokens.VAR_KEYWORD;
public class KtMultiDeclarationEntry extends KtNamedDeclarationNotStubbed implements KtVariableDeclaration { public class KtDestructuringDeclarationEntry extends KtNamedDeclarationNotStubbed implements KtVariableDeclaration {
public KtMultiDeclarationEntry(@NotNull ASTNode node) { public KtDestructuringDeclarationEntry(@NotNull ASTNode node) {
super(node); super(node);
} }
@@ -100,7 +100,7 @@ public class KtMultiDeclarationEntry extends KtNamedDeclarationNotStubbed implem
@Override @Override
public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) {
return visitor.visitMultiDeclarationEntry(this, data); return visitor.visitDestructuringDeclarationEntry(this, data);
} }
@Override @Override
@@ -122,7 +122,7 @@ public class KtMultiDeclarationEntry extends KtNamedDeclarationNotStubbed implem
@NotNull @NotNull
private ASTNode getParentNode() { private ASTNode getParentNode() {
ASTNode parent = getNode().getTreeParent(); ASTNode parent = getNode().getTreeParent();
assert parent.getElementType() == KtNodeTypes.MULTI_VARIABLE_DECLARATION; assert parent.getElementType() == KtNodeTypes.DESTRUCTURING_DECLARATION;
return parent; return parent;
} }
@@ -20,11 +20,8 @@ import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiClass; import com.intellij.psi.PsiClass;
import com.intellij.psi.PsiElement; import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiEnumConstant; import com.intellij.psi.PsiEnumConstant;
import com.intellij.util.IncorrectOperationException;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; 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.KotlinClassStub;
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes;
@@ -42,7 +39,7 @@ public class KtEnumEntry extends KtClass {
@NotNull @NotNull
@Override @Override
public List<KtDelegationSpecifier> getDelegationSpecifiers() { public List<KtSuperTypeListEntry> getSuperTypeListEntries() {
KtInitializerList initializerList = getInitializerList(); KtInitializerList initializerList = getInitializerList();
if (initializerList == null) { if (initializerList == null) {
return Collections.emptyList(); return Collections.emptyList();
@@ -51,7 +48,7 @@ public class KtEnumEntry extends KtClass {
} }
public boolean hasInitializer() { public boolean hasInitializer() {
return !getDelegationSpecifiers().isEmpty(); return !getSuperTypeListEntries().isEmpty();
} }
@Nullable @Nullable
@@ -38,8 +38,8 @@ public class KtForExpression extends KtLoopExpression {
} }
@Nullable @Nullable
public KtMultiDeclaration getMultiParameter() { public KtDestructuringDeclaration getDestructuringParameter() {
return (KtMultiDeclaration) findChildByType(KtNodeTypes.MULTI_VARIABLE_DECLARATION); return (KtDestructuringDeclaration) findChildByType(KtNodeTypes.DESTRUCTURING_DECLARATION);
} }
@Nullable @IfNotParsed @Nullable @IfNotParsed
@@ -39,7 +39,7 @@ public class KtInitializerList extends KtElementImplStub<KotlinPlaceHolderStub<K
} }
@NotNull @NotNull
public List<KtDelegationSpecifier> getInitializers() { public List<KtSuperTypeListEntry> getInitializers() {
return Arrays.asList(getStubOrPsiChildren(KtStubElementTypes.DELEGATION_SPECIFIER_TYPES, KtDelegationSpecifier.ARRAY_FACTORY)); return Arrays.asList(getStubOrPsiChildren(KtStubElementTypes.SUPER_TYPE_LIST_ENTRIES, KtSuperTypeListEntry.ARRAY_FACTORY));
} }
} }
@@ -18,16 +18,16 @@ package org.jetbrains.kotlin.psi
import com.intellij.lang.ASTNode 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<KtValueArgument>.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) { return when (this) {
is KtFunctionLiteralExpression -> this is KtLambdaExpression -> this
is KtLabeledExpression -> baseExpression?.unpackFunctionLiteral(allowParentheses) is KtLabeledExpression -> baseExpression?.unpackFunctionLiteral(allowParentheses)
is KtAnnotatedExpression -> baseExpression?.unpackFunctionLiteral(allowParentheses) is KtAnnotatedExpression -> baseExpression?.unpackFunctionLiteral(allowParentheses)
is KtParenthesizedExpression -> if (allowParentheses) expression?.unpackFunctionLiteral(allowParentheses) else null is KtParenthesizedExpression -> if (allowParentheses) expression?.unpackFunctionLiteral(allowParentheses) else null
@@ -24,14 +24,14 @@ import org.jetbrains.kotlin.lexer.KtTokens;
import java.util.List; import java.util.List;
public class KtFunctionLiteralExpression extends KtExpressionImpl { public class KtLambdaExpression extends KtExpressionImpl {
public KtFunctionLiteralExpression(@NotNull ASTNode node) { public KtLambdaExpression(@NotNull ASTNode node) {
super(node); super(node);
} }
@Override @Override
public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) {
return visitor.visitFunctionLiteralExpression(this, data); return visitor.visitLambdaExpression(this, data);
} }
@NotNull @NotNull
@@ -204,8 +204,8 @@ public class KtPsiFactory(private val project: Project) {
return getter return getter
} }
public fun createMultiDeclaration(text: String): KtMultiDeclaration { public fun createDestructuringDeclaration(text: String): KtDestructuringDeclaration {
return (createFunction("fun foo() {$text}").bodyExpression as KtBlockExpression).statements.first() as KtMultiDeclaration return (createFunction("fun foo() {$text}").bodyExpression as KtBlockExpression).statements.first() as KtDestructuringDeclaration
} }
public fun <TDeclaration : KtDeclaration> createDeclaration(text: String): TDeclaration { public fun <TDeclaration : KtDeclaration> createDeclaration(text: String): TDeclaration {
@@ -279,7 +279,7 @@ public class KtPsiFactory(private val project: Project) {
} }
public fun createFunctionLiteralParameterList(text: String): KtParameterList { 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 { public fun createEnumEntry(text: String): KtEnumEntry {
@@ -395,15 +395,15 @@ public class KtPsiFactory(private val project: Project) {
return argumentList.getArguments().single() return argumentList.getArguments().single()
} }
public fun createDelegatorToSuperCall(text: String): KtDelegatorToSuperCall { public fun createSuperTypeCallEntry(text: String): KtSuperTypeCallEntry {
return createClass("class A: $text").getDelegationSpecifiers().first() as KtDelegatorToSuperCall return createClass("class A: $text").getSuperTypeListEntries().first() as KtSuperTypeCallEntry
} }
public fun createDelegatorToSuperClass(text: String): KtDelegatorToSuperClass { public fun createSuperTypeEntry(text: String): KtSuperTypeEntry {
return createClass("class A: $text").getDelegationSpecifiers().first() as KtDelegatorToSuperClass 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 ": " val colonOrEmpty = if (text.isEmpty()) "" else ": "
return createClass("class A { constructor()$colonOrEmpty$text {}").getSecondaryConstructors().first().getDelegationCall() return createClass("class A { constructor()$colonOrEmpty$text {}").getSecondaryConstructors().first().getDelegationCall()
} }
@@ -298,8 +298,8 @@ public class KtPsiUtil {
public static boolean isVariableNotParameterDeclaration(@NotNull KtDeclaration declaration) { public static boolean isVariableNotParameterDeclaration(@NotNull KtDeclaration declaration) {
if (!(declaration instanceof KtVariableDeclaration)) return false; if (!(declaration instanceof KtVariableDeclaration)) return false;
if (declaration instanceof KtProperty) return true; if (declaration instanceof KtProperty) return true;
assert declaration instanceof KtMultiDeclarationEntry; assert declaration instanceof KtDestructuringDeclarationEntry;
KtMultiDeclarationEntry multiDeclarationEntry = (KtMultiDeclarationEntry) declaration; KtDestructuringDeclarationEntry multiDeclarationEntry = (KtDestructuringDeclarationEntry) declaration;
return !(multiDeclarationEntry.getParent().getParent() instanceof KtForExpression); return !(multiDeclarationEntry.getParent().getParent() instanceof KtForExpression);
} }
@@ -819,7 +819,7 @@ public class KtPsiUtil {
parent instanceof KtDotQualifiedExpression || parent instanceof KtDotQualifiedExpression ||
parent instanceof KtCallExpression || parent instanceof KtCallExpression ||
parent instanceof KtArrayAccessExpression || parent instanceof KtArrayAccessExpression ||
parent instanceof KtMultiDeclaration) { parent instanceof KtDestructuringDeclaration) {
if (parent instanceof KtLabeledExpression) { if (parent instanceof KtLabeledExpression) {
parent = parent.getParent(); parent = parent.getParent();
@@ -835,7 +835,7 @@ public class KtPsiUtil {
else if (parent instanceof KtValueArgument || parent instanceof KtValueArgumentList) { else if (parent instanceof KtValueArgument || parent instanceof KtValueArgumentList) {
parent = parent.getParent(); parent = parent.getParent();
} }
else if (parent instanceof KtFunctionLiteralExpression || parent instanceof KtAnnotatedExpression) { else if (parent instanceof KtLambdaExpression || parent instanceof KtAnnotatedExpression) {
parent = parent.getParent(); parent = parent.getParent();
} }
else { else {
@@ -48,6 +48,6 @@ public class KtSecondaryConstructor : KtConstructor<KtSecondaryConstructor> {
val delegationName = if (isThis) "this" else "super" val delegationName = if (isThis) "this" else "super"
return addAfter(psiFactory.createConstructorDelegationCall(delegationName + "()"), colon) as KtConstructorDelegationCall return addAfter(psiFactory.creareDelegatedSuperTypeEntry(delegationName + "()"), colon) as KtConstructorDelegationCall
} }
} }
@@ -26,18 +26,18 @@ import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
public class KtDelegatorToSuperCall extends KtDelegationSpecifier implements KtCallElement { public class KtSuperTypeCallEntry extends KtSuperTypeListEntry implements KtCallElement {
public KtDelegatorToSuperCall(@NotNull ASTNode node) { public KtSuperTypeCallEntry(@NotNull ASTNode node) {
super(node); super(node);
} }
public KtDelegatorToSuperCall(@NotNull KotlinPlaceHolderStub<? extends KtDelegationSpecifier> stub) { public KtSuperTypeCallEntry(@NotNull KotlinPlaceHolderStub<? extends KtSuperTypeListEntry> stub) {
super(stub, KtStubElementTypes.DELEGATOR_SUPER_CALL); super(stub, KtStubElementTypes.SUPER_TYPE_CALL_ENTRY);
} }
@Override @Override
public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) {
return visitor.visitDelegationToSuperCallSpecifier(this, data); return visitor.visitSuperTypeCallEntry(this, data);
} }
@NotNull @NotNull
@@ -61,7 +61,7 @@ public class KtDelegatorToSuperCall extends KtDelegationSpecifier implements KtC
@NotNull @NotNull
@Override @Override
public List<KtFunctionLiteralArgument> getFunctionLiteralArguments() { public List<KtLambdaArgument> getLambdaArguments() {
return Collections.emptyList(); return Collections.emptyList();
} }
@@ -21,17 +21,17 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub; import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes;
public class KtDelegatorToSuperClass extends KtDelegationSpecifier { public class KtSuperTypeEntry extends KtSuperTypeListEntry {
public KtDelegatorToSuperClass(@NotNull ASTNode node) { public KtSuperTypeEntry(@NotNull ASTNode node) {
super(node); super(node);
} }
public KtDelegatorToSuperClass(@NotNull KotlinPlaceHolderStub<? extends KtDelegationSpecifier> stub) { public KtSuperTypeEntry(@NotNull KotlinPlaceHolderStub<? extends KtSuperTypeListEntry> stub) {
super(stub, KtStubElementTypes.DELEGATOR_SUPER_CLASS); super(stub, KtStubElementTypes.SUPER_TYPE_ENTRY);
} }
@Override @Override
public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) {
return visitor.visitDelegationToSuperClassSpecifier(this, data); return visitor.visitSuperTypeEntry(this, data);
} }
} }
@@ -24,21 +24,21 @@ import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
public class KtDelegationSpecifierList extends KtElementImplStub<KotlinPlaceHolderStub<KtDelegationSpecifierList>> { public class KtSuperTypeList extends KtElementImplStub<KotlinPlaceHolderStub<KtSuperTypeList>> {
public KtDelegationSpecifierList(@NotNull ASTNode node) { public KtSuperTypeList(@NotNull ASTNode node) {
super(node); super(node);
} }
public KtDelegationSpecifierList(@NotNull KotlinPlaceHolderStub<KtDelegationSpecifierList> stub) { public KtSuperTypeList(@NotNull KotlinPlaceHolderStub<KtSuperTypeList> stub) {
super(stub, KtStubElementTypes.DELEGATION_SPECIFIER_LIST); super(stub, KtStubElementTypes.SUPER_TYPE_LIST);
} }
@Override @Override
public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) {
return visitor.visitDelegationSpecifierList(this, data); return visitor.visitSuperTypeList(this, data);
} }
public List<KtDelegationSpecifier> getDelegationSpecifiers() { public List<KtSuperTypeListEntry> getEntries() {
return Arrays.asList(getStubOrPsiChildren(KtStubElementTypes.DELEGATION_SPECIFIER_TYPES, KtDelegationSpecifier.ARRAY_FACTORY)); return Arrays.asList(getStubOrPsiChildren(KtStubElementTypes.SUPER_TYPE_LIST_ENTRIES, KtSuperTypeListEntry.ARRAY_FACTORY));
} }
} }
@@ -24,31 +24,31 @@ import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub; import org.jetbrains.kotlin.psi.stubs.KotlinPlaceHolderStub;
import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes; import org.jetbrains.kotlin.psi.stubs.elements.KtStubElementTypes;
public class KtDelegationSpecifier extends KtElementImplStub<KotlinPlaceHolderStub<? extends KtDelegationSpecifier>> { public class KtSuperTypeListEntry extends KtElementImplStub<KotlinPlaceHolderStub<? extends KtSuperTypeListEntry>> {
private static final KtDelegationSpecifier[] EMPTY_ARRAY = new KtDelegationSpecifier[0]; private static final KtSuperTypeListEntry[] EMPTY_ARRAY = new KtSuperTypeListEntry[0];
public static ArrayFactory<KtDelegationSpecifier> ARRAY_FACTORY = new ArrayFactory<KtDelegationSpecifier>() { public static ArrayFactory<KtSuperTypeListEntry> ARRAY_FACTORY = new ArrayFactory<KtSuperTypeListEntry>() {
@NotNull @NotNull
@Override @Override
public KtDelegationSpecifier[] create(int count) { public KtSuperTypeListEntry[] create(int count) {
return count == 0 ? EMPTY_ARRAY : new KtDelegationSpecifier[count]; return count == 0 ? EMPTY_ARRAY : new KtSuperTypeListEntry[count];
} }
}; };
public KtDelegationSpecifier(@NotNull ASTNode node) { public KtSuperTypeListEntry(@NotNull ASTNode node) {
super(node); super(node);
} }
public KtDelegationSpecifier( public KtSuperTypeListEntry(
@NotNull KotlinPlaceHolderStub<? extends KtDelegationSpecifier> stub, @NotNull KotlinPlaceHolderStub<? extends KtSuperTypeListEntry> stub,
@NotNull IStubElementType nodeType) { @NotNull IStubElementType nodeType) {
super(stub, nodeType); super(stub, nodeType);
} }
@Override @Override
public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) { public <R, D> R accept(@NotNull KtVisitor<R, D> visitor, D data) {
return visitor.visitDelegationSpecifier(this, data); return visitor.visitSuperTypeListEntry(this, data);
} }
@Nullable @Nullable
@@ -57,11 +57,11 @@ public class KtVisitor<R, D> extends PsiElementVisitor {
return visitNamedDeclaration(property, data); return visitNamedDeclaration(property, data);
} }
public R visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, D data) { public R visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, D data) {
return visitDeclaration(multiDeclaration, 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); return visitNamedDeclaration(multiDeclarationEntry, data);
} }
@@ -134,24 +134,24 @@ public class KtVisitor<R, D> extends PsiElementVisitor {
return visitNamedDeclaration(parameter, data); return visitNamedDeclaration(parameter, data);
} }
public R visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list, D data) { public R visitSuperTypeList(@NotNull KtSuperTypeList list, D data) {
return visitKtElement(list, 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); return visitKtElement(specifier, data);
} }
public R visitDelegationByExpressionSpecifier(@NotNull KtDelegatorByExpressionSpecifier specifier, D data) { public R visitDelegatedSuperTypeEntry(@NotNull KtDelegatedSuperTypeEntry specifier, D data) {
return visitDelegationSpecifier(specifier, data); return visitSuperTypeListEntry(specifier, data);
} }
public R visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call, D data) { public R visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call, D data) {
return visitDelegationSpecifier(call, data); return visitSuperTypeListEntry(call, data);
} }
public R visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier, D data) { public R visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier, D data) {
return visitDelegationSpecifier(specifier, data); return visitSuperTypeListEntry(specifier, data);
} }
public R visitConstructorDelegationCall(@NotNull KtConstructorDelegationCall call, D data) { public R visitConstructorDelegationCall(@NotNull KtConstructorDelegationCall call, D data) {
@@ -258,7 +258,7 @@ public class KtVisitor<R, D> extends PsiElementVisitor {
return visitLoopExpression(expression, data); return visitLoopExpression(expression, data);
} }
public R visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression, D data) { public R visitLambdaExpression(@NotNull KtLambdaExpression expression, D data) {
return visitExpression(expression, data); return visitExpression(expression, data);
} }
@@ -53,12 +53,12 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
super.visitProperty(property, null); super.visitProperty(property, null);
} }
public void visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration) { public void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration destructuringDeclaration) {
super.visitMultiDeclaration(multiDeclaration, null); super.visitDestructuringDeclaration(destructuringDeclaration, null);
} }
public void visitMultiDeclarationEntry(@NotNull KtMultiDeclarationEntry multiDeclarationEntry) { public void visitDestructuringDeclarationEntry(@NotNull KtDestructuringDeclarationEntry multiDeclarationEntry) {
super.visitMultiDeclarationEntry(multiDeclarationEntry, null); super.visitDestructuringDeclarationEntry(multiDeclarationEntry, null);
} }
public void visitTypedef(@NotNull KtTypedef typedef) { public void visitTypedef(@NotNull KtTypedef typedef) {
@@ -121,24 +121,24 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
super.visitParameter(parameter, null); super.visitParameter(parameter, null);
} }
public void visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list) { public void visitSuperTypeList(@NotNull KtSuperTypeList list) {
super.visitDelegationSpecifierList(list, null); super.visitSuperTypeList(list, null);
} }
public void visitDelegationSpecifier(@NotNull KtDelegationSpecifier specifier) { public void visitSuperTypeListEntry(@NotNull KtSuperTypeListEntry specifier) {
super.visitDelegationSpecifier(specifier, null); super.visitSuperTypeListEntry(specifier, null);
} }
public void visitDelegationByExpressionSpecifier(@NotNull KtDelegatorByExpressionSpecifier specifier) { public void visitDelegatedSuperTypeEntry(@NotNull KtDelegatedSuperTypeEntry specifier) {
super.visitDelegationByExpressionSpecifier(specifier, null); super.visitDelegatedSuperTypeEntry(specifier, null);
} }
public void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call) { public void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call) {
super.visitDelegationToSuperCallSpecifier(call, null); super.visitSuperTypeCallEntry(call, null);
} }
public void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier) { public void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier) {
super.visitDelegationToSuperClassSpecifier(specifier, null); super.visitSuperTypeEntry(specifier, null);
} }
public void visitConstructorDelegationCall(@NotNull KtConstructorDelegationCall call) { public void visitConstructorDelegationCall(@NotNull KtConstructorDelegationCall call) {
@@ -245,8 +245,8 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
super.visitDoWhileExpression(expression, null); super.visitDoWhileExpression(expression, null);
} }
public void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression) { public void visitLambdaExpression(@NotNull KtLambdaExpression lambdaExpression) {
super.visitFunctionLiteralExpression(expression, null); super.visitLambdaExpression(lambdaExpression, null);
} }
public void visitAnnotatedExpression(@NotNull KtAnnotatedExpression expression) { public void visitAnnotatedExpression(@NotNull KtAnnotatedExpression expression) {
@@ -487,14 +487,14 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
} }
@Override @Override
public final Void visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, Void data) { public final Void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, Void data) {
visitMultiDeclaration(multiDeclaration); visitDestructuringDeclaration(multiDeclaration);
return null; return null;
} }
@Override @Override
public final Void visitMultiDeclarationEntry(@NotNull KtMultiDeclarationEntry multiDeclarationEntry, Void data) { public final Void visitDestructuringDeclarationEntry(@NotNull KtDestructuringDeclarationEntry multiDeclarationEntry, Void data) {
visitMultiDeclarationEntry(multiDeclarationEntry); visitDestructuringDeclarationEntry(multiDeclarationEntry);
return null; return null;
} }
@@ -589,34 +589,34 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
} }
@Override @Override
public final Void visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list, Void data) { public final Void visitSuperTypeList(@NotNull KtSuperTypeList list, Void data) {
visitDelegationSpecifierList(list); visitSuperTypeList(list);
return null; return null;
} }
@Override @Override
public final Void visitDelegationSpecifier(@NotNull KtDelegationSpecifier specifier, Void data) { public final Void visitSuperTypeListEntry(@NotNull KtSuperTypeListEntry specifier, Void data) {
visitDelegationSpecifier(specifier); visitSuperTypeListEntry(specifier);
return null; return null;
} }
@Override @Override
public final Void visitDelegationByExpressionSpecifier( public final Void visitDelegatedSuperTypeEntry(
@NotNull KtDelegatorByExpressionSpecifier specifier, Void data @NotNull KtDelegatedSuperTypeEntry specifier, Void data
) { ) {
visitDelegationByExpressionSpecifier(specifier); visitDelegatedSuperTypeEntry(specifier);
return null; return null;
} }
@Override @Override
public final Void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call, Void data) { public final Void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call, Void data) {
visitDelegationToSuperCallSpecifier(call); visitSuperTypeCallEntry(call);
return null; return null;
} }
@Override @Override
public final Void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier, Void data) { public final Void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier, Void data) {
visitDelegationToSuperClassSpecifier(specifier); visitSuperTypeEntry(specifier);
return null; return null;
} }
@@ -777,8 +777,8 @@ public class KtVisitorVoid extends KtVisitor<Void, Void> {
} }
@Override @Override
public final Void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression, Void data) { public final Void visitLambdaExpression(@NotNull KtLambdaExpression expression, Void data) {
visitFunctionLiteralExpression(expression); visitLambdaExpression(expression);
return null; return null;
} }
@@ -50,12 +50,12 @@ public class KtVisitorVoidWithParameter<P> extends KtVisitor<Void, P> {
super.visitProperty(property, data); super.visitProperty(property, data);
} }
public void visitMultiDeclarationVoid(@NotNull KtMultiDeclaration multiDeclaration, P data) { public void visitDestructuringDeclarationVoid(@NotNull KtDestructuringDeclaration multiDeclaration, P data) {
super.visitMultiDeclaration(multiDeclaration, data); super.visitDestructuringDeclaration(multiDeclaration, data);
} }
public void visitMultiDeclarationEntryVoid(@NotNull KtMultiDeclarationEntry multiDeclarationEntry, P data) { public void visitDestructuringDeclarationEntryVoid(@NotNull KtDestructuringDeclarationEntry multiDeclarationEntry, P data) {
super.visitMultiDeclarationEntry(multiDeclarationEntry, data); super.visitDestructuringDeclarationEntry(multiDeclarationEntry, data);
} }
public void visitTypedefVoid(@NotNull KtTypedef typedef, P data) { public void visitTypedefVoid(@NotNull KtTypedef typedef, P data) {
@@ -118,27 +118,27 @@ public class KtVisitorVoidWithParameter<P> extends KtVisitor<Void, P> {
super.visitParameter(parameter, data); super.visitParameter(parameter, data);
} }
public void visitDelegationSpecifierListVoid(@NotNull KtDelegationSpecifierList list, P data) { public void visitSuperTypeListVoid(@NotNull KtSuperTypeList list, P data) {
super.visitDelegationSpecifierList(list, data); super.visitSuperTypeList(list, data);
} }
public void visitDelegationSpecifierVoid(@NotNull KtDelegationSpecifier specifier, P data) { public void visitSuperTypeListEntryVoid(@NotNull KtSuperTypeListEntry specifier, P data) {
super.visitDelegationSpecifier(specifier, data); super.visitSuperTypeListEntry(specifier, data);
} }
public void visitDelegationByExpressionSpecifierVoid(@NotNull KtDelegatorByExpressionSpecifier specifier, P data) { public void visitDelegatedSuperTypeEntryVoid(@NotNull KtDelegatedSuperTypeEntry specifier, P data) {
super.visitDelegationByExpressionSpecifier(specifier, data); super.visitDelegatedSuperTypeEntry(specifier, data);
} }
public void visitDelegationToSuperCallSpecifierVoid(@NotNull KtDelegatorToSuperCall call, P data) { public void visitSuperTypeCallEntryVoid(@NotNull KtSuperTypeCallEntry call, P data) {
super.visitDelegationToSuperCallSpecifier(call, data); super.visitSuperTypeCallEntry(call, data);
} }
public void visitDelegationToSuperClassSpecifierVoid(@NotNull KtDelegatorToSuperClass specifier, P data) { public void visitSuperTypeEntryVoid(@NotNull KtSuperTypeEntry specifier, P data) {
super.visitDelegationToSuperClassSpecifier(specifier, 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); super.visitConstructorDelegationCall(call, data);
} }
@@ -242,8 +242,8 @@ public class KtVisitorVoidWithParameter<P> extends KtVisitor<Void, P> {
super.visitDoWhileExpression(expression, data); super.visitDoWhileExpression(expression, data);
} }
public void visitFunctionLiteralExpressionVoid(@NotNull KtFunctionLiteralExpression expression, P data) { public void visitLambdaExpressionVoid(@NotNull KtLambdaExpression expression, P data) {
super.visitFunctionLiteralExpression(expression, data); super.visitLambdaExpression(expression, data);
} }
public void visitAnnotatedExpressionVoid(@NotNull KtAnnotatedExpression expression, P data) { public void visitAnnotatedExpressionVoid(@NotNull KtAnnotatedExpression expression, P data) {
@@ -460,14 +460,14 @@ public class KtVisitorVoidWithParameter<P> extends KtVisitor<Void, P> {
} }
@Override @Override
public final Void visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, P data) { public final Void visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, P data) {
visitMultiDeclarationVoid(multiDeclaration, data); visitDestructuringDeclarationVoid(multiDeclaration, data);
return null; return null;
} }
@Override @Override
public final Void visitMultiDeclarationEntry(@NotNull KtMultiDeclarationEntry multiDeclarationEntry, P data) { public final Void visitDestructuringDeclarationEntry(@NotNull KtDestructuringDeclarationEntry multiDeclarationEntry, P data) {
visitMultiDeclarationEntryVoid(multiDeclarationEntry, data); visitDestructuringDeclarationEntryVoid(multiDeclarationEntry, data);
return null; return null;
} }
@@ -556,40 +556,40 @@ public class KtVisitorVoidWithParameter<P> extends KtVisitor<Void, P> {
} }
@Override @Override
public final Void visitDelegationSpecifierList(@NotNull KtDelegationSpecifierList list, P data) { public final Void visitSuperTypeList(@NotNull KtSuperTypeList list, P data) {
visitDelegationSpecifierListVoid(list, data); visitSuperTypeListVoid(list, data);
return null; return null;
} }
@Override @Override
public final Void visitDelegationSpecifier(@NotNull KtDelegationSpecifier specifier, P data) { public final Void visitSuperTypeListEntry(@NotNull KtSuperTypeListEntry specifier, P data) {
visitDelegationSpecifierVoid(specifier, data); visitSuperTypeListEntryVoid(specifier, data);
return null; return null;
} }
@Override @Override
public final Void visitDelegationByExpressionSpecifier( public final Void visitDelegatedSuperTypeEntry(
@NotNull KtDelegatorByExpressionSpecifier specifier, P data @NotNull KtDelegatedSuperTypeEntry specifier, P data
) { ) {
visitDelegationByExpressionSpecifierVoid(specifier, data); visitDelegatedSuperTypeEntryVoid(specifier, data);
return null; return null;
} }
@Override @Override
public final Void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call, P data) { public final Void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call, P data) {
visitDelegationToSuperCallSpecifierVoid(call, data); visitSuperTypeCallEntryVoid(call, data);
return null; return null;
} }
@Override @Override
public final Void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier, P data) { public final Void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier, P data) {
visitDelegationToSuperClassSpecifierVoid(specifier, data); visitSuperTypeEntryVoid(specifier, data);
return null; return null;
} }
@Override @Override
public final Void visitConstructorDelegationCall(@NotNull KtConstructorDelegationCall call, P data) { public final Void visitConstructorDelegationCall(@NotNull KtConstructorDelegationCall call, P data) {
visitDelegationCallVoid(call, data); visitConstructorDelegationCallVoid(call, data);
return null; return null;
} }
@@ -744,8 +744,8 @@ public class KtVisitorVoidWithParameter<P> extends KtVisitor<Void, P> {
} }
@Override @Override
public final Void visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression, P data) { public final Void visitLambdaExpression(@NotNull KtLambdaExpression expression, P data) {
visitFunctionLiteralExpressionVoid(expression, data); visitLambdaExpressionVoid(expression, data);
return null; return null;
} }
@@ -36,8 +36,8 @@ public interface ValueArgument {
public fun isExternal(): Boolean public fun isExternal(): Boolean
} }
public interface FunctionLiteralArgument : ValueArgument { public interface LambdaArgument : ValueArgument {
public fun getFunctionLiteral(): KtFunctionLiteralExpression public fun getLambdaExpression(): KtLambdaExpression
override fun getArgumentExpression(): KtExpression override fun getArgumentExpression(): KtExpression
} }
@@ -164,7 +164,7 @@ public fun <TElement : KtElement> createByPattern(pattern: String, vararg args:
for ((pointer, n) in pointers) { for ((pointer, n) in pointers) {
var element = pointer.getElement()!! var element = pointer.getElement()!!
if (element is KtFunctionLiteral) { if (element is KtFunctionLiteral) {
element = element.getParent() as KtFunctionLiteralExpression element = element.getParent() as KtLambdaExpression
} }
(argumentTypes[n] as PsiElementPlaceholderArgumentType<in Any, in PsiElement>).replacePlaceholderElement(element, args[n]) (argumentTypes[n] as PsiElementPlaceholderArgumentType<in Any, in PsiElement>).replacePlaceholderElement(element, args[n])
} }
@@ -232,7 +232,7 @@ public fun StubBasedPsiElementBase<out KotlinClassOrObjectStub<out KtClassOrObje
return stub.getSuperNames() return stub.getSuperNames()
} }
val specifiers = (this as KtClassOrObject).getDelegationSpecifiers() val specifiers = (this as KtClassOrObject).getSuperTypeListEntries()
if (specifiers.isEmpty()) return Collections.emptyList<String>() if (specifiers.isEmpty()) return Collections.emptyList<String>()
val result = ArrayList<String>() val result = ArrayList<String>()
@@ -351,11 +351,11 @@ public fun KtSimpleNameExpression.isPackageDirectiveExpression(): Boolean {
return parent is KtPackageDirective || parent?.getParent() is KtPackageDirective return parent is KtPackageDirective || parent?.getParent() is KtPackageDirective
} }
public fun KtExpression.isFunctionLiteralOutsideParentheses(): Boolean { public fun KtExpression.isLambdaOutsideParentheses(): Boolean {
val parent = getParent() val parent = getParent()
return when (parent) { return when (parent) {
is KtFunctionLiteralArgument -> true is KtLambdaArgument -> true
is KtLabeledExpression -> parent.isFunctionLiteralOutsideParentheses() is KtLabeledExpression -> parent.isLambdaOutsideParentheses()
else -> false 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 callExpression = getParent() as KtCallExpression
val resolvedCall = callExpression.getResolvedCall(bindingContext) val resolvedCall = callExpression.getResolvedCall(bindingContext)
return (resolvedCall?.getArgumentMapping(this) as? ArgumentMatch)?.valueParameter?.getName() return (resolvedCall?.getArgumentMapping(this) as? ArgumentMatch)?.valueParameter?.getName()
@@ -100,19 +100,19 @@ public interface KtStubElementTypes {
KtPlaceHolderStubElementType<KtTypeArgumentList> TYPE_ARGUMENT_LIST = KtPlaceHolderStubElementType<KtTypeArgumentList> TYPE_ARGUMENT_LIST =
new KtPlaceHolderStubElementType<KtTypeArgumentList>("TYPE_ARGUMENT_LIST", KtTypeArgumentList.class); new KtPlaceHolderStubElementType<KtTypeArgumentList>("TYPE_ARGUMENT_LIST", KtTypeArgumentList.class);
KtPlaceHolderStubElementType<KtDelegationSpecifierList> DELEGATION_SPECIFIER_LIST = KtPlaceHolderStubElementType<KtSuperTypeList> SUPER_TYPE_LIST =
new KtPlaceHolderStubElementType<KtDelegationSpecifierList>("DELEGATION_SPECIFIER_LIST", KtDelegationSpecifierList.class); new KtPlaceHolderStubElementType<KtSuperTypeList>("SUPER_TYPE_LIST", KtSuperTypeList.class);
KtPlaceHolderStubElementType<KtInitializerList> INITIALIZER_LIST = KtPlaceHolderStubElementType<KtInitializerList> INITIALIZER_LIST =
new KtPlaceHolderStubElementType<KtInitializerList>("INITIALIZER_LIST", KtInitializerList.class); new KtPlaceHolderStubElementType<KtInitializerList>("INITIALIZER_LIST", KtInitializerList.class);
KtPlaceHolderStubElementType<KtDelegatorByExpressionSpecifier> DELEGATOR_BY = KtPlaceHolderStubElementType<KtDelegatedSuperTypeEntry> DELEGATED_SUPER_TYPE_ENTRY =
new KtPlaceHolderStubElementType<KtDelegatorByExpressionSpecifier>("DELEGATOR_BY", KtDelegatorByExpressionSpecifier.class); new KtPlaceHolderStubElementType<KtDelegatedSuperTypeEntry>("DELEGATED_SUPER_TYPE_ENTRY", KtDelegatedSuperTypeEntry.class);
KtPlaceHolderStubElementType<KtDelegatorToSuperCall> DELEGATOR_SUPER_CALL = KtPlaceHolderStubElementType<KtSuperTypeCallEntry> SUPER_TYPE_CALL_ENTRY =
new KtPlaceHolderStubElementType<KtDelegatorToSuperCall>("DELEGATOR_SUPER_CALL", KtDelegatorToSuperCall.class); new KtPlaceHolderStubElementType<KtSuperTypeCallEntry>("SUPER_TYPE_CALL_ENTRY", KtSuperTypeCallEntry.class);
KtPlaceHolderStubElementType<KtDelegatorToSuperClass> DELEGATOR_SUPER_CLASS = KtPlaceHolderStubElementType<KtSuperTypeEntry> SUPER_TYPE_ENTRY =
new KtPlaceHolderStubElementType<KtDelegatorToSuperClass>("DELEGATOR_SUPER_CLASS", KtDelegatorToSuperClass.class); new KtPlaceHolderStubElementType<KtSuperTypeEntry>("SUPER_TYPE_ENTRY", KtSuperTypeEntry.class);
KtPlaceHolderStubElementType<KtConstructorCalleeExpression> CONSTRUCTOR_CALLEE = KtPlaceHolderStubElementType<KtConstructorCalleeExpression> CONSTRUCTOR_CALLEE =
new KtPlaceHolderStubElementType<KtConstructorCalleeExpression>("CONSTRUCTOR_CALLEE", KtConstructorCalleeExpression.class); new KtPlaceHolderStubElementType<KtConstructorCalleeExpression>("CONSTRUCTOR_CALLEE", KtConstructorCalleeExpression.class);
@@ -121,7 +121,7 @@ public interface KtStubElementTypes {
TokenSet DECLARATION_TYPES = TokenSet DECLARATION_TYPES =
TokenSet.create(CLASS, OBJECT_DECLARATION, FUNCTION, PROPERTY, CLASS_INITIALIZER, SECONDARY_CONSTRUCTOR, ENUM_ENTRY); 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); TokenSet TYPE_ELEMENT_TYPES = TokenSet.create(USER_TYPE, NULLABLE_TYPE, FUNCTION_TYPE, DYNAMIC_TYPE, SELF_TYPE);
@@ -67,7 +67,7 @@ public class AnnotationChecker(private val additionalCheckers: Iterable<Addition
public fun checkExpression(expression: KtExpression, trace: BindingTrace) { public fun checkExpression(expression: KtExpression, trace: BindingTrace) {
checkEntries(expression.getAnnotationEntries(), getActualTargetList(expression, null), trace) checkEntries(expression.getAnnotationEntries(), getActualTargetList(expression, null), trace)
if (expression is KtFunctionLiteralExpression) { if (expression is KtLambdaExpression) {
for (parameter in expression.valueParameters) { for (parameter in expression.valueParameters) {
parameter.typeReference?.let { check(it, trace) } parameter.typeReference?.let { check(it, trace) }
} }
@@ -112,7 +112,7 @@ public class AnnotationChecker(private val additionalCheckers: Iterable<Addition
val retention = descriptor.type.constructor.declarationDescriptor?.getAnnotationRetention() val retention = descriptor.type.constructor.declarationDescriptor?.getAnnotationRetention()
if (retention == KotlinRetention.SOURCE) return if (retention == KotlinRetention.SOURCE) return
val functionLiteralExpression = annotatedExpression.baseExpression as? KtFunctionLiteralExpression ?: return val functionLiteralExpression = annotatedExpression.baseExpression as? KtLambdaExpression ?: return
if (InlineUtil.isInlinedArgument(functionLiteralExpression.functionLiteral, trace.bindingContext, false)) { if (InlineUtil.isInlinedArgument(functionLiteralExpression.functionLiteral, trace.bindingContext, false)) {
trace.report(Errors.NON_SOURCE_ANNOTATION_ON_INLINED_LAMBDA_EXPRESSION.on(entry)) trace.report(Errors.NON_SOURCE_ANNOTATION_ON_INLINED_LAMBDA_EXPRESSION.on(entry))
} }
@@ -170,7 +170,7 @@ public class AnnotationChecker(private val additionalCheckers: Iterable<Addition
return when (annotated) { return when (annotated) {
is KtClassOrObject -> is KtClassOrObject ->
(descriptor as? ClassDescriptor)?.let { TargetList(KotlinTarget.classActualTargets(it)) } ?: TargetLists.T_CLASSIFIER (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 -> { is KtProperty -> {
if (annotated.isLocal) if (annotated.isLocal)
TargetLists.T_LOCAL_VARIABLE TargetLists.T_LOCAL_VARIABLE
@@ -203,8 +203,8 @@ public class AnnotationChecker(private val additionalCheckers: Iterable<Addition
is KtTypeProjection -> is KtTypeProjection ->
if (annotated.projectionKind == KtProjectionKind.STAR) TargetLists.T_STAR_PROJECTION else TargetLists.T_TYPE_PROJECTION if (annotated.projectionKind == KtProjectionKind.STAR) TargetLists.T_STAR_PROJECTION else TargetLists.T_TYPE_PROJECTION
is KtAnonymousInitializer -> TargetLists.T_INITIALIZER is KtAnonymousInitializer -> TargetLists.T_INITIALIZER
is KtMultiDeclaration -> TargetLists.T_DESTRUCTURING_DECLARATION is KtDestructuringDeclaration -> TargetLists.T_DESTRUCTURING_DECLARATION
is KtFunctionLiteralExpression -> TargetLists.T_FUNCTION_LITERAL is KtLambdaExpression -> TargetLists.T_FUNCTION_LITERAL
is KtObjectLiteralExpression -> TargetLists.T_OBJECT_LITERAL is KtObjectLiteralExpression -> TargetLists.T_OBJECT_LITERAL
is KtExpression -> TargetLists.T_EXPRESSION is KtExpression -> TargetLists.T_EXPRESSION
else -> TargetLists.EMPTY else -> TargetLists.EMPTY
@@ -125,7 +125,7 @@ public interface BindingContext {
WritableSlice<PropertyDescriptor, ResolvedCall<FunctionDescriptor>> DELEGATED_PROPERTY_PD_RESOLVED_CALL = Slices.createSimpleSlice(); WritableSlice<PropertyDescriptor, ResolvedCall<FunctionDescriptor>> DELEGATED_PROPERTY_PD_RESOLVED_CALL = Slices.createSimpleSlice();
WritableSlice<KtMultiDeclarationEntry, ResolvedCall<FunctionDescriptor>> COMPONENT_RESOLVED_CALL = Slices.createSimpleSlice(); WritableSlice<KtDestructuringDeclarationEntry, ResolvedCall<FunctionDescriptor>> COMPONENT_RESOLVED_CALL = Slices.createSimpleSlice();
WritableSlice<KtExpression, ResolvedCall<FunctionDescriptor>> INDEXED_LVALUE_GET = Slices.createSimpleSlice(); WritableSlice<KtExpression, ResolvedCall<FunctionDescriptor>> INDEXED_LVALUE_GET = Slices.createSimpleSlice();
WritableSlice<KtExpression, ResolvedCall<FunctionDescriptor>> INDEXED_LVALUE_SET = Slices.createSimpleSlice(); WritableSlice<KtExpression, ResolvedCall<FunctionDescriptor>> INDEXED_LVALUE_SET = Slices.createSimpleSlice();
@@ -189,9 +189,9 @@ public interface BindingContext {
}; };
WritableSlice<PropertyDescriptor, Boolean> IS_UNINITIALIZED = Slices.createSimpleSetSlice(); WritableSlice<PropertyDescriptor, Boolean> IS_UNINITIALIZED = Slices.createSimpleSetSlice();
WritableSlice<KtFunctionLiteralExpression, Boolean> BLOCK = new Slices.SetSlice<KtFunctionLiteralExpression>(DO_NOTHING) { WritableSlice<KtLambdaExpression, Boolean> BLOCK = new Slices.SetSlice<KtLambdaExpression>(DO_NOTHING) {
@Override @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; isBlock = valueNotFound ? false : isBlock;
return isBlock && !expression.getFunctionLiteral().hasParameterSpecification(); return isBlock && !expression.getFunctionLiteral().hasParameterSpecification();
} }
@@ -98,7 +98,7 @@ public class BodyResolver {
} }
private void resolveBehaviorDeclarationBodies(@NotNull BodiesResolveContext c) { private void resolveBehaviorDeclarationBodies(@NotNull BodiesResolveContext c) {
resolveDelegationSpecifierLists(c); resolveSuperTypeEntryLists(c);
resolvePropertyDeclarationBodies(c); resolvePropertyDeclarationBodies(c);
@@ -231,20 +231,20 @@ public class BodyResolver {
functionAnalyzerExtension.process(c); 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 // TODO : Make sure the same thing is not initialized twice
for (Map.Entry<KtClassOrObject, ClassDescriptorWithResolutionScopes> entry : c.getDeclaredClasses().entrySet()) { for (Map.Entry<KtClassOrObject, ClassDescriptorWithResolutionScopes> entry : c.getDeclaredClasses().entrySet()) {
KtClassOrObject classOrObject = entry.getKey(); KtClassOrObject classOrObject = entry.getKey();
ClassDescriptorWithResolutionScopes descriptor = entry.getValue(); ClassDescriptorWithResolutionScopes descriptor = entry.getValue();
resolveDelegationSpecifierList(c.getOuterDataFlowInfo(), classOrObject, descriptor, resolveSuperTypeEntryList(c.getOuterDataFlowInfo(), classOrObject, descriptor,
descriptor.getUnsubstitutedPrimaryConstructor(), descriptor.getUnsubstitutedPrimaryConstructor(),
descriptor.getScopeForConstructorHeaderResolution(), descriptor.getScopeForConstructorHeaderResolution(),
descriptor.getScopeForMemberDeclarationResolution()); descriptor.getScopeForMemberDeclarationResolution());
} }
} }
public void resolveDelegationSpecifierList( public void resolveSuperTypeEntryList(
@NotNull final DataFlowInfo outerDataFlowInfo, @NotNull final DataFlowInfo outerDataFlowInfo,
@NotNull KtClassOrObject jetClass, @NotNull KtClassOrObject jetClass,
@NotNull final ClassDescriptor descriptor, @NotNull final ClassDescriptor descriptor,
@@ -267,7 +267,7 @@ public class BodyResolver {
} }
@Override @Override
public void visitDelegationByExpressionSpecifier(@NotNull KtDelegatorByExpressionSpecifier specifier) { public void visitDelegatedSuperTypeEntry(@NotNull KtDelegatedSuperTypeEntry specifier) {
if (descriptor.getKind() == ClassKind.INTERFACE) { if (descriptor.getKind() == ClassKind.INTERFACE) {
trace.report(DELEGATION_IN_INTERFACE.on(specifier)); trace.report(DELEGATION_IN_INTERFACE.on(specifier));
} }
@@ -294,7 +294,7 @@ public class BodyResolver {
} }
@Override @Override
public void visitDelegationToSuperCallSpecifier(@NotNull KtDelegatorToSuperCall call) { public void visitSuperTypeCallEntry(@NotNull KtSuperTypeCallEntry call) {
KtValueArgumentList valueArgumentList = call.getValueArgumentList(); KtValueArgumentList valueArgumentList = call.getValueArgumentList();
PsiElement elementToMark = valueArgumentList == null ? call : valueArgumentList; PsiElement elementToMark = valueArgumentList == null ? call : valueArgumentList;
if (descriptor.getKind() == ClassKind.INTERFACE) { if (descriptor.getKind() == ClassKind.INTERFACE) {
@@ -336,7 +336,7 @@ public class BodyResolver {
} }
@Override @Override
public void visitDelegationToSuperClassSpecifier(@NotNull KtDelegatorToSuperClass specifier) { public void visitSuperTypeEntry(@NotNull KtSuperTypeEntry specifier) {
KtTypeReference typeReference = specifier.getTypeReference(); KtTypeReference typeReference = specifier.getTypeReference();
KotlinType supertype = trace.getBindingContext().get(BindingContext.TYPE, typeReference); KotlinType supertype = trace.getBindingContext().get(BindingContext.TYPE, typeReference);
recordSupertype(typeReference, supertype); recordSupertype(typeReference, supertype);
@@ -363,12 +363,12 @@ public class BodyResolver {
} }
}; };
for (KtDelegationSpecifier delegationSpecifier : jetClass.getDelegationSpecifiers()) { for (KtSuperTypeListEntry delegationSpecifier : jetClass.getSuperTypeListEntries()) {
delegationSpecifier.accept(visitor); delegationSpecifier.accept(visitor);
} }
if (DescriptorUtils.isAnnotationClass(descriptor) && jetClass.getDelegationSpecifierList() != null) { if (DescriptorUtils.isAnnotationClass(descriptor) && jetClass.getSuperTypeList() != null) {
trace.report(SUPERTYPES_FOR_ANNOTATION_CLASS.on(jetClass.getDelegationSpecifierList())); trace.report(SUPERTYPES_FOR_ANNOTATION_CLASS.on(jetClass.getSuperTypeList()));
} }
if (primaryConstructorDelegationCall[0] != null && primaryConstructor != null) { if (primaryConstructorDelegationCall[0] != null && primaryConstructor != null) {
@@ -149,7 +149,7 @@ class DeclarationsChecker(
private fun checkTypesInClassHeader(classOrObject: KtClassOrObject) { private fun checkTypesInClassHeader(classOrObject: KtClassOrObject) {
fun KtTypeReference.type(): KotlinType? = trace.bindingContext.get(TYPE, this) fun KtTypeReference.type(): KotlinType? = trace.bindingContext.get(TYPE, this)
for (delegationSpecifier in classOrObject.getDelegationSpecifiers()) { for (delegationSpecifier in classOrObject.getSuperTypeListEntries()) {
val typeReference = delegationSpecifier.typeReference ?: continue val typeReference = delegationSpecifier.typeReference ?: continue
typeReference.type()?.let { DescriptorResolver.checkBounds(typeReference, it, trace) } typeReference.type()?.let { DescriptorResolver.checkBounds(typeReference, it, trace) }
typeReference.checkNotEnumEntry(trace) typeReference.checkNotEnumEntry(trace)
@@ -212,7 +212,7 @@ class DeclarationsChecker(
val containingDeclaration = typeParameterDescriptor.containingDeclaration as? ClassDescriptor val containingDeclaration = typeParameterDescriptor.containingDeclaration as? ClassDescriptor
?: throw AssertionError("Not a class descriptor: " + typeParameterDescriptor.containingDeclaration) ?: throw AssertionError("Not a class descriptor: " + typeParameterDescriptor.containingDeclaration)
if (sourceElement is KtClassOrObject) { if (sourceElement is KtClassOrObject) {
val delegationSpecifierList = sourceElement.getDelegationSpecifierList() ?: continue val delegationSpecifierList = sourceElement.getSuperTypeList() ?: continue
trace.report(INCONSISTENT_TYPE_PARAMETER_VALUES.on( trace.report(INCONSISTENT_TYPE_PARAMETER_VALUES.on(
delegationSpecifierList, typeParameterDescriptor, containingDeclaration, conflictingTypes delegationSpecifierList, typeParameterDescriptor, containingDeclaration, conflictingTypes
)) ))
@@ -252,7 +252,7 @@ class DeclarationsChecker(
private fun checkExposedSupertypes(klass: KtClassOrObject, classDescriptor: ClassDescriptor) { private fun checkExposedSupertypes(klass: KtClassOrObject, classDescriptor: ClassDescriptor) {
val classVisibility = classDescriptor.effectiveVisibility() val classVisibility = classDescriptor.effectiveVisibility()
val isInterface = classDescriptor.kind == ClassKind.INTERFACE val isInterface = classDescriptor.kind == ClassKind.INTERFACE
val delegationList = klass.getDelegationSpecifiers() val delegationList = klass.getSuperTypeListEntries()
classDescriptor.typeConstructor.supertypes.forEachIndexed { i, superType -> classDescriptor.typeConstructor.supertypes.forEachIndexed { i, superType ->
if (i >= delegationList.size) return if (i >= delegationList.size) return
val superDescriptor = TypeUtils.getClassDescriptor(superType) ?: return@forEachIndexed val superDescriptor = TypeUtils.getClassDescriptor(superType) ?: return@forEachIndexed
@@ -20,7 +20,7 @@ import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.DELEGATION import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.DELEGATION
import org.jetbrains.kotlin.diagnostics.Errors.MANY_IMPL_MEMBER_NOT_IMPLEMENTED import org.jetbrains.kotlin.diagnostics.Errors.MANY_IMPL_MEMBER_NOT_IMPLEMENTED
import org.jetbrains.kotlin.psi.KtClassOrObject 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.psi.KtTypeReference
import org.jetbrains.kotlin.resolve.OverridingUtil.OverrideCompatibilityInfo.Result.OVERRIDABLE import org.jetbrains.kotlin.resolve.OverridingUtil.OverrideCompatibilityInfo.Result.OVERRIDABLE
import org.jetbrains.kotlin.types.KotlinType import org.jetbrains.kotlin.types.KotlinType
@@ -37,8 +37,8 @@ class DelegationResolver<T : CallableMemberDescriptor> private constructor(
private fun generateDelegatedMembers(): Collection<T> { private fun generateDelegatedMembers(): Collection<T> {
val delegatedMembers = hashSetOf<T>() val delegatedMembers = hashSetOf<T>()
for (delegationSpecifier in classOrObject.getDelegationSpecifiers()) { for (delegationSpecifier in classOrObject.getSuperTypeListEntries()) {
if (delegationSpecifier !is KtDelegatorByExpressionSpecifier) { if (delegationSpecifier !is KtDelegatedSuperTypeEntry) {
continue continue
} }
val typeReference = delegationSpecifier.typeReference ?: continue val typeReference = delegationSpecifier.typeReference ?: continue
@@ -109,8 +109,8 @@ public class DescriptorResolver {
BindingTrace trace BindingTrace trace
) { ) {
List<KotlinType> supertypes = Lists.newArrayList(); List<KotlinType> supertypes = Lists.newArrayList();
List<KtDelegationSpecifier> delegationSpecifiers = jetClass.getDelegationSpecifiers(); List<KtSuperTypeListEntry> delegationSpecifiers = jetClass.getSuperTypeListEntries();
Collection<KotlinType> declaredSupertypes = resolveDelegationSpecifiers( Collection<KotlinType> declaredSupertypes = resolveSuperTypeListEntries(
scope, scope,
delegationSpecifiers, delegationSpecifiers,
typeResolver, trace, false); typeResolver, trace, false);
@@ -166,9 +166,9 @@ public class DescriptorResolver {
return builtIns.getAnyType(); return builtIns.getAnyType();
} }
public Collection<KotlinType> resolveDelegationSpecifiers( public Collection<KotlinType> resolveSuperTypeListEntries(
LexicalScope extensibleScope, LexicalScope extensibleScope,
List<KtDelegationSpecifier> delegationSpecifiers, List<KtSuperTypeListEntry> delegationSpecifiers,
@NotNull TypeResolver resolver, @NotNull TypeResolver resolver,
BindingTrace trace, BindingTrace trace,
boolean checkBounds boolean checkBounds
@@ -177,7 +177,7 @@ public class DescriptorResolver {
return Collections.emptyList(); return Collections.emptyList();
} }
Collection<KotlinType> result = Lists.newArrayList(); Collection<KotlinType> result = Lists.newArrayList();
for (KtDelegationSpecifier delegationSpecifier : delegationSpecifiers) { for (KtSuperTypeListEntry delegationSpecifier : delegationSpecifiers) {
KtTypeReference typeReference = delegationSpecifier.getTypeReference(); KtTypeReference typeReference = delegationSpecifier.getTypeReference();
if (typeReference != null) { if (typeReference != null) {
KotlinType supertype = resolver.resolveType(extensibleScope, typeReference, trace, checkBounds); KotlinType supertype = resolver.resolveType(extensibleScope, typeReference, trace, checkBounds);
@@ -19,7 +19,6 @@ package org.jetbrains.kotlin.resolve
import com.google.common.collect.HashMultimap import com.google.common.collect.HashMultimap
import com.google.common.collect.Multimap import com.google.common.collect.Multimap
import com.intellij.psi.PsiElement import com.intellij.psi.PsiElement
import com.intellij.psi.util.PsiTreeUtil
import org.jetbrains.kotlin.descriptors.* import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.diagnostics.Errors.* import org.jetbrains.kotlin.diagnostics.Errors.*
import org.jetbrains.kotlin.incremental.KotlinLookupLocation import org.jetbrains.kotlin.incremental.KotlinLookupLocation
@@ -163,7 +162,7 @@ public class LazyTopDownAnalyzer(
trace.report(UNSUPPORTED.on(typedef, "Typedefs are not supported")) 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 // Ignore: multi-declarations are only allowed locally
} }
@@ -192,10 +192,10 @@ public class ModifiersChecker {
checkModifierListCommon(modifierListOwner, descriptor); checkModifierListCommon(modifierListOwner, descriptor);
} }
public void checkModifiersForMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration) { public void checkModifiersForDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration) {
annotationChecker.check(multiDeclaration, trace, null); annotationChecker.check(multiDeclaration, trace, null);
ModifierCheckerCore.INSTANCE.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); annotationChecker.check(multiEntry, trace, null);
ModifierCheckerCore.INSTANCE.check(multiEntry, trace, null); ModifierCheckerCore.INSTANCE.check(multiEntry, trace, null);
UnderscoreChecker.INSTANCE.checkNamed(multiEntry, trace); UnderscoreChecker.INSTANCE.checkNamed(multiEntry, trace);
@@ -57,7 +57,7 @@ class VarianceChecker(private val trace: BindingTrace) {
private fun checkClasses(c: TopDownAnalysisContext) { private fun checkClasses(c: TopDownAnalysisContext) {
for (jetClassOrObject in c.getDeclaredClasses()!!.keySet()) { for (jetClassOrObject in c.getDeclaredClasses()!!.keySet()) {
if (jetClassOrObject is KtClass) { if (jetClassOrObject is KtClass) {
for (specifier in jetClassOrObject.getDelegationSpecifiers()) { for (specifier in jetClassOrObject.getSuperTypeListEntries()) {
specifier.getTypeReference()?.checkTypePosition(trace.getBindingContext(), OUT_VARIANCE, trace) specifier.getTypeReference()?.checkTypePosition(trace.getBindingContext(), OUT_VARIANCE, trace)
} }
jetClassOrObject.checkTypeParameters(trace.getBindingContext(), OUT_VARIANCE, trace) jetClassOrObject.checkTypeParameters(trace.getBindingContext(), OUT_VARIANCE, trace)
@@ -30,22 +30,15 @@ import org.jetbrains.kotlin.resolve.TemporaryBindingTrace;
import org.jetbrains.kotlin.resolve.TypeResolver; import org.jetbrains.kotlin.resolve.TypeResolver;
import org.jetbrains.kotlin.resolve.callableReferences.CallableReferencesResolutionUtilsKt; import org.jetbrains.kotlin.resolve.callableReferences.CallableReferencesResolutionUtilsKt;
import org.jetbrains.kotlin.resolve.calls.callResolverUtil.ResolveArgumentsMode; 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.CallResolutionContext;
import org.jetbrains.kotlin.resolve.calls.context.CheckArgumentTypesMode; import org.jetbrains.kotlin.resolve.calls.context.CheckArgumentTypesMode;
import org.jetbrains.kotlin.resolve.calls.context.ResolutionContext; import org.jetbrains.kotlin.resolve.calls.context.ResolutionContext;
import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderImplKt; import org.jetbrains.kotlin.resolve.calls.inference.ConstraintSystemBuilderImplKt;
import org.jetbrains.kotlin.resolve.calls.model.MutableDataFlowInfoForArguments; import org.jetbrains.kotlin.resolve.calls.model.MutableDataFlowInfoForArguments;
import org.jetbrains.kotlin.resolve.calls.results.OverloadResolutionResults; 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.IntegerValueTypeConstructor;
import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator; import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator;
import org.jetbrains.kotlin.resolve.scopes.LexicalScope; 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.FunctionPlaceholders;
import org.jetbrains.kotlin.types.FunctionPlaceholdersKt; import org.jetbrains.kotlin.types.FunctionPlaceholdersKt;
import org.jetbrains.kotlin.types.KotlinType; import org.jetbrains.kotlin.types.KotlinType;
@@ -117,7 +110,7 @@ public class ArgumentTypeResolver {
for (ValueArgument valueArgument : context.call.getValueArguments()) { for (ValueArgument valueArgument : context.call.getValueArguments()) {
KtExpression argumentExpression = valueArgument.getArgumentExpression(); KtExpression argumentExpression = valueArgument.getArgumentExpression();
if (argumentExpression != null && !(argumentExpression instanceof KtFunctionLiteralExpression)) { if (argumentExpression != null && !(argumentExpression instanceof KtLambdaExpression)) {
checkArgumentTypeWithNoCallee(context, argumentExpression); checkArgumentTypeWithNoCallee(context, argumentExpression);
} }
} }
@@ -173,8 +166,8 @@ public class ArgumentTypeResolver {
@NotNull KtExpression expression, @NotNull ResolutionContext context @NotNull KtExpression expression, @NotNull ResolutionContext context
) { ) {
KtExpression deparenthesizedExpression = getLastElementDeparenthesized(expression, context.statementFilter); KtExpression deparenthesizedExpression = getLastElementDeparenthesized(expression, context.statementFilter);
if (deparenthesizedExpression instanceof KtFunctionLiteralExpression) { if (deparenthesizedExpression instanceof KtLambdaExpression) {
return ((KtFunctionLiteralExpression) deparenthesizedExpression).getFunctionLiteral(); return ((KtLambdaExpression) deparenthesizedExpression).getFunctionLiteral();
} }
if (deparenthesizedExpression instanceof KtFunction) { if (deparenthesizedExpression instanceof KtFunction) {
return (KtFunction) deparenthesizedExpression; return (KtFunction) deparenthesizedExpression;
@@ -24,7 +24,6 @@ import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.builtins.KotlinBuiltIns; import org.jetbrains.kotlin.builtins.KotlinBuiltIns;
import org.jetbrains.kotlin.descriptors.*; import org.jetbrains.kotlin.descriptors.*;
import org.jetbrains.kotlin.lexer.KtTokens;
import org.jetbrains.kotlin.psi.*; import org.jetbrains.kotlin.psi.*;
import org.jetbrains.kotlin.resolve.*; import org.jetbrains.kotlin.resolve.*;
import org.jetbrains.kotlin.resolve.bindingContextUtil.BindingContextUtilsKt; import org.jetbrains.kotlin.resolve.bindingContextUtil.BindingContextUtilsKt;
@@ -222,7 +221,7 @@ public class CallExpressionResolver {
if (result[0]) { if (result[0]) {
FunctionDescriptor functionDescriptor = resolvedCall != null ? resolvedCall.getResultingDescriptor() : null; FunctionDescriptor functionDescriptor = resolvedCall != null ? resolvedCall.getResultingDescriptor() : null;
temporaryForFunction.commit(); temporaryForFunction.commit();
if (callExpression.getValueArgumentList() == null && callExpression.getFunctionLiteralArguments().isEmpty()) { if (callExpression.getValueArgumentList() == null && callExpression.getLambdaArguments().isEmpty()) {
// there are only type arguments // there are only type arguments
boolean hasValueParameters = functionDescriptor == null || functionDescriptor.getValueParameters().size() > 0; boolean hasValueParameters = functionDescriptor == null || functionDescriptor.getValueParameters().size() > 0;
context.trace.report(FUNCTION_CALL_EXPECTED.on(callExpression, callExpression, hasValueParameters)); context.trace.report(FUNCTION_CALL_EXPECTED.on(callExpression, callExpression, hasValueParameters));
@@ -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) // 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; KotlinType expectedType = NO_EXPECTED_TYPE;
if (calleeExpression instanceof KtFunctionLiteralExpression) { if (calleeExpression instanceof KtLambdaExpression) {
int parameterNumber = ((KtFunctionLiteralExpression) calleeExpression).getValueParameters().size(); int parameterNumber = ((KtLambdaExpression) calleeExpression).getValueParameters().size();
List<KotlinType> parameterTypes = new ArrayList<KotlinType>(parameterNumber); List<KotlinType> parameterTypes = new ArrayList<KotlinType>(parameterNumber);
for (int i = 0; i < parameterNumber; i++) { for (int i = 0; i < parameterNumber; i++) {
parameterTypes.add(NO_EXPECTED_TYPE); parameterTypes.add(NO_EXPECTED_TYPE);
@@ -117,7 +117,7 @@ public fun isOrOverridesSynthesized(descriptor: CallableMemberDescriptor): Boole
fun isConventionCall(call: Call): Boolean { fun isConventionCall(call: Call): Boolean {
if (call is CallTransformer.CallForImplicitInvoke) return true if (call is CallTransformer.CallForImplicitInvoke) return true
val callElement = call.callElement 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 val calleeExpression = call.calleeExpression as? KtOperationReferenceExpression ?: return false
return calleeExpression.getNameForConventionalOperation() != null return calleeExpression.getNameForConventionalOperation() != null
} }
@@ -113,7 +113,7 @@ public class CallTransformer<D extends CallableDescriptor, F extends D> {
@NotNull @NotNull
@Override @Override
public List<FunctionLiteralArgument> getFunctionLiteralArguments() { public List<LambdaArgument> getFunctionLiteralArguments() {
return Collections.emptyList(); return Collections.emptyList();
} }
@@ -256,10 +256,10 @@ public class ValueArgumentsToParametersMapper {
D candidate = candidateCall.getCandidateDescriptor(); D candidate = candidateCall.getCandidateDescriptor();
List<ValueParameterDescriptor> valueParameters = candidate.getValueParameters(); List<ValueParameterDescriptor> valueParameters = candidate.getValueParameters();
List<? extends FunctionLiteralArgument> functionLiteralArguments = call.getFunctionLiteralArguments(); List<? extends LambdaArgument> functionLiteralArguments = call.getFunctionLiteralArguments();
if (!functionLiteralArguments.isEmpty()) { if (!functionLiteralArguments.isEmpty()) {
FunctionLiteralArgument functionLiteralArgument = functionLiteralArguments.get(0); LambdaArgument lambdaArgument = functionLiteralArguments.get(0);
KtExpression possiblyLabeledFunctionLiteral = functionLiteralArgument.getArgumentExpression(); KtExpression possiblyLabeledFunctionLiteral = lambdaArgument.getArgumentExpression();
if (valueParameters.isEmpty()) { if (valueParameters.isEmpty()) {
report(TOO_MANY_ARGUMENTS.on(possiblyLabeledFunctionLiteral, candidate)); report(TOO_MANY_ARGUMENTS.on(possiblyLabeledFunctionLiteral, candidate));
@@ -277,7 +277,7 @@ public class ValueArgumentsToParametersMapper {
setStatus(WEAK_ERROR); setStatus(WEAK_ERROR);
} }
else { else {
putVararg(valueParameterDescriptor, functionLiteralArgument); putVararg(valueParameterDescriptor, lambdaArgument);
} }
} }
} }
@@ -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.diagnostics.Errors.UNRESOLVED_REFERENCE_WRONG_RECEIVER
import org.jetbrains.kotlin.psi.Call import org.jetbrains.kotlin.psi.Call
import org.jetbrains.kotlin.psi.KtConstructorDelegationCall 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.psi.KtSecondaryConstructor
import org.jetbrains.kotlin.resolve.BindingContext.CALL import org.jetbrains.kotlin.resolve.BindingContext.CALL
import org.jetbrains.kotlin.resolve.BindingContext.REFERENCE_TARGET import org.jetbrains.kotlin.resolve.BindingContext.REFERENCE_TARGET
@@ -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 funLiteral = funLiteralExpr.getFunctionLiteral()
val receiverType = funLiteral.getReceiverTypeReference()?.let { dynamicType } val receiverType = funLiteral.getReceiverTypeReference()?.let { dynamicType }
@@ -189,7 +189,7 @@ class DynamicCallableDescriptors(private val builtIns: KotlinBuiltIns) {
val argExpression = KtPsiUtil.deparenthesize(arg.getArgumentExpression()) val argExpression = KtPsiUtil.deparenthesize(arg.getArgumentExpression())
when { when {
argExpression is KtFunctionLiteralExpression -> { argExpression is KtLambdaExpression -> {
outType = getFunctionType(argExpression) outType = getFunctionType(argExpression)
varargElementType = null varargElementType = null
} }
@@ -210,7 +210,7 @@ class DynamicCallableDescriptors(private val builtIns: KotlinBuiltIns) {
if (hasSpreadOperator) { if (hasSpreadOperator) {
for (funLiteralArg in call.getFunctionLiteralArguments()) { for (funLiteralArg in call.getFunctionLiteralArguments()) {
addParameter(funLiteralArg, getFunctionType(funLiteralArg.getFunctionLiteral()), null) addParameter(funLiteralArg, getFunctionType(funLiteralArg.getLambdaExpression()), null)
} }
break break
@@ -164,7 +164,7 @@ public class CallMaker {
@NotNull @NotNull
@Override @Override
public List<FunctionLiteralArgument> getFunctionLiteralArguments() { public List<LambdaArgument> getFunctionLiteralArguments() {
return Collections.emptyList(); return Collections.emptyList();
} }
@NotNull @NotNull
@@ -304,8 +304,8 @@ public class CallMaker {
@Override @Override
@NotNull @NotNull
public List<? extends FunctionLiteralArgument> getFunctionLiteralArguments() { public List<? extends LambdaArgument> getFunctionLiteralArguments() {
return callElement.getFunctionLiteralArguments(); return callElement.getLambdaArguments();
} }
@Override @Override
@@ -73,7 +73,7 @@ public class DelegatingCall implements Call {
@Override @Override
@NotNull @NotNull
public List<? extends FunctionLiteralArgument> getFunctionLiteralArguments() { public List<? extends LambdaArgument> getFunctionLiteralArguments() {
return delegate.getFunctionLiteralArguments(); return delegate.getFunctionLiteralArguments();
} }
@@ -87,14 +87,14 @@ public fun KtCallElement.getValueArgumentsInParentheses(): List<ValueArgument> =
public fun Call.getValueArgumentListOrElement(): KtElement = getValueArgumentList() ?: getCalleeExpression() ?: getCallElement() public fun Call.getValueArgumentListOrElement(): KtElement = getValueArgumentList() ?: getCalleeExpression() ?: getCallElement()
@Suppress("UNCHECKED_CAST") @Suppress("UNCHECKED_CAST")
private fun List<ValueArgument?>.filterArgsInParentheses() = filter { it !is KtFunctionLiteralArgument } as List<ValueArgument> private fun List<ValueArgument?>.filterArgsInParentheses() = filter { it !is KtLambdaArgument } as List<ValueArgument>
public fun Call.getValueArgumentForExpression(expression: KtExpression): ValueArgument? { public fun Call.getValueArgumentForExpression(expression: KtExpression): ValueArgument? {
fun KtElement.deparenthesizeStructurally(): KtElement? { fun KtElement.deparenthesizeStructurally(): KtElement? {
val deparenthesized = if (this is KtExpression) KtPsiUtil.deparenthesizeOnce(this) else this val deparenthesized = if (this is KtExpression) KtPsiUtil.deparenthesizeOnce(this) else this
return when { return when {
deparenthesized != this -> deparenthesized deparenthesized != this -> deparenthesized
this is KtFunctionLiteralExpression -> this.getFunctionLiteral() this is KtLambdaExpression -> this.getFunctionLiteral()
this is KtFunctionLiteral -> this.getBodyExpression() this is KtFunctionLiteral -> this.getBodyExpression()
else -> null else -> null
} }
@@ -54,7 +54,7 @@ public abstract class AbstractPsiBasedDeclarationProvider(storageManager: Storag
val scriptInfo = JetScriptInfo(declaration) val scriptInfo = JetScriptInfo(declaration)
classesAndObjects.put(scriptInfo.script.nameAsName, scriptInfo) 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 // Do nothing, just put it into allDeclarations is enough
} }
else { else {
@@ -159,7 +159,7 @@ protected constructor(
result.addAll(classDescriptors(name)) 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. // Do nothing for typedefs as they are not supported.
// MultiDeclarations are not supported on global level too. // MultiDeclarations are not supported on global level too.
} }
@@ -641,7 +641,7 @@ public class LazyClassDescriptor extends ClassDescriptorBase implements ClassDes
PsiElement elementToMark = null; PsiElement elementToMark = null;
if (psiElement instanceof KtClassOrObject) { if (psiElement instanceof KtClassOrObject) {
KtClassOrObject classOrObject = (KtClassOrObject) psiElement; KtClassOrObject classOrObject = (KtClassOrObject) psiElement;
for (KtDelegationSpecifier delegationSpecifier : classOrObject.getDelegationSpecifiers()) { for (KtSuperTypeListEntry delegationSpecifier : classOrObject.getSuperTypeListEntries()) {
KtTypeReference typeReference = delegationSpecifier.getTypeReference(); KtTypeReference typeReference = delegationSpecifier.getTypeReference();
if (typeReference == null) continue; if (typeReference == null) continue;
KotlinType supertype = trace.get(TYPE, typeReference); KotlinType supertype = trace.get(TYPE, typeReference);
@@ -55,7 +55,7 @@ public class DeprecatedSymbolValidator : SymbolUsageValidator {
return return
// Do not check types in calls to super constructor in extends list, rely on call message // Do not check types in calls to super constructor in extends list, rely on call message
val superExpression = KtStubbedPsiUtil.getPsiOrStubParent(element, javaClass<KtDelegatorToSuperCall>(), true) val superExpression = KtStubbedPsiUtil.getPsiOrStubParent(element, javaClass<KtSuperTypeCallEntry>(), true)
if (superExpression != null && superExpression.getCalleeExpression().getConstructorReferenceExpression() == element) if (superExpression != null && superExpression.getCalleeExpression().getConstructorReferenceExpression() == element)
return return
@@ -49,7 +49,7 @@ public class OperatorValidator : SymbolUsageValidator {
} }
fun isMultiDeclaration(): Boolean { fun isMultiDeclaration(): Boolean {
return (resolvedCall != null) && (call?.callElement is KtMultiDeclarationEntry) return (resolvedCall != null) && (call?.callElement is KtDestructuringDeclarationEntry)
} }
fun isConventionOperator(): Boolean { fun isConventionOperator(): Boolean {
@@ -46,10 +46,10 @@ abstract class AssignedVariablesSearcher: KtTreeVisitorVoid() {
currentDeclaration = previous currentDeclaration = previous
} }
override fun visitFunctionLiteralExpression(functionLiteralExpression: KtFunctionLiteralExpression) { override fun visitLambdaExpression(lambdaExpression: KtLambdaExpression) {
val previous = currentDeclaration val previous = currentDeclaration
currentDeclaration = functionLiteralExpression.functionLiteral currentDeclaration = lambdaExpression.functionLiteral
super.visitFunctionLiteralExpression(functionLiteralExpression) super.visitLambdaExpression(lambdaExpression)
currentDeclaration = previous currentDeclaration = previous
} }
@@ -743,9 +743,9 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
expression.getObjectDeclaration()); expression.getObjectDeclaration());
temporaryTrace.commit(); temporaryTrace.commit();
DataFlowInfo resultFlowInfo = context.dataFlowInfo; DataFlowInfo resultFlowInfo = context.dataFlowInfo;
for (KtDelegationSpecifier specifier : expression.getObjectDeclaration().getDelegationSpecifiers()) { for (KtSuperTypeListEntry specifier : expression.getObjectDeclaration().getSuperTypeListEntries()) {
if (specifier instanceof KtDelegatorToSuperCall) { if (specifier instanceof KtSuperTypeCallEntry) {
KtDelegatorToSuperCall delegator = (KtDelegatorToSuperCall) specifier; KtSuperTypeCallEntry delegator = (KtSuperTypeCallEntry) specifier;
KotlinTypeInfo delegatorTypeInfo = context.trace.get(EXPRESSION_TYPE_INFO, delegator.getCalleeExpression()); KotlinTypeInfo delegatorTypeInfo = context.trace.get(EXPRESSION_TYPE_INFO, delegator.getCalleeExpression());
if (delegatorTypeInfo != null) { if (delegatorTypeInfo != null) {
resultFlowInfo = resultFlowInfo.and(delegatorTypeInfo.getDataFlowInfo()); resultFlowInfo = resultFlowInfo.and(delegatorTypeInfo.getDataFlowInfo());
@@ -246,7 +246,7 @@ public class ControlStructureTypingUtils {
@NotNull @NotNull
@Override @Override
public List<FunctionLiteralArgument> getFunctionLiteralArguments() { public List<LambdaArgument> getFunctionLiteralArguments() {
return Collections.emptyList(); return Collections.emptyList();
} }
@@ -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 // .and it with entrance data flow information, because do-while body is executed at least once
// See KT-6283 // See KT-6283
KotlinTypeInfo bodyTypeInfo; KotlinTypeInfo bodyTypeInfo;
if (body instanceof KtFunctionLiteralExpression) { if (body instanceof KtLambdaExpression) {
// As a matter of fact, function literal is always unused at this point // As a matter of fact, function literal is always unused at this point
bodyTypeInfo = facade.getTypeInfo(body, context.replaceScope(context.scope)); bodyTypeInfo = facade.getTypeInfo(body, context.replaceScope(context.scope));
} }
@@ -397,15 +397,15 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
loopScope.addVariableDescriptor(variableDescriptor); loopScope.addVariableDescriptor(variableDescriptor);
} }
else { else {
KtMultiDeclaration multiParameter = expression.getMultiParameter(); KtDestructuringDeclaration multiParameter = expression.getDestructuringParameter();
if (multiParameter != null && loopRange != null) { if (multiParameter != null && loopRange != null) {
KotlinType elementType = expectedParameterType == null ? ErrorUtils.createErrorType("Loop range has no type") : expectedParameterType; KotlinType elementType = expectedParameterType == null ? ErrorUtils.createErrorType("Loop range has no type") : expectedParameterType;
TransientReceiver iteratorNextAsReceiver = new TransientReceiver(elementType); TransientReceiver iteratorNextAsReceiver = new TransientReceiver(elementType);
components.annotationResolver.resolveAnnotationsWithArguments(loopScope, multiParameter.getModifierList(), context.trace); components.annotationResolver.resolveAnnotationsWithArguments(loopScope, multiParameter.getModifierList(), context.trace);
components.multiDeclarationResolver.defineLocalVariablesFromMultiDeclaration( components.destructuringDeclarationResolver.defineLocalVariablesFromMultiDeclaration(
loopScope, multiParameter, iteratorNextAsReceiver, loopRange, context 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.modifiersChecker.withTrace(context.trace).checkParameterHasNoValOrVar(multiParameter, VAL_OR_VAR_ON_LOOP_MULTI_PARAMETER);
components.identifierChecker.checkDeclaration(multiParameter, context.trace); components.identifierChecker.checkDeclaration(multiParameter, context.trace);
} }
@@ -538,7 +538,7 @@ public class ControlStructureTypingVisitor extends ExpressionTypingVisitor {
} }
if (expression.getTargetLabel() == null) { 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 //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); parentDeclaration = PsiTreeUtil.getParentOfType(parentDeclaration, KtDeclaration.class);
} }
@@ -17,9 +17,9 @@
package org.jetbrains.kotlin.types.expressions package org.jetbrains.kotlin.types.expressions
import org.jetbrains.kotlin.diagnostics.Errors 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.KtExpression
import org.jetbrains.kotlin.psi.KtMultiDeclaration
import org.jetbrains.kotlin.psi.KtMultiDeclarationEntry
import org.jetbrains.kotlin.resolve.BindingContext import org.jetbrains.kotlin.resolve.BindingContext
import org.jetbrains.kotlin.resolve.DescriptorResolver import org.jetbrains.kotlin.resolve.DescriptorResolver
import org.jetbrains.kotlin.resolve.TypeResolver 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.TypeUtils
import org.jetbrains.kotlin.types.checker.KotlinTypeChecker import org.jetbrains.kotlin.types.checker.KotlinTypeChecker
public class MultiDeclarationResolver( public class DestructuringDeclarationResolver(
private val fakeCallResolver: FakeCallResolver, private val fakeCallResolver: FakeCallResolver,
private val descriptorResolver: DescriptorResolver, private val descriptorResolver: DescriptorResolver,
private val typeResolver: TypeResolver, private val typeResolver: TypeResolver,
@@ -40,12 +40,12 @@ public class MultiDeclarationResolver(
) { ) {
public fun defineLocalVariablesFromMultiDeclaration( public fun defineLocalVariablesFromMultiDeclaration(
writableScope: LexicalWritableScope, writableScope: LexicalWritableScope,
multiDeclaration: KtMultiDeclaration, destructuringDeclaration: KtDestructuringDeclaration,
receiver: ReceiverValue, receiver: ReceiverValue,
reportErrorsOn: KtExpression, reportErrorsOn: KtExpression,
context: ExpressionTypingContext context: ExpressionTypingContext
) { ) {
for ((componentIndex, entry) in multiDeclaration.getEntries().withIndex()) { for ((componentIndex, entry) in destructuringDeclaration.getEntries().withIndex()) {
val componentName = createComponentName(componentIndex + 1) val componentName = createComponentName(componentIndex + 1)
val expectedType = getExpectedTypeForComponent(context, entry) 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 val entryTypeRef = entry.getTypeReference() ?: return TypeUtils.NO_EXPECTED_TYPE
return typeResolver.resolveType(context.scope, entryTypeRef, context.trace, true) return typeResolver.resolveType(context.scope, entryTypeRef, context.trace, true)
} }
@@ -49,7 +49,7 @@ public class ExpressionTypingComponents {
/*package*/ TypeResolver typeResolver; /*package*/ TypeResolver typeResolver;
/*package*/ AnnotationResolver annotationResolver; /*package*/ AnnotationResolver annotationResolver;
/*package*/ ValueParameterResolver valueParameterResolver; /*package*/ ValueParameterResolver valueParameterResolver;
/*package*/ MultiDeclarationResolver multiDeclarationResolver; /*package*/ DestructuringDeclarationResolver destructuringDeclarationResolver;
/*package*/ ConstantExpressionEvaluator constantExpressionEvaluator; /*package*/ ConstantExpressionEvaluator constantExpressionEvaluator;
/*package*/ ModifiersChecker modifiersChecker; /*package*/ ModifiersChecker modifiersChecker;
/*package*/ DataFlowAnalyzer dataFlowAnalyzer; /*package*/ DataFlowAnalyzer dataFlowAnalyzer;
@@ -142,8 +142,8 @@ public class ExpressionTypingComponents {
} }
@Inject @Inject
public void setMultiDeclarationResolver(MultiDeclarationResolver multiDeclarationResolver) { public void setDestructuringDeclarationResolver(DestructuringDeclarationResolver destructuringDeclarationResolver) {
this.multiDeclarationResolver = multiDeclarationResolver; this.destructuringDeclarationResolver = destructuringDeclarationResolver;
} }
@NotNull @NotNull
@@ -229,8 +229,8 @@ public abstract class ExpressionTypingVisitorDispatcher extends KtVisitor<Kotlin
////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////
@Override @Override
public KotlinTypeInfo visitFunctionLiteralExpression(@NotNull KtFunctionLiteralExpression expression, ExpressionTypingContext data) { public KotlinTypeInfo visitLambdaExpression(@NotNull KtLambdaExpression expression, ExpressionTypingContext data) {
return functions.visitFunctionLiteralExpression(expression, data); return functions.visitLambdaExpression(expression, data);
} }
@Override @Override
@@ -163,7 +163,7 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
} }
@Override @Override
public KotlinTypeInfo visitMultiDeclaration(@NotNull KtMultiDeclaration multiDeclaration, ExpressionTypingContext context) { public KotlinTypeInfo visitDestructuringDeclaration(@NotNull KtDestructuringDeclaration multiDeclaration, ExpressionTypingContext context) {
components.annotationResolver.resolveAnnotationsWithArguments(scope, multiDeclaration.getModifierList(), context.trace); components.annotationResolver.resolveAnnotationsWithArguments(scope, multiDeclaration.getModifierList(), context.trace);
KtExpression initializer = multiDeclaration.getInitializer(); KtExpression initializer = multiDeclaration.getInitializer();
@@ -177,8 +177,9 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito
if (expressionReceiver == null) { if (expressionReceiver == null) {
return TypeInfoFactoryKt.noTypeInfo(context); return TypeInfoFactoryKt.noTypeInfo(context);
} }
components.multiDeclarationResolver.defineLocalVariablesFromMultiDeclaration(scope, multiDeclaration, expressionReceiver, initializer, context); components.destructuringDeclarationResolver
components.modifiersChecker.withTrace(context.trace).checkModifiersForMultiDeclaration(multiDeclaration); .defineLocalVariablesFromMultiDeclaration(scope, multiDeclaration, expressionReceiver, initializer, context);
components.modifiersChecker.withTrace(context.trace).checkModifiersForDestructuringDeclaration(multiDeclaration);
components.identifierChecker.checkDeclaration(multiDeclaration, context.trace); components.identifierChecker.checkDeclaration(multiDeclaration, context.trace);
return typeInfo.replaceType(components.dataFlowAnalyzer.checkStatementType(multiDeclaration, context)); return typeInfo.replaceType(components.dataFlowAnalyzer.checkStatementType(multiDeclaration, context));
} }
@@ -130,7 +130,7 @@ internal class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Expre
return components.builtIns.getFunctionType(Annotations.EMPTY, receiverType, parameters, returnType) return components.builtIns.getFunctionType(Annotations.EMPTY, receiverType, parameters, returnType)
} }
override fun visitFunctionLiteralExpression(expression: KtFunctionLiteralExpression, context: ExpressionTypingContext): KotlinTypeInfo? { override fun visitLambdaExpression(expression: KtLambdaExpression, context: ExpressionTypingContext): KotlinTypeInfo? {
if (!expression.getFunctionLiteral().hasBody()) return null if (!expression.getFunctionLiteral().hasBody()) return null
val expectedType = context.expectedType val expectedType = context.expectedType
@@ -154,7 +154,7 @@ internal class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Expre
} }
private fun createFunctionLiteralDescriptor( private fun createFunctionLiteralDescriptor(
expression: KtFunctionLiteralExpression, expression: KtLambdaExpression,
context: ExpressionTypingContext context: ExpressionTypingContext
): AnonymousFunctionDescriptor { ): AnonymousFunctionDescriptor {
val functionLiteral = expression.getFunctionLiteral() val functionLiteral = expression.getFunctionLiteral()
@@ -174,7 +174,7 @@ internal class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Expre
} }
private fun computeReturnType( private fun computeReturnType(
expression: KtFunctionLiteralExpression, expression: KtLambdaExpression,
context: ExpressionTypingContext, context: ExpressionTypingContext,
functionDescriptor: SimpleFunctionDescriptorImpl, functionDescriptor: SimpleFunctionDescriptorImpl,
functionTypeExpected: Boolean functionTypeExpected: Boolean
@@ -191,7 +191,7 @@ internal class FunctionsTypingVisitor(facade: ExpressionTypingInternals) : Expre
} }
private fun computeUnsafeReturnType( private fun computeUnsafeReturnType(
expression: KtFunctionLiteralExpression, expression: KtLambdaExpression,
context: ExpressionTypingContext, context: ExpressionTypingContext,
functionDescriptor: SimpleFunctionDescriptorImpl, functionDescriptor: SimpleFunctionDescriptorImpl,
expectedReturnType: KotlinType? expectedReturnType: KotlinType?
@@ -65,7 +65,7 @@ public class LabelResolver {
return getLabelNameIfAny(element.getParent()); return getLabelNameIfAny(element.getParent());
} }
if (element instanceof KtFunctionLiteralExpression) { if (element instanceof KtLambdaExpression) {
return getLabelForFunctionalExpression((KtExpression) element); return getLabelForFunctionalExpression((KtExpression) element);
} }
@@ -88,8 +88,8 @@ public class LabelResolver {
@NotNull @NotNull
private KtExpression getExpressionUnderLabel(@NotNull KtExpression labeledExpression) { private KtExpression getExpressionUnderLabel(@NotNull KtExpression labeledExpression) {
KtExpression expression = KtPsiUtil.safeDeparenthesize(labeledExpression); KtExpression expression = KtPsiUtil.safeDeparenthesize(labeledExpression);
if (expression instanceof KtFunctionLiteralExpression) { if (expression instanceof KtLambdaExpression) {
return ((KtFunctionLiteralExpression) expression).getFunctionLiteral(); return ((KtLambdaExpression) expression).getFunctionLiteral();
} }
return expression; return expression;
} }
@@ -111,7 +111,7 @@ public class LabelResolver {
@Nullable @Nullable
private KtCallExpression getContainingCallExpression(@NotNull KtExpression expression) { private KtCallExpression getContainingCallExpression(@NotNull KtExpression expression) {
PsiElement parent = expression.getParent(); PsiElement parent = expression.getParent();
if (parent instanceof KtFunctionLiteralArgument) { if (parent instanceof KtLambdaArgument) {
// f {} // f {}
PsiElement call = parent.getParent(); PsiElement call = parent.getParent();
if (call instanceof KtCallExpression) { if (call instanceof KtCallExpression) {
+4 -4
View File
@@ -40,8 +40,8 @@ JetFile: BabySteps.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -59,7 +59,7 @@ JetFile: BabySteps.kt
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATOR_BY DELEGATED_SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -71,7 +71,7 @@ JetFile: BabySteps.kt
PsiElement(IDENTIFIER)('x') PsiElement(IDENTIFIER)('x')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATOR_SUPER_CLASS SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
+4 -4
View File
@@ -40,8 +40,8 @@ JetFile: BabySteps_ERR.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -61,7 +61,7 @@ JetFile: BabySteps_ERR.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiErrorElement:Expecting a delegation specifier PsiErrorElement:Expecting a delegation specifier
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
DELEGATOR_BY DELEGATED_SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -73,7 +73,7 @@ JetFile: BabySteps_ERR.kt
PsiElement(IDENTIFIER)('x') PsiElement(IDENTIFIER)('x')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATOR_SUPER_CLASS SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
+22 -22
View File
@@ -10,8 +10,8 @@ JetFile: ByClauses.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_BY DELEGATED_SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -44,8 +44,8 @@ JetFile: ByClauses.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_BY DELEGATED_SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -96,8 +96,8 @@ JetFile: ByClauses.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_BY DELEGATED_SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -133,8 +133,8 @@ JetFile: ByClauses.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_BY DELEGATED_SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -148,8 +148,8 @@ JetFile: ByClauses.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -179,8 +179,8 @@ JetFile: ByClauses.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_BY DELEGATED_SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -197,8 +197,8 @@ JetFile: ByClauses.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -228,8 +228,8 @@ JetFile: ByClauses.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_BY DELEGATED_SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -247,8 +247,8 @@ JetFile: ByClauses.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -278,8 +278,8 @@ JetFile: ByClauses.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_BY DELEGATED_SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -308,8 +308,8 @@ JetFile: ByClauses.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
+34 -34
View File
@@ -17,24 +17,24 @@ JetFile: CallWithManyClosures.kt
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -52,24 +52,24 @@ JetFile: CallWithManyClosures.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -87,8 +87,8 @@ JetFile: CallWithManyClosures.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -109,8 +109,8 @@ JetFile: CallWithManyClosures.kt
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -131,24 +131,24 @@ JetFile: CallWithManyClosures.kt
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -172,24 +172,24 @@ JetFile: CallWithManyClosures.kt
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -221,24 +221,24 @@ JetFile: CallWithManyClosures.kt
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
+3 -3
View File
@@ -148,7 +148,7 @@ JetFile: CallsInWhen.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(DOT)('.') PsiElement(DOT)('.')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -167,7 +167,7 @@ JetFile: CallsInWhen.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(DOT)('.') PsiElement(DOT)('.')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -189,7 +189,7 @@ JetFile: CallsInWhen.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(DOT)('.') PsiElement(DOT)('.')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
+8 -8
View File
@@ -27,8 +27,8 @@ JetFile: Constructors.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_SUPER_CLASS SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -52,8 +52,8 @@ JetFile: Constructors.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_SUPER_CLASS SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -78,8 +78,8 @@ JetFile: Constructors.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_SUPER_CLASS SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
@@ -108,8 +108,8 @@ JetFile: Constructors.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_SUPER_CLASS SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
+2 -2
View File
@@ -29,8 +29,8 @@ JetFile: DynamicSoftKeyword.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
DELEGATION_SPECIFIER_LIST SUPER_TYPE_LIST
DELEGATOR_SUPER_CLASS SUPER_TYPE_ENTRY
TYPE_REFERENCE TYPE_REFERENCE
DYNAMIC_TYPE DYNAMIC_TYPE
PsiElement(dynamic)('dynamic') PsiElement(dynamic)('dynamic')
+3 -3
View File
@@ -133,17 +133,17 @@ JetFile: EmptyName.kt
BLOCK BLOCK
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(val)('val') PsiElement(val)('val')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(BAD_CHARACTER)('`') PsiElement(BAD_CHARACTER)('`')
PsiErrorElement:Expecting a name PsiErrorElement:Expecting a name
PsiElement(BAD_CHARACTER)('`') PsiElement(BAD_CHARACTER)('`')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('y') PsiElement(IDENTIFIER)('y')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
+3 -3
View File
@@ -34,7 +34,7 @@ JetFile: EnumMissingName.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('RED') PsiElement(IDENTIFIER)('RED')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -51,7 +51,7 @@ JetFile: EnumMissingName.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('GREEN') PsiElement(IDENTIFIER)('GREEN')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -68,7 +68,7 @@ JetFile: EnumMissingName.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('BLUE') PsiElement(IDENTIFIER)('BLUE')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
+3 -3
View File
@@ -32,7 +32,7 @@ JetFile: EnumShortCommas.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('RED') PsiElement(IDENTIFIER)('RED')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -49,7 +49,7 @@ JetFile: EnumShortCommas.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('GREEN') PsiElement(IDENTIFIER)('GREEN')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -66,7 +66,7 @@ JetFile: EnumShortCommas.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('BLUE') PsiElement(IDENTIFIER)('BLUE')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
+3 -3
View File
@@ -32,7 +32,7 @@ JetFile: EnumShortWithOverload.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('RED') PsiElement(IDENTIFIER)('RED')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -82,7 +82,7 @@ JetFile: EnumShortWithOverload.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('GREEN') PsiElement(IDENTIFIER)('GREEN')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -132,7 +132,7 @@ JetFile: EnumShortWithOverload.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('BLUE') PsiElement(IDENTIFIER)('BLUE')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
+3 -3
View File
@@ -32,7 +32,7 @@ JetFile: Enums.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('RED') PsiElement(IDENTIFIER)('RED')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -49,7 +49,7 @@ JetFile: Enums.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('GREEN') PsiElement(IDENTIFIER)('GREEN')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
@@ -66,7 +66,7 @@ JetFile: Enums.kt
ENUM_ENTRY ENUM_ENTRY
PsiElement(IDENTIFIER)('BLUE') PsiElement(IDENTIFIER)('BLUE')
INITIALIZER_LIST INITIALIZER_LIST
DELEGATOR_SUPER_CALL SUPER_TYPE_CALL_ENTRY
CONSTRUCTOR_CALLEE CONSTRUCTOR_CALLEE
TYPE_REFERENCE TYPE_REFERENCE
USER_TYPE USER_TYPE
+55 -55
View File
@@ -18,9 +18,9 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -40,13 +40,13 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -66,9 +66,9 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -78,7 +78,7 @@ JetFile: ForWithMultiDecl.kt
PsiElement(IDENTIFIER)('Int') PsiElement(IDENTIFIER)('Int')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -104,9 +104,9 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -116,7 +116,7 @@ JetFile: ForWithMultiDecl.kt
PsiElement(IDENTIFIER)('Int') PsiElement(IDENTIFIER)('Int')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -136,13 +136,13 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -168,11 +168,11 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(val)('val') PsiElement(val)('val')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -192,15 +192,15 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(val)('val') PsiElement(val)('val')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -220,11 +220,11 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(val)('val') PsiElement(val)('val')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -234,7 +234,7 @@ JetFile: ForWithMultiDecl.kt
PsiElement(IDENTIFIER)('Int') PsiElement(IDENTIFIER)('Int')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -260,11 +260,11 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(val)('val') PsiElement(val)('val')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -274,7 +274,7 @@ JetFile: ForWithMultiDecl.kt
PsiElement(IDENTIFIER)('Int') PsiElement(IDENTIFIER)('Int')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -294,15 +294,15 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(val)('val') PsiElement(val)('val')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -328,11 +328,11 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(var)('var') PsiElement(var)('var')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -352,15 +352,15 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(var)('var') PsiElement(var)('var')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -380,11 +380,11 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(var)('var') PsiElement(var)('var')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -394,7 +394,7 @@ JetFile: ForWithMultiDecl.kt
PsiElement(IDENTIFIER)('Int') PsiElement(IDENTIFIER)('Int')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -420,11 +420,11 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(var)('var') PsiElement(var)('var')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -434,7 +434,7 @@ JetFile: ForWithMultiDecl.kt
PsiElement(IDENTIFIER)('Int') PsiElement(IDENTIFIER)('Int')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -454,15 +454,15 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(var)('var') PsiElement(var)('var')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -488,9 +488,9 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiErrorElement:Expecting ')' PsiErrorElement:Expecting ')'
<empty list> <empty list>
@@ -511,9 +511,9 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiErrorElement:Expecting a name PsiErrorElement:Expecting a name
@@ -537,9 +537,9 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -564,9 +564,9 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -595,12 +595,12 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
PsiErrorElement:Expecting a name PsiErrorElement:Expecting a name
PsiElement(COMMA)(',') PsiElement(COMMA)(',')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('b') PsiElement(IDENTIFIER)('b')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -626,9 +626,9 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION_ENTRY DESTRUCTURING_DECLARATION_ENTRY
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(COLON)(':') PsiElement(COLON)(':')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -651,7 +651,7 @@ JetFile: ForWithMultiDecl.kt
PsiElement(for)('for') PsiElement(for)('for')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
MULTI_VARIABLE_DECLARATION DESTRUCTURING_DECLARATION
PsiElement(LPAR)('(') PsiElement(LPAR)('(')
PsiErrorElement:Expecting a name PsiErrorElement:Expecting a name
<empty list> <empty list>
+11 -11
View File
@@ -64,8 +64,8 @@ JetFile: FunctionCalls.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('i') PsiElement(IDENTIFIER)('i')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -77,7 +77,7 @@ JetFile: FunctionCalls.kt
PsiElement(IDENTIFIER)('j') PsiElement(IDENTIFIER)('j')
PsiElement(SEMICOLON)(';') PsiElement(SEMICOLON)(';')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -89,8 +89,8 @@ JetFile: FunctionCalls.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('k') PsiElement(IDENTIFIER)('k')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
@@ -110,8 +110,8 @@ JetFile: FunctionCalls.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
@@ -132,7 +132,7 @@ JetFile: FunctionCalls.kt
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiElement(SEMICOLON)(';') PsiElement(SEMICOLON)(';')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
@@ -160,8 +160,8 @@ JetFile: FunctionCalls.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
@@ -190,7 +190,7 @@ JetFile: FunctionCalls.kt
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiElement(SEMICOLON)(';') PsiElement(SEMICOLON)(';')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
+6 -6
View File
@@ -765,8 +765,8 @@ JetFile: FunctionExpressions.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar') PsiElement(IDENTIFIER)('bar')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -857,8 +857,8 @@ JetFile: FunctionExpressions.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar') PsiElement(IDENTIFIER)('bar')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -890,8 +890,8 @@ JetFile: FunctionExpressions.kt
REFERENCE_EXPRESSION REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('bar') PsiElement(IDENTIFIER)('bar')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_ARGUMENT LAMBDA_ARGUMENT
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
+8 -8
View File
@@ -14,14 +14,14 @@ JetFile: FunctionLiterals.kt
BLOCK BLOCK
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -29,7 +29,7 @@ JetFile: FunctionLiterals.kt
PsiElement(IDENTIFIER)('foo') PsiElement(IDENTIFIER)('foo')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -43,7 +43,7 @@ JetFile: FunctionLiterals.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -61,7 +61,7 @@ JetFile: FunctionLiterals.kt
PsiElement(INTEGER_LITERAL)('1') PsiElement(INTEGER_LITERAL)('1')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -81,7 +81,7 @@ JetFile: FunctionLiterals.kt
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -105,7 +105,7 @@ JetFile: FunctionLiterals.kt
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -135,7 +135,7 @@ JetFile: FunctionLiterals.kt
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
+42 -42
View File
@@ -14,7 +14,7 @@ JetFile: FunctionLiterals_ERR.kt
BLOCK BLOCK
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -27,7 +27,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -44,7 +44,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -65,7 +65,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -89,7 +89,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -108,7 +108,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -128,7 +128,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -159,7 +159,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -192,7 +192,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -216,7 +216,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -248,7 +248,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -273,7 +273,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -297,7 +297,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -316,7 +316,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -334,7 +334,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -356,7 +356,7 @@ JetFile: FunctionLiterals_ERR.kt
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -377,7 +377,7 @@ JetFile: FunctionLiterals_ERR.kt
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -398,7 +398,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('f') PsiElement(IDENTIFIER)('f')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -416,7 +416,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -438,7 +438,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -457,7 +457,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(RPAR)(')') PsiElement(RPAR)(')')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST
@@ -472,7 +472,7 @@ JetFile: FunctionLiterals_ERR.kt
<empty list> <empty list>
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -488,7 +488,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -510,7 +510,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -536,7 +536,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -556,7 +556,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -577,7 +577,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -606,7 +606,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -635,7 +635,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -664,7 +664,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -680,7 +680,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -696,7 +696,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -716,7 +716,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -736,7 +736,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -756,7 +756,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -782,7 +782,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -812,7 +812,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -836,7 +836,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(IDENTIFIER)('a') PsiElement(IDENTIFIER)('a')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -877,7 +877,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiElement(INTEGER_LITERAL)('1') PsiElement(INTEGER_LITERAL)('1')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n\n ') PsiWhiteSpace('\n\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
@@ -898,7 +898,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(object)('object') PsiElement(object)('object')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -942,7 +942,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
@@ -980,7 +980,7 @@ JetFile: FunctionLiterals_ERR.kt
PsiWhiteSpace(' ') PsiWhiteSpace(' ')
PsiElement(RBRACE)('}') PsiElement(RBRACE)('}')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
BLOCK BLOCK
+1 -1
View File
@@ -14,7 +14,7 @@ JetFile: IncompleteFunctionLiteral.kt
BLOCK BLOCK
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
PsiWhiteSpace('\n ') PsiWhiteSpace('\n ')
FUNCTION_LITERAL_EXPRESSION LAMBDA_EXPRESSION
FUNCTION_LITERAL FUNCTION_LITERAL
PsiElement(LBRACE)('{') PsiElement(LBRACE)('{')
VALUE_PARAMETER_LIST VALUE_PARAMETER_LIST

Some files were not shown because too many files have changed in this diff Show More