Fork me on GitHub
#cursive
<
2023-10-31
>
Ernesto Garcia11:10:40

Why is it still not able to disambiguate with the ^Runnable tag?

Ernesto Garcia11:10:52

It does work with (fn [] ...) instead of #(...)

Alex Miller (Clojure team)12:10:38

I think the hint gets lost with the anonymous function

Alex Miller (Clojure team)12:10:52

The upcoming arg-tags feature in 1.12 will provide a different better way to say this

Alex Miller (Clojure team)12:10:36

(^[Runnable] Thread. …)

Ernesto Garcia12:10:48

Oh, a vector of parameter types?

Ernesto Garcia12:10:58

Btw, why is it that the type hint is needed above in the first place? fns implement Runnable, is that not apparent when compiled?

Alex Miller (Clojure team)13:10:47

They also implement Callable which is an overload here

Alex Miller (Clojure team)13:10:49

Sorry, that’s in the executor calls, not here

Alex Miller (Clojure team)13:10:35

Here it’s because that fn is not typed as a Runnable, it’s just an expression with unknown type

Alex Miller (Clojure team)13:10:13

There is some nonobvious complexity here between what that expression is and what it returns when invoked

👍 1
gratitude-thank-you 3
onetom23:10:16

the new context info support is very useful in diff windows too. now i don't have to unfold multiple times to see what function does a certain change hunk belongs to!

🎉 7