[plt-dev] Contract not reporting correctly

From: Noel Welsh (noelwelsh at gmail.com)
Date: Wed Jul 1 09:27:18 EDT 2009

> (require scheme/contract)
> (define/contract (foo-x f) (-> (vector-immutableof number?) number?) (vector-ref f 0))
> (foo-x #(1 2 3))
1
> (foo-x '(1 2 3))
. (file "/Users/noel/programming/code/numeric/bonfire/plot.ss") broke
the contract (-> (listof number?) number?) on foo-x; expected <(listof
number?)>, given: (1 2 3)
>

Note the reported contract is listof -- this is incorrect.

N.


Posted on the dev mailing list.