diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/AnnotationCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/AnnotationCodegen.java index ed566547dad..ed6dd01460f 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/AnnotationCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/AnnotationCodegen.java @@ -86,8 +86,7 @@ public abstract class AnnotationCodegen { List annotationEntries = modifierList.getAnnotationEntries(); for (JetAnnotationEntry annotationEntry : annotationEntries) { - ResolvedCall resolvedCall = - bindingContext.get(BindingContext.RESOLVED_CALL, annotationEntry.getCalleeExpression()); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, annotationEntry.getCalleeExpression()); if (resolvedCall == null) continue; // Skipping annotations if they are not resolved. Needed for JetLightClass generation AnnotationDescriptor annotationDescriptor = bindingContext.get(BindingContext.ANNOTATION, annotationEntry); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index 859aba83cdb..7780bd51498 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -464,7 +464,7 @@ public class ExpressionCodegen extends JetVisitor implem // Is it a "1..2" or so RangeCodegenUtil.BinaryCall binaryCall = RangeCodegenUtil.getRangeAsBinaryCall(forExpression); if (binaryCall != null) { - ResolvedCall resolvedCall = bindingContext.get(RESOLVED_CALL, binaryCall.op); + ResolvedCall resolvedCall = bindingContext.get(RESOLVED_CALL, binaryCall.op); if (resolvedCall != null) { if (RangeCodegenUtil.isOptimizableRangeTo(resolvedCall.getResultingDescriptor())) { generateForLoop(new ForInRangeLiteralLoopGenerator(forExpression, binaryCall)); @@ -1625,7 +1625,7 @@ public class ExpressionCodegen extends JetVisitor implem @Override public StackValue visitSimpleNameExpression(@NotNull JetSimpleNameExpression expression, StackValue receiver) { - ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, expression); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, expression); DeclarationDescriptor descriptor; if (resolvedCall == null) { @@ -1894,7 +1894,7 @@ public class ExpressionCodegen extends JetVisitor implem JetExpression callee = expression.getCalleeExpression(); assert callee != null; - ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, callee); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, callee); if (resolvedCall == null) { throw new CompilationException("Cannot resolve: " + callee.getText(), null, expression); } @@ -1922,11 +1922,8 @@ public class ExpressionCodegen extends JetVisitor implem return invokeFunction(call, receiver, resolvedCall); } - private StackValue invokeSamConstructor( - JetCallExpression expression, - ResolvedCall resolvedCall, - JavaClassDescriptor samInterface - ) { + @NotNull + private StackValue invokeSamConstructor(JetCallExpression expression, ResolvedCall resolvedCall, JavaClassDescriptor samInterface) { List arguments = resolvedCall.getValueArgumentsByIndex(); if (arguments == null) { throw new IllegalStateException("Failed to arrange value arguments by index: " + resolvedCall.getResultingDescriptor()); @@ -1994,11 +1991,7 @@ public class ExpressionCodegen extends JetVisitor implem } @NotNull - public StackValue invokeFunction( - Call call, - StackValue receiver, - ResolvedCall resolvedCall - ) { + public StackValue invokeFunction(Call call, StackValue receiver, ResolvedCall resolvedCall) { if (resolvedCall instanceof VariableAsFunctionResolvedCall) { return invokeFunction(call, receiver, ((VariableAsFunctionResolvedCall) resolvedCall).getFunctionCall()); } @@ -2034,7 +2027,7 @@ public class ExpressionCodegen extends JetVisitor implem private StackValue invokeFunctionWithCalleeOnStack( @NotNull Call call, @NotNull StackValue receiver, - @NotNull ResolvedCall resolvedCall, + @NotNull ResolvedCall resolvedCall, @NotNull Callable callable ) { if (callable instanceof CallableMethod) { @@ -2118,7 +2111,7 @@ public class ExpressionCodegen extends JetVisitor implem public void invokeMethodWithArguments( @Nullable Call call, @NotNull CallableMethod callableMethod, - @NotNull ResolvedCall resolvedCall, + @NotNull ResolvedCall resolvedCall, @NotNull StackValue receiver ) { CallableDescriptor descriptor = resolvedCall.getResultingDescriptor(); @@ -2159,11 +2152,7 @@ public class ExpressionCodegen extends JetVisitor implem callGenerator.genCall(callable, resolvedCall, mask, this); } - private void genThisAndReceiverFromResolvedCall( - StackValue receiver, - ResolvedCall resolvedCall, - CallableMethod callableMethod - ) { + private void genThisAndReceiverFromResolvedCall(StackValue receiver, ResolvedCall resolvedCall, CallableMethod callableMethod) { receiver = StackValue.receiver(resolvedCall, receiver, this, callableMethod); receiver.put(receiver.type, v); } @@ -2461,7 +2450,7 @@ public class ExpressionCodegen extends JetVisitor implem FunctionDescriptor functionDescriptor = bindingContext.get(FUNCTION, expression); assert functionDescriptor != null : "Callable reference is not resolved to descriptor: " + expression.getText(); - ResolvedCall resolvedCall = bindingContext.get(RESOLVED_CALL, expression.getCallableReference()); + ResolvedCall resolvedCall = bindingContext.get(RESOLVED_CALL, expression.getCallableReference()); assert resolvedCall != null : "Callable reference is not resolved: " + functionDescriptor + " " + expression.getText(); JetType kFunctionType = bindingContext.get(EXPRESSION_TYPE, expression); @@ -2482,13 +2471,13 @@ public class ExpressionCodegen extends JetVisitor implem } private static class CallableReferenceGenerationStrategy extends FunctionGenerationStrategy.CodegenBased { - private final ResolvedCall resolvedCall; + private final ResolvedCall resolvedCall; private final FunctionDescriptor referencedFunction; public CallableReferenceGenerationStrategy( @NotNull GenerationState state, @NotNull FunctionDescriptor functionDescriptor, - @NotNull ResolvedCall resolvedCall + @NotNull ResolvedCall resolvedCall ) { super(state, functionDescriptor); this.resolvedCall = resolvedCall; @@ -2704,7 +2693,7 @@ public class ExpressionCodegen extends JetVisitor implem return generateIn(StackValue.expression(Type.INT_TYPE, expression.getLeft(), this), expression.getRight(), reference); } else { - ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, reference); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, reference); Call call = bindingContext.get(BindingContext.CALL, reference); DeclarationDescriptor op = bindingContext.get(BindingContext.REFERENCE_TARGET, reference); @@ -2912,8 +2901,7 @@ public class ExpressionCodegen extends JetVisitor implem gen(right, type); } else { - ResolvedCall resolvedCall = - bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference()); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference()); Call call = bindingContext.get(BindingContext.CALL, expression.getOperationReference()); StackValue result = invokeFunction(call, receiver, resolvedCall); type = Type.INT_TYPE; @@ -2975,8 +2963,7 @@ public class ExpressionCodegen extends JetVisitor implem private void callAugAssignMethod(JetBinaryExpression expression, CallableMethod callable, Type lhsType, boolean keepReturnValue) { JetSimpleNameExpression reference = expression.getOperationReference(); - ResolvedCall resolvedCall = - bindingContext.get(BindingContext.RESOLVED_CALL, reference); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, reference); Call call = bindingContext.get(BindingContext.CALL, reference); assert resolvedCall != null : "Resolved call should be not null for operation reference in " + expression.getText(); @@ -3047,8 +3034,7 @@ public class ExpressionCodegen extends JetVisitor implem } DeclarationDescriptor cls = op.getContainingDeclaration(); - ResolvedCall resolvedCall = - bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference()); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference()); assert resolvedCall != null; if (isPrimitiveNumberClassDescriptor(cls) || !(op.getName().asString().equals("inc") || op.getName().asString().equals("dec"))) { @@ -3131,7 +3117,7 @@ public class ExpressionCodegen extends JetVisitor implem storeType = type; } else { - ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference()); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference()); assert resolvedCall != null; Callable callable = resolveToCallable((FunctionDescriptor) op, false); CallableMethod callableMethod = (CallableMethod) callable; @@ -3273,7 +3259,7 @@ public class ExpressionCodegen extends JetVisitor implem @NotNull private StackValue generateNewCall( @NotNull JetCallExpression expression, - @NotNull ResolvedCall resolvedCall, + @NotNull ResolvedCall resolvedCall, @NotNull StackValue receiver ) { Type type = expressionType(expression); @@ -3286,11 +3272,7 @@ public class ExpressionCodegen extends JetVisitor implem } @NotNull - private StackValue generateConstructorCall( - @NotNull ResolvedCall resolvedCall, - @NotNull StackValue receiver, - @NotNull Type type - ) { + private StackValue generateConstructorCall(@NotNull ResolvedCall resolvedCall, @NotNull StackValue receiver, @NotNull Type type) { v.anew(type); v.dup(); @@ -3805,8 +3787,7 @@ The "returned" value of try expression with no finally is either the last expres } private void invokeFunctionByReference(JetSimpleNameExpression operationReference) { - ResolvedCall resolvedCall = - bindingContext.get(RESOLVED_CALL, operationReference); + ResolvedCall resolvedCall = bindingContext.get(RESOLVED_CALL, operationReference); Call call = bindingContext.get(CALL, operationReference); invokeFunction(call, StackValue.none(), resolvedCall); } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java index ed4ee1a36af..917f144a635 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java @@ -1322,7 +1322,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { JetExpression expression = ((JetDelegatorByExpressionSpecifier) specifier).getDelegateExpression(); PropertyDescriptor propertyDescriptor = null; if (expression instanceof JetSimpleNameExpression) { - ResolvedCall call = bindingContext.get(BindingContext.RESOLVED_CALL, expression); + ResolvedCall call = bindingContext.get(BindingContext.RESOLVED_CALL, expression); if (call != null) { CallableDescriptor callResultingDescriptor = call.getResultingDescriptor(); if (callResultingDescriptor instanceof ValueParameterDescriptor) { @@ -1549,8 +1549,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { CallableMethod method = typeMapper.mapToCallableMethod(constructorDescriptor); - ResolvedCall resolvedCall = - bindingContext.get(BindingContext.RESOLVED_CALL, ((JetCallElement) superCall).getCalleeExpression()); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, ((JetCallElement) superCall).getCalleeExpression()); assert resolvedCall != null; ConstructorDescriptor superConstructor = (ConstructorDescriptor) resolvedCall.getResultingDescriptor(); @@ -1651,7 +1650,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { throw new UnsupportedOperationException("unsupported type of enum constant initializer: " + specifier); } - ResolvedCall resolvedCall = + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, ((JetDelegatorToSuperCall) specifier).getCalleeExpression()); assert resolvedCall != null : "Enum entry delegation specifier is unresolved: " + specifier.getText(); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/StackValue.java b/compiler/backend/src/org/jetbrains/jet/codegen/StackValue.java index cffbf1251e7..318ab8299f7 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/StackValue.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/StackValue.java @@ -23,7 +23,6 @@ import org.jetbrains.asm4.Label; import org.jetbrains.asm4.Type; import org.jetbrains.asm4.commons.InstructionAdapter; import org.jetbrains.asm4.commons.Method; -import org.jetbrains.asm4.tree.MethodNode; import org.jetbrains.jet.codegen.intrinsics.IntrinsicMethod; import org.jetbrains.jet.codegen.state.GenerationState; import org.jetbrains.jet.codegen.state.JetTypeMapper; @@ -326,7 +325,7 @@ public abstract class StackValue { } public static StackValue receiver( - ResolvedCall resolvedCall, + ResolvedCall resolvedCall, StackValue receiver, ExpressionCodegen codegen, @Nullable CallableMethod callableMethod @@ -775,7 +774,7 @@ public abstract class StackValue { } } - private boolean isStandardStack(ResolvedCall call, int valueParamsSize) { + private boolean isStandardStack(ResolvedCall call, int valueParamsSize) { if (call == null) { return true; } @@ -1099,14 +1098,14 @@ public abstract class StackValue { } public static class CallReceiver extends StackValue { - private final ResolvedCall resolvedCall; + private final ResolvedCall resolvedCall; final StackValue receiver; private final ExpressionCodegen codegen; private final CallableMethod callableMethod; private final boolean putReceiverArgumentOnStack; public CallReceiver( - ResolvedCall resolvedCall, + ResolvedCall resolvedCall, StackValue receiver, ExpressionCodegen codegen, CallableMethod callableMethod, @@ -1120,11 +1119,7 @@ public abstract class StackValue { this.putReceiverArgumentOnStack = putReceiverArgumentOnStack; } - private static Type calcType( - ResolvedCall resolvedCall, - ExpressionCodegen codegen, - CallableMethod callableMethod - ) { + private static Type calcType(ResolvedCall resolvedCall, ExpressionCodegen codegen, CallableMethod callableMethod) { ReceiverValue thisObject = resolvedCall.getThisObject(); ReceiverValue receiverArgument = resolvedCall.getReceiverArgument(); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/TailRecursionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/TailRecursionCodegen.java index ab550bd161f..457646b007a 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/TailRecursionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/TailRecursionCodegen.java @@ -64,7 +64,7 @@ public class TailRecursionCodegen { return status != null && status.isDoGenerateTailRecursion(); } - public void generateTailRecursion(ResolvedCall resolvedCall) { + public void generateTailRecursion(ResolvedCall resolvedCall) { CallableDescriptor fd = resolvedCall.getResultingDescriptor(); assert fd instanceof FunctionDescriptor : "Resolved call doesn't refer to the function descriptor: " + fd; CallableMethod callable = (CallableMethod) codegen.resolveToCallable((FunctionDescriptor) fd, false); @@ -107,7 +107,7 @@ public class TailRecursionCodegen { JetExpression argumentExpression = argument == null ? null : argument.getArgumentExpression(); if (argumentExpression instanceof JetSimpleNameExpression) { - ResolvedCall resolvedCall = state.getBindingContext().get(RESOLVED_CALL, argumentExpression); + ResolvedCall resolvedCall = state.getBindingContext().get(RESOLVED_CALL, argumentExpression); if (resolvedCall != null && resolvedCall.getResultingDescriptor().equals(parameterDescriptor.getOriginal())) { // do nothing: we shouldn't store argument to itself again AsmUtil.pop(v, type); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java index abd43a47162..165ee2ae2f6 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java @@ -314,8 +314,7 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid { // working around a problem with shallow analysis if (functionDescriptor == null) return; - ResolvedCall referencedFunction = - bindingContext.get(RESOLVED_CALL, expression.getCallableReference()); + ResolvedCall referencedFunction = bindingContext.get(RESOLVED_CALL, expression.getCallableReference()); if (referencedFunction == null) return; JetType superType = getSuperTypeForClosure((FunctionDescriptor) referencedFunction.getResultingDescriptor(), true); @@ -406,7 +405,7 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid { @Override public void visitCallExpression(@NotNull JetCallExpression expression) { super.visitCallExpression(expression); - ResolvedCall call = bindingContext.get(BindingContext.RESOLVED_CALL, expression.getCalleeExpression()); + ResolvedCall call = bindingContext.get(BindingContext.RESOLVED_CALL, expression.getCalleeExpression()); if (call == null) { return; } diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java index 43901c8748b..aae563b9e0d 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java @@ -23,7 +23,6 @@ import org.jetbrains.asm4.Type; import org.jetbrains.asm4.commons.InstructionAdapter; import org.jetbrains.jet.codegen.ExpressionCodegen; import org.jetbrains.jet.codegen.StackValue; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; import org.jetbrains.jet.lang.psi.JetCallExpression; import org.jetbrains.jet.lang.psi.JetExpression; @@ -46,7 +45,7 @@ public class JavaClassArray extends IntrinsicMethod { @Nullable List arguments, StackValue receiver ) { - ResolvedCall call = + ResolvedCall call = codegen.getBindingContext().get(BindingContext.RESOLVED_CALL, ((JetCallExpression) element).getCalleeExpression()); assert call != null; Map.Entry next = call.getValueArguments().entrySet().iterator().next(); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassFunction.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassFunction.java index debb37a8263..130d51aefb7 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassFunction.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassFunction.java @@ -23,7 +23,6 @@ import org.jetbrains.asm4.Type; import org.jetbrains.asm4.commons.InstructionAdapter; import org.jetbrains.jet.codegen.ExpressionCodegen; import org.jetbrains.jet.codegen.StackValue; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.psi.JetCallExpression; import org.jetbrains.jet.lang.psi.JetExpression; import org.jetbrains.jet.lang.resolve.BindingContext; @@ -48,8 +47,7 @@ public class JavaClassFunction extends IntrinsicMethod { StackValue receiver ) { JetCallExpression call = (JetCallExpression) element; - ResolvedCall resolvedCall = - codegen.getBindingContext().get(BindingContext.RESOLVED_CALL, call.getCalleeExpression()); + ResolvedCall resolvedCall = codegen.getBindingContext().get(BindingContext.RESOLVED_CALL, call.getCalleeExpression()); assert resolvedCall != null; JetType returnType = resolvedCall.getResultingDescriptor().getReturnType(); assert returnType != null; diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StupidSync.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StupidSync.java index 415c87dd73f..ab000600b39 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StupidSync.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/StupidSync.java @@ -23,7 +23,6 @@ import org.jetbrains.asm4.Type; import org.jetbrains.asm4.commons.InstructionAdapter; import org.jetbrains.jet.codegen.ExpressionCodegen; import org.jetbrains.jet.codegen.StackValue; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.psi.JetCallExpression; import org.jetbrains.jet.lang.psi.JetExpression; import org.jetbrains.jet.lang.resolve.BindingContext; @@ -47,7 +46,7 @@ public class StupidSync extends IntrinsicMethod { StackValue receiver ) { assert element != null : "Element should not be null"; - ResolvedCall resolvedCall = + ResolvedCall resolvedCall = codegen.getBindingContext().get(BindingContext.RESOLVED_CALL, ((JetCallExpression) element).getCalleeExpression()); assert resolvedCall != null : "Resolved call for " + element.getText() + " should be not null"; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java index 45656172c98..dcc4326c989 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java @@ -377,7 +377,7 @@ public interface Errors { DiagnosticFactory0 INITIALIZER_REQUIRED_FOR_MULTIDECLARATION = DiagnosticFactory0.create(ERROR, DEFAULT); DiagnosticFactory2 COMPONENT_FUNCTION_MISSING = DiagnosticFactory2.create(ERROR, DEFAULT); - DiagnosticFactory2>> COMPONENT_FUNCTION_AMBIGUITY = DiagnosticFactory2.create(ERROR, DEFAULT); + DiagnosticFactory2>> COMPONENT_FUNCTION_AMBIGUITY = DiagnosticFactory2.create(ERROR, DEFAULT); DiagnosticFactory3 COMPONENT_FUNCTION_RETURN_TYPE_MISMATCH = DiagnosticFactory3.create(ERROR, DEFAULT); // Super calls diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/Renderers.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/Renderers.java index 766537f4c01..73effcb8f40 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/Renderers.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/rendering/Renderers.java @@ -106,12 +106,12 @@ public class Renderers { }; public static final Renderer>> AMBIGUOUS_CALLS = - new Renderer>>() { + new Renderer>>() { @NotNull @Override - public String render(@NotNull Collection> argument) { + public String render(@NotNull Collection> argument) { StringBuilder stringBuilder = new StringBuilder("\n"); - for (ResolvedCall call : argument) { + for (ResolvedCall call : argument) { stringBuilder.append(DescriptorRenderer.TEXT.render(call.getResultingDescriptor())).append("\n"); } return stringBuilder.toString(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnnotationResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnnotationResolver.java index f05b93edea4..672fcfe5b9e 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnnotationResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnnotationResolver.java @@ -208,11 +208,10 @@ public class AnnotationResolver { public static void resolveAnnotationArgument( @NotNull AnnotationDescriptorImpl annotationDescriptor, - @NotNull ResolvedCall call, + @NotNull ResolvedCall resolvedCall, @NotNull BindingTrace trace ) { - for (Map.Entry descriptorToArgument : - call.getValueArguments().entrySet()) { + for (Map.Entry descriptorToArgument : resolvedCall.getValueArguments().entrySet()) { ValueParameterDescriptor parameterDescriptor = descriptorToArgument.getKey(); JetType varargElementType = parameterDescriptor.getVarargElementType(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java index 8ccf5bdd842..6f6359410d5 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContext.java @@ -88,8 +88,7 @@ public interface BindingContext { new BasicWritableSlice(DO_NOTHING); @KotlinSignature("val RESOLVED_CALL: WritableSlice>") - WritableSlice> RESOLVED_CALL = - new BasicWritableSlice>(DO_NOTHING); + WritableSlice> RESOLVED_CALL = new BasicWritableSlice>(DO_NOTHING); WritableSlice, TailRecursionKind> TAIL_RECURSION_CALL = Slices.createSimpleSlice(); WritableSlice CONSTRAINT_SYSTEM_COMPLETER = new BasicWritableSlice(DO_NOTHING); WritableSlice CALL = new BasicWritableSlice(DO_NOTHING); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.java index cfe65cb746c..6ffca0a2abb 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.java @@ -39,9 +39,7 @@ import java.util.*; import static org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor.Kind.*; import static org.jetbrains.jet.lang.diagnostics.Errors.AMBIGUOUS_LABEL; -import static org.jetbrains.jet.lang.resolve.BindingContext.AMBIGUOUS_LABEL_TARGET; -import static org.jetbrains.jet.lang.resolve.BindingContext.CAPTURED_IN_CLOSURE; -import static org.jetbrains.jet.lang.resolve.BindingContext.DECLARATION_TO_DESCRIPTOR; +import static org.jetbrains.jet.lang.resolve.BindingContext.*; public class BindingContextUtils { private BindingContextUtils() { @@ -302,7 +300,7 @@ public class BindingContextUtils { ) { if (expression instanceof JetCallExpression) { JetExpression calleeExpression = ((JetCallExpression) expression).getCalleeExpression(); - ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, calleeExpression); + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, calleeExpression); if (resolvedCall instanceof VariableAsFunctionResolvedCall) { return true; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/CompileTimeConstantUtils.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/CompileTimeConstantUtils.java index fa0732638ae..5fc5f3e7770 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/CompileTimeConstantUtils.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/CompileTimeConstantUtils.java @@ -112,11 +112,11 @@ public class CompileTimeConstantUtils { return value instanceof String ? (String) value : null; } - public static boolean isArrayMethodCall(@NotNull ResolvedCall resolvedCall) { + public static boolean isArrayMethodCall(@NotNull ResolvedCall resolvedCall) { return "kotlin.arrays.array".equals(getIntrinsicAnnotationArgument(resolvedCall.getResultingDescriptor().getOriginal())); } - public static boolean isJavaClassMethodCall(@NotNull ResolvedCall resolvedCall) { + public static boolean isJavaClassMethodCall(@NotNull ResolvedCall resolvedCall) { return "kotlin.javaClass.function".equals(getIntrinsicAnnotationArgument(resolvedCall.getResultingDescriptor().getOriginal())); } 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 265b26b70cd..5661e7c53b3 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 @@ -399,8 +399,12 @@ public class CallExpressionResolver { return false; } - private void checkSuper(@NotNull ReceiverValue receiverValue, @NotNull OverloadResolutionResults results, - @NotNull BindingTrace trace, @NotNull JetExpression expression) { + private static void checkSuper( + @NotNull ReceiverValue receiverValue, + @NotNull OverloadResolutionResults results, + @NotNull BindingTrace trace, + @NotNull JetExpression expression + ) { if (!results.isSingleResult()) return; if (!(receiverValue instanceof ExpressionReceiver)) return; JetExpression receiver = ((ExpressionReceiver) receiverValue).getExpression(); diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CandidateResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CandidateResolver.java index ce9d2ec4b14..0c108d01432 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CandidateResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CandidateResolver.java @@ -27,7 +27,10 @@ import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.*; -import org.jetbrains.jet.lang.resolve.calls.autocasts.*; +import org.jetbrains.jet.lang.resolve.calls.autocasts.AutoCastUtils; +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.context.*; import org.jetbrains.jet.lang.resolve.calls.inference.*; import org.jetbrains.jet.lang.resolve.calls.model.*; @@ -347,8 +350,7 @@ public class CandidateResolver { context = context.replaceExpectedType(expectedType); JetExpression keyExpression = getDeferredComputationKeyExpression(expression); - CallCandidateResolutionContext storedContextForArgument = - context.resolutionResultsCache.getDeferredComputation(keyExpression); + CallCandidateResolutionContext storedContextForArgument = context.resolutionResultsCache.getDeferredComputation(keyExpression); PsiElement parent = expression.getParent(); if (parent instanceof JetWhenExpression && expression == ((JetWhenExpression) parent).getSubjectExpression() @@ -361,7 +363,7 @@ public class CandidateResolver { return; } - CallCandidateResolutionContext contextForArgument = storedContextForArgument + CallCandidateResolutionContext contextForArgument = storedContextForArgument .replaceContextDependency(INDEPENDENT).replaceBindingTrace(context.trace).replaceExpectedType(expectedType); JetType type; if (contextForArgument.candidateCall.hasIncompleteTypeParameters() @@ -405,32 +407,27 @@ public class CandidateResolver { JetExpression keyExpression = getDeferredComputationKeyExpression(expression); markResultingCallAsCompleted(context, keyExpression); - CallCandidateResolutionContext storedContextForArgument = + CallCandidateResolutionContext storedContextForArgument = context.resolutionResultsCache.getDeferredComputation(keyExpression); if (storedContextForArgument != null) { completeNestedCallsForNotResolvedInvocation(storedContextForArgument); - CallCandidateResolutionContext newContext = - storedContextForArgument.replaceBindingTrace(context.trace); + CallCandidateResolutionContext newContext = storedContextForArgument.replaceBindingTrace(context.trace); completeUnmappedArguments(newContext, storedContextForArgument.candidateCall.getUnmappedArguments()); argumentTypeResolver.checkTypesForFunctionArgumentsWithNoCallee(newContext.replaceContextDependency(INDEPENDENT)); } } } - private static void markResultingCallAsCompleted( - @NotNull CallResolutionContext context, - @Nullable JetExpression keyExpression - ) { + private static void markResultingCallAsCompleted(@NotNull CallResolutionContext context, @Nullable JetExpression keyExpression) { if (keyExpression == null) return; - CallCandidateResolutionContext storedContextForArgument = - context.resolutionResultsCache.getDeferredComputation(keyExpression); + CallCandidateResolutionContext storedContextForArgument = context.resolutionResultsCache.getDeferredComputation(keyExpression); if (storedContextForArgument == null) return; storedContextForArgument.candidateCall.markCallAsCompleted(); // clean data for "invoke" calls - ResolvedCallWithTrace resolvedCall = context.resolutionResultsCache.getCallForArgument(keyExpression); + ResolvedCallWithTrace resolvedCall = context.resolutionResultsCache.getCallForArgument(keyExpression); assert resolvedCall != null : "Resolved call for '" + keyExpression + "' is not stored, but CallCandidateResolutionContext is."; resolvedCall.markCallAsCompleted(); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/InlineCallResolverExtension.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/InlineCallResolverExtension.java index e1a01597bce..0cf058bad5a 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/InlineCallResolverExtension.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/InlineCallResolverExtension.java @@ -70,9 +70,7 @@ public class InlineCallResolverExtension implements CallResolverExtension { } @Override - public void run( - @NotNull ResolvedCall resolvedCall, @NotNull BasicCallResolutionContext context - ) { + public void run(@NotNull ResolvedCall resolvedCall, @NotNull BasicCallResolutionContext context) { JetExpression expression = context.call.getCalleeExpression(); if (expression == null) { return; @@ -186,7 +184,7 @@ public class InlineCallResolverExtension implements CallResolverExtension { @NotNull BasicCallResolutionContext context, @NotNull JetExpression expression ) { - ResolvedCall thisCall = context.trace.get(BindingContext.RESOLVED_CALL, expression); + ResolvedCall thisCall = context.trace.get(BindingContext.RESOLVED_CALL, expression); return thisCall != null ? thisCall.getResultingDescriptor() : null; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/ResolutionResultsCache.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/ResolutionResultsCache.java index 01944fda42d..4246f294f20 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/ResolutionResultsCache.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/ResolutionResultsCache.java @@ -62,8 +62,8 @@ public interface ResolutionResultsCache { ); @Nullable - CallCandidateResolutionContext getDeferredComputation(@Nullable JetExpression expression); + CallCandidateResolutionContext getDeferredComputation(@Nullable JetExpression expression); @Nullable - ResolvedCallWithTrace getCallForArgument(@Nullable JetExpression expression); + ResolvedCallWithTrace getCallForArgument(@Nullable JetExpression expression); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/ResolutionResultsCacheImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/ResolutionResultsCacheImpl.java index ae058662a83..fe27b6d669d 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/ResolutionResultsCacheImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/ResolutionResultsCacheImpl.java @@ -36,12 +36,11 @@ import static org.jetbrains.jet.lang.psi.Call.CallType; import static org.jetbrains.jet.lang.psi.Call.CallType.*; public class ResolutionResultsCacheImpl implements ResolutionResultsCache { - public static final WritableSlice> - RESOLUTION_RESULTS_FOR_FUNCTION = Slices.createSimpleSlice(); + public static final WritableSlice> RESOLUTION_RESULTS_FOR_FUNCTION = Slices.createSimpleSlice(); public static final WritableSlice> RESOLUTION_RESULTS_FOR_PROPERTY = Slices.createSimpleSlice(); public static final WritableSlice TRACE_DELTAS_CACHE = Slices.createSimpleSlice(); - public static final WritableSlice> DEFERRED_COMPUTATION_FOR_CALL = Slices.createSimpleSlice(); - public static final WritableSlice> RESOLVED_CALL_FOR_ARGUMENT = Slices.createSimpleSlice(); + public static final WritableSlice> DEFERRED_COMPUTATION_FOR_CALL = Slices.createSimpleSlice(); + public static final WritableSlice> RESOLVED_CALL_FOR_ARGUMENT = Slices.createSimpleSlice(); static { BasicWritableSlice.initSliceDebugNames(ResolutionResultsCacheImpl.class); @@ -91,7 +90,7 @@ public class ResolutionResultsCacheImpl implements ResolutionResultsCache { @Override @Nullable - public CallCandidateResolutionContext getDeferredComputation(@Nullable JetExpression expression) { + public CallCandidateResolutionContext getDeferredComputation(@Nullable JetExpression expression) { return getValueTryingAllCallTypes(expression, DEFERRED_COMPUTATION_FOR_CALL); } @@ -113,7 +112,7 @@ public class ResolutionResultsCacheImpl implements ResolutionResultsCache { @Nullable @Override - public ResolvedCallWithTrace getCallForArgument(@Nullable JetExpression expression) { + public ResolvedCallWithTrace getCallForArgument(@Nullable JetExpression expression) { return getValueTryingAllCallTypes(expression, RESOLVED_CALL_FOR_ARGUMENT); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/TemporaryResolutionResultsCache.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/TemporaryResolutionResultsCache.java index d5198c3e9dd..76384000d2c 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/TemporaryResolutionResultsCache.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/context/TemporaryResolutionResultsCache.java @@ -85,8 +85,8 @@ public class TemporaryResolutionResultsCache implements ResolutionResultsCache { @Nullable @Override - public CallCandidateResolutionContext getDeferredComputation(@Nullable JetExpression expression) { - CallCandidateResolutionContext computation = innerCache.getDeferredComputation(expression); + public CallCandidateResolutionContext getDeferredComputation(@Nullable JetExpression expression) { + CallCandidateResolutionContext computation = innerCache.getDeferredComputation(expression); if (computation != null) { return computation; } @@ -95,8 +95,8 @@ public class TemporaryResolutionResultsCache implements ResolutionResultsCache { @Nullable @Override - public ResolvedCallWithTrace getCallForArgument(@Nullable JetExpression expression) { - ResolvedCallWithTrace resolvedCall = innerCache.getCallForArgument(expression); + public ResolvedCallWithTrace getCallForArgument(@Nullable JetExpression expression) { + ResolvedCallWithTrace resolvedCall = innerCache.getCallForArgument(expression); if (resolvedCall != null) { return resolvedCall; } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/model/ResolvedCallImpl.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/model/ResolvedCallImpl.java index 26f5a62adef..c120afa4a51 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/model/ResolvedCallImpl.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/model/ResolvedCallImpl.java @@ -45,16 +45,16 @@ import static org.jetbrains.jet.lang.resolve.calls.results.ResolutionStatus.UNKN public class ResolvedCallImpl implements ResolvedCallWithTrace { - public static final Function, CallableDescriptor> MAP_TO_CANDIDATE = new Function, CallableDescriptor>() { + public static final Function, CallableDescriptor> MAP_TO_CANDIDATE = new Function, CallableDescriptor>() { @Override - public CallableDescriptor fun(ResolvedCallWithTrace resolvedCall) { + public CallableDescriptor fun(ResolvedCallWithTrace resolvedCall) { return resolvedCall.getCandidateDescriptor(); } }; - public static final Function, CallableDescriptor> MAP_TO_RESULT = new Function, CallableDescriptor>() { + public static final Function, CallableDescriptor> MAP_TO_RESULT = new Function, CallableDescriptor>() { @Override - public CallableDescriptor fun(ResolvedCallWithTrace resolvedCall) { + public CallableDescriptor fun(ResolvedCallWithTrace resolvedCall) { return resolvedCall.getResultingDescriptor(); } }; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/results/ResolutionDebugInfo.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/results/ResolutionDebugInfo.java index 4a30b835ad4..5c59f8f4423 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/results/ResolutionDebugInfo.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/results/ResolutionDebugInfo.java @@ -19,7 +19,6 @@ package org.jetbrains.jet.lang.resolve.calls.results; import com.intellij.openapi.application.Application; import com.intellij.openapi.application.ApplicationManager; import com.intellij.psi.PsiElement; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor; import org.jetbrains.jet.lang.resolve.calls.inference.BoundsOwner; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; @@ -27,18 +26,17 @@ import org.jetbrains.jet.lang.resolve.calls.tasks.ResolutionTask; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.util.slicedmap.*; -import java.util.Collection; import java.util.List; import java.util.Map; public class ResolutionDebugInfo { - public static final WritableSlice>> TASKS = Slices.createSimpleSlice(); - public static final WritableSlice> RESULT = Slices.createSimpleSlice(); + public static final WritableSlice>> TASKS = Slices.createSimpleSlice(); + public static final WritableSlice> RESULT = Slices.createSimpleSlice(); - public static final WritableSlice, StringBuilder> ERRORS = Slices.createSimpleSlice(); - public static final WritableSlice, StringBuilder> LOG = Slices.createSimpleSlice(); - public static final WritableSlice, Map> BOUNDS_FOR_UNKNOWNS = Slices.createSimpleSlice(); - public static final WritableSlice, Map> BOUNDS_FOR_KNOWNS = Slices.createSimpleSlice(); + public static final WritableSlice, StringBuilder> ERRORS = Slices.createSimpleSlice(); + public static final WritableSlice, StringBuilder> LOG = Slices.createSimpleSlice(); + public static final WritableSlice, Map> BOUNDS_FOR_UNKNOWNS = Slices.createSimpleSlice(); + public static final WritableSlice, Map> BOUNDS_FOR_KNOWNS = Slices.createSimpleSlice(); public static boolean RESOLUTION_DEBUG_INFO_ENABLED = false; 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 e5655b4969c..3b6d53b9ae9 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 @@ -153,12 +153,12 @@ public class ExpressionTypingUtils { return false; } - ResolvedCall call = context.get(BindingContext.RESOLVED_CALL, callExpression.getCalleeExpression()); - if (call == null) { + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, callExpression.getCalleeExpression()); + if (resolvedCall == null) { return false; } - CallableDescriptor callable = call.getResultingDescriptor(); + CallableDescriptor callable = resolvedCall.getResultingDescriptor(); if (callable instanceof SimpleFunctionDescriptor && ((SimpleFunctionDescriptor) callable).getInlineStrategy().isInline()) { DeclarationDescriptor scopeContainerParent = scopeContainer.getContainingDeclaration(); assert scopeContainerParent != null : "parent is null for " + scopeContainer; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.java b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.java index 9ad3022dec2..41287b7f963 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/types/expressions/ExpressionTypingVisitorForStatements.java @@ -25,7 +25,6 @@ import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; import org.jetbrains.jet.lang.descriptors.SimpleFunctionDescriptor; import org.jetbrains.jet.lang.descriptors.VariableDescriptor; import org.jetbrains.jet.lang.diagnostics.Errors; -import org.jetbrains.jet.lang.evaluate.EvaluatePackage; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.*; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; @@ -273,8 +272,8 @@ public class ExpressionTypingVisitorForStatements extends ExpressionTypingVisito OverloadResolutionResults ambiguityResolutionResults = OverloadResolutionResultsUtil.ambiguity(assignmentOperationDescriptors, binaryOperationDescriptors); context.trace.report(ASSIGN_OPERATOR_AMBIGUITY.on(operationSign, ambiguityResolutionResults.getResultingCalls())); Collection descriptors = Sets.newHashSet(); - for (ResolvedCall call : ambiguityResolutionResults.getResultingCalls()) { - descriptors.add(call.getResultingDescriptor()); + for (ResolvedCall resolvedCall : ambiguityResolutionResults.getResultingCalls()) { + descriptors.add(resolvedCall.getResultingDescriptor()); } dataFlowInfo = facade.getTypeInfo(right, context.replaceDataFlowInfo(dataFlowInfo)).getDataFlowInfo(); context.trace.record(AMBIGUOUS_REFERENCE_TARGET, operationSign, descriptors); diff --git a/compiler/tests/org/jetbrains/jet/checkers/AbstractJetDiagnosticsTest.java b/compiler/tests/org/jetbrains/jet/checkers/AbstractJetDiagnosticsTest.java index 58be78774ff..c52b33aae7c 100644 --- a/compiler/tests/org/jetbrains/jet/checkers/AbstractJetDiagnosticsTest.java +++ b/compiler/tests/org/jetbrains/jet/checkers/AbstractJetDiagnosticsTest.java @@ -22,7 +22,6 @@ import com.intellij.psi.PsiFile; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.JetTestUtils; import org.jetbrains.jet.cli.jvm.compiler.CliLightClassGenerationSupport; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils; import org.jetbrains.jet.lang.psi.JetElement; import org.jetbrains.jet.lang.psi.JetFile; @@ -71,17 +70,16 @@ public abstract class AbstractJetDiagnosticsTest extends BaseDiagnosticsTest { } } - ImmutableMap> resolvedCallsEntries = - bindingContext.getSliceContents(BindingContext.RESOLVED_CALL); - for (Map.Entry> entry : resolvedCallsEntries.entrySet()) { + ImmutableMap> resolvedCallsEntries = bindingContext.getSliceContents(BindingContext.RESOLVED_CALL); + for (Map.Entry> entry : resolvedCallsEntries.entrySet()) { JetElement element = entry.getKey(); - ResolvedCall resolvedCall = entry.getValue(); + ResolvedCall resolvedCall = entry.getValue(); DiagnosticUtils.LineAndColumn lineAndColumn = DiagnosticUtils.getLineAndColumnInPsiFile(element.getContainingFile(), element.getTextRange()); assertTrue("Resolved call for '" + element.getText() + "'" + lineAndColumn + " in not completed", - ((ResolvedCallWithTrace)resolvedCall).isCompleted()); + ((ResolvedCallWithTrace) resolvedCall).isCompleted()); } } } diff --git a/compiler/tests/org/jetbrains/jet/resolve/calls/AbstractResolvedCallsTest.kt b/compiler/tests/org/jetbrains/jet/resolve/calls/AbstractResolvedCallsTest.kt index ae074c87ba2..8468886110a 100644 --- a/compiler/tests/org/jetbrains/jet/resolve/calls/AbstractResolvedCallsTest.kt +++ b/compiler/tests/org/jetbrains/jet/resolve/calls/AbstractResolvedCallsTest.kt @@ -16,18 +16,12 @@ package org.jetbrains.jet.resolve.calls -import com.google.common.collect.ImmutableMap -import org.jetbrains.annotations.NotNull import org.jetbrains.jet.ConfigurationKind import org.jetbrains.jet.JetLiteFixture import org.jetbrains.jet.JetTestUtils -import org.jetbrains.jet.analyzer.AnalyzeExhaust import org.jetbrains.jet.cli.jvm.compiler.JetCoreEnvironment -import org.jetbrains.jet.lang.descriptors.CallableDescriptor import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils import org.jetbrains.jet.lang.psi.JetElement -import org.jetbrains.jet.lang.psi.JetFile -import org.jetbrains.jet.lang.resolve.AnalyzerScriptParameter import org.jetbrains.jet.lang.resolve.BindingContext import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall import org.jetbrains.jet.lang.resolve.calls.tasks.ExplicitReceiverKind @@ -54,14 +48,14 @@ public abstract class AbstractResolvedCallsTest() : JetLiteFixture() { } val explicitReceiverKind = directives.getExplicitReceiverKind() - fun analyzeFileAndGetResolvedCallEntries(): Map> { + fun analyzeFileAndGetResolvedCallEntries(): Map> { val psiFile = JetTestUtils.loadJetFile(getProject(), file) val analyzeExhaust = AnalyzerFacadeForJVM.analyzeOneFileWithJavaIntegration(psiFile, Collections.emptyList()) - val bindingContext = analyzeExhaust!!.getBindingContext() + val bindingContext = analyzeExhaust.getBindingContext() return bindingContext.getSliceContents(BindingContext.RESOLVED_CALL) } - fun checkResolvedCall(resolvedCall: ResolvedCall, element: JetElement) { + fun checkResolvedCall(resolvedCall: ResolvedCall<*>, element: JetElement) { val lineAndColumn = DiagnosticUtils.getLineAndColumnInPsiFile(element.getContainingFile(), element.getTextRange()) val (actualThisObject, actualReceiverArgument, actualExplicitReceiverKind) = with(resolvedCall) { diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java b/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java index 7c915e9d202..bc01eb62f60 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java @@ -19,7 +19,10 @@ package org.jetbrains.jet.plugin.highlighter; import com.intellij.lang.annotation.AnnotationHolder; import com.intellij.psi.PsiElement; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.*; +import org.jetbrains.jet.lang.descriptors.ClassDescriptor; +import org.jetbrains.jet.lang.descriptors.ConstructorDescriptor; +import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; +import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.DescriptorUtils; @@ -64,8 +67,7 @@ public class FunctionsHighlightingVisitor extends AfterAnalysisHighlightingVisit public void visitCallExpression(@NotNull JetCallExpression expression) { JetExpression callee = expression.getCalleeExpression(); if (callee instanceof JetReferenceExpression) { - ResolvedCall resolvedCall = - bindingContext.get(BindingContext.RESOLVED_CALL, (JetReferenceExpression) callee); + ResolvedCall resolvedCall = bindingContext.get(BindingContext.RESOLVED_CALL, (JetReferenceExpression) callee); if (resolvedCall != null) { DeclarationDescriptor calleeDescriptor = resolvedCall.getResultingDescriptor(); if (resolvedCall instanceof VariableAsFunctionResolvedCall) { diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/IdeRenderers.java b/idea/src/org/jetbrains/jet/plugin/highlighter/IdeRenderers.java index 4cf202f14d3..81fd15b9b4d 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/IdeRenderers.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/IdeRenderers.java @@ -61,12 +61,12 @@ public class IdeRenderers { } public static final Renderer>> HTML_AMBIGUOUS_CALLS = - new Renderer>>() { + new Renderer>>() { @NotNull @Override - public String render(@NotNull Collection> calls) { + public String render(@NotNull Collection> calls) { StringBuilder stringBuilder = new StringBuilder(""); - for (ResolvedCall call : calls) { + for (ResolvedCall call : calls) { stringBuilder.append("
  • "); stringBuilder.append(DescriptorRenderer.HTML.render(call.getResultingDescriptor())); stringBuilder.append("
  • "); @@ -84,11 +84,9 @@ public class IdeRenderers { }; public static final Renderer>> HTML_NONE_APPLICABLE_CALLS = - new Renderer>>() { + new Renderer>>() { @Nullable - private ValueParameterDescriptor findParameterByArgumentExpression( - ResolvedCall call, - JetValueArgument argument) { + private ValueParameterDescriptor findParameterByArgumentExpression(ResolvedCall call, JetValueArgument argument) { for (Map.Entry entry : call.getValueArguments().entrySet()) { for (ValueArgument va : entry.getValue().getArguments()) { if (va == argument) { @@ -99,7 +97,7 @@ public class IdeRenderers { return null; } - private Set getParametersToHighlight(ResolvedCall call) { + private Set getParametersToHighlight(ResolvedCall call) { Set parameters = new HashSet(); if (call instanceof ResolvedCallImpl) { Iterable diagnostics = ((ResolvedCallImpl)call).getTrace().getBindingContext().getDiagnostics(); @@ -126,9 +124,9 @@ public class IdeRenderers { @NotNull @Override - public String render(@NotNull Collection> calls) { + public String render(@NotNull Collection> calls) { StringBuilder stringBuilder = new StringBuilder(""); - for (ResolvedCall call : calls) { + for (ResolvedCall call : calls) { stringBuilder.append("
  • "); CallableDescriptor funDescriptor = call.getResultingDescriptor(); Set parametersToHighlight = getParametersToHighlight(call); diff --git a/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolWindow.java b/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolWindow.java index 03ee49e90bc..4ba846fdb7e 100644 --- a/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolWindow.java +++ b/idea/src/org/jetbrains/jet/plugin/internal/resolvewindow/ResolveToolWindow.java @@ -55,7 +55,6 @@ import org.jetbrains.jet.util.slicedmap.ReadOnlySlice; import javax.swing.*; import java.awt.*; -import java.util.List; import java.util.Map; import static org.jetbrains.jet.lang.resolve.BindingContext.*; @@ -200,14 +199,13 @@ public class ResolveToolWindow extends JPanel implements Disposable { private static String renderDebugInfo( PsiElement currentElement, @Nullable ResolutionDebugInfo.Data debugInfo, - @Nullable ResolvedCall call + @Nullable ResolvedCall call ) { StringBuilder result = new StringBuilder(); if (debugInfo != null) { - List> resolutionTasks = debugInfo.get(TASKS); - for (ResolutionTask resolutionTask : resolutionTasks) { - for (ResolvedCallWithTrace resolvedCall : resolutionTask.getResolvedCalls()) { + for (ResolutionTask resolutionTask : debugInfo.get(TASKS)) { + for (ResolvedCallWithTrace resolvedCall : resolutionTask.getResolvedCalls()) { renderResolutionLogForCall(debugInfo, resolvedCall, result); } } @@ -225,11 +223,7 @@ public class ResolveToolWindow extends JPanel implements Disposable { return result.toString(); } - private static void renderResolutionLogForCall( - Data debugInfo, - ResolvedCallWithTrace resolvedCall, - StringBuilder result - ) { + private static void renderResolutionLogForCall(Data debugInfo, ResolvedCallWithTrace resolvedCall, StringBuilder result) { result.append("Trying to call ").append(resolvedCall.getCandidateDescriptor()).append("\n"); StringBuilder errors = debugInfo.getByKey(ERRORS, resolvedCall); if (errors != null) { @@ -265,7 +259,7 @@ public class ResolveToolWindow extends JPanel implements Disposable { } } - private static String renderCall(StringBuilder builder, ResolvedCall resolvedCall) { + private static String renderCall(StringBuilder builder, ResolvedCall resolvedCall) { CallableDescriptor resultingDescriptor = resolvedCall.getResultingDescriptor(); ReceiverValue receiverArgument = resolvedCall.getReceiverArgument(); ReceiverValue thisObject = resolvedCall.getThisObject(); diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/AddNameToArgumentFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/AddNameToArgumentFix.java index 42b4fb63c86..4c7beb512e8 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/AddNameToArgumentFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/AddNameToArgumentFix.java @@ -67,7 +67,7 @@ public class AddNameToArgumentFix extends JetIntentionAction { if (!(callee instanceof JetReferenceExpression)) return Collections.emptyList(); BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) argument.getContainingFile()).getBindingContext(); - ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, (JetReferenceExpression) callee); + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, (JetReferenceExpression) callee); if (resolvedCall == null) return Collections.emptyList(); CallableDescriptor callableDescriptor = resolvedCall.getResultingDescriptor(); diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java index 25344a28575..fb55fd9f905 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java @@ -19,7 +19,6 @@ package org.jetbrains.jet.plugin.quickfix; import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.openapi.editor.Editor; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Pair; import com.intellij.psi.PsiElement; import com.intellij.psi.PsiErrorElement; import com.intellij.psi.PsiFile; @@ -27,7 +26,6 @@ import com.intellij.psi.util.PsiTreeUtil; import com.intellij.util.IncorrectOperationException; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; import org.jetbrains.jet.lang.descriptors.SimpleFunctionDescriptor; import org.jetbrains.jet.lang.diagnostics.Diagnostic; @@ -187,8 +185,7 @@ public class ChangeFunctionReturnTypeFix extends JetIntentionAction JetBinaryExpression expression = QuickFixUtil.getParentElementOfType(diagnostic, JetBinaryExpression.class); assert expression != null : "COMPARE_TO_TYPE_MISMATCH reported on element that is not within any expression"; BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) expression.getContainingFile()).getBindingContext(); - ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, - expression.getOperationReference()); + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, expression.getOperationReference()); if (resolvedCall == null) return null; PsiElement compareTo = BindingContextUtils.descriptorToDeclaration(context, resolvedCall.getCandidateDescriptor()); if (!(compareTo instanceof JetFunction)) return null; diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixFactoryForTypeMismatchError.java b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixFactoryForTypeMismatchError.java index 9eb2dd5314b..aaa57acea09 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixFactoryForTypeMismatchError.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixFactoryForTypeMismatchError.java @@ -20,7 +20,6 @@ import com.intellij.codeInsight.intention.IntentionAction; import com.intellij.psi.PsiElement; import com.intellij.psi.util.PsiTreeUtil; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.diagnostics.Diagnostic; import org.jetbrains.jet.lang.diagnostics.DiagnosticWithParameters2; import org.jetbrains.jet.lang.diagnostics.Errors; @@ -72,7 +71,7 @@ public class QuickFixFactoryForTypeMismatchError implements JetIntentionActionsF // Fixing overloaded operators: if (expression instanceof JetOperationExpression) { - ResolvedCall resolvedCall = + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, ((JetOperationExpression) expression).getOperationReference()); if (resolvedCall != null) { PsiElement declaration = BindingContextUtils.descriptorToDeclaration(context, resolvedCall.getResultingDescriptor()); @@ -84,7 +83,7 @@ public class QuickFixFactoryForTypeMismatchError implements JetIntentionActionsF if (expression.getParent() instanceof JetBinaryExpression) { JetBinaryExpression parentBinary = (JetBinaryExpression) expression.getParent(); if (parentBinary.getRight() == expression) { - ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, parentBinary.getOperationReference()); + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, parentBinary.getOperationReference()); if (resolvedCall != null) { PsiElement declaration = BindingContextUtils.descriptorToDeclaration(context, resolvedCall.getResultingDescriptor()); if (declaration instanceof JetFunction) { @@ -97,7 +96,7 @@ public class QuickFixFactoryForTypeMismatchError implements JetIntentionActionsF // Change function return type when TYPE_MISMATCH is reported on call expression: if (expression instanceof JetCallExpression) { - ResolvedCall resolvedCall = + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, ((JetCallExpression) expression).getCalleeExpression()); if (resolvedCall != null) { PsiElement declaration = BindingContextUtils.descriptorToDeclaration(context, resolvedCall.getResultingDescriptor()); diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixUtil.java b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixUtil.java index 004ebc88284..dcfd84c5b26 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixUtil.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixUtil.java @@ -99,7 +99,7 @@ public class QuickFixUtil { @Nullable public static JetParameterList getParameterListOfCallee(@NotNull JetCallExpression callExpression) { BindingContext context = AnalyzerFacadeWithCache.analyzeFileWithCache((JetFile) callExpression.getContainingFile()).getBindingContext(); - ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, callExpression.getCalleeExpression()); + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, callExpression.getCalleeExpression()); if (resolvedCall == null) return null; PsiElement declaration = BindingContextUtils.descriptorToDeclaration(context, resolvedCall.getCandidateDescriptor()); if (declaration instanceof JetFunction) { diff --git a/idea/src/org/jetbrains/jet/plugin/refactoring/inline/KotlinInlineValHandler.java b/idea/src/org/jetbrains/jet/plugin/refactoring/inline/KotlinInlineValHandler.java index 659d06cea0b..ac6cd89ac12 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/inline/KotlinInlineValHandler.java +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/inline/KotlinInlineValHandler.java @@ -45,12 +45,11 @@ import com.intellij.refactoring.util.RefactoringMessageDialog; import com.intellij.util.Function; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.descriptors.SimpleFunctionDescriptor; import org.jetbrains.jet.lang.descriptors.TypeParameterDescriptor; import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; -import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory; import org.jetbrains.jet.lang.diagnostics.Diagnostic; +import org.jetbrains.jet.lang.diagnostics.DiagnosticFactory; import org.jetbrains.jet.lang.diagnostics.Errors; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; @@ -344,7 +343,7 @@ public class KotlinInlineValHandler extends InlineActionHandler { JetExpression callee = callExpression.getCalleeExpression(); BindingContext context = AnalyzerFacadeWithCache.getContextForElement(initializer); - ResolvedCall call = context.get(BindingContext.RESOLVED_CALL, callee); + ResolvedCall call = context.get(BindingContext.RESOLVED_CALL, callee); if (call == null) { return null; } diff --git a/idea/src/org/jetbrains/jet/plugin/references/JetInvokeFunctionReference.java b/idea/src/org/jetbrains/jet/plugin/references/JetInvokeFunctionReference.java index 5fec3f128a4..ea17f8218b1 100644 --- a/idea/src/org/jetbrains/jet/plugin/references/JetInvokeFunctionReference.java +++ b/idea/src/org/jetbrains/jet/plugin/references/JetInvokeFunctionReference.java @@ -20,7 +20,6 @@ import com.intellij.lang.ASTNode; import com.intellij.openapi.util.TextRange; import com.intellij.psi.MultiRangeReference; import org.jetbrains.annotations.NotNull; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; @@ -49,7 +48,7 @@ class JetInvokeFunctionReference extends JetSimpleReference i @Override @NotNull protected Collection getTargetDescriptors(@NotNull BindingContext context) { - ResolvedCall resolvedCall = context.get(RESOLVED_CALL, getExpression().getCalleeExpression()); + ResolvedCall resolvedCall = context.get(RESOLVED_CALL, getExpression().getCalleeExpression()); if (resolvedCall instanceof VariableAsFunctionResolvedCall) { return Collections.singleton(((VariableAsFunctionResolvedCall) resolvedCall).getCandidateDescriptor()); } diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.java b/js/js.translator/src/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.java index b3718b4765d..28aa0cdc19f 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/initializer/ClassInitializerTranslator.java @@ -20,7 +20,6 @@ import com.google.dart.compiler.backend.js.ast.*; import com.intellij.util.SmartList; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.descriptors.ConstructorDescriptor; import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; import org.jetbrains.jet.lang.descriptors.PropertyDescriptor; @@ -125,7 +124,7 @@ public final class ClassInitializerTranslator extends AbstractTranslator { @NotNull private List translateArguments(@NotNull JetDelegatorToSuperCall superCall) { - ResolvedCall call = context().bindingContext().get(BindingContext.RESOLVED_CALL, superCall.getCalleeExpression()); + ResolvedCall call = context().bindingContext().get(BindingContext.RESOLVED_CALL, superCall.getCalleeExpression()); assert call != null : "ResolvedCall for superCall must be not null"; return CallArgumentTranslator.translate(call, null, context()).getTranslateArguments(); } diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/utils/BindingUtils.java b/js/js.translator/src/org/jetbrains/k2js/translate/utils/BindingUtils.java index a1dc805c997..5f28104ce36 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/utils/BindingUtils.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/utils/BindingUtils.java @@ -137,17 +137,15 @@ public final class BindingUtils { } @NotNull - public static ResolvedCall getResolvedCall(@NotNull BindingContext context, - @NotNull JetExpression expression) { - ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, expression); + public static ResolvedCall getResolvedCall(@NotNull BindingContext context, @NotNull JetExpression expression) { + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, expression); assert resolvedCall != null : message(expression, expression.getText() + " must resolve to a call"); return resolvedCall; } @NotNull - public static ResolvedCall getResolvedCallForProperty(@NotNull BindingContext context, - @NotNull JetExpression expression) { - ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, expression); + public static ResolvedCall getResolvedCallForProperty(@NotNull BindingContext context, @NotNull JetExpression expression) { + ResolvedCall resolvedCall = context.get(BindingContext.RESOLVED_CALL, expression); assert resolvedCall != null : message(expression, expression.getText() + " must resolve to a call"); if (resolvedCall instanceof VariableAsFunctionResolvedCall) { return ((VariableAsFunctionResolvedCall) resolvedCall).getVariableCall();