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)
Activity
Stuart Sierra
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Fix Version/s | Backlog [ 10035 ] | |
| Affects Version/s | Backlog [ 10035 ] | |
| Affects Version/s | Release.Next [ 10038 ] | |
| Approval | Vetted |
Rich Hickey
made changes -
| Fix Version/s | Backlog [ 10035 ] | |
| Fix Version/s | Release 1.6 [ 10157 ] |
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.