Uploaded image for project: 'Clojure'
  1. CLJ-2399

Proxy generated from (bean) doesn't work with clojure.walk

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: Release 1.9
    • Fix versions: None
    • Labels:
    • Patch:
      Code and Test

      Description

      Currently if you run clojure.walk functions on a proxy generated from (bean), it throws exception:

      (clojure.walk/prewalk identity (bean (java.util.Date.)))

      [java] ERROR in (test-walk-bean) (:-1)
      [java] expected: (clojure.walk/prewalk identity b)
      [java] actual: java.lang.UnsupportedOperationException: empty
      [java] at clojure.core.proxy$clojure.lang.APersistentMap$ff19274a.empty (:-1)
      [java] clojure.core$empty.invokeStatic (core.clj:5202)
      [java] clojure.walk$walk.invokeStatic (walk.clj:49)
      [java] clojure.walk$prewalk.invokeStatic (walk.clj:64)
      [java] clojure.walk$prewalk.invoke (walk.clj:60)
      [java] clojure.lang.AFn.applyToHelper (AFn.java:156)
      [java] clojure.lang.AFn.applyTo (AFn.java:144)
      [java] clojure.core$apply.invokeStatic (core.clj:657)

      Because the proxy doesn't implement empty, which is required by clojure.walk. This patch added a test to reproduce and a fix.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              sunng Ning Sun
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: