Improve TR's overlap checking for StructTop types
Closes PR 14458 original commit: eb006a0e9ec78d0d0657fbf8587ba8b5106419aa
This commit is contained in:
parent
fe6cdbc35b
commit
63e2fa1bda
|
@ -79,8 +79,8 @@
|
|||
(Value: (? simple-datum? v2)))
|
||||
(equal? v1 v2)]
|
||||
[(or (list (Value: (? simple-datum?))
|
||||
(Struct: n _ flds _ _ _))
|
||||
(list (Struct: n _ flds _ _ _)
|
||||
(or (? Struct?) (? StructTop?)))
|
||||
(list (or (? Struct?) (? StructTop?))
|
||||
(Value: (? simple-datum?))))
|
||||
#f]
|
||||
[(list (Struct: n _ flds _ _ _)
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
#lang typed/racket
|
||||
|
||||
;; Test for PR 14458. Make sure that overlap checking on
|
||||
;; invariant struct types works against simple data types.
|
||||
|
||||
(struct: (X) S ([z : (Vectorof X)]))
|
||||
(define-type (T X) (U 'Leaf (S X)))
|
||||
|
||||
(: f (∀ (X) (T X) → Any))
|
||||
(define (f s)
|
||||
(match s
|
||||
[(S _) 42]))
|
Loading…
Reference in New Issue
Block a user