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.
This commit is contained in:
Eric Dobson 2014-05-29 20:47:18 -07:00
parent 911b3ee8ee
commit 8d7f12a793
2 changed files with 15 additions and 20 deletions

View File

@ -423,7 +423,6 @@
(match expected (match expected
[(tc-result1: (or (Poly: _ _) (PolyDots: _ _) (PolyRow: _ _ _))) [(tc-result1: (or (Poly: _ _) (PolyDots: _ _) (PolyRow: _ _ _)))
(tc/plambda form (remove-poly-layer tvarss-list) formals bodies expected)] (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)) (define remaining-layers (remove-poly-layer tvarss-list))
(if (null? remaining-layers) (if (null? remaining-layers)

View File

@ -220,11 +220,10 @@
;; Convert a Values to a corresponding tc-results ;; Convert a Values to a corresponding tc-results
(define/cond-contract (values->tc-results tc formals) (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 (match tc
[(AnyValues: f) (tc-any-results f)] [(AnyValues: f) (tc-any-results f)]
[(ValuesDots: (list (and rs (Result: ts fs os)) ...) dty dbound) [(ValuesDots: (list (and rs (Result: ts fs os)) ...) dty dbound)
(if formals
(let-values ([(ts fs os) (let-values ([(ts fs os)
(for/lists (ts fs os) ([r (in-list rs)]) (for/lists (ts fs os) ([r (in-list rs)])
(open-Result r (map (lambda (i) (make-Path null i)) (open-Result r (map (lambda (i) (make-Path null i))
@ -233,14 +232,11 @@
(for/fold ([dty dty]) ([(o idx) (in-indexed (in-list formals))]) (for/fold ([dty dty]) ([(o idx) (in-indexed (in-list formals))])
(define key (list 0 idx)) (define key (list 0 idx))
(subst-type dty key (make-Path null o) #t)) (subst-type dty key (make-Path null o) #t))
dbound)) dbound))]
(ret ts fs os dty dbound))]
[(Values: (list (and rs (Result: ts fs os)) ...)) [(Values: (list (and rs (Result: ts fs os)) ...))
(if formals
(let-values ([(ts fs os) (let-values ([(ts fs os)
(for/lists (ts fs os) ([r (in-list rs)]) (for/lists (ts fs os) ([r (in-list rs)])
(open-Result r (map (lambda (i) (make-Path null i)) (open-Result r (map (lambda (i) (make-Path null i))
formals)))]) formals)))])
(ret ts fs os))
(ret ts fs os))])) (ret ts fs os))]))