typed-racket
typed-racket copied to clipboard
Namespace mismatch; cannot locate module instance
What version of Racket are you using?
Racket 8.0 [CS]
What program did you run?
I tried loading the following program into Dr. Racket and Racket-Mode:
#lang typed/racket
(module inner typed/racket
(provide change-id)
(: change-id (-> Identifier Identifier))
(define (change-id i)
(datum->syntax i 'changed)))
(require (for-syntax 'inner))
(define-syntax (define-special stx)
(syntax-case stx ()
((_ i s) #`(define #,(change-id #'i) s))))
(define-special i 3)
What should have happened?
This should have loaded normally.
If you got an error message, please include it here.
../../usr/racket/share/pkgs/errortrace-lib/errortrace/stacktrace.rkt:690:2: expand: namespace mismatch; cannot locate module instance
module: #<module-path-index:(submod "." inner #%contract-defs-reference ".." #%contract-defs) + 'anonymous-module[238351]>
use phase: 1
definition phase: 0
for identifier: #<syntax idB4>
Adding the expression (begin-for-syntax change-id) before (require (for-syntax 'inner)) causes the error to go away.