Tests for bug found by David Van Horn.
original commit: af689b253188d61ae12c01f0f0240817c767c474
This commit is contained in:
parent
e345eb7448
commit
bbf633a95c
25
collects/tests/typed-scheme/succeed/or-sym.rkt
Normal file
25
collects/tests/typed-scheme/succeed/or-sym.rkt
Normal file
|
@ -0,0 +1,25 @@
|
|||
#lang typed/scheme
|
||||
|
||||
#;#;
|
||||
(: g (Any -> Boolean : (U 'r 's)))
|
||||
(define (g x)
|
||||
(let ([q x])
|
||||
(let ([op2 (eq? 'r x)])
|
||||
(if op2 op2 (eq? 's x)))))
|
||||
|
||||
|
||||
(define: f? : (Any -> Boolean : (U 'q 'r 's))
|
||||
(lambda (x)
|
||||
(let ([op1 (eq? 'q x)])
|
||||
(if op1 op1
|
||||
(let ([op2 (eq? 'r x)])
|
||||
(if op2
|
||||
;; !#f_op2
|
||||
op2
|
||||
(eq? 's x)))))))
|
||||
|
||||
(define: f2? : (Any -> Boolean : (U 'q 'r 's))
|
||||
(lambda (x)
|
||||
(or (eq? 'q x)
|
||||
(eq? 'r x)
|
||||
(eq? 's x))))
|
|
@ -794,6 +794,14 @@
|
|||
[tc-e (floor 1/2) -Integer]
|
||||
[tc-e (ceiling 1/2) -Integer]
|
||||
[tc-e (truncate 0.5) -Flonum]
|
||||
[tc-e/t (ann (lambda (x) (lambda (x) x))
|
||||
(Integer -> (All (X) (X -> X))))
|
||||
(t:-> -Integer (-poly (x) (t:-> x x)))]
|
||||
[tc-e/t (lambda: ([x : Any])
|
||||
(or (eq? 'q x)
|
||||
(eq? 'r x)
|
||||
(eq? 's x)))
|
||||
(make-pred-ty (t:Un (-val 'q) (-val 'r) (-val 's)))]
|
||||
)
|
||||
(test-suite
|
||||
"check-type tests"
|
||||
|
|
Loading…
Reference in New Issue
Block a user