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

From: Sam Tobin-Hochstadt (samth at ccs.neu.edu)
Date: Tue Nov 23 13:18:56 EST 2010

On Tue, Nov 23, 2010 at 1:04 PM, John Clements
<clements at brinckerhoff.org> wrote:
> 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:

So, here's the same behavior without TR:

#lang racket
(require rackunit)
((values check-equal?) (odd? 322) #true)

What's happening here is that the typed wrapper in `typed/rackunit' is
treating `check-equal?' as a function, but it's really an identifier
macro that inserts source locations when used in application position.
 This makes it easy to write a typed wrapper, but it has the drawbacks
you see. Probably the solution is to write a better wrapper in
`typed/rackunit', but that might be hard without integrating with the
internals of Rackunit.
sam th
samth at ccs.neu.edu

Posted on the dev mailing list.