core.async

IOC macro does not handle Dot special form

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
  • Environment:
    I've tested with using the latest snapshot of core.async and latest on github.

Description

This code:

(go (. clojure.lang.Numbers (add 1 2)))

Results in this error:

CompilerException java.lang.RuntimeException: Unable to resolve symbol: add in this context, ...

Looking at the expansion of the state machine the problem seems to be that SSA transformation is treating the (add 1 2) as a separate expression that needs to be evaluated (and assigned) before the clojure.lang.Numbers:

...
(clojure.core/let [inst_4648 (add 1 2)
                   inst_4649 (. clojure.lang.Numbers inst_4648)
                   state_4651 state_4651]
...

The newer / form works fine, e.g. (Math/abs -2), and that is how I would write static method calls myself but I am using macros that expand to the older dot syntax above.

Do you see this as a case the IOC macro should be handling?

Activity

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: