Functions declared in interfaces should be able to contain default implementations. Functions without a default implementation would require an implementation in a sub-class, but functions with a default implementation would not require an implementation in a sub-class.
interface Comparable<T> {
func <(obj : T) : bool
func ===(obj : T) : bool
func <=(obj : T) : bool -> this < obj || this === obj
func >(obj : T) : bool -> !(this <= obj)
func >=(obj : T) : bool -> this === obj || !(this < obj)
}
class A : Comparable<A> {
override func <(obj : T) : bool {
// Implementation-specific code
}
override func ===(obj : T) : bool {
// Implementation-specific code
}
}
Functions declared in interfaces should be able to contain default implementations. Functions without a default implementation would require an implementation in a sub-class, but functions with a default implementation would not require an implementation in a sub-class.