[racket] typing a function

From: Pierpaolo Bernardi (olopierpa at gmail.com)
Date: Thu Nov 22 09:41:27 EST 2012

OK, I think I'm not smart enough for TR.  One last question.

What's wrong in the following?
========
#lang typed/racket

(define-type Array2 (Vectorof (Vectorof Number)))

(: make-array (Positive-Index Positive-Index -> Array2))

(define (make-array xdim ydim)
  (for/vector: : Array2 ((i : Positive-Index (in-range xdim)))
    (make-vector ydim 0)))
========

Welcome to DrRacket, version 5.3 [3m].
Language: typed/racket [custom]; memory limit: 128 MB.
. Type Checker: Error in macro expansion -- insufficient type
information to typecheck. please add more type annotations in:
(for/vector: : Array2 ((i : Positive-Index (in-range xdim)))
(make-vector ydim 0))


Thanks.
P.

Posted on the users mailing list.