-
Notifications
You must be signed in to change notification settings - Fork 35
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 goes on forever with shapeless 2.2.0-RC6 #7
Comments
It appears that RC6 is having trouble with the I'm still investigating the root cause, but in the meantime I think that providing an explicit |
OK, I think I see what's happening here, although I don't entirely understand why the behaviour has changed between RC4 and RC6. We can reproduce the problem with, case class Foo(size: ImageSize)
implicitly[Arbitrary[Foo]] The problem is with ScalaChecks definition of In attempting to resolve the implicit arguments of I think it should be possible to fix this in scalacheck-shapeless somehow, probably by masking or deprioritizing The question for me is whether or not I can or should change shapeless to fix this. Ultimately that boils down to whether I can come up with a more sophisticated form of divergence checking which would catch this case without also excluding the kinds of recursion that we want to support. I don't currently have a clear idea of how to go about doing that. I have, I suppose, been pretty much saying that using Thoughts on how best to proceed would be very welcome ... |
FWIW, I think the fix in ScalaCheck would be to move the implicit argument |
In fact, that might be a clue to a fix in scalacheck-shapeless ... the fix might be to duplicate |
@inthenow has verified locally that my suggested change in ScalaCheck does resolve the problem. So the change in scalacheck-shapeless should be good too. |
Thanks for having looked at this @milessabin and @inthenow ! (I was kind of busy with other projects of mine, I delayed looking at it). I'll try the workaround you suggest soon. |
@alexarchambault np. Btw, The new release of scalacheck has even better scalajs support, as shapeless itself now has. Had you considered cross-compiling this project to support scalajs? As an example, you could start with machinest |
More careful look at the generated type classes needed
Added I'd like to have a more careful look at that, but with cached implicits, I got no divergence / infinite loop, just failed implicit derivation without https://github.com/alexarchambault/scalacheck-shapeless/blob/topic/issue7/src/test/scala/org/scalacheck/Definitions.scala#L65-L66 @inthenow I'll give scalajs a try if I can find some time to do it, looks like a good idea. (Thanks for the hint and the link.) |
https://github.com/adelnizamutdinov/shapeless-rc6-scalacheck Here's a sample project that compiles successfully with 2.2.0-RC4
but when I change that to 2.2.0-RC6, compilation goes on forever (though it sometimes finishes saying that it could not find an implicit Arbitrary)
The text was updated successfully, but these errors were encountered: