Ensure that structs don't overlap with simple values.
Reported by Ray Racine. Please merge to release. original commit: 4a90c6c1fea75fac3132de7df70e5e7e8207b311
This commit is contained in:
parent
2f6213c56f
commit
460b1fe7b3
9
collects/tests/typed-racket/succeed/poly-struct-pred.rkt
Normal file
9
collects/tests/typed-racket/succeed/poly-struct-pred.rkt
Normal file
|
@ -0,0 +1,9 @@
|
|||
#lang typed/racket
|
||||
|
||||
(struct: (X) s ([v : X]))
|
||||
|
||||
(: f : (All (X) (U 'foo (s X)) -> (s X)))
|
||||
(define (f t)
|
||||
(match t
|
||||
[(s value) (s value)]
|
||||
[_ (error 'fail)]))
|
|
@ -66,8 +66,10 @@
|
|||
[(or (list (Pair: _ _) _)
|
||||
(list _ (Pair: _ _)))
|
||||
#f]
|
||||
[(or (list (Value: '()) (Struct: n _ flds _ _ _ _ _))
|
||||
(list (Struct: n _ flds _ _ _ _ _) (Value: '())))
|
||||
[(or (list (Value: (? (λ (e) (or (null? e) (symbol? e) (number? e) (boolean? e) (pair? e) (keyword? e)))))
|
||||
(Struct: n _ flds _ _ _ _ _))
|
||||
(list (Struct: n _ flds _ _ _ _ _)
|
||||
(Value: (? (λ (e) (or (null? e) (symbol? e) (number? e) (boolean? e) (pair? e) (keyword? e)))))))
|
||||
#f]
|
||||
[(list (Struct: n _ flds _ _ _ _ _)
|
||||
(Struct: n* _ flds* _ _ _ _ _)) (=> nevermind)
|
||||
|
|
Loading…
Reference in New Issue
Block a user