summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--stdlib/op.tl8
-rw-r--r--tests/012/op.tl5
2 files changed, 11 insertions, 2 deletions
diff --git a/stdlib/op.tl b/stdlib/op.tl
index 182055f0..06e87633 100644
--- a/stdlib/op.tl
+++ b/stdlib/op.tl
@@ -137,8 +137,12 @@
(let ((arg1 (sys:ensure-op-arg ctx 1)))
^(symacrolet ((,do-gen ,arg1))
,syntax-2)))
- (t (let ((arg1 (sys:ensure-op-arg ctx 1)))
- (append syntax-2 (list arg1))))))
+ (t (let* ((arg1 (sys:ensure-op-arg ctx 1))
+ (syntax-0-alt (append args (list arg1)))
+ (syntax-1-alt (sys:op-alpha-rename f e
+ syntax-0-alt
+ nil)))
+ (sys:op-alpha-rename f e syntax-1-alt t)))))
(t (append syntax-2 rest-sym))))))
(let ((metas (slot ctx 'gens)))
(cond
diff --git a/tests/012/op.tl b/tests/012/op.tl
index 0fffb6ee..12969dcc 100644
--- a/tests/012/op.tl
+++ b/tests/012/op.tl
@@ -40,6 +40,11 @@
(fi (do if @42 @rest)) (42 t)
(fi (do if @1 @3 @rest @2)) (3 t))
+(mtest
+ [(do quote x) 3] :error
+ [(do quote @1) 3] :error
+ (do pop a) :error)
+
(defun y (f)
[(op @1 @1)
(op f (op [@@1 @@1]))])