The requirement that implicit classes be explicitly declared inside another object gets in my way frequently and feels like it could be relaxed.
My typical library code looks like:
package foo.bar
object Baz {
implicit class Baz(…) { … }
}
and corresponding calling code:
One of the two Baz-layers is redundant.
Logically, i want my implicit classes to be considered to live inside their nearest containing package object (in this case foo.bar), just like non-implicit classes, but I can only declare a given package object once, so to use it I have to put all classes in a package in the same file (in the package object), which is also suboptimal.
LMK if I'm missing something? Thanks!
--
You received this message because you are subscribed to the Google Groups "scala-language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
For more options, visit
https://groups.google.com/d/optout.