diff --git a/src/julia-syntax.scm b/src/julia-syntax.scm index 4c216d7502ac3..6dbbb1d2e6d4d 100644 --- a/src/julia-syntax.scm +++ b/src/julia-syntax.scm @@ -1489,10 +1489,13 @@ `(block (= (tuple ,k ,v) ,rk) ,push-expr)))) restkeys)) - (if (call (top isempty) ,container) - (call ,f ,@pa) - (call (top kwcall) ,f ,(length keys) ,@keyargs - ,container ,@pa)))))))) + ,(let ((kw-call `(call (top kwcall) ,f ,(length keys) ,@keyargs + ,container ,@pa))) + (if (not (null? keys)) + kw-call + `(if (call (top isempty) ,container) + (call ,f ,@pa) + ,kw-call))))))))) (define (expand-transposed-op e ops) (let ((a (caddr e))