tools.analyzer

Exception for no matching method with clojure.main/repl-caught, but no exception with alias m/repl-caught

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

This does not throw any exception:

(require '[clojure.tools.analyzer.jvm :as aj])
(require '[clojure.main :as m])
(def env (aj/empty-env))
(def form (read-string "
(defn foo [e]
  (m/repl-caught e))
"))
(def an (aj/analyze form env))

This does:

(require '[clojure.tools.analyzer.jvm :as aj])
(require 'clojure.main)
(def env (aj/empty-env))
(def form (read-string "
(defn foo [e]
  (clojure.main/repl-caught e))
"))
(def an (aj/analyze form env))

The only difference is the require line for clojure.main, and the alias m or the full namespace clojure.main for repl-caught.

Activity

Hide
Nicola Mometto added a comment -

Fixed: https://github.com/clojure/tools.analyzer.jvm/commit/7008ae75f310dfc1a6446ae1941fde088d2bb36b

Looks like if given foo.bar/baz, if foo.bar is both a class and a namespace (that is the case for clojure.main) clojure only considers it as a namespace.

Show
Nicola Mometto added a comment - Fixed: https://github.com/clojure/tools.analyzer.jvm/commit/7008ae75f310dfc1a6446ae1941fde088d2bb36b Looks like if given foo.bar/baz, if foo.bar is both a class and a namespace (that is the case for clojure.main) clojure only considers it as a namespace.
Hide
Andy Fingerhut added a comment -

Thanks for the update. The same test case in the description still give the same exception, unless I have messed something up.

Show
Andy Fingerhut added a comment - Thanks for the update. The same test case in the description still give the same exception, unless I have messed something up.
Hide
Nicola Mometto added a comment -

Thanks for checking it out, I forgot to include a line of diff in the commit, I pushed the additional fix: https://github.com/clojure/tools.analyzer.jvm/commit/c295e3d285a5b4ec710b649cb7c12b169d05a802

Show
Nicola Mometto added a comment - Thanks for checking it out, I forgot to include a line of diff in the commit, I pushed the additional fix: https://github.com/clojure/tools.analyzer.jvm/commit/c295e3d285a5b4ec710b649cb7c12b169d05a802

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: