From ace04bc75cd595deb3df72ac120f2847b7dbfde7 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Thu, 27 Mar 2014 00:18:25 -0700 Subject: [PATCH] Fix misuse of expected in tc-funapp. original commit: eaafd418d977dd77507b56b6cd8e9f0db4fcc5b6 --- .../typed-racket/typecheck/tc-funapp.rkt | 2 +- .../tests/typed-racket/unit-tests/typecheck-tests.rkt | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt index 4b697099..aee3f1bf 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-funapp.rkt @@ -53,7 +53,7 @@ ;; if nothing matched, error (domain-mismatches f-stx args-stx t doms rests drests rngs argtys #f #f - #:expected expected #:return (if (tc-results? expected) expected (ret (Un))) + #:expected expected #:return (ret (Un)) #:msg-thunk (lambda (dom) (string-append "No function domains matched in function application:\n" diff --git a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt index aaaa816a..22a9a212 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-test/tests/typed-racket/unit-tests/typecheck-tests.rkt @@ -2679,6 +2679,15 @@ 4) -PosByte] + [tc-err + (let () + (: z (case-> (Symbol -> Symbol) + (Number -> Number))) + (define z (lambda (a) a)) + (z "y")) + #:ret (ret -String) + #:expected (ret -String -no-filter -no-obj)] + ) (test-suite "tc-literal tests"