Skip to content

Commit

Permalink
Fix parsing of (Struct ...) types.
Browse files Browse the repository at this point in the history
This was a regression that appeared in 5.3.1
(cherry picked from commit 3eb4a75)
  • Loading branch information
takikawa authored and rmculpepper committed Jul 8, 2013
1 parent 4ccb8bf commit 691c156
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions collects/tests/typed-racket/fail/bad-struct-top.rkt
Original file line number Diff line number Diff line change
@@ -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))

4 changes: 2 additions & 2 deletions collects/typed-racket/private/parse-type.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -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)])
Expand Down

0 comments on commit 691c156

Please sign in to comment.