Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "=>" mean in Scala?

Tags:

scala

What does "=>" mean in the example below?

trait MyService[E <: Entity[ID]] extends Management {
    this: Repository[E] =>
    // some code
}
like image 830
JohnWinter Avatar asked Feb 09 '23 22:02

JohnWinter


1 Answers

In this example it means that this has to be of the type Repository[E]. That means that the trait MyService can only be mixed into classes extending Repository[E].

like image 109
Gregor Raýman Avatar answered Feb 16 '23 02:02

Gregor Raýman