Companion class requires import of Companion object methods and nested objects?

后端 未结 1 993
失恋的感觉
失恋的感觉 2020-12-16 15:56

I am looking at Akka related typesafe activator code and the following construct intrigued me:

Companion object:

object MarkerActor {
  sealed trait          


        
相关标签:
1条回答
  • 2020-12-16 16:32

    Several years ago there was a discussion on whether to implicitly import all companion object members into their parent classes. The decision made at the time, which still makes sense today, was to require an explicit import, since it is easier to add an additional import than to remove an undesired one. Here is the full discussion.

    0 讨论(0)
提交回复
热议问题