Make resolve actually do all the necessary resolutions.

original commit: 84d3051feeaca7451c8bfc7f8e0f7abad7475830
This commit is contained in:
Eric Dobson 2013-05-25 14:24:07 -07:00
parent 0e3f79d89e
commit 8b324b1fb5
2 changed files with 14 additions and 1 deletions

View File

@ -0,0 +1,6 @@
#lang typed/racket/base
(struct: (v) a ((x : v)) #:mutable)
(: z (Struct (Rec b (a (U #f b)))))
(define z (a #f))

View File

@ -86,7 +86,14 @@
(hash-set! resolver-cache seq r*))
r*)))
;; Repeatedly unfolds Mu, App, and Name constructors until the top type
;; constructor is not one of them.
;; Type/c? -> Type/c?
(define (resolve t)
(if (needs-resolving? t) (resolve-once t) t))
(let loop ((t t))
(if (needs-resolving? t)
(loop (resolve-once t))
t)))
;(trace resolve-app)