-
Notifications
You must be signed in to change notification settings - Fork 19
Remove any2stringadd. #54
Comments
This would be cool indeed. |
I had an idea of putting in a What do you think? The other alternative is to do something similar to what Paul did with Policy recently and modify the stdlib/compiler. I don't see a clear way for us to do that without drastically revising our compatibility guarantees. |
This was some of the motivation for #26 (any2stringadd is just an implicit in Predef) - sadly my PR misses a case and so doesn't give a nice error. |
@puffnfresh You know the implicit never kicks on expressions like 1 + "bob" because a (String)String method has been synthetically added to Int/Long/etc, yes? See paulp/policy@4bb74b2bb . |
Also, |
@paulp I am sadly very aware of that. |
Independent of |
@non absolutely. That'd be great. |
I updated #32 to fix the problem with my object Nope {
@annotation.implicitAmbiguous("any2string is disabled")
implicit def any2stringaddamb1[A](self: A): any2stringadd[A] = ???
List(1, 2, 3) + "two"
} Gives this:
Which makes me pretty happy. 🍰 |
Nice! Horrible use case, though... ;) |
To resurrect this issue, please rework it as an issue/PR against Lightbend Scala (ie. scala/scala). |
Following on from a related thread Paul has started this here https://github.com/paulp/policy/commit/d5c06772d
How feasible it is to support from behind a flag may be questionable - but this would be a big win if it can be done.
The text was updated successfully, but these errors were encountered: