[racket] weird typed racket error

From: Sam Tobin-Hochstadt (samth at cs.indiana.edu)
Date: Sun Jul 13 20:23:37 EDT 2014

Probably, what's going on here is that `for/last` has a hidden loop
variable that starts off as `#f` and Typed Racket infers that to have
type `False`.

If that's the case, there's nothing you can really do other than
rewrite this as `for/fold`.

Sam

On Sun, Jul 13, 2014 at 7:57 PM, Alexander D. Knauth
<alexander at knauth.org> wrote:
> For some reason this:
> (for/last : (U Index #f)
>     ([i : Index (ann (in-range 5) (Sequenceof Index))])
>     i)
> Is giving me this error:
> . Type Checker: type mismatch
>   expected: False
>   given: Index in: (for/last : (U Index #f) ((i : Index (ann (in-range 5) (Sequenceof Index)))) i)
>
> Why is it expecting False?
> And is there some type annotation I can put somewhere to fix it or anything?
>
>
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users

Posted on the users mailing list.