[racket] Typed Racket Confusing Error Message / Type Check Error
The following gives an error of "Expected Nothing, but got D in elem."
Type checking error?
#lang typed/racket/base
(struct: (D C) Collection ([append : (D -> Void)]
[build : (-> C)]))
(: List-Builder (All (D) -> (Collection D (Listof D))))
(define (List-Builder)
(: lst (Listof D))
(define lst '())
(Collection (λ: ((datum : D))
(set! lst (cons datum lst)))
(λ () lst)))
(: build-Collection (All (D C) (Collection D C)-> C))
(define (build-Collection collection)
((Collection-build collection)))
(: append-Collection (All (D C) (Collection D C) D -> Void))
(define (append-Collection coll elem)
((Collection-append coll) elem))
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120801/de35c263/attachment.html>