Fixed subtyping for StructTop. Closes PR11099.
original commit: c62f09ac5b5d4788d06401010eb7cfd02a91c623
This commit is contained in:
parent
505327ffed
commit
d642105b65
11
collects/tests/typed-racket/succeed/pr11099.rkt
Normal file
11
collects/tests/typed-racket/succeed/pr11099.rkt
Normal file
|
@ -0,0 +1,11 @@
|
|||
#lang typed/racket
|
||||
|
||||
(struct: (X) b ([bar : (Vectorof X)]))
|
||||
|
||||
(define: b-val : (b Integer)
|
||||
(b (ann (vector 1) (Vectorof Integer))))
|
||||
|
||||
|
||||
(if (b? b-val)
|
||||
(b-bar b-val)
|
||||
#f)
|
|
@ -196,7 +196,7 @@
|
|||
[(Name: stx) (fp "~a" (syntax-e stx))]
|
||||
[(app has-name? (? values name))
|
||||
(fp "~a" name)]
|
||||
[(StructTop: st) (fp "~a" st)]
|
||||
[(StructTop: st) (fp "(struct-top: ~a)" st)]
|
||||
[(BoxTop:) (fp "Box")]
|
||||
[(ChannelTop:) (fp "Channel")]
|
||||
[(ThreadCellTop:) (fp "ThreadCell")]
|
||||
|
|
|
@ -383,7 +383,8 @@
|
|||
[proc* (fail! proc proc*)]
|
||||
[else A0])])
|
||||
(subtype/flds* A flds flds*))]
|
||||
[((Struct: _ _ _ _ _ _ _ _) (StructTop: (== s type-equal?)))
|
||||
[((Struct: nm _ _ _ _ _ _ _) (StructTop: (Struct: nm* _ _ _ _ _ _ _))) (=> nevermind)
|
||||
(unless (free-identifier=? nm nm*) (nevermind))
|
||||
A0]
|
||||
;ephemerons are covariant
|
||||
[((Ephemeron: s) (Ephemeron: t))
|
||||
|
|
Loading…
Reference in New Issue
Block a user