From b9b038bfb964d201413458449fd25fb021a5f050 Mon Sep 17 00:00:00 2001 From: Eric Dobson Date: Thu, 29 May 2014 20:47:18 -0700 Subject: [PATCH] Remove bad branch it tc-lambda, and support code in values->tc-results. The branch was bad because Values is not a valid Type/c. original commit: 8d7f12a793bfe0e98484606f730517ec30451d8c --- .../typed-racket/typecheck/tc-lambda-unit.rkt | 1 - .../typed-racket/typecheck/tc-subst.rkt | 34 ++++++++----------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-lambda-unit.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-lambda-unit.rkt index 00ed03c8..ad40c42e 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-lambda-unit.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-lambda-unit.rkt @@ -423,7 +423,6 @@ (match expected [(tc-result1: (or (Poly: _ _) (PolyDots: _ _) (PolyRow: _ _ _))) (tc/plambda form (remove-poly-layer tvarss-list) formals bodies expected)] - [(tc-result1: (and v (Values: _))) (maybe-loop form formals bodies (values->tc-results v #f))] [_ (define remaining-layers (remove-poly-layer tvarss-list)) (if (null? remaining-layers) diff --git a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-subst.rkt b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-subst.rkt index a44af4f1..0338f61d 100644 --- a/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-subst.rkt +++ b/pkgs/typed-racket-pkgs/typed-racket-lib/typed-racket/typecheck/tc-subst.rkt @@ -220,27 +220,23 @@ ;; Convert a Values to a corresponding tc-results (define/cond-contract (values->tc-results tc formals) - (SomeValues/c (or/c #f (listof identifier?)) . -> . tc-results/c) + (SomeValues/c (listof identifier?) . -> . tc-results/c) (match tc [(AnyValues: f) (tc-any-results f)] [(ValuesDots: (list (and rs (Result: ts fs os)) ...) dty dbound) - (if formals - (let-values ([(ts fs os) - (for/lists (ts fs os) ([r (in-list rs)]) - (open-Result r (map (lambda (i) (make-Path null i)) - formals)))]) - (ret ts fs os - (for/fold ([dty dty]) ([(o idx) (in-indexed (in-list formals))]) - (define key (list 0 idx)) - (subst-type dty key (make-Path null o) #t)) - dbound)) - (ret ts fs os dty dbound))] + (let-values ([(ts fs os) + (for/lists (ts fs os) ([r (in-list rs)]) + (open-Result r (map (lambda (i) (make-Path null i)) + formals)))]) + (ret ts fs os + (for/fold ([dty dty]) ([(o idx) (in-indexed (in-list formals))]) + (define key (list 0 idx)) + (subst-type dty key (make-Path null o) #t)) + dbound))] [(Values: (list (and rs (Result: ts fs os)) ...)) - (if formals - (let-values ([(ts fs os) - (for/lists (ts fs os) ([r (in-list rs)]) - (open-Result r (map (lambda (i) (make-Path null i)) - formals)))]) - (ret ts fs os)) - (ret ts fs os))])) + (let-values ([(ts fs os) + (for/lists (ts fs os) ([r (in-list rs)]) + (open-Result r (map (lambda (i) (make-Path null i)) + formals)))]) + (ret ts fs os))]))