cursive-ide / cursive

Cursive: The IDE for beautiful Clojure code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Bug disambiguating overloads - type hints when `@` is used

isaksky opened this issue · comments

There is a problem with using type hints in combination with @. If you use deref instead, it works as expected. (This is from Cursive, not Clojure, as (set! *warn-on-reflection* true) does not complain.)

(let [!my-str (atom "hi")
      sb (StringBuilder.)]
  ;; Overload cannot be disambiguated
  (.append sb ^String @!my-str 1 1)
  ;; This one can
  (.append sb ^String (deref !my-str) 1 1))

image

Using Cursive version 1.13.0-2023.2.