Is the exporting feature really necessary?

It’s necessary precisely because such forwarding functions are tedious to write and do not update automatically when their targets change.

For example, suppose I want to make my own Predef and put my most commonly used libraries there. In Scala 2 this is a huge, truly arduous task. In Scala 3 it’s a few lines:

package myprelude

export lib1._
export lib2._
export lib3._

IMHO this is the best new feature in Dotty, addressing a long-time concern. The only thing better would be to also have Kotlin-esque scope injection to go with exports.

4 Likes