add a check that struct/c can find all of the selectors in the current scope

This commit is contained in:
Robby Findler 2012-08-23 18:37:35 -05:00
parent 1ad2c75531
commit 66b78bf488

View File

@ -1039,7 +1039,10 @@
[else
(define si-selectors (fourth si))
(cond
[(ormap (λ (x) (and x (free-identifier=? x sel)))
[(ormap (λ (x) (and x
(free-identifier=? x sel)
(free-identifier=? (datum->syntax stx x)
sel)))
si-selectors)
(define strip-reg (regexp (format "^~a-" (regexp-quote (symbol->string (syntax-e struct-id))))))
(define field-name
@ -1054,7 +1057,7 @@
[else #f])))
(unless candidate
(raise-syntax-error 'struct/c
(format "could not determine selector id for field ~a (counting from 0)"
(format "could not find selector id for field ~a (counting from 0) in current scope"
i)
stx
sel))