Skip to content

Instantly share code, notes, and snippets.

@bensu
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bensu/e146fff87a67f41798ca to your computer and use it in GitHub Desktop.
Save bensu/e146fff87a67f41798ca to your computer and use it in GitHub Desktop.
Compiles without warnings even though there is a potential name conflict.
(ns import-names.core
(:import (java.util Date)))
(def Date "Should this compile?")
(defn -main []
(println Date))
;; Throws:
;; Exception in thread "main" java.lang.RuntimeException:
;; Expecting var, but Date is mapped to class java.util.Date
(ns import-names.core
(:import [goog debug]))
;; This var has the same name as an imported JS object
(def debug goog.debug)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment