-
Notifications
You must be signed in to change notification settings - Fork 28
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
Run after macro expansion #4
Comments
can you provide a test case? I'm not having any problems with simulacrum. |
import simulacrum.typeclass
@typeclass trait Foo[A] {
def foo(a: A): A
}
package object implicits extends Foo.ToFooOps This errors with “not found: value Foo”. If I add a dummy companion object, it errors with “type ToFooOps is not a member of object Foo”. If I disable splain, it compiles cleanly. (My original code has a bunch of stuff in explicitly-created companion, so I didn’t see that first error before.) |
that's pretty peculiar…first of all, the error occurs even if the implicits feature is deactivated. also, the plugin doesn't really run at a specific time, it just overwrites some of the default phases. I don't have the slightest idea how this could be caused, but I'll try and dig around. |
so, I just noticed that your case failed when I tried because I was using a toolbox to compile the code, which, of course, doesn't include macro paradise just because it is an sbt dependency. |
Oh, I have a theory … still narrowing it down, but this wouldn’t surprise me:
|
Nope. |
Ok, I have a very minimal project at https://github.com/sellout/matryoshka/tree/test-splain that still fails. It’s being built with sbt 0.13.13 and ~/.sbt has been removed. Commenting out the Splain plugin makes it compile (with a feature warning that can be eliminated by adding |
this is really weird, but it works for me if I change the paradise version spec to |
Hrmm, I still have no luck with addCompilerPlugin("org.scalamacros" % "paradise" % "2.1.+" cross CrossVersion.full) |
the only thing that comes to mind is that the change triggered some reordering of the plugins, but it seems to work pretty consistently here. very strange |
A similar issue also happened to me using https://github.com/frees-io/freestyle that depends on https://github.com/scalamacros/paradise . After reading the comments about reordering here i got my project working by adding the splain compiler plugin before the paradise one so that may also help on similar cases. |
huh, interesting! |
But today i added coursier (https://github.com/coursier/coursier) and build fails again and the reordering does not help in this case, so the workaround seems to be very fragile... |
Somehow 0.3.4 is breaking monocle Is splain modifying any trees? |
I wish I could give you an answer 😄 it seems to be completely random |
I've had this issue a couple times now, with implicits from simulacrum ( |
Is splain modifying trees? btw 0.4.0 seems much worse, it breaks monocle much more |
nope, no modifications. |
hello dear reporters, please take a look at the new PR for integration into scalac: scala/scala#7785 |
fixed by scala/scala#7785 |
With Splain I’m getting an error saying that an implicit I reference doesn’t exist. My guess is that this is because the implicit in question is generated by Simulacrum’s
@typeclass
macro, and Splain is running before it generates the implicit.The text was updated successfully, but these errors were encountered: