Support operatorAssign expressions in inline
This commit is contained in:
@@ -3007,9 +3007,13 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void callAugAssignMethod(JetBinaryExpression expression, CallableMethod callable, Type lhsType, boolean keepReturnValue) {
|
private void callAugAssignMethod(JetBinaryExpression expression, CallableMethod callable, Type lhsType, boolean keepReturnValue) {
|
||||||
|
JetSimpleNameExpression reference = expression.getOperationReference();
|
||||||
ResolvedCall<? extends CallableDescriptor> resolvedCall =
|
ResolvedCall<? extends CallableDescriptor> resolvedCall =
|
||||||
bindingContext.get(BindingContext.RESOLVED_CALL, expression.getOperationReference());
|
bindingContext.get(BindingContext.RESOLVED_CALL, reference);
|
||||||
assert resolvedCall != null;
|
Call call = bindingContext.get(BindingContext.CALL, reference);
|
||||||
|
|
||||||
|
assert resolvedCall != null : "Resolved call should be not null for operation reference in " + expression.getText();
|
||||||
|
assert call != null : "Call should be not null for operation reference in " + expression.getText();
|
||||||
|
|
||||||
StackValue value = gen(expression.getLeft());
|
StackValue value = gen(expression.getLeft());
|
||||||
if (keepReturnValue) {
|
if (keepReturnValue) {
|
||||||
@@ -3018,12 +3022,7 @@ public class ExpressionCodegen extends JetVisitor<StackValue, StackValue> implem
|
|||||||
value.put(lhsType, v);
|
value.put(lhsType, v);
|
||||||
StackValue receiver = StackValue.onStack(lhsType);
|
StackValue receiver = StackValue.onStack(lhsType);
|
||||||
|
|
||||||
if (!(resolvedCall.getResultingDescriptor() instanceof ConstructorDescriptor)) { // otherwise already
|
invokeMethodWithArguments(call, callable, resolvedCall, receiver);
|
||||||
receiver = StackValue.receiver(resolvedCall, receiver, this, callable);
|
|
||||||
receiver.put(receiver.type, v);
|
|
||||||
}
|
|
||||||
|
|
||||||
pushArgumentsAndInvoke(resolvedCall, callable, CallGenerator.NOT_INLINE);
|
|
||||||
|
|
||||||
if (keepReturnValue) {
|
if (keepReturnValue) {
|
||||||
value.store(callable.getReturnType(), v);
|
value.store(callable.getReturnType(), v);
|
||||||
|
|||||||
Reference in New Issue
Block a user