Tests for bug found by David Van Horn.

original commit: af689b253188d61ae12c01f0f0240817c767c474
This commit is contained in:
Sam Tobin-Hochstadt 2010-05-24 14:04:43 -07:00
parent e345eb7448
commit bbf633a95c
2 changed files with 33 additions and 0 deletions

View 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))))

View File

@ -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"