Guest User

Proxy bug

a guest
May 9th, 2012
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (let [n 3
  2.       b (byte-array n)
  3.       p (proxy [java.io.InputStream] []
  4.           (read [] -1))]
  5.   ;; Returns -1, which is expected.
  6.   (.read p)
  7.   ;; Throws clojure.lang.AFn.throwArity, unexpected; should call
  8.   ;; InputStream.read(byte[], int, int)
  9.   (.read p b 0 n))
Advertisement
Add Comment
Please, Sign In to add comment