Re: [racket-users] type mismatch: given (Listof Error)

2015-05-11 Thread Asumu Takikawa
On 2015-05-11 14:33:51 -0400, Benjamin Greenman wrote:
This program gives a confusing error message. Does anyone know why the
xs in the body doesn't have type (List Foo)? 

It's because the type `Foo` is not defined, so it cannot have a sensible
representation. Erroneous types like this `Foo` are turned into `Error` (unless
the error stops the type-checker).

Error does not propagate (i.e., (Listof Error) != Error) so you can get weird
error messages like this.

;;;

Maybe we should consider just terminating the typechecker when it hits
undefined types (or other malformed types) instead of trying to continue?

I know that the current behavior of Error types causes at least one soundness
bug in the top-level.

Cheers,
Asumu

-- 
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.


Re: [racket-users] type mismatch: given (Listof Error)

2015-05-11 Thread Sam Tobin-Hochstadt
I think we should at least make `(Listof Error)` turn into `Error`.
That would eliminate the error message than Ben reported.

Sam

On Mon, May 11, 2015 at 4:01 PM, Asumu Takikawa as...@ccs.neu.edu wrote:
 On 2015-05-11 14:33:51 -0400, Benjamin Greenman wrote:
This program gives a confusing error message. Does anyone know why the
xs in the body doesn't have type (List Foo)?

 It's because the type `Foo` is not defined, so it cannot have a sensible
 representation. Erroneous types like this `Foo` are turned into `Error` 
 (unless
 the error stops the type-checker).

 Error does not propagate (i.e., (Listof Error) != Error) so you can get weird
 error messages like this.

 ;;;

 Maybe we should consider just terminating the typechecker when it hits
 undefined types (or other malformed types) instead of trying to continue?

 I know that the current behavior of Error types causes at least one soundness
 bug in the top-level.

 Cheers,
 Asumu

 --
 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.


Re: [racket-users] type mismatch: given (Listof Error)

2015-05-11 Thread Hendrik Boom
On Mon, May 11, 2015 at 04:01:15PM -0400, Asumu Takikawa wrote:
 On 2015-05-11 14:33:51 -0400, Benjamin Greenman wrote:
 This program gives a confusing error message. Does anyone know why the
 xs in the body doesn't have type (List Foo)? 
 
 It's because the type `Foo` is not defined, so it cannot have a sensible
 representation. Erroneous types like this `Foo` are turned into `Error` 
 (unless
 the error stops the type-checker).
 
 Error does not propagate (i.e., (Listof Error) != Error) so you can get weird
 error messages like this.
 
 ;;;
 
 Maybe we should consider just terminating the typechecker when it hits
 undefined types (or other malformed types) instead of trying to continue?

No. Don't terminate the type checker -- it can still be useful to find 
*other* errors that do not depend on the malformed type.

I think the answer needs to be a little more subtle.

For example, if Foo is an undefined type, it can still be useful to 
report an error if one tries to multiply a list of Foo by 7.
But once the undefinedness of Foo has been reported, it probably isn't 
useful to flag as an error an attempt multiply a Foo by 7.

-- hendrik

-- 
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.