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:
parent
983f943bc4
commit
82e7f9249b
11
collects/tests/typed-racket/succeed/any-wrap-list.rkt
Normal file
11
collects/tests/typed-racket/succeed/any-wrap-list.rkt
Normal 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)
|
|
@ -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))]
|
||||
|
|
Loading…
Reference in New Issue
Block a user