From ae3a41a9abf188b4b0a4ed86a224ed62cf0ae68e Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Thu, 24 Jan 2013 23:01:18 -0500 Subject: [PATCH] Avoid using unsafe structure access. Moral: a little temporary speed should never be bought at the cost of safety. original commit: 492bda2305665445e429ad34db495f0e12d0e466 --- collects/typed-racket/types/subtype.rkt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collects/typed-racket/types/subtype.rkt b/collects/typed-racket/types/subtype.rkt index 7885c91c..8770fe09 100644 --- a/collects/typed-racket/types/subtype.rkt +++ b/collects/typed-racket/types/subtype.rkt @@ -1,5 +1,5 @@ #lang racket/base -(require (except-in "../utils/utils.rkt" infer) racket/unsafe/ops +(require (except-in "../utils/utils.rkt" infer) (rep type-rep filter-rep object-rep rep-utils) (utils tc-utils) (types utils resolve base-abbrev numeric-tower substitute) @@ -49,7 +49,7 @@ ;; type type -> boolean (define/cond-contract (subtype s t) (c:-> (c:or/c Type/c SomeValues/c) (c:or/c Type/c SomeValues/c) boolean?) - (define k (cons (unsafe-struct-ref s 0) (unsafe-struct-ref t 0))) + (define k (cons (Type-seq s) (Type-seq t))) (define (new-val) (define result (handle-failure (and (subtype* (current-seen) s t) #t))) ;(printf "subtype cache miss ~a ~a\n" s t)