From ccf7d79d27359b4be8f17ad24f2722dcbba4e898 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Sun, 9 Mar 2014 11:21:50 -0700 Subject: [PATCH] Fix tc-results->values and filter-tc-results to handle polydots. original commit: 88af96f19a340e4d6ac72a736456a3ec91354bc4 --- .../typed-racket/typecheck/tc-metafunctions.rkt | 3 ++- .../typed-racket-lib/typed-racket/types/filter-ops.rkt | 7 ++++++- .../tests/typed-racket/unit-tests/typecheck-tests.rkt | 3 +++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-metafunctions.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-metafunctions.rkt index 2770a5e5..85857bb6 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-metafunctions.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-metafunctions.rkt @@ -174,7 +174,8 @@ (define (tc-results->values tc) (match tc [(tc-any-results:) ManyUniv] - [(tc-results: ts) (-values ts)])) + [(tc-results: ts) (-values ts)] + [(tc-results: ts _ _ dty dbound) (-values-dots ts dty dbound)])) (define/cond-contract (resolve atoms prop) ((listof Filter/c) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/filter-ops.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/filter-ops.rkt index 206f1872..ed4a9e03 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/filter-ops.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/types/filter-ops.rkt @@ -209,4 +209,9 @@ [(tc-results: ts _ _) (ret ts (for/list ([f (in-list ts)]) -no-filter) - (for/list ([f (in-list ts)]) -no-obj))])) + (for/list ([f (in-list ts)]) -no-obj))] + [(tc-results: ts _ _ dty dbound) + (ret ts + (for/list ([f (in-list ts)]) -no-filter) + (for/list ([f (in-list ts)]) -no-obj) + dty dbound)])) 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 4165926a..26be4d13 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 @@ -2448,6 +2448,9 @@ ;; make sure no-binding cases like the middle expression are checked [tc-err (let () (define r "r") (string-append r 'foo) (define x "x") "y") #:msg "expected: String.*given: 'foo"] + + [tc-err (ann (lambda () (let ([my-values values]) (my-values))) + (All (A ...) (-> (Values Symbol ... A))))] ) (test-suite "tc-literal tests"