[racket] typed racket: how to define a binding as both a runtime var and a type?
Indeed, this was a bug introduced by the levels of indirection I added to
put contracts into submodules. I'll push a fix when the tests finish.
Thanks for finding this.
Sam
On Sun, Feb 22, 2015 at 3:12 PM Sam Tobin-Hochstadt <samth at cs.indiana.edu>
wrote:
> This looks like a bug to me.
>
> Sam
>
> On Sun, Feb 22, 2015, 2:49 PM Alexander D. Knauth <alexander at knauth.org>
> wrote:
>
>> Using #:omit-define-syntaxes doesn’t work because then when other modules
>> import it it forgets about the type:
>>
>> def.rkt:
>> #lang typed/racket
>> (provide x)
>> (define-type x 'x #:omit-define-syntaxes)
>> (define x : x 'x)
>>
>> ref.rkt:
>> #lang typed/racket
>> (require "def.rkt")
>> x ; works fine, outputs 'x
>> (define y : x x) ; Type Checker: parse error in type; type name `x' is
>> unbound in: x
>>
>> Why doesn’t this work, and is there another way to do this?
>>
>>
>>
>> ____________________
>> Racket Users list:
>> http://lists.racket-lang.org/users
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20150306/761fffbe/attachment.html>