From 66b78bf488b1010fb9e01598fce6f88433363e4f Mon Sep 17 00:00:00 2001 From: Robby Findler Date: Thu, 23 Aug 2012 18:37:35 -0500 Subject: [PATCH] add a check that struct/c can find all of the selectors in the current scope --- collects/racket/contract/private/struct-dc.rkt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/collects/racket/contract/private/struct-dc.rkt b/collects/racket/contract/private/struct-dc.rkt index bb73096d45..ac4c2d7427 100644 --- a/collects/racket/contract/private/struct-dc.rkt +++ b/collects/racket/contract/private/struct-dc.rkt @@ -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))