From 31d6c046081575be8b633123ad35b2d10fe09ca4 Mon Sep 17 00:00:00 2001 From: Asumu Takikawa Date: Thu, 12 Feb 2015 14:51:54 -0500 Subject: [PATCH] Use Univ instead of (make-Univ) --- .../typecheck/check-class-unit.rkt | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt b/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt index 235d9a47..d3df2b39 100644 --- a/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt +++ b/typed-racket-lib/typed-racket/typecheck/check-class-unit.rkt @@ -804,7 +804,7 @@ (for/list ([m (in-set method-names)]) (define external (dict-ref internal-external-mapping m)) (define maybe-type (dict-ref type-map external #f)) - (->* (list (make-Univ)) + (->* (list Univ) (cond [(and maybe-type (not (equal? (car maybe-type) top-func)) (not inner?)) @@ -813,7 +813,7 @@ (not (equal? (car maybe-type) top-func))) (Un (-val #f) (function->method (car maybe-type) self-type))] - [else (make-Univ)])))) + [else Univ])))) (define method-types (make-method-types (hash-ref parse-info 'method-internals) methods)) @@ -835,10 +835,8 @@ (define external (dict-ref internal-external-mapping f)) (define maybe-type (dict-ref type-map external #f)) (values - (-> (make-Univ) (or (and maybe-type (car maybe-type)) - (make-Univ))) - (-> (make-Univ) (or (and maybe-type (car maybe-type)) - -Bottom) + (-> Univ (or (and maybe-type (car maybe-type)) Univ)) + (-> Univ (or (and maybe-type (car maybe-type)) -Bottom) -Void)))) (define (make-private-field-types field-names getter-ids type-map) @@ -850,14 +848,13 @@ ;; This case is more complicated than for public fields because private ;; fields support occurrence typing. The object is set as the field's ;; accessor id, so that *its* range type is refined for occurrence typing. - (list (make-arr* (list (make-Univ)) + (list (make-arr* (list Univ) (or (and maybe-type (car maybe-type)) - (make-Univ)) + Univ) #:filters -no-filter #:object (make-Path (list (make-FieldPE)) getter-id)))) - (-> (make-Univ) (or (and maybe-type (car maybe-type)) - -Bottom) + (-> Univ (or (and maybe-type (car maybe-type)) -Bottom) -Void)))) (define-values (field-get-types field-set-types) @@ -878,7 +875,7 @@ (or (and maybe-type (not (equal? maybe-type top-func)) (function->method maybe-type self-type)) - (make-Univ)))) + Univ))) (define private-method-types (make-private-like-types (hash-ref parse-info 'private-names) @@ -942,7 +939,7 @@ (append all-types init-types init-rest-type - (list self-type (make-Univ))))) + (list self-type Univ)))) ;; check-methods : Listof Listof Dict Dict Type ;; -> Dict