diff --git a/collects/typed-racket/typecheck/tc-if.rkt b/collects/typed-racket/typecheck/tc-if.rkt index 6dab98b74c..586125e52b 100644 --- a/collects/typed-racket/typecheck/tc-if.rkt +++ b/collects/typed-racket/typecheck/tc-if.rkt @@ -15,12 +15,6 @@ (import tc-expr^) (export tc-if^) -(define (erase-filter tc) - (match tc - [(tc-any-results:) tc] - [(tc-results: ts _ _) - (ret ts (for/list ([f (in-list ts)]) (make-NoFilter)) (for/list ([f (in-list ts)]) (make-NoObject)))])) - (define (tc/if-twoarm tst thn els [expected #f]) (define (tc expr reachable?) (unless reachable? (warn-unreachable expr)) diff --git a/collects/typed-racket/typecheck/tc-let-unit.rkt b/collects/typed-racket/typecheck/tc-let-unit.rkt index a6eeba00b6..3a02293992 100644 --- a/collects/typed-racket/typecheck/tc-let-unit.rkt +++ b/collects/typed-racket/typecheck/tc-let-unit.rkt @@ -2,7 +2,7 @@ (require "../utils/utils.rkt" (only-in srfi/1/list s:member) - (except-in (types utils abbrev union) -> ->* one-of/c) + (except-in (types utils abbrev union filter-ops) -> ->* one-of/c) (only-in (types abbrev) (-> t:->)) (private type-annotation parse-type syntax-properties) (env lexical-env type-alias-env global-env type-env-structs scoped-tvar-env) @@ -17,12 +17,6 @@ (import tc-expr^) (export tc-let^) -(define (erase-filter tc) - (match tc - [(tc-any-results:) tc] - [(tc-results: ts _ _) - (ret ts (for/list ([f (in-list ts)]) (make-NoFilter)) (for/list ([f (in-list ts)]) (make-NoObject)))])) - (define/cond-contract (do-check expr->type namess results expected-results form exprs body clauses expected #:abstract [abstract null]) (((syntax? syntax? tc-results/c . -> . any/c) (listof (listof identifier?)) (listof tc-results/c) (listof tc-results/c) diff --git a/collects/typed-racket/types/filter-ops.rkt b/collects/typed-racket/types/filter-ops.rkt index 1896d92428..2695c67e83 100644 --- a/collects/typed-racket/types/filter-ops.rkt +++ b/collects/typed-racket/types/filter-ops.rkt @@ -4,10 +4,10 @@ racket/list racket/match racket/dict (prefix-in c: (contract-req)) - (rep type-rep filter-rep rep-utils) + (rep type-rep filter-rep object-rep rep-utils) (utils tc-utils) (only-in (infer infer) restrict) - (types union subtype remove-intersect abbrev)) + (types union subtype remove-intersect abbrev tc-result)) (provide (all-defined-out)) @@ -203,3 +203,12 @@ (-and false-filter new-filters)) op))) rest drest kws))))])])) + +;; tc-results/c -> tc-results/c +(define (erase-filter tc) + (match tc + [(tc-any-results:) tc] + [(tc-results: ts _ _) + (ret ts + (for/list ([f (in-list ts)]) (make-NoFilter)) + (for/list ([f (in-list ts)]) (make-NoObject)))]))