parent
a90a1bd689
commit
eb93a2b571
|
@ -5,8 +5,8 @@
|
|||
"utils.rkt"
|
||||
syntax/parse syntax/stx racket/match
|
||||
(typecheck signatures tc-funapp)
|
||||
(types abbrev union utils)
|
||||
(rep type-rep)
|
||||
(types abbrev filter-ops union utils)
|
||||
(rep type-rep object-rep)
|
||||
|
||||
(for-label racket/base racket/bool))
|
||||
|
||||
|
@ -53,6 +53,12 @@
|
|||
(alt eqv? eqv?-able)
|
||||
(alt equal? equal?-able)))
|
||||
(match* ((single-value v1) (single-value v2))
|
||||
[((tc-result1: (Value: (? ok? val1)) _ o1)
|
||||
(tc-result1: (Value: (? ok? val2)) _ o2))
|
||||
(ret -Boolean (-FS (-and (-filter (-val val2) o1)
|
||||
(-filter (-val val1) o2))
|
||||
(-and (-not-filter (-val val1) o1)
|
||||
(-not-filter (-val val2) o2))))]
|
||||
[((tc-result1: t _ o) (tc-result1: (Value: (? ok? val))))
|
||||
(ret -Boolean (-FS (-filter (-val val) o) (-not-filter (-val val) o)))]
|
||||
[((tc-result1: (Value: (? ok? val))) (tc-result1: t _ o))
|
||||
|
|
15
typed-racket-test/succeed/gh-issue-164.rkt
Normal file
15
typed-racket-test/succeed/gh-issue-164.rkt
Normal file
|
@ -0,0 +1,15 @@
|
|||
#lang typed/racket/base
|
||||
|
||||
;; Test for GH issue 164
|
||||
|
||||
(: x (U (Pairof (U) Any)
|
||||
(Pairof 'a Number)))
|
||||
(define x (cons 'a 1))
|
||||
|
||||
(if (eq? (car x) 'a)
|
||||
(+ (cdr x) 1)
|
||||
0)
|
||||
|
||||
(if (eq? 'a (car x))
|
||||
(+ (cdr x) 1)
|
||||
0)
|
Loading…
Reference in New Issue
Block a user