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

IllegalArgumentException thrown when defining a var whose value is calculated with a primitive fn.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Completed
    • Affects versions: Release 1.3
    • Fix versions: Release 1.4
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code and Test

      Description

      Note the following stacktrace line numbers are from the latest 1.4-snapshot, though this happens on 1.3 as well.

      Example:

      user=> (defn foo ^long [^long x] x)
      #'user/foo
      user=> (def x (inc (foo 10)))
      CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: long, compiling:(NO_SOURCE_PATH:2) 
      user=> (pst)
      CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: long, compiling:(NO_SOURCE_PATH:2)
      	clojure.lang.Compiler.analyzeSeq (Compiler.java:6444)
      	clojure.lang.Compiler.analyze (Compiler.java:6244)
      	clojure.lang.Compiler.analyze (Compiler.java:6205)
      	clojure.lang.Compiler.analyzeSeq (Compiler.java:6432)
      	clojure.lang.Compiler.analyze (Compiler.java:6244)
      	clojure.lang.Compiler.access$100 (Compiler.java:37)
      	clojure.lang.Compiler$DefExpr$Parser.parse (Compiler.java:492)
      	clojure.lang.Compiler.analyzeSeq (Compiler.java:6437)
      	clojure.lang.Compiler.analyze (Compiler.java:6244)
      	clojure.lang.Compiler.analyze (Compiler.java:6205)
      	clojure.lang.Compiler.eval (Compiler.java:6497)
      	clojure.lang.Compiler.eval (Compiler.java:6459)
      Caused by:
      IllegalArgumentException Unable to resolve classname: long
      	clojure.lang.Compiler$HostExpr.tagToClass (Compiler.java:1003)
      	clojure.lang.Compiler$InvokeExpr.getJavaClass (Compiler.java:3474)
      	clojure.lang.Compiler.getMatchingParams (Compiler.java:2304)
      	clojure.lang.Compiler$StaticMethodExpr.<init> (Compiler.java:1510)
      	clojure.lang.Compiler$HostExpr$Parser.parse (Compiler.java:910)
      	clojure.lang.Compiler.analyzeSeq (Compiler.java:6437)
      	clojure.lang.Compiler.analyze (Compiler.java:6244)
      

      Note though that the following works fine:

      user=> (def x (foo (inc 10)))
      #'user/x
      

        Attachments

          Activity

            People

            • Assignee:
              bsmith.occs@gmail.com Ben Smith-Mannschott
              Reporter:
              ataggart Alexander Taggart
            • Votes:
              4 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: