Fix typo in vector contract implementation leading to wrong error message

This commit is contained in:
Daniel Feltey 2017-05-15 17:03:52 -05:00 committed by Robby Findler
parent f2a29515d1
commit 8bc9cef7a9
2 changed files with 8 additions and 3 deletions

View File

@ -167,5 +167,10 @@
(test/pos-blame
'vectorof-eager-fail
'(contract (vectorof integer? #:eager 5) (vector-immutable 0 "") 'pos 'neg))
(test/pos-blame
'vectorof/mutable-flat
'(contract (vectorof integer? #:immutable #f #:flat? #t) (vector-immutable 3) 'pos 'neg))
(test/pos-blame
'vectorof/mutable-higher-order
'(contract (vectorof (-> integer? integer?) #:immutable #f) (vector-immutable add1) 'pos 'neg))
)

View File

@ -63,7 +63,7 @@
(fail val '(expected "an immutable vector" given: "~e") val))]
[(eq? immutable #f)
(when (immutable? val)
(fail val '(expected "an mutable vector" given: "~e" val)))]
(fail val '(expected "an mutable vector" given: "~e") val))]
[else (void)])
(when first-order?
(let loop ([n 0])
@ -93,7 +93,7 @@
(cond
[(immutable? val)
(raise-blame-error blame #:missing-party neg-party
val '(expected "an mutable vector" given: "~e" val))]
val '(expected "an mutable vector" given: "~e") val)]
[else #f])]
[else #f])]
[else