If you have a class/record that implements a functional interface AND IFn
, serializing it will throw the same error as CLJ-2880. Here's a repro
(let [^java.util.function.Function my-f
(reify
Serializable
java.util.function.Function
clojure.lang.IFn
)]
(with-open [os (java.io.ObjectOutputStream. (java.io.ByteArrayOutputStream.))]
(.writeObject os my-f)))
Will throw java.io.NotSerializableException
. If you comment out clojure.lang.IFn
, this code works.
This is a regression from 1.11.