Generalize #t and #f to `Boolean'.
This commit is contained in:
parent
3b13b7dfc3
commit
ba09e906d8
|
@ -185,9 +185,9 @@
|
||||||
[tc-e/t #(3 4 5) (make-HeterogenousVector (list -Integer -Integer -Integer))]
|
[tc-e/t #(3 4 5) (make-HeterogenousVector (list -Integer -Integer -Integer))]
|
||||||
[tc-e/t '(2 3 4) (-lst* -PosByte -PosByte -PosByte)]
|
[tc-e/t '(2 3 4) (-lst* -PosByte -PosByte -PosByte)]
|
||||||
[tc-e/t '(2 3 #t) (-lst* -PosByte -PosByte (-val #t))]
|
[tc-e/t '(2 3 #t) (-lst* -PosByte -PosByte (-val #t))]
|
||||||
[tc-e/t #(2 3 #t) (make-HeterogenousVector (list -Integer -Integer (-val #t)))]
|
[tc-e/t #(2 3 #t) (make-HeterogenousVector (list -Integer -Integer -Boolean))]
|
||||||
[tc-e (vector 2 "3" #t) (make-HeterogenousVector (list -Integer -String (-val #t)))]
|
[tc-e (vector 2 "3" #t) (make-HeterogenousVector (list -Integer -String -Boolean))]
|
||||||
[tc-e (vector-immutable 2 "3" #t) (make-HeterogenousVector (list -Integer -String (-val #t)))]
|
[tc-e (vector-immutable 2 "3" #t) (make-HeterogenousVector (list -Integer -String -Boolean))]
|
||||||
[tc-e/t '(#t #f) (-lst* (-val #t) (-val #f))]
|
[tc-e/t '(#t #f) (-lst* (-val #t) (-val #f))]
|
||||||
[tc-e/t (plambda: (a) ([l : (Listof a)]) (car l))
|
[tc-e/t (plambda: (a) ([l : (Listof a)]) (car l))
|
||||||
(make-Poly '(a) (t:-> (make-Listof (-v a)) (-v a)))]
|
(make-Poly '(a) (t:-> (make-Listof (-v a)) (-v a)))]
|
||||||
|
@ -1329,7 +1329,6 @@
|
||||||
[tc-e (#%variable-reference +) -Variable-Reference]
|
[tc-e (#%variable-reference +) -Variable-Reference]
|
||||||
[tc-e (apply (λ: ([x : String] [y : String]) (string-append x y)) (list "foo" "bar")) -String]
|
[tc-e (apply (λ: ([x : String] [y : String]) (string-append x y)) (list "foo" "bar")) -String]
|
||||||
[tc-e (apply (plambda: (a) ([x : a] [y : a]) x) (list "foo" "bar")) -String]
|
[tc-e (apply (plambda: (a) ([x : a] [y : a]) x) (list "foo" "bar")) -String]
|
||||||
|
|
||||||
[tc-e (ann
|
[tc-e (ann
|
||||||
(case-lambda [(x) (add1 x)]
|
(case-lambda [(x) (add1 x)]
|
||||||
[(x y) (add1 x)])
|
[(x y) (add1 x)])
|
||||||
|
@ -1338,6 +1337,10 @@
|
||||||
#:ret (ret (cl->* (t:-> -Integer -Integer)
|
#:ret (ret (cl->* (t:-> -Integer -Integer)
|
||||||
(t:-> -Integer -Integer -Integer))
|
(t:-> -Integer -Integer -Integer))
|
||||||
(-FS -top -bot))]
|
(-FS -top -bot))]
|
||||||
|
[tc-e (let ([my-pred (λ () #f)])
|
||||||
|
(for/and: : Any ([i (in-range 4)])
|
||||||
|
(my-pred)))
|
||||||
|
#:ret (ret Univ (-FS -top -top) (make-NoObject))]
|
||||||
)
|
)
|
||||||
(test-suite
|
(test-suite
|
||||||
"check-type tests"
|
"check-type tests"
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
(begin
|
(begin
|
||||||
(require
|
(require
|
||||||
racket/list
|
racket/list racket/unsafe/ops
|
||||||
(for-template racket/flonum racket/fixnum racket/math racket/unsafe/ops racket/base
|
(for-template racket/flonum racket/fixnum racket/math racket/unsafe/ops racket/base
|
||||||
(only-in "../types/numeric-predicates.rkt" index?))
|
(only-in "../types/numeric-predicates.rkt" index?))
|
||||||
(only-in (types abbrev numeric-tower) [-Number N] [-Boolean B] [-Symbol Sym] [-Real R] [-PosInt -Pos]))
|
(only-in (types abbrev numeric-tower) [-Number N] [-Boolean B] [-Symbol Sym] [-Real R] [-PosInt -Pos]))
|
||||||
|
|
|
@ -56,6 +56,7 @@
|
||||||
(exit t)))]
|
(exit t)))]
|
||||||
[(ListDots: t bound) (-lst (substitute Univ bound t))]
|
[(ListDots: t bound) (-lst (substitute Univ bound t))]
|
||||||
[(? (lambda (t) (subtype t -Symbol))) -Symbol]
|
[(? (lambda (t) (subtype t -Symbol))) -Symbol]
|
||||||
|
[(or (Value: #f) (Value: #t)) -Boolean]
|
||||||
[_ (exit t)]))))
|
[_ (exit t)]))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user