From cbbd889621d1376ac5bd17080daa6884b88afffb Mon Sep 17 00:00:00 2001 From: Sam Tobin-Hochstadt Date: Sun, 3 Jun 2012 10:25:25 -0400 Subject: [PATCH] `=` can equate values with different types. Closes PR 12804. --- collects/tests/typed-racket/unit-tests/typecheck-tests.rkt | 4 ++++ collects/typed-racket/typecheck/tc-app.rkt | 3 +-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/collects/tests/typed-racket/unit-tests/typecheck-tests.rkt b/collects/tests/typed-racket/unit-tests/typecheck-tests.rkt index 2a7b5340a1..b66da920f8 100644 --- a/collects/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/collects/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -1406,6 +1406,10 @@ [tc-e/t (ann #() (Vectorof Integer)) (-vec -Integer)] + [tc-e (let: ([x : Float 0.0]) + (= 0 x)) + #:ret (ret -Boolean (-FS -top -top) (make-NoObject))] + [tc-e/t (ann (lambda: ([x : Boolean]) (if x x #t)) (Boolean -> #t)) (t:-> -Boolean (-val #t))] ) (test-suite diff --git a/collects/typed-racket/typecheck/tc-app.rkt b/collects/typed-racket/typecheck/tc-app.rkt index 12d2126728..30b146dc9b 100644 --- a/collects/typed-racket/typecheck/tc-app.rkt +++ b/collects/typed-racket/typecheck/tc-app.rkt @@ -51,8 +51,7 @@ (define (ok? val) (define-syntax-rule (alt nm pred ...) (and (free-identifier=? #'nm comparator) (or (pred val) ...))) (or (alt symbol=? symbol?) - (alt string=? string?) - (alt = number?) + (alt string=? string?) (alt eq? eq?-able) (alt eqv? eqv?-able) (alt equal? equal?-able)))