getImplicitReceiverHierarchy() returns a List
This commit is contained in:
@@ -105,7 +105,7 @@ public final class TipsManager {
|
|||||||
else {
|
else {
|
||||||
Collection<DeclarationDescriptor> descriptorsSet = Sets.newHashSet();
|
Collection<DeclarationDescriptor> descriptorsSet = Sets.newHashSet();
|
||||||
|
|
||||||
List<ReceiverParameterDescriptor> result = JetScopeUtils.getImplicitReceiversHierarchy(resolutionScope);
|
List<ReceiverParameterDescriptor> result = resolutionScope.getImplicitReceiversHierarchy();
|
||||||
|
|
||||||
for (ReceiverParameterDescriptor receiverDescriptor : result) {
|
for (ReceiverParameterDescriptor receiverDescriptor : result) {
|
||||||
JetType receiverType = receiverDescriptor.getType();
|
JetType receiverType = receiverDescriptor.getType();
|
||||||
@@ -153,7 +153,7 @@ public final class TipsManager {
|
|||||||
) {
|
) {
|
||||||
final Set<DeclarationDescriptor> descriptorsSet = Sets.newHashSet(descriptors);
|
final Set<DeclarationDescriptor> descriptorsSet = Sets.newHashSet(descriptors);
|
||||||
|
|
||||||
final List<ReceiverParameterDescriptor> result = JetScopeUtils.getImplicitReceiversHierarchy(scope);
|
final List<ReceiverParameterDescriptor> result = scope.getImplicitReceiversHierarchy();
|
||||||
|
|
||||||
descriptorsSet.removeAll(
|
descriptorsSet.removeAll(
|
||||||
Collections2.filter(JetScopeUtils.getAllExtensions(scope), new Predicate<CallableDescriptor>() {
|
Collections2.filter(JetScopeUtils.getAllExtensions(scope), new Predicate<CallableDescriptor>() {
|
||||||
|
|||||||
+4
-3
@@ -29,6 +29,7 @@ import org.jetbrains.jet.lang.resolve.scopes.RedeclarationHandler;
|
|||||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
|
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
|
||||||
|
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@@ -243,10 +244,10 @@ public class MutableClassDescriptor extends MutableClassDescriptorLite implement
|
|||||||
return classObjectDescriptor.getDefaultType().getMemberScope();
|
return classObjectDescriptor.getDefaultType().getMemberScope();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
super.getImplicitReceiversHierarchy(result);
|
return Collections.singletonList(classObjectDescriptor.getThisAsReceiverParameter());
|
||||||
result.add(0, classObjectDescriptor.getThisAsReceiverParameter());
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -34,9 +34,10 @@ public abstract class AbstractScopeAdapter implements JetScope {
|
|||||||
@NotNull
|
@NotNull
|
||||||
protected abstract JetScope getWorkerScope();
|
protected abstract JetScope getWorkerScope();
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
getWorkerScope().getImplicitReceiversHierarchy(result);
|
return getWorkerScope().getImplicitReceiversHierarchy();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+1
-1
@@ -226,7 +226,7 @@ public abstract class TaskPrioritizer {
|
|||||||
private static <D extends CallableDescriptor> boolean setImpliedThis(@NotNull JetScope scope, ResolutionCandidate<D> candidate) {
|
private static <D extends CallableDescriptor> boolean setImpliedThis(@NotNull JetScope scope, ResolutionCandidate<D> candidate) {
|
||||||
ReceiverParameterDescriptor expectedThisObject = candidate.getDescriptor().getExpectedThisObject();
|
ReceiverParameterDescriptor expectedThisObject = candidate.getDescriptor().getExpectedThisObject();
|
||||||
if (!expectedThisObject.exists()) return true;
|
if (!expectedThisObject.exists()) return true;
|
||||||
List<ReceiverParameterDescriptor> receivers = JetScopeUtils.getImplicitReceiversHierarchy(scope);
|
List<ReceiverParameterDescriptor> receivers = scope.getImplicitReceiversHierarchy();
|
||||||
for (ReceiverParameterDescriptor receiver : receivers) {
|
for (ReceiverParameterDescriptor receiver : receivers) {
|
||||||
if (JetTypeChecker.INSTANCE.isSubtypeOf(receiver.getType(), expectedThisObject.getType())) {
|
if (JetTypeChecker.INSTANCE.isSubtypeOf(receiver.getType(), expectedThisObject.getType())) {
|
||||||
// TODO : Autocasts & nullability
|
// TODO : Autocasts & nullability
|
||||||
|
|||||||
+4
-2
@@ -260,12 +260,14 @@ public abstract class AbstractLazyMemberScope<D extends DeclarationDescriptor, D
|
|||||||
|
|
||||||
protected abstract void addExtraDescriptors();
|
protected abstract void addExtraDescriptors();
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
ReceiverParameterDescriptor receiver = getImplicitReceiver();
|
ReceiverParameterDescriptor receiver = getImplicitReceiver();
|
||||||
if (receiver.exists()) {
|
if (receiver.exists()) {
|
||||||
result.add(receiver);
|
return Collections.singletonList(receiver);
|
||||||
}
|
}
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.resolve.scopes;
|
package org.jetbrains.jet.lang.resolve.scopes;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.lang.descriptors.*;
|
import org.jetbrains.jet.lang.descriptors.*;
|
||||||
@@ -34,6 +35,7 @@ public class ChainedScope implements JetScope {
|
|||||||
private final DeclarationDescriptor containingDeclaration;
|
private final DeclarationDescriptor containingDeclaration;
|
||||||
private final JetScope[] scopeChain;
|
private final JetScope[] scopeChain;
|
||||||
private Collection<DeclarationDescriptor> allDescriptors;
|
private Collection<DeclarationDescriptor> allDescriptors;
|
||||||
|
private List<ReceiverParameterDescriptor> implicitReceiverHierarchy;
|
||||||
|
|
||||||
public ChainedScope(DeclarationDescriptor containingDeclaration, JetScope... scopes) {
|
public ChainedScope(DeclarationDescriptor containingDeclaration, JetScope... scopes) {
|
||||||
this.containingDeclaration = containingDeclaration;
|
this.containingDeclaration = containingDeclaration;
|
||||||
@@ -114,11 +116,16 @@ public class ChainedScope implements JetScope {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
for (JetScope jetScope : scopeChain) {
|
if (implicitReceiverHierarchy == null) {
|
||||||
jetScope.getImplicitReceiversHierarchy(result);
|
implicitReceiverHierarchy = Lists.newArrayList();
|
||||||
|
for (JetScope jetScope : scopeChain) {
|
||||||
|
implicitReceiverHierarchy.addAll(jetScope.getImplicitReceiversHierarchy());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
return implicitReceiverHierarchy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+4
-2
@@ -29,6 +29,7 @@ import org.jetbrains.jet.lang.resolve.name.LabelName;
|
|||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -82,9 +83,10 @@ public class InnerClassesScopeWrapper extends AbstractScopeAdapter {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
// Do nothing
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -86,9 +86,9 @@ public interface JetScope {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds receivers to the list in order of locality, so that the closest (the most local) receiver goes first
|
* Adds receivers to the list in order of locality, so that the closest (the most local) receiver goes first
|
||||||
* @param result
|
|
||||||
*/
|
*/
|
||||||
void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result);
|
@NotNull
|
||||||
|
List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy();
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
Collection<DeclarationDescriptor> getOwnDeclaredDescriptors();
|
Collection<DeclarationDescriptor> getOwnDeclaredDescriptors();
|
||||||
|
|||||||
@@ -85,8 +85,10 @@ public abstract class JetScopeImpl implements JetScope {
|
|||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -36,22 +36,8 @@ import java.util.Set;
|
|||||||
public final class JetScopeUtils {
|
public final class JetScopeUtils {
|
||||||
private JetScopeUtils() {}
|
private JetScopeUtils() {}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get receivers in order of locality, so that the closest (the most local) receiver goes first
|
|
||||||
* A wrapper for {@link JetScope#getImplicitReceiversHierarchy(List)}
|
|
||||||
*
|
|
||||||
* @param scope Scope for getting receivers hierarchy.
|
|
||||||
* @return receivers hierarchy.
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
public static List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy(@NotNull JetScope scope) {
|
|
||||||
List<ReceiverParameterDescriptor> descriptors = Lists.newArrayList();
|
|
||||||
scope.getImplicitReceiversHierarchy(descriptors);
|
|
||||||
return descriptors;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static List<ReceiverDescriptor> getImplicitReceiversHierarchyValues(@NotNull JetScope scope) {
|
public static List<ReceiverDescriptor> getImplicitReceiversHierarchyValues(@NotNull JetScope scope) {
|
||||||
Collection<ReceiverParameterDescriptor> hierarchy = getImplicitReceiversHierarchy(scope);
|
Collection<ReceiverParameterDescriptor> hierarchy = scope.getImplicitReceiversHierarchy();
|
||||||
|
|
||||||
return Lists.newArrayList(
|
return Lists.newArrayList(
|
||||||
Collections2.transform(hierarchy,
|
Collections2.transform(hierarchy,
|
||||||
|
|||||||
@@ -118,8 +118,9 @@ public class SubstitutingScope implements JetScope {
|
|||||||
return workerScope.getNamespace(name); // TODO
|
return workerScope.getNamespace(name); // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
throw new UnsupportedOperationException(); // TODO
|
throw new UnsupportedOperationException(); // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -462,14 +462,13 @@ public class WritableScopeImpl extends WritableScopeWithImports {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
protected List<ReceiverParameterDescriptor> computeImplicitReceiversHierarchy() {
|
||||||
checkMayRead();
|
List<ReceiverParameterDescriptor> implicitReceiverHierarchy = Lists.newArrayList();
|
||||||
|
|
||||||
super.getImplicitReceiversHierarchy(result);
|
|
||||||
|
|
||||||
if (implicitReceiver != null && implicitReceiver.exists()) {
|
if (implicitReceiver != null && implicitReceiver.exists()) {
|
||||||
result.add(0, implicitReceiver);
|
implicitReceiverHierarchy.add(implicitReceiver);
|
||||||
}
|
}
|
||||||
|
implicitReceiverHierarchy.addAll(super.computeImplicitReceiversHierarchy());
|
||||||
|
return implicitReceiverHierarchy;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @SuppressWarnings({"NullableProblems"})
|
// @SuppressWarnings({"NullableProblems"})
|
||||||
|
|||||||
+16
-8
@@ -16,17 +16,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.lang.resolve.scopes;
|
package org.jetbrains.jet.lang.resolve.scopes;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
import org.jetbrains.jet.lang.descriptors.*;
|
import org.jetbrains.jet.lang.descriptors.*;
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Collection;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author abreslav
|
* @author abreslav
|
||||||
@@ -40,6 +37,7 @@ public abstract class WritableScopeWithImports extends JetScopeAdapter implement
|
|||||||
private List<JetScope> imports;
|
private List<JetScope> imports;
|
||||||
private WritableScope currentIndividualImportScope;
|
private WritableScope currentIndividualImportScope;
|
||||||
protected final RedeclarationHandler redeclarationHandler;
|
protected final RedeclarationHandler redeclarationHandler;
|
||||||
|
private List<ReceiverParameterDescriptor> implicitReceiverHierarchy;
|
||||||
|
|
||||||
public WritableScopeWithImports(@NotNull JetScope scope, @NotNull RedeclarationHandler redeclarationHandler, @NotNull String debugName) {
|
public WritableScopeWithImports(@NotNull JetScope scope, @NotNull RedeclarationHandler redeclarationHandler, @NotNull String debugName) {
|
||||||
super(scope);
|
super(scope);
|
||||||
@@ -101,17 +99,27 @@ public abstract class WritableScopeWithImports extends JetScopeAdapter implement
|
|||||||
currentIndividualImportScope = null;
|
currentIndividualImportScope = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
checkMayRead();
|
checkMayRead();
|
||||||
|
|
||||||
super.getImplicitReceiversHierarchy(result);
|
if (implicitReceiverHierarchy == null) {
|
||||||
|
implicitReceiverHierarchy = computeImplicitReceiversHierarchy();
|
||||||
|
}
|
||||||
|
return implicitReceiverHierarchy;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected List<ReceiverParameterDescriptor> computeImplicitReceiversHierarchy() {
|
||||||
|
List<ReceiverParameterDescriptor> implicitReceiverHierarchy = Lists.newArrayList();
|
||||||
// Imported scopes come with their receivers
|
// Imported scopes come with their receivers
|
||||||
// Example: class member resolution scope imports a scope of it's class object
|
// Example: class member resolution scope imports a scope of it's class object
|
||||||
// members of the class object must be able to find it as an implicit receiver
|
// members of the class object must be able to find it as an implicit receiver
|
||||||
for (JetScope scope : getImports()) {
|
for (JetScope scope : getImports()) {
|
||||||
scope.getImplicitReceiversHierarchy(result);
|
implicitReceiverHierarchy.addAll(scope.getImplicitReceiversHierarchy());
|
||||||
}
|
}
|
||||||
|
implicitReceiverHierarchy.addAll(super.getImplicitReceiversHierarchy());
|
||||||
|
return implicitReceiverHierarchy;
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -76,8 +76,10 @@ public class ErrorUtils {
|
|||||||
return null; // TODO : review
|
return null; // TODO : review
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
+1
-2
@@ -42,7 +42,6 @@ import org.jetbrains.jet.lang.resolve.constants.StringValue;
|
|||||||
import org.jetbrains.jet.lang.resolve.name.LabelName;
|
import org.jetbrains.jet.lang.resolve.name.LabelName;
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
import org.jetbrains.jet.lang.resolve.scopes.JetScope;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.JetScopeUtils;
|
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
|
import org.jetbrains.jet.lang.resolve.scopes.WritableScopeImpl;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ExpressionReceiver;
|
import org.jetbrains.jet.lang.resolve.scopes.receivers.ExpressionReceiver;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
import org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverDescriptor;
|
||||||
@@ -511,7 +510,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor {
|
|||||||
expression.getInstanceReference(), expression.getTargetLabel(), context, thisReceiver, new LabelName(labelName));
|
expression.getInstanceReference(), expression.getTargetLabel(), context, thisReceiver, new LabelName(labelName));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
List<ReceiverParameterDescriptor> receivers = JetScopeUtils.getImplicitReceiversHierarchy(context.scope);
|
List<ReceiverParameterDescriptor> receivers = context.scope.getImplicitReceiversHierarchy();
|
||||||
if (onlyClassReceivers) {
|
if (onlyClassReceivers) {
|
||||||
for (ReceiverParameterDescriptor receiver : receivers) {
|
for (ReceiverParameterDescriptor receiver : receivers) {
|
||||||
if (receiver.getContainingDeclaration() instanceof ClassDescriptor) {
|
if (receiver.getContainingDeclaration() instanceof ClassDescriptor) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
package org.jetbrains.jet.types;
|
package org.jetbrains.jet.types;
|
||||||
|
|
||||||
|
import com.google.common.collect.Lists;
|
||||||
import com.google.common.collect.Sets;
|
import com.google.common.collect.Sets;
|
||||||
import com.intellij.openapi.project.Project;
|
import com.intellij.openapi.project.Project;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
@@ -32,7 +33,8 @@ import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor;
|
|||||||
import org.jetbrains.jet.lang.psi.*;
|
import org.jetbrains.jet.lang.psi.*;
|
||||||
import org.jetbrains.jet.lang.resolve.*;
|
import org.jetbrains.jet.lang.resolve.*;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
||||||
import org.jetbrains.jet.lang.resolve.java.*;
|
import org.jetbrains.jet.lang.resolve.java.DescriptorSearchRule;
|
||||||
|
import org.jetbrains.jet.lang.resolve.java.JavaDescriptorResolver;
|
||||||
import org.jetbrains.jet.lang.resolve.name.FqName;
|
import org.jetbrains.jet.lang.resolve.name.FqName;
|
||||||
import org.jetbrains.jet.lang.resolve.name.Name;
|
import org.jetbrains.jet.lang.resolve.name.Name;
|
||||||
import org.jetbrains.jet.lang.resolve.scopes.*;
|
import org.jetbrains.jet.lang.resolve.scopes.*;
|
||||||
@@ -571,9 +573,10 @@ public class JetTypeCheckerTest extends JetLiteFixture {
|
|||||||
private void assertType(String contextType, final String expression, String expectedType) {
|
private void assertType(String contextType, final String expression, String expectedType) {
|
||||||
final JetType thisType = makeType(contextType);
|
final JetType thisType = makeType(contextType);
|
||||||
JetScope scope = new JetScopeAdapter(classDefinitions.BASIC_SCOPE) {
|
JetScope scope = new JetScopeAdapter(classDefinitions.BASIC_SCOPE) {
|
||||||
|
@NotNull
|
||||||
@Override
|
@Override
|
||||||
public void getImplicitReceiversHierarchy(@NotNull List<ReceiverParameterDescriptor> result) {
|
public List<ReceiverParameterDescriptor> getImplicitReceiversHierarchy() {
|
||||||
result.add(new ReceiverParameterDescriptorImpl(
|
return Lists.<ReceiverParameterDescriptor>newArrayList(new ReceiverParameterDescriptorImpl(
|
||||||
classDefinitions.BASIC_SCOPE.getContainingDeclaration(),
|
classDefinitions.BASIC_SCOPE.getContainingDeclaration(),
|
||||||
thisType,
|
thisType,
|
||||||
new ExpressionReceiver(JetPsiFactory.createExpression(getProject(), expression), thisType)
|
new ExpressionReceiver(JetPsiFactory.createExpression(getProject(), expression), thisType)
|
||||||
|
|||||||
Reference in New Issue
Block a user