Details
-
Type:
Defect
-
Status:
Open
-
Priority:
Minor
-
Resolution: Unresolved
-
Affects Version/s: Backlog
-
Fix Version/s: Release 1.6
-
Component/s: None
-
Labels:None
-
Approval:Vetted
Description
Subvectors created with subvec from a PersistentVector cannot be made transient:
user=> (transient (subvec [1 2 3 4] 2)) ClassCastException clojure.lang.APersistentVector$SubVector cannot be cast to clojure.lang.IEditableCollection clojure.core/transient (core.clj:2864)
Confirmed. APersistentVector$SubVector does not implement IEditableCollection.
The current implementation of TransientVector depends on implementation details of PersistentVector, so it is not a trivial fix. The simplest fix might be to implement IEditableCollection.asTransient in SubVector by creating a new PersistentVector, but I do not know the performance implications.