Generalize ListDots to Listof in inference of loop var types.
This commit is contained in:
parent
a2af89bafd
commit
f7b59f78e9
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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)]))))
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user