tools.analyzer

Class/method call in macro in ns1 causes 'No such namespace' when used in ns2 that does not import the class

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

I am hoping that this one is not yet another derivative of TANAL-24

I tried to create a minimal test case but it didn't work. The quickest example I can give is to pull a clone of the quartzite library and use the latest tools.analyzer(.jvm) and Eastwood to analyze it. Several namespaces throw the exception during analysis, including clojurewerkz.quartzite.test.execution-test

% git clone https://github.com/michaelklishin/quartzite.git
% cd quartzite
% lein eastwood

[ ... ]

Exception thrown during phase :analyze of linting namespace clojurewerkz.quartzite.test.execution-test
Got exception with extra ex-data:
    msg='No such namespace: JobBuilder'
    (keys dat)=(:ns)
ExceptionInfo No such namespace: JobBuilder
	clojure.core/ex-info (core.clj:4327)
	clojure.tools.analyzer.passes.jvm.validate/eval1613/fn--1615 (validate.clj:33)

The basic problem seems to be that one namespace defines a macro that invokes (Class/method args), without a package name qualifier, but imports the class so it does not need one.

A second namespace invokes the macro, but does not import the class.

However, a minimal test case based on that pattern gave no error while using Eastwood on it, so there may be more conditions required than that for the exception to occur.

Activity

Hide
Nicola Mometto added a comment -

Oddly enough this was a.. tools.reader bug
I'm pushing a new release that fixes the typo right now.

Show
Nicola Mometto added a comment - Oddly enough this was a.. tools.reader bug I'm pushing a new release that fixes the typo right now.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: