Finish tests fix
This commit is contained in:
+15
-1
@@ -22,6 +22,9 @@ import org.jetbrains.annotations.Nullable;
|
||||
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;
|
||||
import org.jetbrains.jet.lang.psi.JetReferenceExpression;
|
||||
import org.jetbrains.jet.lang.psi.JetSimpleNameExpression;
|
||||
import org.jetbrains.jet.lang.resolve.calls.ExpressionAsFunctionDescriptor;
|
||||
import org.jetbrains.jet.lang.resolve.calls.ResolvedCall;
|
||||
import org.jetbrains.jet.lang.resolve.calls.ResolvedValueArgument;
|
||||
@@ -95,11 +98,22 @@ public final class CallExpressionTranslator extends AbstractCallExpressionTransl
|
||||
return translateExpressionAsFunction();
|
||||
}
|
||||
if (resolvedCall instanceof VariableAsFunctionResolvedCall) {
|
||||
return Translation.translateAsExpression(PsiUtils.getCallee(expression), context());
|
||||
return translateVariableForVariableAsFunctionResolvedCall();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@NotNull
|
||||
//TODO: looks hacky and should be modified soon
|
||||
private JsExpression translateVariableForVariableAsFunctionResolvedCall() {
|
||||
JetExpression callee = PsiUtils.getCallee(expression);
|
||||
if (callee instanceof JetSimpleNameExpression) {
|
||||
return ReferenceTranslator.getAccessTranslator((JetSimpleNameExpression) callee, receiver, context()).translateAsGet();
|
||||
}
|
||||
assert receiver != null;
|
||||
return Translation.translateAsExpression(callee, context());
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private JsExpression translateExpressionAsFunction() {
|
||||
return Translation.translateAsExpression(getCallee(expression), context());
|
||||
|
||||
@@ -103,6 +103,7 @@ public final class CallTranslator extends AbstractTranslator {
|
||||
return descriptor.getName().equals("invoke");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
private JsExpression invokeCall() {
|
||||
JsInvocation callMethodInvocation = generateCallMethodInvocation();
|
||||
List<JsExpression> parameters = Lists.<JsExpression>newArrayList(context().program().getNullLiteral());
|
||||
|
||||
Reference in New Issue
Block a user