[CLJ-851] Type-hinting a var with primitive array pseudo-class results in IllegalArgumentException when the var is used as an arg Created: 10/Oct/11 Updated: 01/Mar/13 Resolved: 09/Nov/12
|Affects Version/s:||Release 1.3|
Workaround: use the class string, e.g., ^"[J"
|Comment by Ben Smith-Mannschott [ 15/Oct/11 11:40 AM ]|
Provides a test to reproduce this issue, as well as a test that shows that the workaround of using ^"[J" as type hint works correctly.
|Comment by Ben Smith-Mannschott [ 16/Oct/11 2:23 AM ]|
OK, I see the problem here: longs plays two roles in Clojure:
The example in the issue description is expecting the first interpretation, but what we're actually getting is the second interpretation, i.e. the :tag is not a symbol longs, but rather a function (an instance of the class clojure.core$longs, to be precise).
So, it's as if we'd written this:
When really, we meant this:
While the behavior described by this issue is confusing, it looks to me like it's not a bug.
|Comment by Stuart Sierra [ 09/Nov/12 8:39 AM ]|
Correct, this is not a bug. The reader will attempt to resolve symbols in the ^tag metadata form, so that it can resolve unqualified class names.