racket/contract: Fix (box/c #:immutable #f) failing on mutable boxes

This commit is contained in:
Lukas Lazarek 2019-05-05 17:45:03 -05:00 committed by Alexis King
parent bfe649bcc7
commit 001eeded9f
2 changed files with 14 additions and 2 deletions

View File

@ -173,4 +173,16 @@
(box (list values))
'pos
'neg)])
((car (unbox f)) 3))))
((car (unbox f)) 3)))
(test/no-error
'(contract (box/c any/c #:immutable #f) (box 1) 'pos 'neg))
(test/spec-passed/result
'box/c-immutable-f2
'(unbox (contract (box/c any/c #:immutable #f) (box 1) 'pos 'neg))
1)
(test/pos-blame
'box/c-immutable-t
'(contract (box/c any/c #:immutable #f) (box-immutable 1) 'pos 'neg)))

View File

@ -39,7 +39,7 @@
val '(expected "an immutable box" given: "~e") val))])]
[(#f)
(cond
[(immutable? val) #F]
[(not (immutable? val)) #f]
[else
(λ (neg-party)
(raise-blame-error blame #:missing-party neg-party