Fork me on GitHub
#cursive
<
2024-03-29
>
roklenarcic07:03:27

In a lot of cases where Clojure compiler will use reflection Cursive seems to know which method instance will be used. So this means I get no warning that method call is ambigous. Example:

(.setScale n digits RoundingMode/HALF_UP)
Cursive seems to understand this is a call of specific method in BigDecimal class. But clojure compiler, if warn on reflection is on, will issue a warning: call to method setScale can't be resolved (target class is unknown). Interestingly enough, if I typehint the receiver I get warning in Cursive too:

👀 1
cfleming20:03:36

Yes, the reflection warnings are still pretty much a best effort basis, since it’s hard to reproduce exactly what the compiler does. I’ll look at that case, though.