Generalize ListDots to Listof in inference of loop var types.

This commit is contained in:
Sam Tobin-Hochstadt 2010-05-28 12:26:30 -04:00
parent a2af89bafd
commit f7b59f78e9
2 changed files with 2 additions and 4 deletions

View File

@ -1,4 +1,3 @@
;; Change the lang to scheme for untyped version ;; Change the lang to scheme for untyped version
#lang typed-scheme #lang typed-scheme

View File

@ -23,9 +23,7 @@
(apply Un (map tc-result-t args))) (apply Un (map tc-result-t args)))
;; if t is of the form (Pair t* (Pair t* ... (Listof t*))) ;; used to produce a more general type for loop variables
;; return t*
;; otherwise, return t
;; generalize : Type -> Type ;; generalize : Type -> Type
(define (generalize t) (define (generalize t)
(let/ec exit (let/ec exit
@ -45,6 +43,7 @@
t-new) t-new)
t-new t-new
(exit t)))] (exit t)))]
[(ListDots: t bound) (-lst (substitute Univ bound t))]
[_ (exit t)])))) [_ (exit t)]))))