Just tried the following program:
#lang typed-scheme (require/typed srfi/1 (fold (All (a b) ((a b -> b) b (Listof a) -> b)))) And got an error because (orig-module-stx) was #f. I'm not sure whether it should have been or not, but I've fixed up this to handle that case (having it just use the normal error message when that's #f, as I'm not sure whether the error message would be correct otherwise). However, it might just be that (orig-module-stx) should have not been #f, in which case this should be checked out.
This commit is contained in:
parent
2456dcc18b
commit
b991505297
|
@ -85,9 +85,12 @@
|
|||
(let ([stx (locate-stx (current-orig-stx))])
|
||||
;; If this isn't original syntax, then we can get some pretty bogus error messages. Note
|
||||
;; that this is from a macro expansion, so that introduced vars and such don't confuse the user.
|
||||
(if (eq? (syntax-source (current-orig-stx)) (syntax-source (orig-module-stx)))
|
||||
(raise-typecheck-error (apply format msg rest) (list stx))
|
||||
(raise-typecheck-error (apply format (string-append "Error in macro expansion -- " msg) rest) (list stx)))))
|
||||
(cond
|
||||
[(not (orig-module-stx))
|
||||
(raise-typecheck-error (apply format msg rest) (list stx))]
|
||||
[(eq? (syntax-source (current-orig-stx)) (syntax-source (orig-module-stx)))
|
||||
(raise-typecheck-error (apply format msg rest) (list stx))]
|
||||
[else (raise-typecheck-error (apply format (string-append "Error in macro expansion -- " msg) rest) (list stx))])))
|
||||
|
||||
;; produce a type error, given a particular syntax
|
||||
(define (tc-error/stx stx msg . rest)
|
||||
|
|
Loading…
Reference in New Issue
Block a user