[racket] Typed Racket bug

From: Jon Zeppieri (zeppieri at gmail.com)
Date: Thu Aug 12 16:56:43 EDT 2010

I've found a bug in Typed Racket's handling of (List t0 ...) types -- at
least, when they appear on the right hand side of the -> type constructor
and involve ellipsis patterns with type variables. Here is a simple example
demonstrating the problem:

Definitions window:

#lang typed/racket

(: listify (All (a ...) (a ... a -> (List a ... a))))
(define (listify . xs) xs)

Interactions window:

Welcome to DrRacket, version 5.0.1 [3m].
Language: typed/racket; memory limit: 128 MB.
> listify
- : (All (a ...) (a ... a -> (List a ... a)))
> (listify 1 "hello" #\c)
- : (List Char String Positive-Fixnum)
'(1 "hello" #\c)

As you can see, the result of (listify 1 "hello" #\c) is correct, but the
result's type is incorrect; the types of the list members are reversed.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20100812/dc602ef4/attachment.html>

Posted on the users mailing list.