you could defined :shared class Fruit(name) { shared default Boolean canEqual(Fruit that) => true;}shared class ColouredFruit(String name, colour) extends Fruit(name) satisfies Coloured { shared actual default Boolean canEqual(Fruit that) => that is ColouredFruit;}(In ceylon, we have to declare a method 'shared' to be able to declare it 'default' and refine it ? we don't have the 'protected' java equivalent ?)
you could defined :
ReplyDeleteshared class Fruit(name) {
shared default Boolean canEqual(Fruit that) => true;
}
shared class ColouredFruit(String name, colour) extends Fruit(name) satisfies Coloured {
shared actual default Boolean canEqual(Fruit that) => that is ColouredFruit;
}
(In ceylon, we have to declare a method 'shared' to be able to declare it 'default' and refine it ? we don't have the 'protected' java equivalent ?)