diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/AnnotationCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/AnnotationCodegen.java index d871bca5a11..555c5f4c26a 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/AnnotationCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/AnnotationCodegen.java @@ -45,7 +45,7 @@ import java.util.*; import static org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor.Kind.DELEGATION; import static org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils.descriptorToDeclaration; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCall; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCall; public abstract class AnnotationCodegen { diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java index 46eaa4cf146..c20f09bfee1 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ExpressionCodegen.java @@ -81,8 +81,7 @@ import static org.jetbrains.jet.lang.psi.PsiPackage.JetPsiFactory; import static org.jetbrains.jet.lang.resolve.BindingContext.*; import static org.jetbrains.jet.lang.resolve.BindingContextUtils.getNotNull; import static org.jetbrains.jet.lang.resolve.BindingContextUtils.isVarCapturedInClosure; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCall; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCallWithAssert; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.*; import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.*; import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.KotlinSyntheticClass; import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.OtherOrigin; diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java index 715b9e2462e..0a685f8392d 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/ImplementationBodyCodegen.java @@ -44,8 +44,8 @@ import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.DeclarationResolver; import org.jetbrains.jet.lang.resolve.DescriptorUtils; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; import org.jetbrains.jet.lang.resolve.calls.CallResolverUtil; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.DefaultValueArgument; import org.jetbrains.jet.lang.resolve.calls.model.ExpressionValueArgument; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; @@ -75,7 +75,7 @@ import static org.jetbrains.jet.codegen.binding.CodegenBinding.*; import static org.jetbrains.jet.descriptors.serialization.NameSerializationUtil.createNameResolver; import static org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils.descriptorToDeclaration; import static org.jetbrains.jet.lang.resolve.DescriptorUtils.*; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCallWithAssert; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCallWithAssert; import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.*; import static org.jetbrains.jet.lang.resolve.java.JvmAnnotationNames.KotlinSyntheticClass; import static org.jetbrains.jet.lang.resolve.java.diagnostics.DiagnosticsPackage.DelegationToTraitImpl; @@ -1360,7 +1360,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { private PropertyDescriptor getDelegatePropertyIfAny(JetExpression expression) { PropertyDescriptor propertyDescriptor = null; if (expression instanceof JetSimpleNameExpression) { - ResolvedCall call = BindingContextUtilPackage.getResolvedCall(expression, bindingContext); + ResolvedCall call = CallUtilPackage.getResolvedCall(expression, bindingContext); if (call != null) { CallableDescriptor callResultingDescriptor = call.getResultingDescriptor(); if (callResultingDescriptor instanceof ValueParameterDescriptor) { @@ -1549,7 +1549,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { ) { iv.load(0, OBJECT_TYPE); - ResolvedCall resolvedCall = getResolvedCallWithAssert(superCall, bindingContext); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCallWithAssert(superCall, bindingContext); ConstructorDescriptor superConstructor = (ConstructorDescriptor) resolvedCall.getResultingDescriptor(); CallableMethod superCallable = typeMapper.mapToCallableMethod(superConstructor); @@ -1701,7 +1701,7 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen { throw new UnsupportedOperationException("unsupported type of enum constant initializer: " + specifier); } - ResolvedCall resolvedCall = getResolvedCallWithAssert(specifier, bindingContext); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCallWithAssert(specifier, bindingContext); CallableMethod method = typeMapper.mapToCallableMethod((ConstructorDescriptor) resolvedCall.getResultingDescriptor()); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/TailRecursionCodegen.java b/compiler/backend/src/org/jetbrains/jet/codegen/TailRecursionCodegen.java index 2864c66b499..f6295545a05 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/TailRecursionCodegen.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/TailRecursionCodegen.java @@ -34,7 +34,7 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter; import java.util.List; import static org.jetbrains.jet.lang.resolve.BindingContext.TAIL_RECURSION_CALL; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCall; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCall; public class TailRecursionCodegen { 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 1ea38075945..45177a04b71 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenAnnotatingVisitor.java @@ -34,7 +34,7 @@ import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.BindingTrace; import org.jetbrains.jet.lang.resolve.DescriptorUtils; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ExpressionValueArgument; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedValueArgument; @@ -323,7 +323,7 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid { // working around a problem with shallow analysis if (functionDescriptor == null) return; - ResolvedCall referencedFunction = BindingContextUtilPackage.getResolvedCall(expression.getCallableReference(), bindingContext); + ResolvedCall referencedFunction = CallUtilPackage.getResolvedCall(expression.getCallableReference(), bindingContext); if (referencedFunction == null) return; Collection supertypes = runtimeTypes.getSupertypesForFunctionReference((FunctionDescriptor) referencedFunction.getResultingDescriptor()); @@ -414,7 +414,7 @@ class CodegenAnnotatingVisitor extends JetVisitorVoid { @Override public void visitCallExpression(@NotNull JetCallExpression expression) { super.visitCallExpression(expression); - ResolvedCall call = BindingContextUtilPackage.getResolvedCall(expression, bindingContext); + ResolvedCall call = CallUtilPackage.getResolvedCall(expression, bindingContext); if (call == null) return; CallableDescriptor descriptor = call.getResultingDescriptor(); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java index 8e4e542a566..a526d6c1bb2 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/binding/CodegenBinding.java @@ -44,7 +44,7 @@ import java.util.*; import static org.jetbrains.jet.codegen.JvmCodegenUtil.isInterface; import static org.jetbrains.jet.lang.resolve.BindingContext.*; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCall; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCall; public class CodegenBinding { public static final WritableSlice CLOSURE = Slices.createSimpleSlice(); diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Clone.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Clone.java index 229a899b6e1..4636bd760d7 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Clone.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/Clone.java @@ -32,7 +32,7 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter; import java.util.List; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCallWithAssert; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCallWithAssert; import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE; public class Clone extends IntrinsicMethod { 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 635cf69dd96..daf5fb2c6f1 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/JavaClassArray.java @@ -33,7 +33,7 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter; import java.util.List; import java.util.Map; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCallWithAssert; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCallWithAssert; public class JavaClassArray extends IntrinsicMethod { @NotNull 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 706a8c53df7..4853eb4130b 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,7 @@ import org.jetbrains.jet.codegen.ExpressionCodegen; import org.jetbrains.jet.codegen.StackValue; import org.jetbrains.jet.lang.psi.JetElement; import org.jetbrains.jet.lang.psi.JetExpression; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.org.objectweb.asm.Type; @@ -45,7 +45,7 @@ public class JavaClassFunction extends IntrinsicMethod { @Nullable List arguments, StackValue receiver ) { - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCallWithAssert( + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCallWithAssert( (JetElement) element, codegen.getBindingContext()); JetType returnType = resolvedCall.getResultingDescriptor().getReturnType(); assert returnType != null; diff --git a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/MonitorInstruction.java b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/MonitorInstruction.java index 0be45c440c4..263b102b31f 100644 --- a/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/MonitorInstruction.java +++ b/compiler/backend/src/org/jetbrains/jet/codegen/intrinsics/MonitorInstruction.java @@ -33,7 +33,7 @@ import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter; import java.util.List; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCallWithAssert; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCallWithAssert; import static org.jetbrains.jet.lang.resolve.java.AsmTypeConstants.OBJECT_TYPE; public class MonitorInstruction extends IntrinsicMethod { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java index 6eae7020b8b..144e3cfd59b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetControlFlowProcessor.java @@ -38,6 +38,7 @@ import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.BindingContextUtils; import org.jetbrains.jet.lang.resolve.BindingTrace; import org.jetbrains.jet.lang.resolve.CompileTimeConstantUtils; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.*; import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; import org.jetbrains.jet.lang.resolve.name.Name; @@ -55,7 +56,7 @@ import java.util.*; import static org.jetbrains.jet.lang.cfg.JetControlFlowBuilder.PredefinedOperation.*; import static org.jetbrains.jet.lang.diagnostics.Errors.*; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCall; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCall; import static org.jetbrains.jet.lexer.JetTokens.*; public class JetControlFlowProcessor { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.java b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.java index ad2af02b337..dce9c963b15 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/cfg/JetFlowInformationProvider.java @@ -70,8 +70,8 @@ import static org.jetbrains.jet.lang.cfg.pseudocodeTraverser.TraversalOrder.FORW import static org.jetbrains.jet.lang.diagnostics.Errors.*; import static org.jetbrains.jet.lang.resolve.BindingContext.CAPTURED_IN_CLOSURE; import static org.jetbrains.jet.lang.resolve.BindingContext.TAIL_RECURSION_CALL; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCall; import static org.jetbrains.jet.lang.resolve.calls.TailRecursionKind.*; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCall; import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE; import static org.jetbrains.jet.lang.types.TypeUtils.noExpectedType; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt b/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt index a0e0a11edeb..e6448f65644 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/evaluate/ConstantExpressionEvaluator.kt @@ -33,7 +33,7 @@ import org.jetbrains.jet.JetNodeTypes import java.math.BigInteger import org.jetbrains.jet.lang.diagnostics.Errors import com.intellij.psi.util.PsiTreeUtil -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall public class ConstantExpressionEvaluator private (val trace: BindingTrace) : JetVisitor, JetType>() { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/psi/psiUtil/jetPsiUtil.kt b/compiler/frontend/src/org/jetbrains/jet/lang/psi/psiUtil/jetPsiUtil.kt index cd397741d6a..ee554618f10 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/psi/psiUtil/jetPsiUtil.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/psi/psiUtil/jetPsiUtil.kt @@ -318,15 +318,4 @@ public fun JetSimpleNameExpression.isImportDirectiveExpression(): Boolean { } } -public fun JetElement.getCalleeExpressionIfAny(): JetExpression? { - val element = if (this is JetExpression) JetPsiUtil.safeDeparenthesize(this, false) else this - return when (element) { - is JetSimpleNameExpression -> element - is JetCallElement -> element.getCalleeExpression() - is JetQualifiedExpression -> element.getSelectorExpression()?.getCalleeExpressionIfAny() - is JetOperationExpression -> element.getOperationReference() - else -> null - } -} - -public fun JetElement.getTextWithLocation(): String = "'${this.getText()}' at ${DiagnosticUtils.atLocation(this)}" +public fun JetElement.getTextWithLocation(): String = "'${this.getText()}' at ${DiagnosticUtils.atLocation(this)}" \ No newline at end of file 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 a5cd40b51f8..e9c06c8089b 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnnotationResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/AnnotationResolver.java @@ -30,10 +30,10 @@ import org.jetbrains.jet.lang.descriptors.annotations.AnnotationsImpl; import org.jetbrains.jet.lang.diagnostics.Errors; import org.jetbrains.jet.lang.evaluate.ConstantExpressionEvaluator; import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver; import org.jetbrains.jet.lang.resolve.calls.CallResolver; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedValueArgument; import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults; @@ -325,7 +325,7 @@ public class AnnotationResolver { @NotNull JetCallExpression expression, @NotNull BindingTrace trace ) { - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(expression, trace.getBindingContext()); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(expression, trace.getBindingContext()); if (resolvedCall == null || !CompileTimeConstantUtils.isArrayMethodCall(resolvedCall)) { return null; } 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 5bb2ea6ef3f..0689a8deded 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.java @@ -24,8 +24,8 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.model.VariableAsFunctionResolvedCall; import org.jetbrains.jet.lang.types.JetType; @@ -158,7 +158,7 @@ public class BindingContextUtils { @NotNull BindingContext context ) { if (expression instanceof JetCallExpression) { - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(expression, context); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(expression, context); return resolvedCall instanceof VariableAsFunctionResolvedCall; } return expression instanceof JetReferenceExpression; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.kt b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.kt index 97af29f7fcf..8026be85914 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/BindingContextUtils.kt @@ -16,13 +16,7 @@ package org.jetbrains.jet.lang.resolve.bindingContextUtil -import org.jetbrains.jet.lang.psi.JetExpression -import org.jetbrains.jet.lang.psi.Call -import org.jetbrains.jet.lang.psi.JetPsiUtil -import org.jetbrains.jet.lang.psi.JetCallExpression import org.jetbrains.jet.lang.resolve.BindingContext -import org.jetbrains.jet.lang.resolve.BindingContext.CALL -import org.jetbrains.jet.lang.resolve.BindingContext.RESOLVED_CALL import org.jetbrains.jet.lang.psi.JetReturnExpression import org.jetbrains.jet.lang.descriptors.FunctionDescriptor import org.jetbrains.jet.lang.resolve.BindingContext.LABEL_TARGET @@ -32,104 +26,8 @@ import org.jetbrains.jet.lang.psi.psiUtil.getParentByType import org.jetbrains.jet.lang.psi.JetDeclarationWithBody import org.jetbrains.jet.lang.resolve.DescriptorUtils import org.jetbrains.jet.lang.descriptors.impl.AnonymousFunctionDescriptor -import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver -import org.jetbrains.jet.lang.psi.JetArrayAccessExpression -import org.jetbrains.jet.lang.psi.JetUnaryExpression -import org.jetbrains.jet.lang.psi.JetBinaryExpression -import org.jetbrains.jet.lang.psi.JetSimpleNameExpression -import com.intellij.psi.util.PsiTreeUtil -import org.jetbrains.jet.lang.psi.JetThisExpression -import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall -import org.jetbrains.jet.lang.descriptors.CallableDescriptor -import org.jetbrains.jet.lang.psi.JetElement -import org.jetbrains.jet.lang.diagnostics.DiagnosticUtils -import org.jetbrains.jet.lang.psi.psiUtil.getCalleeExpressionIfAny -import org.jetbrains.jet.lang.resolve.calls.CallTransformer.CallForImplicitInvoke -import org.jetbrains.kotlin.util.sure -import org.jetbrains.jet.lang.psi.JetCallElement -import org.jetbrains.jet.lang.psi.psiUtil.getTextWithLocation -import org.jetbrains.jet.lang.psi.JetInstanceExpressionWithLabel -import org.jetbrains.jet.lang.psi.JetConstructorCalleeExpression -import org.jetbrains.jet.lang.psi.JetUserType +import org.jetbrains.jet.lang.psi.JetExpression -/** - * For expressions like a(), a[i], a.b.c(), +a, a + b, (a()), a(): Int, @label a() - * returns a corresponding call. - * - * Note: special construction like a!!, a ?: b, if (c) a else b are resolved as calls, - * so there is a corresponding call for them. - */ -public fun JetElement.getCall(context: BindingContext): Call? { - val element = if (this is JetExpression) JetPsiUtil.deparenthesize(this) else this - if (element == null) return null - - val parent = element.getParent() - val reference = when { - parent is JetInstanceExpressionWithLabel -> parent : JetInstanceExpressionWithLabel - parent is JetUserType -> parent.getParent()?.getParent() as? JetConstructorCalleeExpression - else -> element.getCalleeExpressionIfAny() - } - if (reference != null) { - return context[CALL, reference] - } - return context[CALL, element] -} - -public fun JetElement.getParentCall(context: BindingContext, strict: Boolean = true): Call? { - val callExpressionTypes = array?>( - javaClass(), javaClass(), javaClass(), - javaClass(), javaClass()) - - val parent = if (strict) { - PsiTreeUtil.getParentOfType(this, *callExpressionTypes) - } else { - PsiTreeUtil.getNonStrictParentOfType(this, *callExpressionTypes) - } - return parent?.getCall(context) -} - -public fun Call?.getResolvedCall(context: BindingContext): ResolvedCall? { - return context[RESOLVED_CALL, this] -} - -public fun JetElement?.getResolvedCall(context: BindingContext): ResolvedCall? { - return this?.getCall(context)?.getResolvedCall(context) -} - -public fun JetElement?.getParentResolvedCall(context: BindingContext, strict: Boolean = true): ResolvedCall? { - return this?.getParentCall(context, strict)?.getResolvedCall(context) -} - -public fun JetElement.getCallWithAssert(context: BindingContext): Call { - return getCall(context).sure("No call for ${this.getTextWithLocation()}") -} - -public fun JetElement.getResolvedCallWithAssert(context: BindingContext): ResolvedCall { - return getResolvedCall(context).sure("No resolved call for ${this.getTextWithLocation()}") -} - -public fun Call.getResolvedCallWithAssert(context: BindingContext): ResolvedCall { - return getResolvedCall(context).sure("No resolved call for ${this.getCallElement().getTextWithLocation()}") -} - -public fun JetExpression.getFunctionResolvedCallWithAssert(context: BindingContext): ResolvedCall { - val resolvedCall = getResolvedCallWithAssert(context) - assert(resolvedCall.getResultingDescriptor() is FunctionDescriptor) { - "ResolvedCall for this expression must be ResolvedCall: ${this.getTextWithLocation()}" - } - [suppress("UNCHECKED_CAST")] - return resolvedCall as ResolvedCall -} - -public fun Call.hasUnresolvedArguments(context: BindingContext): Boolean { - val arguments = getValueArguments().map { it?.getArgumentExpression() } - return arguments.any { - argument -> - val expressionType = context[BindingContext.EXPRESSION_TYPE, argument] - argument != null && !ArgumentTypeResolver.isFunctionLiteralArgument(argument) - && (expressionType == null || expressionType.isError()) - } -} public fun JetReturnExpression.getTargetFunctionDescriptor(context: BindingContext): FunctionDescriptor? { val targetLabel = getTargetLabel() diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DelegatedPropertyResolver.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DelegatedPropertyResolver.java index 499a036c511..cd35edfe785 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DelegatedPropertyResolver.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/DelegatedPropertyResolver.java @@ -47,8 +47,8 @@ import java.util.List; import static org.jetbrains.jet.lang.diagnostics.Errors.*; import static org.jetbrains.jet.lang.psi.PsiPackage.JetPsiFactory; -import static org.jetbrains.jet.lang.psi.psiUtil.PsiUtilPackage.getCalleeExpressionIfAny; import static org.jetbrains.jet.lang.resolve.BindingContext.*; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getCalleeExpressionIfAny; import static org.jetbrains.jet.lang.types.TypeUtils.NO_EXPECTED_TYPE; import static org.jetbrains.jet.lang.types.TypeUtils.noExpectedType; import static org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils.createFakeExpressionOfType; diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/InlineDescriptorUtils.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/InlineDescriptorUtils.java index 2220bbe5f17..a364129da6a 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/InlineDescriptorUtils.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/InlineDescriptorUtils.java @@ -22,7 +22,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.psi.*; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMapping; import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMatch; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; @@ -50,7 +50,7 @@ public class InlineDescriptorUtils { boolean allowsNonLocalReturns = false; JetExpression call = JetPsiUtil.getParentCallIfPresent((JetFunctionLiteralExpression) containingFunction); if (call != null) { - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(call, bindingContext); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(call, bindingContext); CallableDescriptor resultingDescriptor = resolvedCall == null ? null : resolvedCall.getResultingDescriptor(); if (resultingDescriptor instanceof SimpleFunctionDescriptor && ((SimpleFunctionDescriptor) resultingDescriptor).getInlineStrategy().isInline()) { diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallCompleter.kt b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallCompleter.kt index 4bc1b1421d9..f0f7ba8b8a3 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallCompleter.kt +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/CallCompleter.kt @@ -16,8 +16,6 @@ package org.jetbrains.jet.lang.resolve.calls -import javax.inject.Inject -import kotlin.properties.Delegates import org.jetbrains.jet.lang.descriptors.CallableDescriptor import org.jetbrains.jet.lang.resolve.calls.context.BasicCallResolutionContext import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResultsImpl @@ -41,9 +39,9 @@ import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMapping import org.jetbrains.jet.lang.resolve.calls.autocasts.DataFlowInfo import org.jetbrains.jet.lang.resolve.calls.model.ArgumentUnmapped import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMatch -import org.jetbrains.jet.lang.psi.JetWhenExpression import org.jetbrains.jet.lang.resolve.BindingContext import org.jetbrains.jet.lang.resolve.calls.context.ResolutionContext +import org.jetbrains.jet.lang.resolve.calls.callUtil.* import org.jetbrains.jet.lang.resolve.BindingContextUtils import org.jetbrains.jet.lang.resolve.calls.context.CallResolutionContext import org.jetbrains.jet.lang.types.expressions.DataFlowUtils @@ -52,11 +50,9 @@ import org.jetbrains.jet.lang.psi.Call import org.jetbrains.jet.lang.types.expressions.ExpressionTypingUtils import org.jetbrains.jet.lang.psi.JetBlockExpression import org.jetbrains.jet.lang.psi.JetPsiUtil -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getCall import org.jetbrains.jet.lang.psi.JetSafeQualifiedExpression import org.jetbrains.jet.lang.resolve.calls.CallResolverUtil.ResolveArgumentsMode.RESOLVE_FUNCTION_ARGUMENTS import org.jetbrains.jet.lang.resolve.TemporaryBindingTrace -import org.jetbrains.jet.lang.resolve.calls.util.getAllValueArguments import org.jetbrains.jet.lang.psi.JetQualifiedExpression import java.util.ArrayList 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 34ba11e94e6..eec721e67d7 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 @@ -24,7 +24,7 @@ import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.diagnostics.Errors; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.DescriptorUtils; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.context.BasicCallResolutionContext; import org.jetbrains.jet.lang.resolve.calls.model.DefaultValueArgument; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; @@ -187,7 +187,7 @@ public class InlineCallResolverExtension implements CallResolverExtension { ) { if (!(expression instanceof JetSimpleNameExpression || expression instanceof JetThisExpression)) return null; - ResolvedCall thisCall = BindingContextUtilPackage.getResolvedCall(expression, context.trace.getBindingContext()); + ResolvedCall thisCall = CallUtilPackage.getResolvedCall(expression, context.trace.getBindingContext()); if (unwrapVariableAsFunction && thisCall instanceof VariableAsFunctionResolvedCall) { return ((VariableAsFunctionResolvedCall) thisCall).getVariableCall().getResultingDescriptor(); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.java index 43251b3e0e6..03acfb883e0 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/autocasts/DataFlowValueFactory.java @@ -24,7 +24,7 @@ import org.jetbrains.jet.lang.descriptors.*; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.JetModuleUtil; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.scopes.receivers.*; import org.jetbrains.jet.lang.types.JetType; @@ -166,7 +166,7 @@ public class DataFlowValueFactory { ) { DeclarationDescriptor declarationDescriptor = bindingContext.get(REFERENCE_TARGET, simpleNameExpression); if (declarationDescriptor instanceof VariableDescriptor) { - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(simpleNameExpression, bindingContext); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(simpleNameExpression, bindingContext); // todo uncomment assert // KT-4113 // for now it fails for resolving 'invoke' convention, return it after 'invoke' algorithm changes diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/results/ResolutionResultsHandler.java b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/results/ResolutionResultsHandler.java index c7e679d5c05..e8d37959e9a 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/results/ResolutionResultsHandler.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/results/ResolutionResultsHandler.java @@ -20,7 +20,7 @@ import com.google.common.collect.Sets; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.CallableDescriptor; import org.jetbrains.jet.lang.resolve.OverrideResolver; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.context.CheckValueArgumentsMode; import org.jetbrains.jet.lang.resolve.calls.model.MutableResolvedCall; import org.jetbrains.jet.lang.resolve.calls.tasks.ResolutionTask; @@ -102,7 +102,7 @@ public class ResolutionResultsHandler { // This check is needed for the following case: // x.foo(unresolved) -- if there are multiple foo's, we'd report an ambiguity, and it does not make sense here if (task.checkArguments == CheckValueArgumentsMode.DISABLED || - !BindingContextUtilPackage.hasUnresolvedArguments(task.call, task.trace.getBindingContext())) { + !CallUtilPackage.hasUnresolvedArguments(task.call, task.trace.getBindingContext())) { if (allCandidatesIncomplete) { task.tracing.cannotCompleteResolve(task.trace, results.getResultingCalls()); } diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/util/callUtil.kt b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/util/callUtil.kt new file mode 100644 index 00000000000..b925969d5cb --- /dev/null +++ b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/util/callUtil.kt @@ -0,0 +1,174 @@ +/* + * Copyright 2010-2014 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.jet.lang.resolve.calls.callUtil + +import org.jetbrains.jet.lang.descriptors.CallableDescriptor +import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall +import org.jetbrains.jet.lang.resolve.calls.model.ArgumentUnmapped +import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor +import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMatch +import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMatchStatus +import org.jetbrains.jet.lang.psi.Call +import org.jetbrains.jet.lang.psi.ValueArgument +import org.jetbrains.jet.lang.resolve.calls.util.CallMaker +import org.jetbrains.jet.lang.resolve.BindingContext +import org.jetbrains.jet.lang.resolve.calls.ArgumentTypeResolver +import org.jetbrains.jet.lang.psi.JetElement +import org.jetbrains.jet.lang.psi.JetExpression +import org.jetbrains.jet.lang.psi.JetPsiUtil +import org.jetbrains.jet.lang.psi.JetSimpleNameExpression +import org.jetbrains.jet.lang.psi.JetCallElement +import org.jetbrains.jet.lang.psi.JetQualifiedExpression +import org.jetbrains.jet.lang.psi.JetOperationExpression +import org.jetbrains.jet.lang.psi.JetInstanceExpressionWithLabel +import org.jetbrains.jet.lang.psi.JetUserType +import org.jetbrains.jet.lang.psi.JetConstructorCalleeExpression +import org.jetbrains.jet.lang.resolve.BindingContext.CALL +import org.jetbrains.jet.lang.psi.JetBinaryExpression +import org.jetbrains.jet.lang.psi.JetUnaryExpression +import org.jetbrains.jet.lang.psi.JetArrayAccessExpression +import com.intellij.psi.util.PsiTreeUtil +import org.jetbrains.jet.lang.resolve.BindingContext.RESOLVED_CALL +import org.jetbrains.kotlin.util.sure +import org.jetbrains.jet.lang.psi.psiUtil.getTextWithLocation +import org.jetbrains.jet.lang.descriptors.FunctionDescriptor + +// resolved call + +public fun ResolvedCall.noErrorsInValueArguments(): Boolean { + return getCall().getValueArguments().all { argument -> !getArgumentMapping(argument!!).isError() } +} + +public fun ResolvedCall.hasUnmappedArguments(): Boolean { + return getCall().getValueArguments().any { argument -> getArgumentMapping(argument!!) == ArgumentUnmapped } +} + +public fun ResolvedCall.hasUnmappedParameters(): Boolean { + val parameterToArgumentMap = getValueArguments() + return !parameterToArgumentMap.keySet().containsAll(getResultingDescriptor().getValueParameters()) +} + +public fun ResolvedCall.hasTypeMismatchErrorOnParameter(parameter: ValueParameterDescriptor): Boolean { + val resolvedValueArgument = getValueArguments()[parameter] + if (resolvedValueArgument == null) return true + + return resolvedValueArgument.getArguments().any { argument -> + val argumentMapping = getArgumentMapping(argument) + argumentMapping is ArgumentMatch && argumentMapping.status == ArgumentMatchStatus.TYPE_MISMATCH + } +} + +// call + +public fun Call.hasUnresolvedArguments(context: BindingContext): Boolean { + val arguments = getValueArguments().map { it?.getArgumentExpression() } + return arguments.any { + argument -> + val expressionType = context[BindingContext.EXPRESSION_TYPE, argument] + argument != null && !ArgumentTypeResolver.isFunctionLiteralArgument(argument) + && (expressionType == null || expressionType.isError()) + } +} + +public fun Call.getAllValueArguments(): List { + val arguments = getValueArguments() + + getFunctionLiteralArguments().map { functionLiteral -> CallMaker.makeValueArgument(functionLiteral) } + [suppress("UNCHECKED_CAST")] + return arguments as List +} + +// Get call / resolved call from binding context + +public fun JetElement.getCalleeExpressionIfAny(): JetExpression? { + val element = if (this is JetExpression) JetPsiUtil.safeDeparenthesize(this, false) else this + return when (element) { + is JetSimpleNameExpression -> element + is JetCallElement -> element.getCalleeExpression() + is JetQualifiedExpression -> element.getSelectorExpression()?.getCalleeExpressionIfAny() + is JetOperationExpression -> element.getOperationReference() + else -> null + } +} + +/** + * For expressions like a(), a[i], a.b.c(), +a, a + b, (a()), a(): Int, @label a() + * returns a corresponding call. + * + * Note: special construction like a!!, a ?: b, if (c) a else b are resolved as calls, + * so there is a corresponding call for them. + */ +public fun JetElement.getCall(context: BindingContext): Call? { + val element = if (this is JetExpression) JetPsiUtil.deparenthesize(this) else this + if (element == null) return null + + val parent = element.getParent() + val reference = when { + parent is JetInstanceExpressionWithLabel -> parent : JetInstanceExpressionWithLabel + parent is JetUserType -> parent.getParent()?.getParent() as? JetConstructorCalleeExpression + else -> element.getCalleeExpressionIfAny() + } + if (reference != null) { + return context[CALL, reference] + } + return context[CALL, element] +} + +public fun JetElement.getParentCall(context: BindingContext, strict: Boolean = true): Call? { + val callExpressionTypes = array?>( + javaClass(), javaClass(), javaClass(), + javaClass(), javaClass()) + + val parent = if (strict) { + PsiTreeUtil.getParentOfType(this, *callExpressionTypes) + } else { + PsiTreeUtil.getNonStrictParentOfType(this, *callExpressionTypes) + } + return parent?.getCall(context) +} + +public fun Call?.getResolvedCall(context: BindingContext): ResolvedCall? { + return context[RESOLVED_CALL, this] +} + +public fun JetElement?.getResolvedCall(context: BindingContext): ResolvedCall? { + return this?.getCall(context)?.getResolvedCall(context) +} + +public fun JetElement?.getParentResolvedCall(context: BindingContext, strict: Boolean = true): ResolvedCall? { + return this?.getParentCall(context, strict)?.getResolvedCall(context) +} + +public fun JetElement.getCallWithAssert(context: BindingContext): Call { + return getCall(context).sure("No call for ${this.getTextWithLocation()}") +} + +public fun JetElement.getResolvedCallWithAssert(context: BindingContext): ResolvedCall { + return getResolvedCall(context).sure("No resolved call for ${this.getTextWithLocation()}") +} + +public fun Call.getResolvedCallWithAssert(context: BindingContext): ResolvedCall { + return getResolvedCall(context).sure("No resolved call for ${this.getCallElement().getTextWithLocation()}") +} + +public fun JetExpression.getFunctionResolvedCallWithAssert(context: BindingContext): ResolvedCall { + val resolvedCall = getResolvedCallWithAssert(context) + assert(resolvedCall.getResultingDescriptor() is FunctionDescriptor) { + "ResolvedCall for this expression must be ResolvedCall: ${this.getTextWithLocation()}" + } + [suppress("UNCHECKED_CAST")] + return resolvedCall as ResolvedCall +} \ No newline at end of file diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/util/resolvedCallUtil.kt b/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/util/resolvedCallUtil.kt deleted file mode 100644 index fa484ef4b93..00000000000 --- a/compiler/frontend/src/org/jetbrains/jet/lang/resolve/calls/util/resolvedCallUtil.kt +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2010-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.jetbrains.jet.lang.resolve.calls.util - -import org.jetbrains.jet.lang.descriptors.CallableDescriptor -import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall -import org.jetbrains.jet.lang.resolve.calls.model.ArgumentUnmapped -import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor -import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMatch -import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMatchStatus -import org.jetbrains.jet.lang.psi.Call -import org.jetbrains.jet.lang.psi.ValueArgument - -public fun ResolvedCall.noErrorsInValueArguments(): Boolean { - return getCall().getValueArguments().all { argument -> !getArgumentMapping(argument!!).isError() } -} - -public fun ResolvedCall.hasUnmappedArguments(): Boolean { - return getCall().getValueArguments().any { argument -> getArgumentMapping(argument!!) == ArgumentUnmapped } -} - -public fun ResolvedCall.hasUnmappedParameters(): Boolean { - val parameterToArgumentMap = getValueArguments() - return !parameterToArgumentMap.keySet().containsAll(getResultingDescriptor().getValueParameters()) -} - -public fun ResolvedCall.hasTypeMismatchErrorOnParameter(parameter: ValueParameterDescriptor): Boolean { - val resolvedValueArgument = getValueArguments()[parameter] - if (resolvedValueArgument == null) return true - - return resolvedValueArgument.getArguments().any { argument -> - val argumentMapping = getArgumentMapping(argument) - argumentMapping is ArgumentMatch && argumentMapping.status == ArgumentMatchStatus.TYPE_MISMATCH - } -} - -fun Call.getAllValueArguments(): List { - val arguments = getValueArguments() + - getFunctionLiteralArguments().map { functionLiteral -> CallMaker.makeValueArgument(functionLiteral) } - [suppress("UNCHECKED_CAST")] - return arguments as List -} 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 5e86ca96cc4..e278bebadd5 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 @@ -32,8 +32,8 @@ 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.*; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; import org.jetbrains.jet.lang.resolve.calls.CallResolver; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintPosition; import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystem; import org.jetbrains.jet.lang.resolve.calls.inference.ConstraintSystemImpl; @@ -155,7 +155,7 @@ public class ExpressionTypingUtils { return false; } - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(callExpression, context); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(callExpression, context); if (resolvedCall == null) { return false; } diff --git a/compiler/tests/org/jetbrains/jet/resolve/calls/AbstractResolvedCallsTest.kt b/compiler/tests/org/jetbrains/jet/resolve/calls/AbstractResolvedCallsTest.kt index c1eeff7aafb..9733991bcd0 100644 --- a/compiler/tests/org/jetbrains/jet/resolve/calls/AbstractResolvedCallsTest.kt +++ b/compiler/tests/org/jetbrains/jet/resolve/calls/AbstractResolvedCallsTest.kt @@ -28,7 +28,7 @@ import java.io.File import org.jetbrains.jet.lang.resolve.lazy.JvmResolveUtil import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMapping import org.jetbrains.jet.lang.resolve.calls.model.ArgumentMatch -import org.jetbrains.jet.lang.resolve.calls.util.getAllValueArguments +import org.jetbrains.jet.lang.resolve.calls.callUtil.getAllValueArguments import org.jetbrains.jet.renderer.DescriptorRenderer import com.intellij.openapi.util.io.FileUtil import org.jetbrains.jet.lang.psi.ValueArgument @@ -36,7 +36,7 @@ import org.jetbrains.jet.lang.psi.JetPsiFactory import org.jetbrains.jet.lang.psi.JetExpression import com.intellij.psi.util.PsiTreeUtil import org.jetbrains.jet.lang.resolve.calls.model.VariableAsFunctionResolvedCall -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getParentResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getParentResolvedCall import org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor import org.jetbrains.jet.lang.resolve.scopes.receivers.ExtensionReceiver import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor diff --git a/idea/src/org/jetbrains/jet/plugin/codeInsight/ShortenReferences.kt b/idea/src/org/jetbrains/jet/plugin/codeInsight/ShortenReferences.kt index c32165c4139..1f3779ffda2 100644 --- a/idea/src/org/jetbrains/jet/plugin/codeInsight/ShortenReferences.kt +++ b/idea/src/org/jetbrains/jet/plugin/codeInsight/ShortenReferences.kt @@ -37,7 +37,7 @@ import com.intellij.psi.PsiDocumentManager import org.jetbrains.jet.plugin.caches.resolve.getLazyResolveSession import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall import org.jetbrains.jet.renderer.DescriptorRenderer.FQ_NAMES_IN_TYPES -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall public object ShortenReferences { public fun process(element: JetElement) { diff --git a/idea/src/org/jetbrains/jet/plugin/completion/ExpectedInfos.kt b/idea/src/org/jetbrains/jet/plugin/completion/ExpectedInfos.kt index e81c12f2df6..5aedb3d2081 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/ExpectedInfos.kt +++ b/idea/src/org/jetbrains/jet/plugin/completion/ExpectedInfos.kt @@ -43,9 +43,8 @@ import org.jetbrains.jet.lang.psi.JetIfExpression import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns import org.jetbrains.jet.lang.psi.JetContainerNode import org.jetbrains.jet.plugin.completion.smart.isSubtypeOf -import org.jetbrains.jet.lang.resolve.calls.util.DelegatingCall -import org.jetbrains.jet.lang.resolve.calls.util.noErrorsInValueArguments -import org.jetbrains.jet.lang.resolve.calls.util.hasUnmappedParameters +import org.jetbrains.jet.lang.resolve.calls.callUtil.noErrorsInValueArguments +import org.jetbrains.jet.lang.resolve.calls.callUtil.hasUnmappedParameters import org.jetbrains.jet.lang.descriptors.Visibilities import org.jetbrains.jet.lang.psi.JetBlockExpression import org.jetbrains.jet.plugin.util.makeNotNullable @@ -57,6 +56,7 @@ import org.jetbrains.jet.lang.types.TypeUtils import org.jetbrains.jet.lang.resolve.calls.context.BasicCallResolutionContext import org.jetbrains.jet.lang.resolve.DelegatingBindingTrace import org.jetbrains.jet.lang.psi.JetPrefixExpression +import org.jetbrains.jet.lang.resolve.calls.util.DelegatingCall enum class Tail { COMMA diff --git a/idea/src/org/jetbrains/jet/plugin/completion/smart/SmartCompetionUtil.kt b/idea/src/org/jetbrains/jet/plugin/completion/smart/SmartCompetionUtil.kt index 1a427f686d7..07df1c00130 100644 --- a/idea/src/org/jetbrains/jet/plugin/completion/smart/SmartCompetionUtil.kt +++ b/idea/src/org/jetbrains/jet/plugin/completion/smart/SmartCompetionUtil.kt @@ -19,8 +19,8 @@ package org.jetbrains.jet.plugin.completion.smart import org.jetbrains.jet.lang.descriptors.CallableDescriptor import org.jetbrains.jet.lang.resolve.calls.results.OverloadResolutionResults import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall -import org.jetbrains.jet.lang.resolve.calls.util.noErrorsInValueArguments -import org.jetbrains.jet.lang.resolve.calls.util.hasUnmappedParameters +import org.jetbrains.jet.lang.resolve.calls.callUtil.noErrorsInValueArguments +import org.jetbrains.jet.lang.resolve.calls.callUtil.hasUnmappedParameters fun OverloadResolutionResults.getCandidatesForCompletion(): Collection> { diff --git a/idea/src/org/jetbrains/jet/plugin/debugger/JetPositionManager.java b/idea/src/org/jetbrains/jet/plugin/debugger/JetPositionManager.java index b30274c8363..f9c145f8a5d 100644 --- a/idea/src/org/jetbrains/jet/plugin/debugger/JetPositionManager.java +++ b/idea/src/org/jetbrains/jet/plugin/debugger/JetPositionManager.java @@ -43,7 +43,7 @@ import org.jetbrains.jet.lang.descriptors.ClassDescriptor; import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedValueArgument; import org.jetbrains.jet.lang.resolve.extension.InlineAnalyzerExtension; @@ -284,7 +284,7 @@ public class JetPositionManager implements PositionManager { if (!(parent instanceof JetElement)) return false; - ResolvedCall call = BindingContextUtilPackage.getResolvedCall((JetElement) parent, context); + ResolvedCall call = CallUtilPackage.getResolvedCall((JetElement) parent, context); if (call == null) return false; InlineStrategy inlineType = InlineUtil.getInlineType(call.getResultingDescriptor()); diff --git a/idea/src/org/jetbrains/jet/plugin/debugger/KotlinSmartStepIntoHandler.kt b/idea/src/org/jetbrains/jet/plugin/debugger/KotlinSmartStepIntoHandler.kt index 492def218ed..34d4aae19f5 100644 --- a/idea/src/org/jetbrains/jet/plugin/debugger/KotlinSmartStepIntoHandler.kt +++ b/idea/src/org/jetbrains/jet/plugin/debugger/KotlinSmartStepIntoHandler.kt @@ -26,7 +26,6 @@ import com.intellij.util.Range import org.jetbrains.jet.lang.resolve.BindingContext import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache import org.jetbrains.jet.asJava.LightClassUtil -import org.jetbrains.jet.lang.resolve.BindingContextUtils import org.jetbrains.jet.lang.descriptors.CallableMemberDescriptor import com.intellij.psi.PsiElement import org.jetbrains.jet.lang.psi.* @@ -38,7 +37,7 @@ import com.sun.jdi.Location import com.intellij.psi.PsiMethod import org.jetbrains.jet.plugin.codeInsight.CodeInsightUtils import com.intellij.psi.PsiDocumentManager -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall import org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils public class KotlinSmartStepIntoHandler : JvmSmartStepIntoHandler() { diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/DeprecatedAnnotationVisitor.java b/idea/src/org/jetbrains/jet/plugin/highlighter/DeprecatedAnnotationVisitor.java index 60ef099d17e..e8eccd94e8e 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/DeprecatedAnnotationVisitor.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/DeprecatedAnnotationVisitor.java @@ -30,7 +30,7 @@ import org.jetbrains.jet.lang.descriptors.annotations.AnnotationDescriptor; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.DescriptorUtils; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.model.VariableAsFunctionResolvedCall; import org.jetbrains.jet.lang.resolve.constants.CompileTimeConstant; @@ -63,7 +63,7 @@ public class DeprecatedAnnotationVisitor extends AfterAnalysisHighlightingVisito @Override public void visitReferenceExpression(@NotNull JetReferenceExpression expression) { super.visitReferenceExpression(expression); - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(expression, bindingContext); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(expression, bindingContext); if (resolvedCall != null && resolvedCall instanceof VariableAsFunctionResolvedCall) { // Deprecated for invoke() JetCallExpression parent = PsiTreeUtil.getParentOfType(expression, JetCallExpression.class); diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java b/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java index 782705365c4..5a4f4e9239a 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/FunctionsHighlightingVisitor.java @@ -26,7 +26,7 @@ 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; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.model.VariableAsFunctionResolvedCall; import org.jetbrains.jet.lang.types.JetType; @@ -67,7 +67,7 @@ public class FunctionsHighlightingVisitor extends AfterAnalysisHighlightingVisit @Override public void visitCallExpression(@NotNull JetCallExpression expression) { JetExpression callee = expression.getCalleeExpression(); - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(expression, bindingContext); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(expression, bindingContext); if (callee instanceof JetReferenceExpression && resolvedCall != null) { DeclarationDescriptor calleeDescriptor = resolvedCall.getResultingDescriptor(); if (resolvedCall instanceof VariableAsFunctionResolvedCall) { diff --git a/idea/src/org/jetbrains/jet/plugin/highlighter/renderersUtil.kt b/idea/src/org/jetbrains/jet/plugin/highlighter/renderersUtil.kt index 72dfd50aa46..9c6909f534d 100644 --- a/idea/src/org/jetbrains/jet/plugin/highlighter/renderersUtil.kt +++ b/idea/src/org/jetbrains/jet/plugin/highlighter/renderersUtil.kt @@ -19,12 +19,8 @@ package org.jetbrains.jet.plugin.highlighter.renderersUtil import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall import org.jetbrains.jet.lang.descriptors.CallableDescriptor import org.jetbrains.jet.renderer.DescriptorRenderer -import org.jetbrains.jet.lang.descriptors.ReceiverParameterDescriptor import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor -import org.jetbrains.jet.lang.types.JetType -import org.jetbrains.jet.lang.resolve.calls.util.* -import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor -import org.jetbrains.jet.lang.resolve.name.FqNameUnsafe +import org.jetbrains.jet.lang.resolve.calls.callUtil.* import org.jetbrains.jet.lang.resolve.DescriptorUtils import org.jetbrains.jet.lang.resolve.name.FqName import org.jetbrains.jet.plugin.highlighter.IdeRenderers diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/ConvertAssertToIfWithThrowIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/ConvertAssertToIfWithThrowIntention.kt index 27915572c67..3f0b46cdee8 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/ConvertAssertToIfWithThrowIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/ConvertAssertToIfWithThrowIntention.kt @@ -28,7 +28,7 @@ import kotlin.properties.Delegates import org.jetbrains.jet.lang.types.lang.KotlinBuiltIns import org.jetbrains.jet.lang.psi.JetIfExpression import org.jetbrains.jet.lang.psi.JetDotQualifiedExpression -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall import org.jetbrains.jet.lang.psi.JetBlockExpression import org.jetbrains.jet.lang.psi.JetThrowExpression import org.jetbrains.jet.lang.psi.psiUtil.replaced diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/ConvertIfWithThrowToAssertIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/ConvertIfWithThrowToAssertIntention.kt index 91a12053d06..ebceca27ea0 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/ConvertIfWithThrowToAssertIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/ConvertIfWithThrowToAssertIntention.kt @@ -29,7 +29,7 @@ import org.jetbrains.jet.lang.psi.JetThrowExpression import org.jetbrains.jet.lang.psi.JetDotQualifiedExpression import org.jetbrains.jet.lang.psi.JetExpression import org.jetbrains.jet.plugin.intentions.branchedTransformations.isNullExpression -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall public class ConvertIfWithThrowToAssertIntention : JetSelfTargetingIntention("convert.if.with.throw.to.assert", javaClass()) { diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/ConvertToForEachLoopIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/ConvertToForEachLoopIntention.kt index 6521e2c8d35..ac2baea5bf4 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/ConvertToForEachLoopIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/ConvertToForEachLoopIntention.kt @@ -26,7 +26,7 @@ import org.jetbrains.jet.lang.psi.JetBinaryExpression import org.jetbrains.jet.lang.resolve.DescriptorUtils import org.jetbrains.jet.plugin.caches.resolve.getLazyResolveSession import org.jetbrains.jet.lang.psi.JetParenthesizedExpression -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall public class ConvertToForEachLoopIntention : JetSelfTargetingIntention("convert.to.for.each.loop.intention", javaClass()) { private fun getFunctionLiteralArgument(element: JetExpression): JetFunctionLiteralExpression? { diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/InsertExplicitTypeArguments.kt b/idea/src/org/jetbrains/jet/plugin/intentions/InsertExplicitTypeArguments.kt index ad85bac1fb2..29507fff243 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/InsertExplicitTypeArguments.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/InsertExplicitTypeArguments.kt @@ -23,7 +23,7 @@ import org.jetbrains.jet.lang.psi.JetPsiFactory import org.jetbrains.jet.lang.types.ErrorUtils import org.jetbrains.jet.renderer.DescriptorRenderer import org.jetbrains.jet.plugin.codeInsight.ShortenReferences -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall public class InsertExplicitTypeArguments : JetSelfTargetingIntention( "insert.explicit.type.arguments", javaClass()) { diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/MoveLambdaInsideParenthesesIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/MoveLambdaInsideParenthesesIntention.kt index a1459d0120d..321dcf85571 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/MoveLambdaInsideParenthesesIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/MoveLambdaInsideParenthesesIntention.kt @@ -20,7 +20,7 @@ import com.intellij.openapi.editor.Editor import org.jetbrains.jet.lang.psi.JetCallExpression import org.jetbrains.jet.lang.psi.JetPsiFactory import org.jetbrains.jet.plugin.caches.resolve.getBindingContext -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall public class MoveLambdaInsideParenthesesIntention : JetSelfTargetingIntention( "move.lambda.inside.parentheses", javaClass()) { diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/OperatorToFunctionIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/OperatorToFunctionIntention.kt index 2a4ee74881a..f1c2b2d6b94 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/OperatorToFunctionIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/OperatorToFunctionIntention.kt @@ -30,7 +30,7 @@ import org.jetbrains.jet.lang.psi.JetDotQualifiedExpression import org.jetbrains.jet.plugin.project.AnalyzerFacadeWithCache import org.jetbrains.jet.lang.resolve.BindingContext import org.jetbrains.jet.lang.descriptors.FunctionDescriptor -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall public class OperatorToFunctionIntention : JetSelfTargetingIntention("operator.to.function", javaClass()) { fun isApplicablePrefix(element: JetPrefixExpression): Boolean { diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/RemoveExplicitTypeArguments.kt b/idea/src/org/jetbrains/jet/plugin/intentions/RemoveExplicitTypeArguments.kt index 8a7a40a2823..163262ab2b6 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/RemoveExplicitTypeArguments.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/RemoveExplicitTypeArguments.kt @@ -34,7 +34,7 @@ import org.jetbrains.jet.lang.psi.JetProperty import org.jetbrains.jet.lang.psi.JetTypeArgumentList import org.jetbrains.jet.lang.psi.JetReturnExpression import org.jetbrains.jet.lang.psi.JetDeclarationWithBody -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall import org.jetbrains.jet.lang.psi.psiUtil.getTextWithLocation public class RemoveExplicitTypeArguments : JetSelfTargetingIntention( diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/ReplaceWithInfixFunctionCallIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/ReplaceWithInfixFunctionCallIntention.kt index 2ccaeca6bf9..8a1c29aa5bd 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/ReplaceWithInfixFunctionCallIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/ReplaceWithInfixFunctionCallIntention.kt @@ -28,7 +28,7 @@ import org.jetbrains.jet.lang.types.PackageType import org.jetbrains.jet.lang.psi.JetPsiUnparsingUtils import org.jetbrains.jet.lang.psi.JetPsiFactory import com.intellij.codeInsight.hint.HintManager -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall public open class ReplaceWithInfixFunctionCallIntention : JetSelfTargetingIntention("replace.with.infix.function.call.intention", javaClass()) { override fun isApplicableTo(element: JetCallExpression): Boolean { diff --git a/idea/src/org/jetbrains/jet/plugin/intentions/attributeCallReplacements/AttributeCallReplacementIntention.kt b/idea/src/org/jetbrains/jet/plugin/intentions/attributeCallReplacements/AttributeCallReplacementIntention.kt index 4bdebfb6ba2..7aafb19d916 100644 --- a/idea/src/org/jetbrains/jet/plugin/intentions/attributeCallReplacements/AttributeCallReplacementIntention.kt +++ b/idea/src/org/jetbrains/jet/plugin/intentions/attributeCallReplacements/AttributeCallReplacementIntention.kt @@ -32,7 +32,7 @@ import org.jetbrains.jet.plugin.util.Maybe import org.jetbrains.jet.plugin.util.MaybeError import org.jetbrains.jet.plugin.util.MaybeValue import com.intellij.codeInsight.hint.HintManager -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall // Internal because you shouldn't construct this manually. You can end up with an inconsistant CallDescription. public class CallDescription internal ( diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/AddNameToArgumentFix.java b/idea/src/org/jetbrains/jet/plugin/quickfix/AddNameToArgumentFix.java index 077b183f8eb..3fd37661c99 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/AddNameToArgumentFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/AddNameToArgumentFix.java @@ -38,7 +38,7 @@ import org.jetbrains.jet.lang.psi.JetExpression; import org.jetbrains.jet.lang.psi.JetFile; import org.jetbrains.jet.lang.psi.JetValueArgument; import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lang.types.checker.JetTypeChecker; @@ -69,7 +69,7 @@ public class AddNameToArgumentFix extends JetIntentionAction { assert callElement != null : "The argument has to be inside a function or constructor call"; BindingContext context = ResolvePackage.getBindingContext(argument.getContainingJetFile()); - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(callElement, context); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(callElement, context); 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 990e600a4eb..13913233f8f 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/ChangeFunctionReturnTypeFix.java @@ -33,7 +33,7 @@ import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.DescriptorResolver; import org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.name.FqName; import org.jetbrains.jet.lang.types.ErrorUtils; @@ -188,7 +188,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 = ResolvePackage.getBindingContext(expression.getContainingJetFile()); - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(expression, context); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(expression, context); if (resolvedCall == null) return null; PsiElement compareTo = DescriptorToSourceUtils.descriptorToDeclaration(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 62126b7aa10..07680d90042 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixFactoryForTypeMismatchError.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixFactoryForTypeMismatchError.java @@ -26,8 +26,7 @@ import org.jetbrains.jet.lang.diagnostics.DiagnosticWithParameters2; import org.jetbrains.jet.lang.diagnostics.Errors; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.BindingContextUtils; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.plugin.caches.resolve.ResolvePackage; @@ -71,7 +70,7 @@ public class QuickFixFactoryForTypeMismatchError implements JetIntentionActionsF // Fixing overloaded operators: if (expression instanceof JetOperationExpression) { - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(expression, context); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(expression, context); if (resolvedCall != null) { JetFunction declaration = getFunctionDeclaration(resolvedCall); if (declaration != null) { @@ -82,7 +81,7 @@ public class QuickFixFactoryForTypeMismatchError implements JetIntentionActionsF if (expression.getParent() instanceof JetBinaryExpression) { JetBinaryExpression parentBinary = (JetBinaryExpression) expression.getParent(); if (parentBinary.getRight() == expression) { - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(parentBinary, context); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(parentBinary, context); if (resolvedCall != null) { JetFunction declaration = getFunctionDeclaration(resolvedCall); if (declaration != null) { @@ -95,7 +94,7 @@ public class QuickFixFactoryForTypeMismatchError implements JetIntentionActionsF // Change function return type when TYPE_MISMATCH is reported on call expression: if (expression instanceof JetCallExpression) { - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(expression, context); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(expression, context); if (resolvedCall != null) { JetFunction declaration = getFunctionDeclaration(resolvedCall); if (declaration != null) { diff --git a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixUtil.java b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixUtil.java index 1f126b39444..1fa7e2620bb 100644 --- a/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixUtil.java +++ b/idea/src/org/jetbrains/jet/plugin/quickfix/QuickFixUtil.java @@ -33,7 +33,7 @@ import org.jetbrains.jet.lang.diagnostics.Diagnostic; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; import org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.types.DeferredType; import org.jetbrains.jet.lang.types.JetType; @@ -108,7 +108,7 @@ public class QuickFixUtil { @Nullable public static JetParameterList getParameterListOfCallee(@NotNull JetCallExpression callExpression) { BindingContext context = ResolvePackage.getBindingContext(callExpression.getContainingJetFile()); - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(callExpression, context); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(callExpression, context); if (resolvedCall == null) return null; PsiElement declaration = safeGetDeclaration(resolvedCall); if (declaration instanceof JetFunction) { diff --git a/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ExtractionData.kt b/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ExtractionData.kt index 1cba3fda403..938a0865de9 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ExtractionData.kt +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/extractFunction/ExtractionData.kt @@ -49,7 +49,7 @@ import org.jetbrains.jet.lang.descriptors.ValueParameterDescriptor import org.jetbrains.jet.lang.psi.JetPsiFactory import org.jetbrains.jet.lang.psi.JetFunctionLiteral import org.jetbrains.jet.lang.psi.JetClassInitializer -import org.jetbrains.jet.lang.resolve.bindingContextUtil.getResolvedCall +import org.jetbrains.jet.lang.resolve.calls.callUtil.getResolvedCall import org.jetbrains.jet.lang.resolve.DescriptorToSourceUtils data class ExtractionOptions(val inferUnitTypeForUnusedValues: Boolean) { 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 ad695cc94ac..978f9a99460 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/inline/KotlinInlineValHandler.java +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/inline/KotlinInlineValHandler.java @@ -53,7 +53,7 @@ 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; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.types.ErrorUtils; import org.jetbrains.jet.lang.types.JetType; @@ -325,7 +325,7 @@ public class KotlinInlineValHandler extends InlineActionHandler { ResolveSessionForBodies resolveSessionForBodies = ResolvePackage.getLazyResolveSession(containingFile); for (JetExpression inlinedExpression : inlinedExpressions) { BindingContext context = resolveSessionForBodies.resolveToElement(inlinedExpression); - Call call = BindingContextUtilPackage.getCallWithAssert(inlinedExpression, context); + Call call = CallUtilPackage.getCallWithAssert(inlinedExpression, context); JetElement callElement = call.getCallElement(); if (callElement instanceof JetCallExpression && hasIncompleteTypeInferenceDiagnostic(call, context) && @@ -344,7 +344,7 @@ public class KotlinInlineValHandler extends InlineActionHandler { @Nullable private static String getTypeArgumentsStringForCall(@NotNull JetExpression initializer) { BindingContext context = AnalyzerFacadeWithCache.getContextForElement(initializer); - ResolvedCall call = BindingContextUtilPackage.getResolvedCall(initializer, context); + ResolvedCall call = CallUtilPackage.getResolvedCall(initializer, context); if (call == null) return null; List typeArguments = Lists.newArrayList(); diff --git a/idea/src/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java b/idea/src/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java index 239d62eadcd..48f971231f8 100644 --- a/idea/src/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java +++ b/idea/src/org/jetbrains/jet/plugin/refactoring/introduce/introduceVariable/KotlinIntroduceVariableHandler.java @@ -62,7 +62,7 @@ import org.jetbrains.jet.renderer.DescriptorRenderer; import java.util.*; import static org.jetbrains.jet.lang.psi.PsiPackage.JetPsiFactory; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getResolvedCall; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getResolvedCall; public class KotlinIntroduceVariableHandler extends KotlinIntroduceHandlerBase { diff --git a/idea/src/org/jetbrains/jet/plugin/references/JetInvokeFunctionReference.java b/idea/src/org/jetbrains/jet/plugin/references/JetInvokeFunctionReference.java index 767a5cb71c3..ae5eb638b4b 100644 --- a/idea/src/org/jetbrains/jet/plugin/references/JetInvokeFunctionReference.java +++ b/idea/src/org/jetbrains/jet/plugin/references/JetInvokeFunctionReference.java @@ -23,7 +23,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.DeclarationDescriptor; import org.jetbrains.jet.lang.psi.*; import org.jetbrains.jet.lang.resolve.BindingContext; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.model.VariableAsFunctionResolvedCall; import org.jetbrains.jet.lexer.JetTokens; @@ -47,8 +47,8 @@ class JetInvokeFunctionReference extends JetSimpleReference i @Override @NotNull protected Collection getTargetDescriptors(@NotNull BindingContext context) { - Call call = BindingContextUtilPackage.getCall(getElement(), context); - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCall(call, context); + Call call = CallUtilPackage.getCall(getElement(), context); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCall(call, context); if (resolvedCall instanceof VariableAsFunctionResolvedCall) { return Collections.singleton( ((VariableAsFunctionResolvedCall) resolvedCall).getFunctionCall().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 79062348d7c..3d09dffb5a0 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 @@ -27,7 +27,7 @@ import org.jetbrains.jet.lang.psi.JetClassOrObject; import org.jetbrains.jet.lang.psi.JetDelegationSpecifier; import org.jetbrains.jet.lang.psi.JetDelegatorToSuperCall; import org.jetbrains.jet.lang.psi.JetParameter; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.types.JetType; import org.jetbrains.jet.lexer.JetTokens; @@ -124,7 +124,7 @@ public final class ClassInitializerTranslator extends AbstractTranslator { @NotNull private List translateArguments(@NotNull JetDelegatorToSuperCall superCall) { - ResolvedCall call = BindingContextUtilPackage.getResolvedCallWithAssert(superCall, context().bindingContext()); + ResolvedCall call = CallUtilPackage.getResolvedCallWithAssert(superCall, context().bindingContext()); return CallArgumentTranslator.translate(call, null, context()).getTranslateArguments(); } diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.java b/js/js.translator/src/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.java index b75e292dec8..5e1a33aa575 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/operation/BinaryOperationTranslator.java @@ -37,7 +37,7 @@ import org.jetbrains.k2js.translate.utils.TranslationUtils; import org.jetbrains.k2js.translate.utils.mutator.AssignToExpressionMutator; import org.jetbrains.k2js.translate.utils.mutator.LastExpressionMutator; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getFunctionResolvedCallWithAssert; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getFunctionResolvedCallWithAssert; import static org.jetbrains.k2js.translate.operation.AssignmentTranslator.isAssignmentOperator; import static org.jetbrains.k2js.translate.operation.CompareToTranslator.isCompareToCall; import static org.jetbrains.k2js.translate.utils.BindingUtils.getCallableDescriptorForOperationExpression; diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.java b/js/js.translator/src/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.java index 4ad17ad6b41..f2cac875a90 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/operation/OverloadedAssignmentTranslator.java @@ -20,7 +20,7 @@ import com.google.dart.compiler.backend.js.ast.JsExpression; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; import org.jetbrains.jet.lang.psi.JetBinaryExpression; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.k2js.translate.callTranslator.CallTranslator; import org.jetbrains.k2js.translate.context.TranslationContext; @@ -39,7 +39,7 @@ public final class OverloadedAssignmentTranslator extends AssignmentTranslator { private OverloadedAssignmentTranslator(@NotNull JetBinaryExpression expression, @NotNull TranslationContext context) { super(expression, context); - resolvedCall = BindingContextUtilPackage.getFunctionResolvedCallWithAssert(expression, context.bindingContext()); + resolvedCall = CallUtilPackage.getFunctionResolvedCallWithAssert(expression, context.bindingContext()); } @NotNull diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.java b/js/js.translator/src/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.java index c2904a0d4f6..5c34dd77957 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/operation/OverloadedIncrementTranslator.java @@ -20,7 +20,7 @@ import com.google.dart.compiler.backend.js.ast.JsExpression; import org.jetbrains.annotations.NotNull; import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; import org.jetbrains.jet.lang.psi.JetUnaryExpression; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.k2js.translate.callTranslator.CallTranslator; import org.jetbrains.k2js.translate.context.TranslationContext; @@ -35,7 +35,7 @@ public final class OverloadedIncrementTranslator extends IncrementTranslator { @NotNull TranslationContext context ) { super(expression, context); - this.resolvedCall = BindingContextUtilPackage.getFunctionResolvedCallWithAssert(expression, context.bindingContext()); + this.resolvedCall = CallUtilPackage.getFunctionResolvedCallWithAssert(expression, context.bindingContext()); } diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.java b/js/js.translator/src/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.java index 94d89aa2624..664d97bb4d2 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/operation/UnaryOperationTranslator.java @@ -32,7 +32,7 @@ import org.jetbrains.k2js.translate.callTranslator.CallTranslator; import org.jetbrains.k2js.translate.context.TranslationContext; import org.jetbrains.k2js.translate.utils.TranslationUtils; -import static org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage.getFunctionResolvedCallWithAssert; +import static org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage.getFunctionResolvedCallWithAssert; import static org.jetbrains.k2js.translate.general.Translation.translateAsExpression; import static org.jetbrains.k2js.translate.utils.PsiUtils.getBaseExpression; import static org.jetbrains.k2js.translate.utils.PsiUtils.getOperationToken; diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/reference/AbstractCallExpressionTranslator.java b/js/js.translator/src/org/jetbrains/k2js/translate/reference/AbstractCallExpressionTranslator.java index 167a33295cf..eef15dcf6df 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/reference/AbstractCallExpressionTranslator.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/reference/AbstractCallExpressionTranslator.java @@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.FunctionDescriptor; import org.jetbrains.jet.lang.psi.JetCallExpression; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.k2js.translate.context.TranslationContext; import org.jetbrains.k2js.translate.general.AbstractTranslator; @@ -42,7 +42,7 @@ public abstract class AbstractCallExpressionTranslator extends AbstractTranslato ) { super(context); this.expression = expression; - this.resolvedCall = BindingContextUtilPackage.getFunctionResolvedCallWithAssert(expression, bindingContext()); + this.resolvedCall = CallUtilPackage.getFunctionResolvedCallWithAssert(expression, bindingContext()); this.receiver = receiver; } diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/reference/InlinedCallExpressionTranslator.java b/js/js.translator/src/org/jetbrains/k2js/translate/reference/InlinedCallExpressionTranslator.java index 1a75d256150..b6b2665ca18 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/reference/InlinedCallExpressionTranslator.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/reference/InlinedCallExpressionTranslator.java @@ -51,7 +51,7 @@ public final class InlinedCallExpressionTranslator extends AbstractCallExpressio @SuppressWarnings("UnusedParameters") public static boolean shouldBeInlined(@NotNull JetCallExpression expression, @NotNull TranslationContext context) { //TODO: inlining turned off - //ResolvedCall resolvedCall = BindingContextUtilPackage.getFunctionResolvedCall(expression, bindingContext()); + //ResolvedCall resolvedCall = CallUtilPackage.getFunctionResolvedCall(expression, bindingContext()); //CallableDescriptor descriptor = resolvedCall.getCandidateDescriptor(); //if (descriptor instanceof SimpleFunctionDescriptor) { // return ((SimpleFunctionDescriptor)descriptor).isInline(); diff --git a/js/js.translator/src/org/jetbrains/k2js/translate/reference/VariableAccessTranslator.java b/js/js.translator/src/org/jetbrains/k2js/translate/reference/VariableAccessTranslator.java index 952b5e069b8..2bf4102dedb 100644 --- a/js/js.translator/src/org/jetbrains/k2js/translate/reference/VariableAccessTranslator.java +++ b/js/js.translator/src/org/jetbrains/k2js/translate/reference/VariableAccessTranslator.java @@ -21,7 +21,7 @@ import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.jet.lang.descriptors.VariableDescriptor; import org.jetbrains.jet.lang.psi.JetReferenceExpression; -import org.jetbrains.jet.lang.resolve.bindingContextUtil.BindingContextUtilPackage; +import org.jetbrains.jet.lang.resolve.calls.callUtil.CallUtilPackage; import org.jetbrains.jet.lang.resolve.calls.model.ResolvedCall; import org.jetbrains.jet.lang.resolve.calls.model.VariableAsFunctionResolvedCall; import org.jetbrains.k2js.translate.callTranslator.CallTranslator; @@ -38,7 +38,7 @@ public class VariableAccessTranslator extends AbstractTranslator implements Acce @NotNull JetReferenceExpression referenceExpression, @Nullable JsExpression receiver ) { - ResolvedCall resolvedCall = BindingContextUtilPackage.getResolvedCallWithAssert(referenceExpression, context.bindingContext()); + ResolvedCall resolvedCall = CallUtilPackage.getResolvedCallWithAssert(referenceExpression, context.bindingContext()); if (resolvedCall instanceof VariableAsFunctionResolvedCall) { resolvedCall = ((VariableAsFunctionResolvedCall) resolvedCall).getVariableCall(); }