We're updating the issue view to help you get more done. 

Undeclared Var warnings with static-fns and extend-protocol

Description

Odd undeclared Var warnings are emitted if you enable static-fns and use extend-protocol

To repo with script/noderepljs, modify the last line to specify :static-fns true.

Then run the REPL and define a protocol and extend it to nil

1 2 3 4 5 6 7 8 9 10 11 12 13 cljs.user=> (defprotocol Foo (bar [x])) nil cljs.user=> (extend-protocol Foo nil (bar [_] nil)) #object[Function "function (_){ return null; }"] cljs.user=> (bar nil) WARNING: Use of undeclared Var cljs.user/clj-nil at line 1 <cljs repl> WARNING: Use of undeclared Var cljs.user/clj-nil at line 1 <cljs repl> nil

If you instead extend to string, and evaluate (bar "abc") you will see:

1 2 WARNING: Use of undeclared Var cljs.user/string at line 1 <cljs repl> WARNING: Use of undeclared Var cljs.user/string at line 1 <cljs repl>

FWIW, the same odd WARNINGs are emitted in self-host mode.

Environment

None

Status

Assignee

Unassigned

Reporter

Mike Fikes

Labels

None

Approval

None

Patch

None

Affects versions

1.7.145

Priority

Minor