If a read-handler function has more than one arity, transit-cljs/read attempts to call the incorrect arity when deserializing.
If the incorrect arity happens to be defined, this can lead to bizarre errors originating far from the transit code or top-level constructor; if not defined, it results in "Error: Invalid arity: X".
I discovered this by using partial to define a read handler, which of course constructs a function with many arities. The extra argument being passed to the function appears to be a Transit$TaggedValue, defined in transit-js.
Steps to Reproduce
Use a read-handler function with more than one arity. A complete minimal example, based on the official tutorial, can be found here:
Description
If a read-handler function has more than one arity,
transit-cljs/read
attempts to call the incorrect arity when deserializing.If the incorrect arity happens to be defined, this can lead to bizarre errors originating far from the transit code or top-level constructor; if not defined, it results in
"Error: Invalid arity: X"
.I discovered this by using
partial
to define a read handler, which of course constructs a function with many arities. The extra argument being passed to the function appears to be aTransit$TaggedValue
, defined intransit-js
.Steps to Reproduce
Use a read-handler function with more than one arity. A complete minimal example, based on the official tutorial, can be found here:
https://gist.github.com/galdre/cc875e28590d253b2c40cdfd3f5ecd07