                       (get-in @namespaces [ns-name :uses sym]))
                 (let [ev (resolve-existing-var (dissoc env :locals) sym)]
                   (when *cljs-warn-on-redef*
-                    (binding [*out* *err*]
-                      (println (str "WARNING: " sym " already refers to: " (symbol (str (:ns ev)) (str sym))
-                                    " being replaced by: " (symbol (str ns-name) (str sym))
-                                    (when (:line env)
-                                      (str " at line " (:line env) " " *cljs-file*))))))
+                    (warning env
+                      (str "WARNING: " sym " already refers to: " (symbol (str (:ns ev)) (str sym))
+                           " being replaced by: " (symbol (str ns-name) (str sym)))))
                   (swap! namespaces update-in [ns-name :excludes] conj sym)
                   (update-in env [:ns :excludes] conj sym))
                 env)

                 ;; dependency ordering happens *after* compilation
                 (= (:ns ev) *cljs-ns*)
                 ev (not (-> ev :dynamic)))
        (binding [*out* *err*]
          (println (str "WARNING: " (:name-sym ev) " not declared ^:dynamic"
                        (when (:line env)
                          (str " at line " (:line env) " " *cljs-file*)))))))))

(defn- comma-sep [xs]
  (interpose "," xs))

    (let [crnt-ns (-> env :ns :name)]
      (when (= prefix crnt-ns)
        (when-not (-> @namespaces crnt-ns :defs suffix)
          (warning env
            (str "WARNING: Use of undeclared Var " prefix "/" suffix)))))))

(defn resolve-ns-alias [env name]
  (let [sym (symbol name)]
