This issue is also solved by supplying an externs file to GCC, as suggested by @pesterhazy. I tried the extern inference option in Clojurescript, and I also tried using extern inference in Shadow CLJS as suggested by @jiyinyiyong.
I have to say the experience in Shadow CLJS is much better. At least for my simple program:
- the warnings were spot on.
- The type hint that has to be added for the Shadow CLJS to generate the extern file is just
^js
. Shadow CLJS does not require the actual type to be specified.
Shadow CLJS also has other ‘conveniences’ spelt out in the user manual which I did not have the chance to use:
- it accepts a simplified extern file
- calls on globals using js/ do not require type hints
- no hints required on
:as
and:refer
bindings