You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to a macro provided by clojure.core: with-precision
problem
Clojure core includes a macro with-precision to set both precision and rounding mode for BigDecimal operations.
The macro optionally accepts an argument :rounding, which must be followed by one of CEILING, FLOOR, HALF_UP, HALF_DOWN, HALF_EVEN, UP, DOWN, and UNNECESSARY. The macro translates this to a matching enum constant from java.math.RoundingMode for use in the proceeding expression.
When used, Clj-kondo reports the enum names as "Unresolved symbol". They are not symbols. They are merely characters to be interpreted by the macro.
repro
--- clj_kondo_with_precision.clj ---
(nsclj-kondo-with-precision)
;; Example copied from clojure core `master` branch:;; `test/clojure/test_clojure/vars.clj`: line: 45
(with-precision6:rounding CEILING (+3.5555555M1))
Since this is a core macro, and all legal entries are fully enumerated in the docs, the linter should not require any special configuration to prevent reporting an error for any of the specified enums within the context of with-precision.
The text was updated successfully, but these errors were encountered:
version
2022.04.25
macro usage
Related to a macro provided by clojure.core:
with-precision
problem
Clojure core includes a macro
with-precision
to set both precision and rounding mode for BigDecimal operations.The macro optionally accepts an argument
:rounding
, which must be followed by one ofCEILING
,FLOOR
,HALF_UP
,HALF_DOWN
,HALF_EVEN
,UP
,DOWN
, andUNNECESSARY
. The macro translates this to a matching enum constant fromjava.math.RoundingMode
for use in the proceeding expression.When used, Clj-kondo reports the enum names as "Unresolved symbol". They are not symbols. They are merely characters to be interpreted by the macro.
repro
--- clj_kondo_with_precision.clj ---
on command line
expected behavior
Since this is a core macro, and all legal entries are fully enumerated in the docs, the linter should not require any special configuration to prevent reporting an error for any of the specified enums within the context of
with-precision
.The text was updated successfully, but these errors were encountered: