Closed nhurden closed 3 years ago
@nhurden Can you verify this is still an issue? I believe some later changes that Zach made to let-flow
cleared up this problem. (Maybe https://github.com/clj-commons/manifold/commit/dae833 or https://github.com/clj-commons/manifold/commit/651594)
I tried with both Clojure 1.9.0 and 1.10.3, and I can't recreate the exception unless I specifically refer to a reserved field, which I imagine is extremely rare in real code.
Looks like it works now 👍 , though I needed to add an explicit manifold
dependency since the latest version of aleph
still has 0.1.9-alpha3
and this issue is fixed in 0.1.9-alpha4
.
@nhurden Yes, we've fixed a few bugs, but haven't quite cut a new release yet.
Using
let-flow
insidedefrecord
causes ajava.lang.UnsupportedOperationException
:Can't type hint a primitive local
(See also https://github.com/clojure/clojure/blob/b19b781b1f0f3f46aee5e951f415e0456a39cbcb/src/jvm/clojure/lang/Compiler.java#L6015)e.g.
It appears that this has only been an issue since the introduction of
__hash
and__hasheq
to records in Clojure 1.9, since these have a type hint of^int
: https://github.com/clojure/clojure/commit/a1c3dafec01ab02fb10d91f98b9ffd3241e860c0#diff-03234b041c0917ec98f2ad9477a0a014It looks like this happens because
expand-let-flow
's call to(riddley.compiler/locals)
returns the reserved symbols defined bydefrecord
:__hash __meta __hasheq __extmap
.A possible fix might be just to filter out those reserved symbols: