SR-103 Protocol Extension: function's implementation cannot be overridden by a subclass
Issue Description:
protocolP {
funcf() -> Int
}
extensionP {
funcf() -> Int { return0 }
funcg() -> Int { returnf() }
}
classX : P {
init() { }
}
classY : X {
// Compiler lets me write this, and claims that Y conforms to P (see// "redundant conformance" error below), however...funcf() -> Int { return1 }
}
print(Y().g()) // prints 0!classY1 : X {
// error: method does not override any method from its superclassoverridefuncf() -> Int { return1 }
}
// error: redundant conformance of 'Y2' to protocol 'P'classY2 : X, P {
funcf() -> Int { return1 }
}
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: 3cf7eef6af2f039969919debd16c6dd2
duplicates:
Issue Description:
The text was updated successfully, but these errors were encountered: