~ chicken-core (chicken-5) 0c2c01dd73218ef7463152cb9911ad27fd8b42b3


commit 0c2c01dd73218ef7463152cb9911ad27fd8b42b3
Author:     Peter Bex <peter.bex@xs4all.nl>
AuthorDate: Sun May 6 21:22:43 2012 +0200
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Fri May 11 13:32:51 2012 +0200

    Ensure error messages carry their line numbers correctly inside modules by preventing all syntax from being stripped off of modules

diff --git a/compiler.scm b/compiler.scm
index 495abf5a..c0f9e285 100644
--- a/compiler.scm
+++ b/compiler.scm
@@ -810,8 +810,7 @@
 			   (walk `(##core#begin ,@(cddr x)) e se dest ldest h ln))))
 
 		       ((##core#module)
-			(let* ((x (##sys#strip-syntax x))
-			       (name (cadr x))
+			(let* ((name (cadr x))
 			       (exports 
 				(or (eq? #t (caddr x))
 				    (map (lambda (exp)
diff --git a/tests/scrutiny-tests.scm b/tests/scrutiny-tests.scm
index 717ad7fd..5f0f56a1 100644
--- a/tests/scrutiny-tests.scm
+++ b/tests/scrutiny-tests.scm
@@ -128,3 +128,9 @@
 	 (pair? del))
      (<handle-ins-and-del>))
  (<do-some-more>))
+
+;; Checking whether reported line numbers inside modules are correct
+(module foo (blabla)
+  (import chicken scheme)
+  (define (blabla)
+    (+ 1 'x)))
diff --git a/tests/scrutiny.expected b/tests/scrutiny.expected
index f4200af6..609757c5 100644
--- a/tests/scrutiny.expected
+++ b/tests/scrutiny.expected
@@ -37,7 +37,7 @@ Warning: at toplevel:
   (scrutiny-tests.scm:28) in procedure call to `+', expected argument #2 of type `number', but was given an argument of type `symbol'
 
 Warning: at toplevel:
-  assignment of value of type `fixnum' to toplevel variable `car' does not match declared type `(forall (a124) (procedure car ((pair a124 *)) a124))'
+  assignment of value of type `fixnum' to toplevel variable `car' does not match declared type `(forall (a132) (procedure car ((pair a132 *)) a132))'
 
 Warning: at toplevel:
   expected in `let' binding of `g8' a single result, but were given 2 results
@@ -93,4 +93,7 @@ Warning: in toplevel procedure `foo10':
 Warning: in toplevel procedure `foo10':
   (scrutiny-tests.scm:111) in procedure call to `*', expected argument #1 of type `number', but was given an argument of type `string'
 
-Warning: redefinition of standard binding: car
+Warning: in toplevel procedure `foo#blabla':
+  (scrutiny-tests.scm:136) in procedure call to `+', expected argument #2 of type `number', but was given an argument of type `symbol'
+
+Warning: redefinition of standard binding: car
\ No newline at end of file
Trap