Fix parsing of (Struct ...) types.

This was a regression that appeared in 5.3.1
(cherry picked from commit 3eb4a75613)
This commit is contained in:
Asumu Takikawa 2013-05-19 20:31:25 -04:00 committed by Ryan Culpepper
parent 4ccb8bf185
commit 691c156777
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

@ -170,9 +170,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)])