diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptBodyResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptBodyResolver.java index 91b636894ed..e4eb0e028e6 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptBodyResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/ScriptBodyResolver.java @@ -20,6 +20,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.ScriptDescriptor; import org.jetbrains.jet.lang.psi.JetScript; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; +import org.jetbrains.jet.lang.resolve.calls.context.ExpressionPosition; import org.jetbrains.jet.lang.resolve.scopes.WritableScope; import org.jetbrains.jet.lang.types.ErrorUtils; import org.jetbrains.jet.lang.types.JetType; @@ -73,7 +74,7 @@ public class ScriptBodyResolver { scope, DataFlowInfo.EMPTY, NO_EXPECTED_TYPE, - false); + ExpressionPosition.FREE); JetType returnType = expressionTypingServices.getBlockReturnedType(scope, declaration.getBlockExpression(), CoercionStrategy.NO_COERCION, context, trace).getType(); if (returnType == null) { returnType = ErrorUtils.createErrorType("getBlockReturnedType returned null"); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallExpressionResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallExpressionResolver.java index 105d6802e91..ec3a470a2ad 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallExpressionResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallExpressionResolver.java @@ -25,9 +25,7 @@ import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.BindingTrace; import org.jetbrains.jet.lang.resolve.TemporaryBindingTrace; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; -import org.jetbrains.jet.lang.resolve.calls.context.BasicCallResolutionContext; -import org.jetbrains.jet.lang.resolve.calls.context.TypeInfoForCall; -import org.jetbrains.jet.lang.resolve.calls.context.ResolutionContext; +import org.jetbrains.jet.lang.resolve.calls.context.*; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults; import org.jetbrains.jet.lang.resolve.calls.util.CallMaker; @@ -50,7 +48,6 @@ import static org.jetbrains.jet.lang.diagnostics.Errors.*; import static org.jetbrains.jet.lang.resolve.BindingContext.*; import static org.jetbrains.jet.lang.resolve.DescriptorUtils.getStaticNestedClassesScope; -import org.jetbrains.jet.lang.resolve.calls.context.ResolveMode; import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE; public class CallExpressionResolver { @@ -71,12 +68,12 @@ public class CallExpressionResolver { if (classObjectType != null) { context.trace.record(REFERENCE_TARGET, expression, classifier); JetType result; - if (context.namespacesAllowed && classifier instanceof ClassDescriptor) { + if (context.expressionPosition == ExpressionPosition.LHS_OF_DOT && classifier instanceof ClassDescriptor) { JetScope scope = new ChainedScope(classifier, classObjectType.getMemberScope(), getStaticNestedClassesScope((ClassDescriptor) classifier)); result = new NamespaceType(referencedName, scope); } - else if (context.namespacesAllowed || classifier.isClassObjectAValue()) { + else if (context.expressionPosition == ExpressionPosition.LHS_OF_DOT || classifier.isClassObjectAValue()) { result = classObjectType; } else { @@ -95,7 +92,7 @@ public class CallExpressionResolver { } // To report NO_CLASS_OBJECT when no namespace found if (classifier != null) { - if (!context.namespacesAllowed) { + if (context.expressionPosition == ExpressionPosition.FREE) { context.trace.report(NO_CLASS_OBJECT.on(expression, classifier)); } context.trace.record(REFERENCE_TARGET, expression, classifier); @@ -117,7 +114,7 @@ public class CallExpressionResolver { if (namespaceType == null) { return false; } - if (context.namespacesAllowed) { + if (context.expressionPosition == ExpressionPosition.LHS_OF_DOT) { result[0] = namespaceType; return true; } @@ -218,7 +215,7 @@ public class CallExpressionResolver { JetType type = getVariableType(nameExpression, receiver, callOperationNode, context.replaceBindingTrace(traceForVariable), result); if (result[0]) { traceForVariable.commit(); - if (type instanceof NamespaceType && !context.namespacesAllowed) { + if (type instanceof NamespaceType && context.expressionPosition == ExpressionPosition.FREE) { type = null; } return JetTypeInfo.create(type, context.dataFlowInfo); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java index 9c9f2c5a164..689564cd1be 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallResolver.java @@ -28,6 +28,7 @@ import org.jetbrains.jet.lang.resolve.*; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; import org.jetbrains.jet.lang.resolve.calls.context.BasicCallResolutionContext; import org.jetbrains.jet.lang.resolve.calls.context.CallCandidateResolutionContext; +import org.jetbrains.jet.lang.resolve.calls.context.ExpressionPosition; import org.jetbrains.jet.lang.resolve.calls.context.ResolveMode; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallImpl; @@ -128,7 +129,7 @@ public class CallResolver { @NotNull JetType expectedType, @NotNull DataFlowInfo dataFlowInfo ) { - return resolveFunctionCall(BasicCallResolutionContext.create(trace, scope, call, expectedType, dataFlowInfo, ResolveMode.TOP_LEVEL_CALL, false)); + return resolveFunctionCall(BasicCallResolutionContext.create(trace, scope, call, expectedType, dataFlowInfo, ResolveMode.TOP_LEVEL_CALL, ExpressionPosition.FREE)); } @NotNull @@ -490,7 +491,7 @@ public class CallResolver { public List getFunctionLiteralArguments() { return Collections.emptyList(); } - }, task.expectedType, task.dataFlowInfo, task.resolveMode, task.namespacesAllowed); + }, task.expectedType, task.dataFlowInfo, task.resolveMode, task.expressionPosition); OverloadResolutionResultsImpl resultsWithFunctionLiteralsStripped = performResolution(newTask, callTransformer, traceForResolutionCache); if (resultsWithFunctionLiteralsStripped.isSuccess() || resultsWithFunctionLiteralsStripped.isAmbiguity()) { task.tracing.danglingFunctionLiteralArgumentSuspected(task.trace, task.call.getFunctionLiteralArguments()); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformer.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformer.java index 03f913afac4..23aedd22b3b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformer.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallTransformer.java @@ -193,7 +193,7 @@ public class CallTransformer { final DelegatingBindingTrace variableCallTrace = context.candidateCall.getTrace(); BasicCallResolutionContext basicCallResolutionContext = BasicCallResolutionContext.create( - variableCallTrace, context.scope, functionCall, context.expectedType, context.dataFlowInfo, context.resolveMode, context.namespacesAllowed); + variableCallTrace, context.scope, functionCall, context.expectedType, context.dataFlowInfo, context.resolveMode, context.expressionPosition); // 'invoke' call resolve OverloadResolutionResults results = callResolver.resolveCallWithGivenName(basicCallResolutionContext, task.reference, Name.identifier("invoke")); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/BasicCallResolutionContext.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/BasicCallResolutionContext.java index 39291033a8c..fb6498907b1 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/BasicCallResolutionContext.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/BasicCallResolutionContext.java @@ -32,19 +32,20 @@ public class BasicCallResolutionContext extends CallResolutionContext @NotNull JetType expectedType, @NotNull DataFlowInfo dataFlowInfo, @NotNull ResolveMode resolveMode, - boolean namespacesAllowed + ExpressionPosition expressionPosition ) { - super(trace, scope, call, expectedType, dataFlowInfo, resolveMode, namespacesAllowed); + super(trace, scope, call, expectedType, dataFlowInfo, resolveMode, expressionPosition); this.candidateCall = candidateCall; this.tracing = tracing; } @@ -54,7 +54,7 @@ public final class CallCandidateResolutionContext @NotNull TracingStrategy tracing, @NotNull Call call) { candidateCall.setInitialDataFlowInfo(context.dataFlowInfo); return new CallCandidateResolutionContext(candidateCall, tracing, trace, context.scope, call, context.expectedType, - context.dataFlowInfo, context.resolveMode, context.namespacesAllowed); + context.dataFlowInfo, context.resolveMode, context.expressionPosition); } public static CallCandidateResolutionContext create( @@ -74,7 +74,7 @@ public final class CallCandidateResolutionContext @NotNull ResolveMode resolveMode, @NotNull TracingStrategy tracing ) { return new CallCandidateResolutionContext(candidateCall, tracing, context.trace, context.scope, call, - context.expectedType, context.dataFlowInfo, resolveMode, context.namespacesAllowed); + context.expectedType, context.dataFlowInfo, resolveMode, context.expressionPosition); } @Override @@ -83,10 +83,10 @@ public final class CallCandidateResolutionContext @NotNull JetScope scope, @NotNull DataFlowInfo dataFlowInfo, @NotNull JetType expectedType, - boolean namespacesAllowed + ExpressionPosition expressionPosition ) { return new CallCandidateResolutionContext( - candidateCall, tracing, trace, scope, call, expectedType, dataFlowInfo, resolveMode, namespacesAllowed); + candidateCall, tracing, trace, scope, call, expectedType, dataFlowInfo, resolveMode, expressionPosition); } @Override @@ -98,6 +98,6 @@ public final class CallCandidateResolutionContext public CallCandidateResolutionContext replaceResolveMode(@NotNull ResolveMode newResolveMode) { if (newResolveMode == resolveMode) return this; return new CallCandidateResolutionContext( - candidateCall, tracing, trace, scope, call, expectedType, dataFlowInfo, newResolveMode, namespacesAllowed); + candidateCall, tracing, trace, scope, call, expectedType, dataFlowInfo, newResolveMode, expressionPosition); } } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/CallResolutionContext.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/CallResolutionContext.java index aa01508cfd5..17617ab01e3 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/CallResolutionContext.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/CallResolutionContext.java @@ -33,14 +33,14 @@ public abstract class CallResolutionContext { public final JetScope scope; public final JetType expectedType; public final DataFlowInfo dataFlowInfo; - // true for positions on the lhs of a '.', i.e. allows namespace results and 'super' - public final boolean namespacesAllowed; + public final ExpressionPosition expressionPosition; protected ResolutionContext( BindingTrace trace, JetScope scope, JetType expectedType, DataFlowInfo dataFlowInfo, - boolean namespacesAllowed + ExpressionPosition expressionPosition ) { this.trace = trace; this.scope = scope; this.expectedType = expectedType; this.dataFlowInfo = dataFlowInfo; - this.namespacesAllowed = namespacesAllowed; + this.expressionPosition = expressionPosition; } protected abstract Context create( @@ -52,38 +50,38 @@ public abstract class ResolutionContext { @NotNull JetScope scope, @NotNull DataFlowInfo dataFlowInfo, @NotNull JetType expectedType, - boolean namespacesAllowed + ExpressionPosition expressionPosition ); protected abstract Context self(); public Context replaceBindingTrace(@NotNull BindingTrace trace) { if (this.trace == trace) return self(); - return create(trace, scope, dataFlowInfo, expectedType, namespacesAllowed); + return create(trace, scope, dataFlowInfo, expectedType, expressionPosition); } @NotNull - public Context replaceNamespacesAllowed(boolean namespacesAllowed) { - if (namespacesAllowed == this.namespacesAllowed) return self(); - return create(trace, scope, dataFlowInfo, expectedType, namespacesAllowed); + public Context replaceExpressionPosition(@NotNull ExpressionPosition expressionPosition) { + if (expressionPosition == this.expressionPosition) return self(); + return create(trace, scope, dataFlowInfo, expectedType, expressionPosition); } @NotNull - public Context replaceDataFlowInfo(DataFlowInfo newDataFlowInfo) { + public Context replaceDataFlowInfo(@NotNull DataFlowInfo newDataFlowInfo) { if (newDataFlowInfo == dataFlowInfo) return self(); - return create(trace, scope, newDataFlowInfo, expectedType, namespacesAllowed); + return create(trace, scope, newDataFlowInfo, expectedType, expressionPosition); } @NotNull public Context replaceExpectedType(@Nullable JetType newExpectedType) { if (newExpectedType == null) return replaceExpectedType(TypeUtils.NO_EXPECTED_TYPE); if (expectedType == newExpectedType) return self(); - return create(trace, scope, dataFlowInfo, newExpectedType, namespacesAllowed); + return create(trace, scope, dataFlowInfo, newExpectedType, expressionPosition); } @NotNull public Context replaceScope(@NotNull JetScope newScope) { if (newScope == scope) return self(); - return create(trace, newScope, dataFlowInfo, expectedType, namespacesAllowed); + return create(trace, newScope, dataFlowInfo, expectedType, expressionPosition); } } \ No newline at end of file diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/ResolutionTask.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/ResolutionTask.java index 762013ad00f..1be0298a2f8 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/ResolutionTask.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/tasks/ResolutionTask.java @@ -25,6 +25,7 @@ import org.jetbrains.jet.lang.resolve.BindingTrace; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; import org.jetbrains.jet.lang.resolve.calls.context.BasicCallResolutionContext; import org.jetbrains.jet.lang.resolve.calls.context.CallResolutionContext; +import org.jetbrains.jet.lang.resolve.calls.context.ExpressionPosition; import org.jetbrains.jet.lang.resolve.calls.context.ResolveMode; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCallWithTrace; import org.jetbrains.jet.lang.resolve.scopes.JetScope; @@ -45,15 +46,15 @@ public class ResolutionTask extends C public ResolutionTask( @NotNull Collection> candidates, @NotNull JetReferenceExpression reference, @NotNull TracingStrategy tracing, - BindingTrace trace, JetScope scope, Call call, JetType expectedType, DataFlowInfo dataFlowInfo, ResolveMode resolveMode, boolean namespacesAllowed) { - super(trace, scope, call, expectedType, dataFlowInfo, resolveMode, namespacesAllowed); + BindingTrace trace, JetScope scope, Call call, JetType expectedType, DataFlowInfo dataFlowInfo, ResolveMode resolveMode, ExpressionPosition expressionPosition) { + super(trace, scope, call, expectedType, dataFlowInfo, resolveMode, expressionPosition); this.candidates = candidates; this.reference = reference; this.tracing = tracing; } public ResolutionTask(@NotNull Collection> candidates, @NotNull JetReferenceExpression reference, @NotNull BasicCallResolutionContext context) { - this(candidates, reference, TracingStrategyImpl.create(reference, context.call), context.trace, context.scope, context.call, context.expectedType, context.dataFlowInfo, context.resolveMode, context.namespacesAllowed); + this(candidates, reference, TracingStrategyImpl.create(reference, context.call), context.trace, context.scope, context.call, context.expectedType, context.dataFlowInfo, context.resolveMode, context.expressionPosition); } @NotNull @@ -83,9 +84,9 @@ public class ResolutionTask extends C @NotNull JetScope scope, @NotNull DataFlowInfo dataFlowInfo, @NotNull JetType expectedType, - boolean namespacesAllowed + ExpressionPosition expressionPosition ) { - ResolutionTask newTask = new ResolutionTask(candidates, reference, tracing, trace, scope, call, expectedType, dataFlowInfo, resolveMode, namespacesAllowed); + ResolutionTask newTask = new ResolutionTask(candidates, reference, tracing, trace, scope, call, expectedType, dataFlowInfo, resolveMode, expressionPosition); newTask.setCheckingStrategy(checkingStrategy); return newTask; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.java index 689b9b3160f..494fc27382d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/BasicExpressionTypingVisitor.java @@ -33,6 +33,7 @@ import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowValue; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowValueFactory; import org.jetbrains.jet.lang.resolve.calls.autocasts.Nullability; +import org.jetbrains.jet.lang.resolve.calls.context.ExpressionPosition; import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults; import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResultsUtil; import org.jetbrains.jet.lang.resolve.calls.util.CallMaker; @@ -57,7 +58,6 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.*; import static org.jetbrains.jet.lang.resolve.scopes.receivers.ReceiverValue.NO_RECEIVER; import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE; import static org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils.*; -import static org.jetbrains.jet.lang.types.expressions.OperatorConventions.*; @SuppressWarnings("SuspiciousMethodCalls") public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor { @@ -421,7 +421,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor { public JetTypeInfo visitSuperExpression(JetSuperExpression expression, ExpressionTypingContext context) { LabelResolver.LabeledReceiverResolutionResult resolutionResult = resolveToReceiver(expression, context, true); - if (!context.namespacesAllowed) { + if (context.expressionPosition == ExpressionPosition.FREE) { context.trace.report(SUPER_IS_NOT_AN_EXPRESSION.on(expression, expression.getText())); return errorInSuper(expression, context); } @@ -1036,7 +1036,7 @@ public class BasicExpressionTypingVisitor extends ExpressionTypingVisitor { @Override public JetTypeInfo visitRootNamespaceExpression(JetRootNamespaceExpression expression, ExpressionTypingContext context) { - if (context.namespacesAllowed) { + if (context.expressionPosition == ExpressionPosition.LHS_OF_DOT) { return DataFlowUtils.checkType(JetModuleUtil.getRootNamespaceType(expression), expression, context, context.dataFlowInfo); } context.trace.report(NAMESPACE_IS_NOT_AN_EXPRESSION.on(expression)); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.java index 9e79c7e5b07..98f75c0bd8f 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingContext.java @@ -23,6 +23,7 @@ import org.jetbrains.jet.lang.psi.JetReferenceExpression; import org.jetbrains.jet.lang.resolve.BindingTrace; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; import org.jetbrains.jet.lang.resolve.calls.context.BasicCallResolutionContext; +import org.jetbrains.jet.lang.resolve.calls.context.ExpressionPosition; import org.jetbrains.jet.lang.resolve.calls.context.ResolutionContext; import org.jetbrains.jet.lang.resolve.calls.context.ResolveMode; import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults; @@ -40,8 +41,8 @@ public class ExpressionTypingContext extends ResolutionContext returnedExpressions = Lists.newArrayList(); if (function.hasBlockBody()) { @@ -363,7 +364,7 @@ public class ExpressionTypingServices { private ExpressionTypingContext createContext(ExpressionTypingContext oldContext, BindingTrace trace, WritableScope scope, DataFlowInfo dataFlowInfo, JetType expectedType) { return ExpressionTypingContext.newContext( - this, oldContext.labelResolver, trace, scope, dataFlowInfo, expectedType, oldContext.namespacesAllowed); + this, oldContext.labelResolver, trace, scope, dataFlowInfo, expectedType, oldContext.expressionPosition); } @Nullable diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.java index f4d01867eac..1710a9d8a30 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingUtils.java @@ -33,6 +33,7 @@ import org.jetbrains.jet.lang.diagnostics.Diagnostic; import org.jetbrains.jet.lang.diagnostics.Errors; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.*; +import org.jetbrains.jet.lang.resolve.calls.context.ExpressionPosition; import org.jetbrains.jet.lang.resolve.calls.util.CallMaker; import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; @@ -166,7 +167,7 @@ public class ExpressionTypingUtils { scope, DataFlowInfo.EMPTY, TypeUtils.NO_EXPECTED_TYPE, - false + ExpressionPosition.FREE ); return ControlStructureTypingVisitor.checkIterableConvention(expressionReceiver, context) != null; } diff --git a/compiler/tests/org/jetbrains/jet/resolve/JetExpectedResolveDataUtil.java b/compiler/tests/org/jetbrains/jet/resolve/JetExpectedResolveDataUtil.java index ab822d7170a..bebab56392a 100644 --- a/compiler/tests/org/jetbrains/jet/resolve/JetExpectedResolveDataUtil.java +++ b/compiler/tests/org/jetbrains/jet/resolve/JetExpectedResolveDataUtil.java @@ -28,6 +28,7 @@ import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; import org.jetbrains.jet.lang.resolve.BindingTraceContext; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; +import org.jetbrains.jet.lang.resolve.calls.context.ExpressionPosition; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults; import org.jetbrains.jet.lang.resolve.java.PsiClassFinder; @@ -132,7 +133,7 @@ public class JetExpectedResolveDataUtil { ExpressionTypingContext context = ExpressionTypingContext.newContext( expressionTypingServices, new BindingTraceContext(), classDescriptor.getDefaultType().getMemberScope(), - DataFlowInfo.EMPTY, TypeUtils.NO_EXPECTED_TYPE, false); + DataFlowInfo.EMPTY, TypeUtils.NO_EXPECTED_TYPE, ExpressionPosition.FREE); OverloadResolutionResults functions = resolveFakeCall( context, ReceiverValue.NO_RECEIVER, Name.identifier(name), parameterTypes);