noprompt / meander

Tools for transparent data transformation
MIT License
918 stars 55 forks source link

Reflection warning in util/epsilon.cljc, field val #201

Closed SevereOverfl0w closed 2 years ago

SevereOverfl0w commented 2 years ago
❯ clj -Sdeps '{:deps {meander/epsilon {:mvn/version "0.0.650"}}}'
Downloading: meander/epsilon/0.0.650/epsilon-0.0.650.pom from clojars
Downloading: meander/epsilon/0.0.650/epsilon-0.0.650.jar from clojars
Clojure 1.10.3
user=> (require '[meander.epsilon :as m])
Reflection warning, meander/util/epsilon.cljc:758:24 - reference to field val can't be resolved.
noprompt commented 2 years ago

@vemv Are you able to figure this one out? This is connected to the (awesome) work you did a while back. I'm not quite sure what to do.

vemv commented 2 years ago

Will check it out, appreciate the repro as well 👍

vemv commented 2 years ago

So I believe this is not a realistic reflection warning to experience. If you're using val-of-js-value then cljs.tagged_literals.JSValue should be in the classpath.

The reason why Reflection warning, meander/util/epsilon.cljc:758:24 - reference to field val can't be resolved is printed is because https://github.com/noprompt/meander/blob/501c7d1d1079cb275f11d0476bab6c31c9b37dc9/src/meander/util/epsilon.cljc#L10 is performed.

I'd recommend against (set! *warn-on-reflection* true), here's an explanatory rant (and suggested alternatives)

Cheers - V

noprompt commented 2 years ago

@vemv Thanks for the prompt reply and advice! I'm in favor of removing the check. 👍

noprompt commented 2 years ago

This has been patched and will go out with the next version of the library!