|
|
|
|
|
by esarbe
2055 days ago
|
|
In the Scala 2.x this can be done with an implicit class. It's a bit cumbersome and not very use-case oriented (mechanism over intention) and so Scala 3 has introduced extension methods[0]. This gives you exactly what you want. Since Scala 3 is pretty much completely backwards compatible (and with the use of Tasty you can use Scala 3 code in Scala 2.x projects), so I don't see the migration as a big problem. The Scala team has spent a lot of work to make the transition as painless as possible. [0] https://dotty.epfl.ch/docs/reference/contextual/extension-me... |
|