This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-04-02
Channels
- # announcements (1)
- # architecture (1)
- # aws (21)
- # babashka (37)
- # beginners (173)
- # boot (12)
- # chlorine-clover (5)
- # cider (36)
- # clara (11)
- # clj-kondo (25)
- # clojure (128)
- # clojure-europe (7)
- # clojure-finland (3)
- # clojure-germany (2)
- # clojure-nl (57)
- # clojure-uk (23)
- # clojurescript (71)
- # clojurex (1)
- # core-async (30)
- # core-typed (5)
- # cursive (35)
- # datomic (8)
- # duct (4)
- # emacs (8)
- # exercism (41)
- # fulcro (116)
- # jackdaw (4)
- # jobs-discuss (6)
- # juxt (4)
- # kaocha (16)
- # leiningen (14)
- # malli (5)
- # observability (4)
- # off-topic (2)
- # pathom (19)
- # pedestal (29)
- # re-frame (64)
- # reitit (18)
- # ring (8)
- # shadow-cljs (3)
- # sql (13)
- # tools-deps (32)
- # tree-sitter (5)
- # yada (17)
Hi!
We're running into an issue with the type inference warnings (and the automatic externs inference, it appears) when we thread js
field accesses with some->
instead of ->
:
(def window (if (exists? js/window) js/window nil))
(def ^js jswindow (if (exists? js/window) js/window nil))
(js/console.log (-> js/window .-test))
(js/console.log (-> jswindow .-test))
(js/console.log (-> window .-test))
(js/console.log (-> js/window .-test .-identity))
(js/console.log (some-> js/window .-test .-identity))
(js/console.log (-> jswindow .-test .-identity))
(js/console.log (some-> jswindow .-test .-identity))
(js/console.log (-> window .-test .-identity)) ;; <---- Inference warning only here
(js/console.log (some-> window .-test .-identity))
It was observed on 2.8.68
and reproduced on 2.8.93
.
Is it expected/unavoidable?