I am trying to understand when I create Class that extends a Trait which I believe extends Function0 [() => Unit] why does an instantiation of an object for that class is of type Function0? Is the apply method invoked as a constructor during object instantiation? I am not able to fully comprehend the mechanics of the below code.
scala> trait Base extends (() => Unit) {
|
| def label: String
| }
defined trait Base
scala> class Extend extends Base{
| override def label = "Hello label"
| override def apply()= println ("This is apply")
|
| }
defined class Extend
scala> val m = new Extend
m: Extend = <function0>
scala> m()
This is apply