[racket] DRRacket Check Syntax Loops Endlessly (Sample Provided)

From: Matthias Felleisen (matthias at ccs.neu.edu)
Date: Thu Nov 1 14:46:19 EDT 2012

Since S0 is a function from T :: Type to some Union and TR doesn't allow this, you want to signal a syntax error here. Correct? 


On Nov 1, 2012, at 12:16 PM, Sam Tobin-Hochstadt wrote:

> On Thu, Nov 1, 2012 at 12:07 PM, Ray Racine <ray.racine at gmail.com> wrote:
>> Fresh build from Racket git MASTER, the following causes DRRacket's Check
>> Syntax to loop without termination.
> 
> Clearly, this isn't the behavior you want, but I don't think a
> contract is possible to generate for this code.
> 
> If you change the type of the S2-x field to `(S0 T)`, then it works.
> That might even have been what you wanted.
> 
>> 
>> #lang typed/racket/base
>> 
>> (provide f)
>> 
>> (struct: (T) S1 ([x : (Listof String)]))
>> 
>> (struct: (T) S2 ([x : S0]
>>                 [g : (T -> Boolean)]))
>> 
>> (define-type (S0 T) (U (S1 T) (S2 T)))
>> 
>> (: f (String -> (S0 String)))
>> (define (f x)
>>  (S1 '()))
>> 
>> ____________________
>>  Racket Users list:
>>  http://lists.racket-lang.org/users
>> 
> 
> 
> 
> --
> sam th
> samth at ccs.neu.edu
> ____________________
>  Racket Users list:
>  http://lists.racket-lang.org/users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4373 bytes
Desc: not available
URL: <http://lists.racket-lang.org/users/archive/attachments/20121101/a0a21982/attachment.p7s>

Posted on the users mailing list.