[racket-dev] TR -> no source locations?

From: John Clements (clements at brinckerhoff.org)
Date: Tue Nov 23 13:04:58 EST 2010

On Nov 20, 2010, at 8:19 PM, Sam Tobin-Hochstadt wrote:

> There are a lot of things you could mean by "Typed Racket doesn't
> preserve source locations".  Some of them TR definitely preserves
> source locations, and some are hard cases where TR tries but doesn't
> always succeed.  So I am also interested in an example.

Here's an example:

#lang typed/racket

(require typed/rackunit)

(: f (Integer -> Boolean))
(define (f x) (odd? x))

(check-equal? (f 23421) #true)
(check-equal? (f 33242) #false)
(check-equal? (f 322) #true)

Running this produces this output for me:

name:       check-equal?
location:   (unknown #f #f #f #f)
expression: unknown
params:     (#f #t)
actual:     #f
expected:   #t


So... which test case failed? No idea. Well, actually, in this case, I have *some* idea :). When it isn't a deliberately introduced bug, though, it's binary-search time to isolate which test case failed.

I'm "rack"ing my brain to see whether this could be rackunit's fault, but I don't see how it could be.... Oh, unless the problem is that the "check-equal?" macro in typed/rackunit just needs some work...


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

Posted on the dev mailing list.