Add `warn-unreachable'
svn: r12145 original commit: 5db61f199fff5b2a8c0d8595de984184336a5bac
This commit is contained in:
parent
c988220e11
commit
f24c93b475
|
@ -30,6 +30,18 @@
|
|||
|
||||
(define check-unreachable-code? (make-parameter #f))
|
||||
|
||||
(define warn-unreachable? (make-parameter #t))
|
||||
|
||||
(define (warn-unreachable e)
|
||||
(let ([l (current-logger)])
|
||||
(when (and (warn-unreachable?)
|
||||
(log-level? l 'warning)
|
||||
(printf "~a~n~a~n" (syntax-source-module e) (syntax-source-module (orig-module-stx)))
|
||||
(eq? (syntax-source-module e) (syntax-source-module (orig-module-stx)))
|
||||
#;(syntax-source-module e))
|
||||
(log-message l 'warning (format "Typed Scheme has detected unreachable code: ~e" (syntax->datum (locate-stx e)))
|
||||
e))))
|
||||
|
||||
(define (locate-stx stx)
|
||||
(define omodule (orig-module-stx))
|
||||
(define emodule (expanded-module-stx))
|
||||
|
|
Loading…
Reference in New Issue
Block a user