Reputation: 65
How can I use the isEmpty of class A in Class B?
Class A{
def isEmpty = ...
Class B{
def isEmpty = ...
}
}
Upvotes: 2
Views: 160
Reputation: 60006
Try this:
class A {
outer =>
def isEmpty = ...
class B {
def isEmpty = outer.isEmpty
}
}
Alternatively:
class A {
def isEmpty = ...
class B {
def isEmpty = A.this.isEmpty
}
}
Upvotes: 7