add a check that struct/c can find all of the selectors in the current scope
This commit is contained in:
parent
1ad2c75531
commit
66b78bf488
|
@ -1039,7 +1039,10 @@
|
||||||
[else
|
[else
|
||||||
(define si-selectors (fourth si))
|
(define si-selectors (fourth si))
|
||||||
(cond
|
(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)
|
si-selectors)
|
||||||
(define strip-reg (regexp (format "^~a-" (regexp-quote (symbol->string (syntax-e struct-id))))))
|
(define strip-reg (regexp (format "^~a-" (regexp-quote (symbol->string (syntax-e struct-id))))))
|
||||||
(define field-name
|
(define field-name
|
||||||
|
@ -1054,7 +1057,7 @@
|
||||||
[else #f])))
|
[else #f])))
|
||||||
(unless candidate
|
(unless candidate
|
||||||
(raise-syntax-error 'struct/c
|
(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)
|
i)
|
||||||
stx
|
stx
|
||||||
sel))
|
sel))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user