(defn find-def-clash [env ns segments]
(let [to-check (map (fn [xs]
[(symbol (string/join "." (butlast xs)))
(symbol (last xs))])
(drop 2 (reductions conj [] segments)))]
(doseq [[clash-ns name] to-check]
(when (get-in @env/*compiler* [::namespaces clash-ns :defs name])
(warning :ns-var-clash env
{:ns ns
:var (symbol (str clash-ns) (str name))})))))