Clojure

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

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Completed
  • Affects Version/s: Release 1.3
  • Fix Version/s: Release 1.4
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test
  • Approval:
    Ok

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
  1. CLJ-852-fix.patch
    13/Nov/11 9:18 AM
    5 kB
    Ben Smith-Mannschott
  2. clj-852-patch2.txt
    22/Feb/12 9:02 PM
    4 kB
    Andy Fingerhut
  3. CLJ-852-rfc-fix.patch
    15/Oct/11 2:59 PM
    4 kB
    Ben Smith-Mannschott
  4. CLJ-852-test.patch
    15/Oct/11 10:41 AM
    2 kB
    Ben Smith-Mannschott

Activity

Ben Smith-Mannschott made changes -
Field Original Value New Value
Attachment CLJ-852-test.patch [ 10397 ]
Ben Smith-Mannschott made changes -
Attachment CLJ-852-test.patch [ 10397 ]
Ben Smith-Mannschott made changes -
Attachment CLJ-852-test.patch [ 10398 ]
Ben Smith-Mannschott made changes -
Attachment CLJ-852-rfc-fix.patch [ 10401 ]
Ben Smith-Mannschott made changes -
Patch Code and Test [ 10002 ]
Ben Smith-Mannschott made changes -
Attachment CLJ-852-fix.patch [ 10701 ]
Ben Smith-Mannschott made changes -
Assignee Ben Smith-Mannschott [ bsmith.occs@gmail.com ]
Andy Fingerhut made changes -
Attachment clj-852-patch2.txt [ 10940 ]
Stuart Sierra made changes -
Waiting On richhickey
Approval Screened [ 10004 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Fix Version/s Release 1.4 [ 10040 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]

People

Vote (4)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: