ClojureScript

Recompilation throws java.lang.IllegalStateException if alias target changes

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

When running lein cljs auto and changing

(ns foo
  (require [clojure.string :as s]))

to

(ns foo
  (:require [clojure.set :as s]]))

(re)compilation fails with "java.lang.IllegalStateException: Alias s already exists in namespace foo, aliasing cljs.string"

A minimal script to reproduce the issue:

java -server -Xmx2G -Xms2G -Xmn256m -cp 'lib/*:src/clj:src/cljs' clojure.main - <<CLJ
(require '[cljs.closure :as cljs])
(cljs/-compile '(ns foo (:require [cljs.string :as s])) {})
(cljs/-compile '(ns foo (:require [cljs.set :as s])) {})
CLJ

I also ran git bisect (with the aboove script) which found the following offending commit: https://github.com/clojure/clojurescript/commit/69741f2af76035e4adf1e6333c502095581b2179

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: