TP0228
Error: incompatible override
Messages
Section titled “Messages”'<m>' must take the same parameters as '<B>.<m>'parameter '<p>' of '<m>' must have type <T>, as in '<B>.<m>'parameter '<p>' of '<m>' needs a default, as in '<B>.<m>''<m>' must return <T>, as '<B>.<m>' does(orreturn nothing)'<m>' is a <static method|class method|method|property> in '<B>''<p>' must have a setter, as '<B>.<p>' does'<D>.<m>' must return <R>, since it can run in place of '<B>.<op>''<D>' must be constructed as '<C>' is, since '<C>.<m>' calls 'cls(…)'(M28)'<B>.<m>' is final'<m>' must return Self, as '<B>.<m>' does(M39)'<m>' must be 'def <m>(self, <params>) -> <R>', as in '<I>.<m>'(implementing a .NET interface’s method, or overriding a .NET class’s) (M43)
Example
Section titled “Example”From the golden case tests/cases/m39/tp0228_classes.tpn:
class Animal: @final def name(self) -> str: return "animal"
def me(self) -> Self: return self
class Dog(Animal): @override def name(self) -> str: return "dog"
@override def me(self) -> Dog: return selfThe compiler reports:
tp0228_classes.tpn:11:9: error TP0228: 'Animal.name' is finaltp0228_classes.tpn:15:21: error TP0228: 'me' must return Self, as 'Animal.me' doesThe specification lists every code.
© 2026 Discover Edge, LLC · Taipan is released under the MIT License.