简体   繁体   中英

What does “=>” mean in Scala?

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

trait MyService[E <: Entity[ID]] extends Management {
    this: Repository[E] =>
    // some code
}

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] .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM