Reputation: 3460
How does this code work?
package lila
object makeTimeout {
implicit val large = 5
}
package lila.socket
import makeTimeout.large
lila.socket
package imports makeTimeout.large
, but it doesn't use lila.makeTimeout.large
.
Upvotes: 2
Views: 255
Reputation: 5712
It doesn't, but your minimized example is different from the original code.
In the original code makeTimeout
is defined inside a trait WithPlay, and that's later inherited by the package object lila, defined in package.scala, and that makes makeTimeout
a member of package lila
.
Note that you could make your code compile if you broke down the package declaration in two lines:
package lila
package socket
Upvotes: 3