Fix wrapping of null' when provided as Any'.

Reported by 'dingfeng' on #racket.
Please merge to 5.2.

original commit: da5b68fd4d944cef981062de5ed6d283a351fd1d
This commit is contained in:
Sam Tobin-Hochstadt 2011-10-21 10:54:56 -04:00
parent 983f943bc4
commit 82e7f9249b
2 changed files with 14 additions and 0 deletions

View File

@ -0,0 +1,11 @@
#lang racket/load
(module m typed/racket
(provide f)
(define: f : Any '(a (2 3))))
(module n racket
(require 'm)
(list? (second f)))
(require 'n)

View File

@ -7,12 +7,15 @@
(lambda (v p write?)
(fprintf p "#<Typed Value: ~a>" (any-wrap-val v))))
(define undef (letrec ([x x]) x))
(define (traverse wrap?)
(define (t v)
(match v
[(? (lambda (e) (and (any-wrap? e) (not wrap?)))) (any-wrap-val v)]
[(? (lambda (e)
(or (number? e) (string? e) (char? e) (symbol? e)
(null? e) (regexp? e) (eq? undef e)
(keyword? e) (bytes? e) (boolean? e) (void? e))))
v]
[(cons x y) (cons (t x) (t y))]