From 21da67fbd9b1c9441547495132aba23dc5c80ae4 Mon Sep 17 00:00:00 2001 From: Stevie Strickland Date: Thu, 12 Aug 2010 17:38:18 -0400 Subject: [PATCH] Fix creation of a reversed List type from ListDots substitution. original commit: a9f6ea69bfbb23d4e6ab1b5ebfcb6bb9e3b3c05a --- collects/tests/typed-scheme/unit-tests/typecheck-tests.rkt | 3 +++ collects/typed-scheme/types/substitute.rkt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/collects/tests/typed-scheme/unit-tests/typecheck-tests.rkt b/collects/tests/typed-scheme/unit-tests/typecheck-tests.rkt index e03ec46d..75f94b57 100644 --- a/collects/tests/typed-scheme/unit-tests/typecheck-tests.rkt +++ b/collects/tests/typed-scheme/unit-tests/typecheck-tests.rkt @@ -640,6 +640,9 @@ (apply (plambda: (b ...) ([x : Number] . [y : Number ... b]) x) 1 w)) (-polydots (a) ((list -String) (N a) . ->... . N))] + [tc-e/t (let ([f (plambda: (a ...) [w : a ... a] w)]) + (f 1 "hello" #\c)) + (-pair -PositiveFixnum (-pair -String (-pair -Char (-val null))))] ;; instantiating non-dotted terms [tc-e/t (inst (plambda: (a) ([x : a]) x) Integer) (make-Function (list (make-arr* (list -Integer) -Integer diff --git a/collects/typed-scheme/types/substitute.rkt b/collects/typed-scheme/types/substitute.rkt index a2957404..f148e8bc 100644 --- a/collects/typed-scheme/types/substitute.rkt +++ b/collects/typed-scheme/types/substitute.rkt @@ -71,7 +71,7 @@ ;; We need to recur first, just to expand out any dotted usages of this. (let ([expanded (sb dty)]) (for/fold ([t (make-Value null)]) - ([img images]) + ([img (reverse images)]) (make-Pair (substitute img name expanded) t))) (make-ListDots (sb dty) dbound))] [#:ValuesDots types dty dbound