racket/contract: Fix (box/c #:immutable #f) failing on mutable boxes
This commit is contained in:
parent
bfe649bcc7
commit
001eeded9f
|
@ -173,4 +173,16 @@
|
||||||
(box (list values))
|
(box (list values))
|
||||||
'pos
|
'pos
|
||||||
'neg)])
|
'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)))
|
||||||
|
|
|
@ -39,7 +39,7 @@
|
||||||
val '(expected "an immutable box" given: "~e") val))])]
|
val '(expected "an immutable box" given: "~e") val))])]
|
||||||
[(#f)
|
[(#f)
|
||||||
(cond
|
(cond
|
||||||
[(immutable? val) #F]
|
[(not (immutable? val)) #f]
|
||||||
[else
|
[else
|
||||||
(λ (neg-party)
|
(λ (neg-party)
|
||||||
(raise-blame-error blame #:missing-party neg-party
|
(raise-blame-error blame #:missing-party neg-party
|
||||||
|
|
Loading…
Reference in New Issue
Block a user