adjusted the blame objects so that equality tests (and equal hashing) work better

This commit is contained in:
Robby Findler 2018-04-09 11:21:15 -05:00
parent 853f14b9a5
commit 1e93424f67
2 changed files with 10 additions and 1 deletions

View File

@ -320,4 +320,13 @@
'(has-complete-blame? (contract (vectorof integer?) (vector 1 2 3) 'pos 'neg))
#t)
(test/spec-passed/result
'blame-equality
'(let ([b
(make-blame (srcloc "src.rkt" #f #f #f #f)
'whatever (λ () 'the-name) 'pos 'neg #t)])
(equal? (blame-add-context b "thing" #:important 'yes!)
(blame-add-context b "thing" #:important 'yes!)))
#t)
)

View File

@ -103,7 +103,7 @@
[context new-context]
[top-known? #t]))
(struct important (name sense-swapped?))
(struct important (name sense-swapped?) #:transparent)
(define (blame-add-unknown-context b)
(define old (blame-context b))