reagent-project / reagent

A minimalistic ClojureScript interface to React.js
http://reagent-project.github.io/
MIT License
4.75k stars 415 forks source link

tag with-let macro symbol to silence infer warning #586

Closed thheller closed 1 year ago

thheller commented 1 year ago

This will properly silence the warning generated by recent shadow-cljs versions.

The warning is new since older versions only accounted for values tagged as any. But in cases like the with-let-values it is tagged as #{any array} due to the if branch having a hardcoded array return value. So, no externs inference was ever warned about.

In this case it is not a problem and technically no externs are needed. However in other projects under different circumstances the missing warnings could lead to build failures due to missing externs. So this change was added and uncovered a lot of previously missed cases, this being one of them.