Developed a small package object that looks like this:
package object logic {
type Chat = engine.logic.chat.Chat
type History = engine.logic.history.History
type Meta = engine.logic.meta.Meta
type Notification = engine.logic.notification.Notification
type Service = engine.logic.service.Service
type State = engine.logic.state.State
type Sync = engine.logic.sync.Sync
}
Looks like I am misunderstanding the point of the package object since I was under the belief that the preceding would bring the companion object Sync
into scope.
Sync
is a top-level object under package engine.logic.sync
.
Here is how I am accessing it:
engine.logic.Sync.aMemberDef(var: String)
However the compiler throws an error object Sync is not a member of package engine.logic
. So what's the workaround and how did I mess up my packaging?
Thanks!
If you want to create instance alias, just use val:
val Sync = engine.logic.sync.Sync
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With