<< Back to previous view

[CLJ-1180] defprotocol doesn't resolve tag classnames Created: 10/Mar/13  Updated: 18/Jan/16

Status: Open
Project: Clojure
Component/s: None
Affects Version/s: Release 1.5, Release 1.6
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Nicola Mometto Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: protocols

Attachments: Text File 001-CLJ-1180.patch     Text File clj-1180-2.patch    
Patch: Code and Test
Approval: Prescreened

 Description   

defprotocol doesn't resolve tag classnames, this results in exceptions being thrown when the declared protocol uses as a tag an imported class that is not imported in the namespace that uses it.

user=> (import 'clojure.lang.ISeq)
clojure.lang.ISeq
user=> (defprotocol p (^ISeq f [_]))
p
user=> (ns x)
nil
x=> (defn x [y] (let [z (user/f y)] (inc z)))
CompilerException java.lang.IllegalArgumentException: Unable to resolve classname: ISeq, compiling:(NO_SOURCE_PATH:4:33)

Patch: clj-1180-2.patch

Screened by: Alex Miller

  • My only hesitancy with this patch is making the tagToClass public and reaching into it from core_deftype - this means that call into the Compiler needs to remain open forever as an api.


 Comments   
Comment by Alex Miller [ 03/Sep/13 9:38 AM ]

Similer to CLJ-1232.

Comment by Alex Miller [ 18/Jan/16 4:50 PM ]

Patch updates for current master, retains attribution.

Generated at Thu Jul 28 17:33:36 CDT 2016 using JIRA 4.4#649-r158309.