diff --git a/collects/typed-scheme/private/annotate-classes.ss b/collects/typed-scheme/private/annotate-classes.ss index c16c30d6c2..09b369d60d 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 3872bb31d5..6d91e099c2 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