Fix parsing of (Struct ...) types.

This was a regression that appeared in 5.3.1

original commit: 3eb4a75613ef819cf58504cb7f8b7cec62eb3f7e
This commit is contained in:
Asumu Takikawa 2013-05-19 20:31:25 -04:00
parent c478e881c0
commit ee4be88f8b
2 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,7 @@
#;
(exn:pred #rx"Argument to Struct must be a structure")
#lang typed/racket
;; Make sure `Struct` constructor rejects bad arguments
(: x (Struct Integer))

View File

@ -177,9 +177,9 @@
(add-disappeared-use #'kw)
(let ([v (parse-type #'t)])
(match (resolve v)
[(and s Struct?) (make-StructTop s)]
[(and s (? Struct?)) (make-StructTop s)]
[_ (tc-error/delayed "Argument to Struct must be a structure type, got ~a" v)
(make-Instance (Un))]))]
(make-StructTop (Un))]))]
[((~and kw t:Instance) t)
(add-disappeared-use #'kw)
(let ([v (parse-type #'t)])