(module tc-utils mzscheme
(provide (all-defined))
(require (planet "environment.ss" ("cobbe" "environment.plt" 3 0)))
(define current-orig-stx (make-parameter #'here))
(define (find-origin stx)
(cond [(syntax-property stx 'origin) => (lambda (orig)
(if (pair? orig) (car orig) orig))]
[else 'fnord]))
(define (tc-error msg . rest)
(raise-syntax-error 'typecheck (apply format msg rest) (find-origin (current-orig-stx)) (current-orig-stx)))
(define (tc-error/stx stx msg . rest)
(parameterize ([current-orig-stx stx])
(apply tc-error msg rest)))
(define (symbolic-identifier=? a b)
(eq? (syntax-e a) (syntax-e b)))
(define current-type-names (make-parameter (lambda () '())))
)