Removed ExpressionTypingContext.containingDeclaration
it's always scope.getContainingDeclaration()
This commit is contained in:
+1
-1
@@ -143,7 +143,7 @@ public class CallExpressionResolver {
|
|||||||
|
|
||||||
ClassDescriptor classObject = ((ClassDescriptor) classifier).getClassObjectDescriptor();
|
ClassDescriptor classObject = ((ClassDescriptor) classifier).getClassObjectDescriptor();
|
||||||
assert classObject != null : "This check should be done only for classes with class objects: " + classifier;
|
assert classObject != null : "This check should be done only for classes with class objects: " + classifier;
|
||||||
DeclarationDescriptor from = context.containingDeclaration;
|
DeclarationDescriptor from = context.scope.getContainingDeclaration();
|
||||||
if (!Visibilities.isVisible(classObject, from)) {
|
if (!Visibilities.isVisible(classObject, from)) {
|
||||||
context.trace.report(INVISIBLE_MEMBER.on(expression, classObject, classObject.getVisibility(), from));
|
context.trace.report(INVISIBLE_MEMBER.on(expression, classObject, classObject.getVisibility(), from));
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-7
@@ -17,7 +17,6 @@
|
|||||||
package org.jetbrains.jet.lang.types.expressions;
|
package org.jetbrains.jet.lang.types.expressions;
|
||||||
|
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor;
|
|
||||||
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
import org.jetbrains.jet.lang.resolve.BindingTrace;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.CallResolverExtension;
|
import org.jetbrains.jet.lang.resolve.calls.CallResolverExtension;
|
||||||
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo;
|
||||||
@@ -47,7 +46,7 @@ public class ExpressionTypingContext extends ResolutionContext<ExpressionTypingC
|
|||||||
@NotNull
|
@NotNull
|
||||||
public static ExpressionTypingContext newContext(@NotNull ResolutionContext context) {
|
public static ExpressionTypingContext newContext(@NotNull ResolutionContext context) {
|
||||||
return new ExpressionTypingContext(
|
return new ExpressionTypingContext(
|
||||||
context.trace, context.scope, context.scope.getContainingDeclaration(), context.dataFlowInfo, context.expectedType,
|
context.trace, context.scope, context.dataFlowInfo, context.expectedType,
|
||||||
context.contextDependency, context.resolutionResultsCache, context.callResolverExtension, context.isAnnotationContext,
|
context.contextDependency, context.resolutionResultsCache, context.callResolverExtension, context.isAnnotationContext,
|
||||||
context.collectAllCandidates
|
context.collectAllCandidates
|
||||||
);
|
);
|
||||||
@@ -65,17 +64,15 @@ public class ExpressionTypingContext extends ResolutionContext<ExpressionTypingC
|
|||||||
boolean isAnnotationContext
|
boolean isAnnotationContext
|
||||||
) {
|
) {
|
||||||
return new ExpressionTypingContext(
|
return new ExpressionTypingContext(
|
||||||
trace, scope, scope.getContainingDeclaration(), dataFlowInfo, expectedType, contextDependency,
|
trace, scope, dataFlowInfo, expectedType, contextDependency,
|
||||||
resolutionResultsCache, callResolverExtension, isAnnotationContext, false);
|
resolutionResultsCache, callResolverExtension, isAnnotationContext, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final DeclarationDescriptor containingDeclaration;
|
|
||||||
private CompileTimeConstantChecker compileTimeConstantChecker;
|
private CompileTimeConstantChecker compileTimeConstantChecker;
|
||||||
|
|
||||||
private ExpressionTypingContext(
|
private ExpressionTypingContext(
|
||||||
@NotNull BindingTrace trace,
|
@NotNull BindingTrace trace,
|
||||||
@NotNull JetScope scope,
|
@NotNull JetScope scope,
|
||||||
@NotNull DeclarationDescriptor containingDeclaration,
|
|
||||||
@NotNull DataFlowInfo dataFlowInfo,
|
@NotNull DataFlowInfo dataFlowInfo,
|
||||||
@NotNull JetType expectedType,
|
@NotNull JetType expectedType,
|
||||||
@NotNull ContextDependency contextDependency,
|
@NotNull ContextDependency contextDependency,
|
||||||
@@ -86,7 +83,6 @@ public class ExpressionTypingContext extends ResolutionContext<ExpressionTypingC
|
|||||||
) {
|
) {
|
||||||
super(trace, scope, expectedType, dataFlowInfo, contextDependency, resolutionResultsCache, callResolverExtension,
|
super(trace, scope, expectedType, dataFlowInfo, contextDependency, resolutionResultsCache, callResolverExtension,
|
||||||
isAnnotationContext, collectAllCandidates);
|
isAnnotationContext, collectAllCandidates);
|
||||||
this.containingDeclaration = containingDeclaration;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -99,7 +95,7 @@ public class ExpressionTypingContext extends ResolutionContext<ExpressionTypingC
|
|||||||
@NotNull ResolutionResultsCache resolutionResultsCache,
|
@NotNull ResolutionResultsCache resolutionResultsCache,
|
||||||
boolean collectAllCandidates
|
boolean collectAllCandidates
|
||||||
) {
|
) {
|
||||||
return new ExpressionTypingContext(trace, scope, containingDeclaration, dataFlowInfo,
|
return new ExpressionTypingContext(trace, scope, dataFlowInfo,
|
||||||
expectedType, contextDependency, resolutionResultsCache, callResolverExtension,
|
expectedType, contextDependency, resolutionResultsCache, callResolverExtension,
|
||||||
isAnnotationContext, collectAllCandidates);
|
isAnnotationContext, collectAllCandidates);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user