-
Notifications
You must be signed in to change notification settings - Fork 533
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
Ugh implicit value classes #154
Comments
or drop Scala 2.10 support? |
Thanks, @xuwei-k. There are at least a couple of other places where we have workarounds for 2.10—maybe it's time for version-specific source trees. |
Note that Scala.js currently does not look into |
Sorry for kind of barging in (saw @travisbrown 's tweet), but wouldn't making the field private ( |
@chwthewke That works on 2.11, but not 2.10, unfortunately. |
@travisbrown Gotcha, thanks for the explanation |
I don't think option 2 is a bad choice. It would be consistent with the common approach of giving implicit values long, descriptive names to avoid likely clashes. |
(Or... just use sbt-catalysts) |
Remove old versions, housekeeping, etc.
If we've got the following set-up:
And then we try to use the
Optional
, we'll get this:But…
This made absolutely no sense to me for about ten minutes this morning, until I remembered that the
io.circe.syntax.EncoderOps
class looks like this:Which means that anything with an
Encoder
instance gets aa
method that's just the identity. For some reason I never realized that implicit value classes have this horrible property. This happens in the standard library, too. For example, in a fresh REPL:…thanks to
RichInt
. I hate implicits.At the moment I can imagine three solutions:
EncoderOps
not a value class.I'm leaning toward the first option.
The text was updated successfully, but these errors were encountered: