Fix parsing of (Struct ...) types.
This was a regression that appeared in 5.3.1 original commit: 3eb4a75613ef819cf58504cb7f8b7cec62eb3f7e
This commit is contained in:
parent
c478e881c0
commit
ee4be88f8b
7
collects/tests/typed-racket/fail/bad-struct-top.rkt
Normal file
7
collects/tests/typed-racket/fail/bad-struct-top.rkt
Normal 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))
|
||||
|
|
@ -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)])
|
||||
|
|
Loading…
Reference in New Issue
Block a user