Share definition of erase-filter.
This commit is contained in:
parent
a76d57fa88
commit
edc3b60b67
|
@ -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))
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)))]))
|
||||
|
|
Loading…
Reference in New Issue
Block a user