Tests fixed
+ 'this' is resolved to the corresponding declaration
This commit is contained in:
@@ -3,6 +3,7 @@ package org.jetbrains.jet.codegen;
|
||||
import com.intellij.psi.PsiClass;
|
||||
import com.intellij.psi.PsiElement;
|
||||
import jet.typeinfo.TypeInfo;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.psi.*;
|
||||
import org.jetbrains.jet.lang.resolve.BindingContext;
|
||||
@@ -125,7 +126,7 @@ public class JetTypeMapper {
|
||||
return mapType(jetType, OwnerKind.INTERFACE);
|
||||
}
|
||||
|
||||
public Type mapType(final JetType jetType, OwnerKind kind) {
|
||||
public Type mapType(@NotNull final JetType jetType, OwnerKind kind) {
|
||||
if (jetType.equals(JetStandardClasses.getUnitType()) || jetType.equals(JetStandardClasses.getNothingType())) {
|
||||
return Type.VOID_TYPE;
|
||||
}
|
||||
|
||||
@@ -1520,7 +1520,10 @@ public class JetExpressionParsing extends AbstractJetParsing {
|
||||
private void parseThisExpression() {
|
||||
assert _at(THIS_KEYWORD);
|
||||
PsiBuilder.Marker mark = mark();
|
||||
|
||||
PsiBuilder.Marker thisReference = mark();
|
||||
advance(); // THIS_KEYWORD
|
||||
thisReference.done(REFERENCE_EXPRESSION);
|
||||
|
||||
parseLabel();
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import org.jetbrains.jet.lexer.JetTokens;
|
||||
* @author max
|
||||
*/
|
||||
public class JetSimpleNameExpression extends JetReferenceExpression {
|
||||
public static final TokenSet REFERENCE_TOKENS = TokenSet.orSet(JetTokens.LABELS, TokenSet.create(JetTokens.IDENTIFIER, JetTokens.FIELD_IDENTIFIER));
|
||||
public static final TokenSet REFERENCE_TOKENS = TokenSet.orSet(JetTokens.LABELS, TokenSet.create(JetTokens.IDENTIFIER, JetTokens.FIELD_IDENTIFIER, JetTokens.THIS_KEYWORD));
|
||||
|
||||
public JetSimpleNameExpression(@NotNull ASTNode node) {
|
||||
super(node);
|
||||
|
||||
@@ -24,4 +24,9 @@ public class JetThisExpression extends JetLabelQualifiedExpression {
|
||||
return (JetTypeReference) findChildByType(JetNodeTypes.TYPE_REFERENCE);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public JetReferenceExpression getThisReference() {
|
||||
return (JetReferenceExpression) findChildByType(JetNodeTypes.REFERENCE_EXPRESSION);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -57,4 +57,8 @@ public abstract class AbstractScopeAdapter implements JetScope {
|
||||
return getWorkerScope().getPropertyByFieldReference(fieldName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeclarationDescriptor getDeclarationDescriptorForUnqualifiedThis() {
|
||||
return getWorkerScope().getDeclarationDescriptorForUnqualifiedThis();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,4 +92,19 @@ public class ChainedScope implements JetScope {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeclarationDescriptor getDeclarationDescriptorForUnqualifiedThis() {
|
||||
if (DescriptorUtils.definesItsOwnThis(getContainingDeclaration())) {
|
||||
return getContainingDeclaration();
|
||||
}
|
||||
|
||||
for (JetScope jetScope : scopeChain) {
|
||||
DeclarationDescriptor containingDeclaration = jetScope.getContainingDeclaration();
|
||||
if (DescriptorUtils.definesItsOwnThis(containingDeclaration)) {
|
||||
return containingDeclaration;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +174,6 @@ public class ClassDescriptorResolver {
|
||||
WritableScope innerScope = new WritableScopeImpl(scope, functionDescriptor, trace.getErrorHandler());
|
||||
innerScope.addLabeledDeclaration(functionDescriptor);
|
||||
|
||||
|
||||
List<TypeParameterDescriptor> typeParameterDescriptors = resolveTypeParameters(functionDescriptor, innerScope, function.getTypeParameters());
|
||||
|
||||
JetType receiverType = null;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package org.jetbrains.jet.lang.resolve;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
|
||||
/**
|
||||
* @author abreslav
|
||||
*/
|
||||
public class DescriptorUtils {
|
||||
public static boolean definesItsOwnThis(@NotNull DeclarationDescriptor descriptor) {
|
||||
return descriptor.accept(new DeclarationDescriptorVisitor<Boolean, Void>() {
|
||||
@Override
|
||||
public Boolean visitDeclarationDescriptor(DeclarationDescriptor descriptor, Void data) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean visitFunctionDescriptor(FunctionDescriptor descriptor, Void data) {
|
||||
return descriptor.getReceiverType() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean visitClassDescriptor(ClassDescriptor descriptor, Void data) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean visitPropertyDescriptor(PropertyDescriptor descriptor, Void data) {
|
||||
return descriptor.getReceiverType() != null;
|
||||
}
|
||||
}, null);
|
||||
}
|
||||
}
|
||||
@@ -46,4 +46,7 @@ public interface JetScope {
|
||||
*/
|
||||
@Nullable
|
||||
PropertyDescriptor getPropertyByFieldReference(@NotNull String fieldName);
|
||||
|
||||
@Nullable
|
||||
DeclarationDescriptor getDeclarationDescriptorForUnqualifiedThis();
|
||||
}
|
||||
@@ -48,4 +48,9 @@ public abstract class JetScopeImpl implements JetScope {
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull String fieldName) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeclarationDescriptor getDeclarationDescriptorForUnqualifiedThis() {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.jetbrains.jet.lang.resolve;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.jet.lang.descriptors.*;
|
||||
import org.jetbrains.jet.lang.types.*;
|
||||
|
||||
@@ -79,4 +80,10 @@ public class SubstitutingScope implements JetScope {
|
||||
public PropertyDescriptor getPropertyByFieldReference(@NotNull String fieldName) {
|
||||
throw new UnsupportedOperationException(); // TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public DeclarationDescriptor getDeclarationDescriptorForUnqualifiedThis() {
|
||||
return workerScope.getDeclarationDescriptorForUnqualifiedThis();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,6 +45,14 @@ public class WritableScopeImpl extends WritableScopeWithImports {
|
||||
return ownerDeclarationDescriptor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeclarationDescriptor getDeclarationDescriptorForUnqualifiedThis() {
|
||||
if (DescriptorUtils.definesItsOwnThis(ownerDeclarationDescriptor)) {
|
||||
return ownerDeclarationDescriptor;
|
||||
}
|
||||
return super.getDeclarationDescriptorForUnqualifiedThis();
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private Map<String, List<DeclarationDescriptor>> getLabelsToDescriptors() {
|
||||
if (labelsToDescriptors == null) {
|
||||
|
||||
@@ -47,6 +47,11 @@ public class JavaClassMembersScope implements JetScope {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeclarationDescriptor getDeclarationDescriptorForUnqualifiedThis() {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ClassifierDescriptor getClassifier(@NotNull String name) {
|
||||
ClassifierDescriptor classifierDescriptor = classifiers.get(name);
|
||||
|
||||
@@ -59,6 +59,11 @@ public class ErrorUtils {
|
||||
return null; // TODO : review
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeclarationDescriptor getDeclarationDescriptorForUnqualifiedThis() {
|
||||
return ERROR_CLASS; // TODO : review
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
private static final FunctionGroup ERROR_FUNCTION_GROUP = new FunctionGroup() {
|
||||
|
||||
@@ -933,28 +933,34 @@ public class JetTypeInferrer {
|
||||
if (labelName != null) {
|
||||
Collection<DeclarationDescriptor> declarationsByLabel = scope.getDeclarationsByLabel(labelName);
|
||||
int size = declarationsByLabel.size();
|
||||
final JetSimpleNameExpression targetLabel = expression.getTargetLabel();
|
||||
assert targetLabel != null;
|
||||
if (size == 1) {
|
||||
DeclarationDescriptor declarationDescriptor = declarationsByLabel.iterator().next();
|
||||
if (declarationDescriptor instanceof ClassDescriptor) {
|
||||
ClassDescriptor classDescriptor = (ClassDescriptor) declarationDescriptor;
|
||||
thisType = classDescriptor.getDefaultType();
|
||||
trace.recordReferenceResolution(expression.getTargetLabel(), classDescriptor);
|
||||
trace.recordReferenceResolution(targetLabel, classDescriptor);
|
||||
trace.recordReferenceResolution(expression.getThisReference(), classDescriptor);
|
||||
}
|
||||
else {
|
||||
throw new UnsupportedOperationException(); // TODO
|
||||
}
|
||||
}
|
||||
else if (size == 0) {
|
||||
trace.getErrorHandler().unresolvedReference(expression.getTargetLabel());
|
||||
trace.getErrorHandler().unresolvedReference(targetLabel);
|
||||
}
|
||||
else {
|
||||
JetSimpleNameExpression labelElement = expression.getTargetLabel();
|
||||
assert labelElement != null;
|
||||
trace.getErrorHandler().genericError(labelElement.getNode(), "Ambiguous label");
|
||||
trace.getErrorHandler().genericError(targetLabel.getNode(), "Ambiguous label");
|
||||
}
|
||||
}
|
||||
else {
|
||||
thisType = scope.getThisType();
|
||||
|
||||
DeclarationDescriptor declarationDescriptorForUnqualifiedThis = scope.getDeclarationDescriptorForUnqualifiedThis();
|
||||
if (declarationDescriptorForUnqualifiedThis != null) {
|
||||
trace.recordReferenceResolution(expression.getThisReference(), declarationDescriptorForUnqualifiedThis);
|
||||
}
|
||||
}
|
||||
|
||||
if (thisType != null) {
|
||||
@@ -989,6 +995,9 @@ public class JetTypeInferrer {
|
||||
} else {
|
||||
result = thisType;
|
||||
}
|
||||
if (result != null) {
|
||||
trace.recordExpressionType(expression.getThisReference(), result);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1407,9 +1416,9 @@ public class JetTypeInferrer {
|
||||
else {
|
||||
result = selectorReturnType;
|
||||
}
|
||||
// if (selectorExpression != null && result != null) {
|
||||
// trace.recordExpressionType(selectorExpression, result);
|
||||
// }
|
||||
if (selectorExpression != null && result != null) {
|
||||
trace.recordExpressionType(selectorExpression, result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@ JetFile: AnnotatedExpressions.jet
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace(' ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace('\n')
|
||||
PsiElement(RBRACE)('}')
|
||||
@@ -385,28 +385,33 @@ JetFile: Labels.jet
|
||||
PsiElement(RBRACE)('}')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace('\n ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
LABEL_QUALIFIER
|
||||
LABEL_REFERENCE
|
||||
PsiElement(AT)('@')
|
||||
PsiWhiteSpace('\n ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
LABEL_QUALIFIER
|
||||
LABEL_REFERENCE
|
||||
PsiElement(LABEL_IDENTIFIER)('@a')
|
||||
PsiWhiteSpace('\n ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
LABEL_QUALIFIER
|
||||
LABEL_REFERENCE
|
||||
PsiElement(ATAT)('@@')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(LT)('<')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
@@ -415,7 +420,8 @@ JetFile: Labels.jet
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace('\n ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
LABEL_QUALIFIER
|
||||
LABEL_REFERENCE
|
||||
PsiElement(AT)('@')
|
||||
@@ -427,7 +433,8 @@ JetFile: Labels.jet
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace('\n ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
LABEL_QUALIFIER
|
||||
LABEL_REFERENCE
|
||||
PsiElement(LABEL_IDENTIFIER)('@a')
|
||||
@@ -439,7 +446,8 @@ JetFile: Labels.jet
|
||||
PsiElement(GT)('>')
|
||||
PsiWhiteSpace('\n ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
LABEL_QUALIFIER
|
||||
LABEL_REFERENCE
|
||||
PsiElement(ATAT)('@@')
|
||||
|
||||
@@ -768,7 +768,8 @@ JetFile: Properties.jet
|
||||
BINARY_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('size')
|
||||
|
||||
@@ -261,7 +261,8 @@ JetFile: SimpleExpressions.jet
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace('\n ')
|
||||
VALUE_PARAMETER
|
||||
@@ -277,7 +278,8 @@ JetFile: SimpleExpressions.jet
|
||||
PsiElement(EQ)('=')
|
||||
PsiWhiteSpace(' ')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(LT)('<')
|
||||
TYPE_REFERENCE
|
||||
USER_TYPE
|
||||
|
||||
@@ -180,7 +180,8 @@ JetFile: BinaryTree.jet
|
||||
BINARY_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('compare')
|
||||
@@ -286,7 +287,8 @@ JetFile: BinaryTree.jet
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
@@ -1897,7 +1899,8 @@ JetFile: BinaryTree.jet
|
||||
PsiElement(IDENTIFIER)('BinaryTree')
|
||||
PsiElement(DOT)('.')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('version')
|
||||
@@ -2475,7 +2478,8 @@ JetFile: BinaryTree.jet
|
||||
PsiElement(IDENTIFIER)('BinaryTree')
|
||||
PsiElement(DOT)('.')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('version')
|
||||
@@ -2520,7 +2524,8 @@ JetFile: BinaryTree.jet
|
||||
PsiElement(IDENTIFIER)('BinaryTree')
|
||||
PsiElement(DOT)('.')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('version')
|
||||
|
||||
@@ -499,7 +499,8 @@ JetFile: BitArith.jet
|
||||
BINARY_EXPRESSION
|
||||
BINARY_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(IDENTIFIER)('and')
|
||||
|
||||
@@ -363,7 +363,8 @@ JetFile: PolymorphicClassObjects.jet
|
||||
PsiWhiteSpace(' ')
|
||||
LOOP_RANGE
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace(' ')
|
||||
BODY
|
||||
|
||||
@@ -388,7 +388,8 @@ JetFile: UnionFind.jet
|
||||
BINARY_EXPRESSION
|
||||
BINARY_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(PERC)('%')
|
||||
|
||||
@@ -350,7 +350,8 @@ JetFile: ArrayList.jet
|
||||
PsiElement(IDENTIFIER)('ArrayList')
|
||||
PsiElement(DOT)('.')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
CALL_EXPRESSION
|
||||
REFERENCE_EXPRESSION
|
||||
|
||||
@@ -44,7 +44,8 @@ JetFile: HashMap.jet
|
||||
PsiElement(LPAR)('(')
|
||||
BINARY_WITH_TYPE
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(as)('as')
|
||||
@@ -138,7 +139,8 @@ JetFile: HashMap.jet
|
||||
PsiElement(LPAR)('(')
|
||||
BINARY_WITH_TYPE
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(as)('as')
|
||||
@@ -373,7 +375,8 @@ JetFile: HashMap.jet
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(RPAR)(')')
|
||||
PsiWhiteSpace('\n\n')
|
||||
CLASS
|
||||
|
||||
@@ -202,7 +202,8 @@ JetFile: List.jet
|
||||
PsiWhiteSpace(' ')
|
||||
BINARY_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(EQEQ)('==')
|
||||
@@ -256,7 +257,8 @@ JetFile: List.jet
|
||||
PsiElement(IDENTIFIER)('List')
|
||||
PsiElement(DOT)('.')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace('\n\n ')
|
||||
PROPERTY
|
||||
MODIFIER_LIST
|
||||
|
||||
@@ -138,7 +138,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('compare')
|
||||
@@ -152,7 +153,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('data')
|
||||
@@ -254,7 +256,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('compare')
|
||||
@@ -268,7 +271,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('data')
|
||||
@@ -297,7 +301,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('data')
|
||||
@@ -343,7 +348,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('comparator')
|
||||
@@ -393,7 +399,8 @@ JetFile: BinaryHeap.jet
|
||||
CONDITION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('isEmpty')
|
||||
@@ -942,7 +949,8 @@ JetFile: BinaryHeap.jet
|
||||
PsiElement(LPAR)('(')
|
||||
BINARY_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(MINUS)('-')
|
||||
@@ -979,7 +987,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
BINARY_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(MUL)('*')
|
||||
@@ -1015,7 +1024,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
BINARY_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(MUL)('*')
|
||||
@@ -1067,7 +1077,8 @@ JetFile: BinaryHeap.jet
|
||||
INDICES
|
||||
PsiElement(LBRACKET)('[')
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(RBRACKET)(']')
|
||||
PsiWhiteSpace('\n ')
|
||||
PROPERTY_ACCESSOR
|
||||
@@ -1117,7 +1128,8 @@ JetFile: BinaryHeap.jet
|
||||
PsiElement(LPAR)('(')
|
||||
BINARY_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(LT)('<')
|
||||
@@ -1137,7 +1149,8 @@ JetFile: BinaryHeap.jet
|
||||
PsiElement(LPAR)('(')
|
||||
BINARY_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiWhiteSpace(' ')
|
||||
OPERATION_REFERENCE
|
||||
PsiElement(GTEQ)('>=')
|
||||
@@ -1209,7 +1222,8 @@ JetFile: BinaryHeap.jet
|
||||
PsiElement(LPAR)('(')
|
||||
VALUE_ARGUMENT
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(COMMA)(',')
|
||||
PsiWhiteSpace(' ')
|
||||
VALUE_ARGUMENT
|
||||
@@ -1274,7 +1288,8 @@ JetFile: BinaryHeap.jet
|
||||
PsiWhiteSpace(' ')
|
||||
ARRAY_ACCESS_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
INDICES
|
||||
PsiElement(LBRACKET)('[')
|
||||
REFERENCE_EXPRESSION
|
||||
@@ -1284,7 +1299,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
ARRAY_ACCESS_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
INDICES
|
||||
PsiElement(LBRACKET)('[')
|
||||
REFERENCE_EXPRESSION
|
||||
@@ -1296,7 +1312,8 @@ JetFile: BinaryHeap.jet
|
||||
PsiWhiteSpace(' ')
|
||||
ARRAY_ACCESS_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
INDICES
|
||||
PsiElement(LBRACKET)('[')
|
||||
REFERENCE_EXPRESSION
|
||||
@@ -1306,7 +1323,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
ARRAY_ACCESS_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
INDICES
|
||||
PsiElement(LBRACKET)('[')
|
||||
REFERENCE_EXPRESSION
|
||||
@@ -1356,7 +1374,8 @@ JetFile: BinaryHeap.jet
|
||||
BINARY_EXPRESSION
|
||||
DOT_QUALIFIED_EXPRESSION
|
||||
THIS_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(this)('this')
|
||||
PsiElement(DOT)('.')
|
||||
REFERENCE_EXPRESSION
|
||||
PsiElement(IDENTIFIER)('size')
|
||||
|
||||
@@ -2,8 +2,13 @@ namespace qualified_this {
|
||||
~qtA~class A(val a:Int) {
|
||||
|
||||
~qtB~class B() {
|
||||
val x = this`qtB`@B
|
||||
val y = this`qtA`@A
|
||||
val x = `qtB`this`qtB`@B
|
||||
val y = `qtA`this`qtA`@A
|
||||
val z = `qtB`this
|
||||
~xx~val Int.xx = `xx`this : Int
|
||||
~xx()~fun Int.xx() {
|
||||
`xx()`this : Int
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -178,6 +178,7 @@ public class JetTestUtils {
|
||||
public Collection<JetDiagnostic> getDiagnostics() {
|
||||
throw new UnsupportedOperationException(); // TODO
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user