Fixed subtyping for StructTop. Closes PR11099.

original commit: c62f09ac5b5d4788d06401010eb7cfd02a91c623
This commit is contained in:
Eric Dobson 2011-09-05 16:58:47 -07:00 committed by Sam Tobin-Hochstadt
parent 505327ffed
commit d642105b65
3 changed files with 14 additions and 2 deletions

View 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)

View File

@ -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")]

View File

@ -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))