<< Back to previous view

[CLJS-122] `reify` does not implement IWithMeta on the object it creates Created: 13/Jan/12  Updated: 27/Jul/13  Resolved: 13/Jan/12

Status: Closed
Project: ClojureScript
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Shantanu Kumar Assignee: Unassigned
Resolution: Completed Votes: 0
Labels: meta
Environment:

ClojureScript commit 0df1bc4d7bdf4d411e72d443b5a23d146d5e64b8 on JDK 1.6 on Mac OS X (Lion)



 Description   

When reifying a protocol, the created object cannot be annotated with metadata.

(defprotocol IFoo (foo [this]))

(with-meta (reify IFoo (foo [this] :foo)) {:foo :bar})
"Error evaluating:" (with-meta (reify IFoo (foo [this] :foo)) {:foo :bar}) :as "cljs.core.with_meta.call(null,(function (){if(cljs.core.truth_(cljs.core.undefined_QMARK_.call(null,cljs.user.t4972)))\n{\n/*\n @constructor\n*/\ncljs.user.t4972 = (function (){\n})\ncljs.user.t4972.prototype.cljs$user$IFoo$ = true;\ncljs.user.t4972.prototype.cljs$user$IFoo$foo = (function (this$){\nvar this__4973 = this;\nreturn \"?'foo\";\n});\n} else\n{}\nreturn (new cljs.user.t4972());\n})(),cljs.core.ObjMap.fromObject([\"?'foo\"],{\"?'foo\":\"?'bar\"}));\n"
org.mozilla.javascript.JavaScriptException: Error: No protocol method IWithMeta.-with-meta defined for type object: [object Object] (cljs/core.cljs#165)
at cljs/core.cljs:165 (anonymous)
at cljs/core.cljs:155 (_with_meta)
at cljs/core.cljs:511 (with_meta)
at <cljs repl>:22 (anonymous)
at <cljs repl>:22



 Comments   
Comment by David Nolen [ 13/Jan/12 8:22 AM ]

fixed, https://github.com/clojure/clojurescript/commit/32845427cd4cb115e15a09c90150a06919227a64





Generated at Tue Sep 16 00:09:32 CDT 2014 using JIRA 4.4#649-r158309.