diff --git a/collects/typed-racket/private/with-types.rkt b/collects/typed-racket/private/with-types.rkt index d1910813..27242787 100644 --- a/collects/typed-racket/private/with-types.rkt +++ b/collects/typed-racket/private/with-types.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require racket/require +(require racket/require racket/promise (for-template (except-in racket/base for for* with-handlers lambda λ define) "../base-env/prims.rkt" @@ -79,8 +79,8 @@ ;; this parameter is just for printing types ;; this is a parameter to avoid dependency issues [current-type-names - (lambda () - (append + (delay + (append (type-name-env-map (lambda (id ty) (cons (syntax-e id) ty))) (type-alias-env-map (lambda (id ty) diff --git a/collects/typed-racket/tc-setup.rkt b/collects/typed-racket/tc-setup.rkt index 4214d9cf..807f279c 100644 --- a/collects/typed-racket/tc-setup.rkt +++ b/collects/typed-racket/tc-setup.rkt @@ -2,7 +2,7 @@ (require (rename-in "utils/utils.rkt" [infer r:infer]) (except-in syntax/parse id) - racket/pretty + racket/pretty racket/promise (private type-contract) (types utils convenience) (typecheck typechecker provide-handling tc-toplevel) @@ -50,7 +50,7 @@ ;; this parameter is just for printing types ;; this is a parameter to avoid dependency issues [current-type-names - (lambda () + (delay (append (type-name-env-map (lambda (id ty) (cons (syntax-e id) ty))) diff --git a/collects/typed-racket/types/printer.rkt b/collects/typed-racket/types/printer.rkt index 8e556d08..0cd0a4fa 100644 --- a/collects/typed-racket/types/printer.rkt +++ b/collects/typed-racket/types/printer.rkt @@ -1,6 +1,6 @@ #lang racket/base -(require racket/require racket/match unstable/sequence racket/string +(require racket/require racket/match unstable/sequence racket/string racket/promise (prefix-in s: srfi/1) (path-up "rep/type-rep.rkt" "rep/filter-rep.rkt" "rep/object-rep.rkt" "rep/rep-utils.rkt" "types/abbrev.rkt" "types/subtype.rkt" @@ -21,7 +21,7 @@ ;; has-name : Type -> Maybe[Symbol] (define (has-name? t) (and print-aliases - (for/first ([(n t*) (in-pairs (in-list ((current-type-names))))] + (for/first ([(n t*) (in-pairs (in-list (force (current-type-names))))] #:when (and (Type? t*) (type-equal? t t*))) n))) @@ -86,7 +86,7 @@ [(cons name (and t* (Union: elts))) (subtype t* t)] [_ #f])) - ((current-type-names)))) + (force (current-type-names)))) ;; names and the sets themselves (not the union types) ;; we use srfi/1 lsets as sets, to use custom type equality. (define candidates diff --git a/collects/typed-racket/utils/tc-utils.rkt b/collects/typed-racket/utils/tc-utils.rkt index 78f9fc1d..3bf80656 100644 --- a/collects/typed-racket/utils/tc-utils.rkt +++ b/collects/typed-racket/utils/tc-utils.rkt @@ -6,7 +6,7 @@ don't depend on any other portion of the system |# (provide (all-defined-out) (all-from-out "disappeared-use.rkt")) -(require "syntax-traversal.rkt" racket/dict "disappeared-use.rkt" +(require "syntax-traversal.rkt" racket/dict "disappeared-use.rkt" racket/promise syntax/parse (for-syntax racket/base syntax/parse) racket/match) ;; a parameter representing the original location of the syntax being @@ -151,7 +151,7 @@ don't depend on any other portion of the system ;; parameter for currently-defined type aliases ;; this is used only for printing type names -(define current-type-names (make-parameter (lambda () '()))) +(define current-type-names (make-parameter (delay '()))) ;; for reporting internal errors in the type checker (define-struct (exn:fail:tc exn:fail) ())