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
0.13.6 throws null pointer with macro paradise #1655
Comments
Could you try 0.13.7-M3? What's the full stacktrace? |
trace for 0.13.6 =>
ibid for 0.13.7-M3
|
@Duhemm, would you like to have a look? |
I've discussed this issue with @xeno-by a few days ago and I think this is a bug in scalamacros/paradise. I have a fix that simply ignores Shall I open a PR with it while the bug is not fixed in paradise ? |
Hmmm, I'd prefer not clutter our code too much if not absolutely necessary. If this is a bug in the paradise, I'd prefer it being fixed there. @xeno-by, what's your take on this? |
@Duhemm, also is there any work-around for people using paradise. E.g., manually setting tpe for TypeTrees? |
That's why I didn't share this patch... Not that I know of. I quickly showed Duhemm/macro-annotation (not sure about the name, I'm on my phone) to Eugene when I first encountered this bug and he couldn't tell me how to fix it either (my first guess was that the problem came from my macro). |
This ExtractDependenciesByMemberRefTraverser, what does it traverse? Where does it get the trees to look into? I don't remember this off the top of my head, but it might very well be that after expanding macro annotations, macro paradise saves the expansion into |
@MasseGuillaume Disable name hashing, and you should be fine - crashes only happen when name hashing is turned on. |
Here's a debugging session of what's happening. Notice that all trees have null types at the time when dependency extraction gets to run. @xeno-by, is there some cleanup phase in macro paradise that should run before dependency extraction?
|
How does SBT get hold of |
Probably by handling MacroExpansion. @gkossakowski can explain better what he's after. |
Macro paradise does not attach any @xeno-by we discussed the origin of this problem last week, do you think that my previous "analysis" of the problem was wrong ? |
It looks like I actually misled you. Paradise does attach this attachment, because expansion of macro annotations is retrofitted onto the infrastructure that expands def macros (hence the What I can do is not attaching anything when expanding annotations. That shouldn't be very hard to implement in paradise. Alternatively, we can keep the attachment, so that it's available for anyone who might want to analyze it and then in SBT you could insert a check: if a tpe of the attached tree is null, you disregard it and don't recur into its children. What would make more sense? |
@Duhemm, the stack trace is pretty clear on that. @xeno-by, my preference is to harden Sbt in the event that macros can break this assumption, and it would also fix #1593, which so far isn't directly linked to a macro. But @gkossakowski has the final say. |
Possible related issue: vigoo/scalafxml#13 |
Allright guys, is there any news? What do we do about this? |
@xeno-by, regarding your comment above. Do you attach untyped trees as an |
@gkossakowski Yes. Arguments to macro annotations are untyped, so that's what's attached. |
Hey guys, |
I think we agreed we should add a null check, but nobody did it so far (maybe the discussion was on #1593). I promise to review the PR if you open one :) |
I have still the same issue on using 0.13.5 and @sfxml 😢 |
I don't think there's a release containing a fix for this one yet (this bug was reported on 0.13.6 anyway). @jsuereth or @gkossakowski do you know when will this fix be released? |
Also the workaround: Do someone use now sfxml and why this work at his code? |
@IntelligyScience, if the workaround doesn't work then I think you are hitting some different problem. |
According to milestones, 0.13.8 should be around the corner: https://github.com/sbt/sbt/milestones |
@gkossakowski same error with 0.13.8-M2 |
This is now fixed via #1754 |
@eed3si9n cool can you release this under v0.13.8-M3 ? |
\o/ |
0.13.8-M3 should be out today. |
clone this https://github.com/MasseGuillaume/sbt-example-paradise
git@github.com:MasseGuillaume/sbt-example-paradise.git
sbt "core/run"
The text was updated successfully, but these errors were encountered: