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