cursive icon indicating copy to clipboard operation
cursive copied to clipboard

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

Open isaksky opened this issue 2 years ago • 0 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.

isaksky avatar Dec 01 '23 18:12 isaksky