From f77ab7177246b664b80b8d347ff12b817632bda1 Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Fri, 7 Jan 2011 19:49:42 -0700 Subject: [PATCH] Fixing PR11592 --- collects/plai/datatype.rkt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/collects/plai/datatype.rkt b/collects/plai/datatype.rkt index 960cbedce4..0f8f397204 100644 --- a/collects/plai/datatype.rkt +++ b/collects/plai/datatype.rkt @@ -352,7 +352,12 @@ ;;; far, either the clauses are malformed or the error is completely ;;; unintelligible. [(_ type-id test-expr clauses ...) - (map validate-clause (syntax->list #'(clauses ...)))] + (begin + (unless (identifier? #'type-id) + (plai-syntax-error 'type-case #'type-id type-case:not-a-type)) + (validate-and-remove-type-symbol #'type-id (syntax-local-value #'type-id (λ () #f))) + (andmap validate-clause (syntax->list #'(clauses ...))) + (plai-syntax-error 'type-case stx "Unknown error"))] [_ (plai-syntax-error 'type-case stx type-case:generic)]))