Fork me on GitHub
#clojure-dev
<
2018-11-08
>
leonoel08:11:47

Hi. I already asked this question a while ago but this is pretty annoying and I want to be sure there's not a hidden feature I'm unaware of. Basically I'm writing a macro that emits aset exprs to put arbitrary values into an object array. The problem is when values happen to be inferred as primitives, emitted code makes the compiler complain about reflection with warnings like "call to static method aset on clojure.lang.RT can't be resolved (argument types: [Ljava.lang.Object;, int, long)." So what I need is way to tell the compiler to ensure a given value will be boxed to fit in an object container. I'm about to implement this in my macro based on analyzer information but it feels kind of the wrong place to do that

leonoel18:11:39

ok thanks @hiredman. that looks suboptimal to me but at least I have my answer.

danielcompton19:11:28

@ghadi thanks for the edit :)