From e4e84ecf7004fa481d3d2cfa8caab56a77eb0522 Mon Sep 17 00:00:00 2001 From: Vincent St-Amour Date: Tue, 5 Feb 2013 11:04:36 -0500 Subject: [PATCH] Use locations from typed identifiers for type-generated contracts. original commit: ff3d785da2d87bdf3ef1d91d89400dd5b5a9722f --- .../typecheck/provide-handling.rkt | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/collects/typed-racket/typecheck/provide-handling.rkt b/collects/typed-racket/typecheck/provide-handling.rkt index bf47120e..e583ef32 100644 --- a/collects/typed-racket/typecheck/provide-handling.rkt +++ b/collects/typed-racket/typecheck/provide-handling.rkt @@ -1,16 +1,16 @@ #lang racket/base (require "../utils/utils.rkt" - (only-in srfi/1/list s:member) + (only-in srfi/1/list s:member) syntax/kerncase syntax/boundmap - (env type-name-env type-alias-env) + (env type-name-env type-alias-env) (only-in (private type-contract) type->contract) "renamer.rkt" (rep type-rep) - (utils tc-utils) + (utils tc-utils) (for-syntax syntax/parse racket/base) racket/contract/private/provide unstable/list - syntax/id-table racket/dict + syntax/id-table syntax/location racket/dict racket/syntax racket/struct-info racket/match "def-binding.rkt" syntax/parse (for-template racket/base "def-export.rkt" racket/contract)) @@ -96,7 +96,15 @@ (define-syntax cnt-id (make-provide/contract-transformer (quote-syntax the-contract) - (quote-syntax id) + (datum->syntax ; preserve source location in expanded code + (quote-syntax id) + (syntax->datum (quote-syntax id)) + (list (quote-source-file id) + (quote-line-number id) + (quote-column-number id) + (quote-character-position id) + (quote-character-span id)) + (quote-syntax id)) (quote-syntax export-id) (quote-syntax module-source))) (def-export export-id id cnt-id)))