Re: [racket-users] Type error using in-list on empty list

2015-05-19 Thread Sam Tobin-Hochstadt
What's happening here is that when typechecking a `let loop`, Typed
Racket will try to guess the loop argument types from the initial
values. Here, it converts `Null` into `(Listof Any)`, and then that
choice runs into trouble later.

The simplest fix here is to pass something with the type `(Listof
Void)`, such as `(ann '() (Listof Void))`. The real fix is more type
inference in Typed Racket.

Sam

On Tue, May 19, 2015 at 4:52 PM, Benjamin Greenman bl...@cornell.edu wrote:
 This program raises a type error about unsafe-car

 (for ([x : Void (in-list '())]) x)

 So far, I've found ways to remove the error
 1. Remove the annotation on x
 2. Remove the in-list hint
 3. Use a non-empty list

 Is this a bug?

 --
 You received this message because you are subscribed to the Google Groups
 Racket Users group.
 To unsubscribe from this group and stop receiving emails from it, send an
 email to racket-users+unsubscr...@googlegroups.com.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Type error using in-list on empty list

2015-05-19 Thread Benjamin Greenman
This program raises a type error about unsafe-car

(for ([x : Void (in-list '())]) x)

So far, I've found ways to remove the error
1. Remove the annotation on x
2. Remove the in-list hint
3. Use a non-empty list

Is this a bug?

-- 
You received this message because you are subscribed to the Google Groups 
Racket Users group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.