Clojure

Class name clash between top-level functions and defn'ed ones

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: Release 1.7
  • Component/s: None
  • Labels:
  • Patch:
    Code
  • Approval:
    Vetted

Description

Named anonymous fn's are not guaranteed to have unique class names when AOT-compiled.

For example:

(defn g [])
(def xx (fn g []))

When AOT-compiled both functions will emit user$g.class, the latter overwriting the former.

Demonstration script: demo1.clj

Patch: 0001-CLJ-1093-v2.patch

Approach: Generate unique class names for named fn's the same way as for unnamed anonymous fn's.

See also: This patch also fixes the issue reported in CLJ-1227.

  1. 0001-CLJ-1093-v2.patch
    12/Sep/14 7:26 PM
    2 kB
    Nicola Mometto
  2. 0001-Fix-CLJ-1330-make-top-level-named-functions-classnam.patch
    22/Jan/14 3:57 PM
    1 kB
    Nicola Mometto
  3. 0001-Fix-CLJ-1330-refactored.patch
    12/Sep/14 5:27 PM
    2 kB
    Nicola Mometto
  4. demo1.clj
    23/Jan/14 1:10 PM
    0.6 kB
    Stuart Sierra

Activity

People

Vote (7)
Watch (11)

Dates

  • Created:
    Updated: