Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation warnings on Clojure 1.7 #83

Closed
sritchie opened this issue Sep 25, 2014 · 10 comments
Closed

Compilation warnings on Clojure 1.7 #83

sritchie opened this issue Sep 25, 2014 · 10 comments

Comments

@sritchie
Copy link

When I try to compile cljs with Clojure 1.7, I see a bunch of warnings like this:

WARNING: Use of undeclared Var dommy.template/->node-like at line 37 file:/Users/sritchie/.m2/repository/prismatic/dommy/0.1.3/dommy-0.1.3.jar!/dommy/attrs.cljs

I'm guessing that requiring dommy.template in that namespace will fix this up.

@ccfontes
Copy link
Contributor

ccfontes commented Oct 4, 2014

@sritchie I have the same issue. Did you manage to solve it?
I opened that jar file and read /dommy/attrs.cljs. It's amazing to find there is no symbol ->node-like anywhere in the file! So the warning message is at the very least fascinating.

@ccfontes
Copy link
Contributor

ccfontes commented Oct 4, 2014

Downgrading clojurescript to version 0.0-2322 mysteriously solves the issue.

@sritchie
Copy link
Author

sritchie commented Oct 6, 2014

Well, it's coming in from the macro definition (on my phone now, so can't link). Check the line the error references, then see the definition of that macro.


Sent from Mailbox

On Sat, Oct 4, 2014 at 4:08 PM, Carlos Cunha notifications@github.com
wrote:

Downgrading clojurescript to version 0.0-2322 mysteriously solves the issue.

Reply to this email directly or view it on GitHub:
#83 (comment)

@ccfontes
Copy link
Contributor

ccfontes commented Oct 6, 2014

It's amazing to find there is no symbol ->node-like anywhere in the file!

There's nothing in that line as I have mentioned before.

Maybe it's spurious. Not even sure it had any impact in my app.

@sritchie
Copy link
Author

sritchie commented Oct 6, 2014

Okay, back at my computer.

At line 37, that warning comes in because of the macroexpansion of node here: https://github.com/Prismatic/dommy/blob/master/src/dommy/attrs.cljs#L37

Here's the code for node:

https://github.com/Prismatic/dommy/blob/master/src/dommy/macros.clj#L155

So that line gets expanded to (dommy.template/->node-like ~data) before getting passed into the cljs compiler. That's why it thinks that that symbol exists on that line, because of macro-expansion.

There's no actual error when you run your program if, down the road, some other file requires dommy.template.

The solution would be to require dommy.template in dommy.attrs. This would kill the warnings.

@ccfontes
Copy link
Contributor

ccfontes commented Oct 6, 2014

Thanks for the in-depth investigation.

The solution would be to require dommy.template in dommy.attrs. This would kill the warnings.

So this is a problem with the compiler. But polluting the codebase with requires for every similar problem doesn't seem correct, imo.

I prefer to not the use that compiler version until the issue is fixed.

@sritchie
Copy link
Author

sritchie commented Oct 6, 2014

Sure, fine by me. Closing.

@sritchie sritchie closed this as completed Oct 6, 2014
@jeluard
Copy link

jeluard commented Oct 6, 2014

It's not clear to me that this is a compiler bug. The compiler has been recently enhanced to catch more issues so it might be the case here.
@ccfontes If you believe that this is a compiler issue maybe it should be tracked in the CLJS JIRA?

@jeluard
Copy link

jeluard commented Oct 6, 2014

I understand from the response to this question that the node macro could be modified to fix the warning. It would also be safer as current code should not run and might break in the future.

Maybe this issue should be reopened?

@swannodette
Copy link

This is not a ClojureScript compiler bug. It should be documented in the library what dependencies are implied by macro usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants