Skip to content

Commit

Permalink
Make the "duplicate pattern variable" message more informative
Browse files Browse the repository at this point in the history
Having the `sym` and `pattern-vars` info makes it possible to guess
which expression the error concerns.
  • Loading branch information
wolneykien committed Nov 24, 2023
1 parent faf8fa0 commit 41ac4d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/_syntax-pattern.scm
Expand Up @@ -117,7 +117,7 @@
(else
(let ((x (assq sym pattern-vars)))
(if x
(error "duplicate pattern variable")
(error "duplicate pattern variable: " sym pattern-vars)
(let ((index (length pattern-vars)))
(cont (vector (syn#pattern-var)) ;; TODO: replace with '#(0) to allow sharing?
(cons (cons sym (cons index rank))
Expand Down

0 comments on commit 41ac4d1

Please sign in to comment.