From 0482c90bfa0e1ce76ec903e0be37051463345fd3 Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Thu, 7 Jan 2010 20:16:05 +0000 Subject: [PATCH] Improve error messages. svn: r17545 original commit: a40d5c55693037f2a260512c74a6ef4d58d5ba5e --- collects/typed-scheme/private/annotate-classes.ss | 1 + collects/typed-scheme/private/prims.ss | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/collects/typed-scheme/private/annotate-classes.ss b/collects/typed-scheme/private/annotate-classes.ss index c16c30d6..09b369d6 100644 --- a/collects/typed-scheme/private/annotate-classes.ss +++ b/collects/typed-scheme/private/annotate-classes.ss @@ -42,6 +42,7 @@ (define-syntax-class annotated-formal #:description "annotated variable of the form [x : T]" + #:opaque #:attributes (name ty ann-name) (pattern [:annotated-name])) diff --git a/collects/typed-scheme/private/prims.ss b/collects/typed-scheme/private/prims.ss index 3872bb31..6d91e099 100644 --- a/collects/typed-scheme/private/prims.ss +++ b/collects/typed-scheme/private/prims.ss @@ -170,8 +170,11 @@ This file defines two sorts of primitives. All of them are provided into any mod (identifier? #'nm) (with-syntax ([new-nm (syntax-property #'nm 'type-label #'ty)]) (syntax/loc stx (define new-nm body)))] - [(define: (vars:id ...) (f:id args ...) : ret body ...) - #'(pdefine: (vars ...) (f args ...) : ret body ...)])) + [(define: (tvars:id ...) (nm:id . formals:annotated-formals) : ret-ty body ...) + (with-syntax ([type (syntax/loc #'ret-ty (All (tvars ...) (formals.arg-ty ... -> ret-ty)))]) + (syntax/loc stx + (define: nm : type + (plambda: (tvars ...) formals body ...))))])) (define-syntax (lambda: stx) (syntax-parse stx