You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should have the compiler enforce that functions in implementations (or subclasses) use the same argument names as the parent.
Notes
Unless we roll out a new major version, we cannot start enforcing this on existing projects because the fix would have to be argument renaming, and this would be a breaking change. In order to maintain backwards compatibility and stop the proliferation of this mistake, we need to provide an allow list mechanism to ignore existing violations, as well as a feature toggle to activate this validation. In the next major version of the compiler, we can remove these provisions and start enforcing it.
Currently, the compiler will allow the following program:
Notice the argument names in
Adder.add
are different fromIAdder.add
.This results in an incompatibility between the
IAdder
interface and theAdder
class in python. See:We should have the compiler enforce that functions in implementations (or subclasses) use the same argument names as the parent.
Notes
The text was updated successfully, but these errors were encountered: