[racket-dev] Fix to module reader?

From: Danny Yoo (dyoo at hashcollision.org)
Date: Fri Mar 29 15:28:15 EDT 2013

I'm running into an internal error with the syntax/module-reader
library with the given test program, and wanted to double check with
someone else before committing the fix upstream.

The test file is:


When I run this under an unpatched module reader, I see the following error:

128-110-73-138:Desktop dyoo$ raco test prepend-lang-line.rkt
testing prepend-lang-line.rkt
-: contract violation
  expected: number?
  given: #f
  argument position: 2nd
  other arguments...:
v5.3.2/collects/syntax/module-reader.rkt:173:2: wrap-internal
   /Users/dyoo/Desktop/prepend-lang-line.rkt: [running body]
   /Applications/Racket v5.3.2/collects/compiler/commands/test.rkt:
[running body]
   /Applications/Racket v5.3.2/collects/raco/raco.rkt: [running body]
   /Applications/Racket v5.3.2/collects/raco/main.rkt: [running body]

My proposed patch is:


Does this look ok?  Also, if I do push this upstream, how do I attach
my test file so it gets run as part of the DrDr regression suite?

Posted on the dev mailing list.