Be less rigid about the shape of type annotations in units

Closes #535
This commit is contained in:
Daniel Feltey 2017-04-27 11:48:40 -05:00
parent 80d1654dee
commit 4b35df2c96
2 changed files with 15 additions and 2 deletions

View File

@ -327,13 +327,13 @@
;; The inserted lambda expression will be expanded to the internal
;; name of the variable being annotated, this internal name
;; can then be associated with the type annotation during typechecking
[(define-values () (colon-helper (: name:id type) rest ...))
[(define-values () (colon-helper (: name:id type ...) rest ...))
(quasisyntax/loc stx
(define-values ()
#,(tr:unit:body-exp-def-type-property
#`(#%expression
(begin (void (lambda () name))
(colon-helper (: name type) rest ...)))
(colon-helper (: name type ...) rest ...)))
'def/type)))]
[(define-values (name:id ...) rhs)
(quasisyntax/loc stx

View File

@ -0,0 +1,13 @@
#lang typed/racket/base
(require typed/racket/unit)
(define-signature sig^
([f : (Integer Integer)]))
(define-unit sig@
(import)
(export sig^)
(: f : Integer Integer)
(define (f x) (+ 1 x)))