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

Type hinting for array classes does not work in binding forms

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects versions: Release 1.5, Release 1.4
    • Fix versions: None
    • Labels:
    • Environment:

      replicated on OpenJDK 7u9 on Ubuntu 12.04, and Hotspot 1.6.0_37 on OSX Lion

      Description

      Type hints don't work as expected in binding forms.

      The following form results in a reflection warning:

      (let [^{:tag (Class/forName "[Ljava.lang.Object;")} a (make-array Object 2)]
      (aget a 0))

      However, hinting does appear to work correctly on vars:

      (def ^{:tag (Class/forName "[Ljava.lang.Object;")} a (make-array Object 2))
      (aget a 0) ;; no reflection warning

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              lvanderhart Luke VanderHart
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: