You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The blame-source field is supposed to describe where the contract is from, not where it’s used, even if the attachment of the contract is deferred. To illustrate, see the following behavior with contract-out:
f: contract violation
expected: integer?
given: 'not-an-integer
in: the 1st argument of
(-> integer? integer?)
contract from: (anonymous-module a)
blaming: (anonymous-module b)
(assuming the contract is correct)
at: unsaved-editor:5.13
The equivalent example using expr/c puts the source at the use site, instead:
#lang racket
(module a racket
(require syntax/parse/define)
(provide f)
(define-simple-macro (f e)
#:declare e (expr/c #'integer?)
(add1 e.c)))
(module b racket
(require (submod".." a))
(f 'not-an-integer))
(require'b)
f: contract violation
expected: integer?
given: 'not-an-integer
in: macro argument contract
contract from: (submod anonymous-module a)
blaming: (submod (quote anonymous-module) b)
(assuming the contract is correct)
at: unsaved editor:12.5
The source location reported by wrap-expr/c is actually very useful, since normally that information isn’t reported anywhere, but it isn’t what blame-source is supposed to report.
The text was updated successfully, but these errors were encountered:
The
blame-source
field is supposed to describe where the contract is from, not where it’s used, even if the attachment of the contract is deferred. To illustrate, see the following behavior withcontract-out
:The equivalent example using
expr/c
puts the source at the use site, instead:The source location reported by
wrap-expr/c
is actually very useful, since normally that information isn’t reported anywhere, but it isn’t whatblame-source
is supposed to report.The text was updated successfully, but these errors were encountered: