Report the correct position for a blamed procedure.
... if the `lambda' of that procedure was the result of expanding a `define': Attach the `define''s source location to the `lambda' expression.
This commit is contained in:
parent
8d39c15b17
commit
f899fdf15d
|
@ -541,13 +541,17 @@
|
|||
(lambda (fn)
|
||||
(with-syntax ([fn fn]
|
||||
[args (cdr (syntax-e #'name-seq))])
|
||||
(quasisyntax/loc stx (define fn #,(stepper-syntax-property
|
||||
(stepper-syntax-property
|
||||
#`(lambda args expr ...)
|
||||
'stepper-define-type
|
||||
'shortened-proc-define)
|
||||
'stepper-proc-define-name
|
||||
#`fn))))))])
|
||||
(quasisyntax/loc stx
|
||||
(define fn
|
||||
#,(stepper-syntax-property
|
||||
(stepper-syntax-property
|
||||
;; this is so contract blame can report a
|
||||
;; position for the procedure
|
||||
(syntax/loc stx (lambda args expr ...))
|
||||
'stepper-define-type
|
||||
'shortened-proc-define)
|
||||
'stepper-proc-define-name
|
||||
#`fn))))))])
|
||||
(check-definition-new
|
||||
'define
|
||||
stx
|
||||
|
|
Loading…
Reference in New Issue
Block a user