ClojureScript

defprotocol generates unresolvable symbols

Details

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

Description

defprotocol will emit symbols the analyzer cannot resolve. This has no impact in the JS since the emitted symbol is "correct", it just can't be resolved properly in the analyzer which may have other effects.

Each method of a defprotocol will be emitted with only dots and no namespace separation. The broken resolve for dotted symbols just accepts any symbol and in turn resolves them incorrectly.

(defprotocol ICloneable
  "Protocol for cloning a value."
  (^clj -clone [value]
    "Creates a clone of value."))

;; expands to "invalid" CLJS
cljs.core.-clone
;; resolves to broken CLJS
cljs/core.-clone
;; emits "correct" JS regardless
cljs.core._clone

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: