Skip to content

ALL-OVER0003 · overriding_method_demands_an_argument_the_base_defaulted

Count overriding methods that made an optional argument of the base a required one.

This is a deterministic rule for all languages. Read its implementation.

Read every member a base declares beside the declaration the subclass writes for it, and report an override that states the same parameters under the same names while quietly withdrawing a default. This is the worst shape a signature change can take, because nothing about the two declarations looks different. They have the same length, the same order, and the same names, and the only difference is an argument the base said a caller could leave out.

A call written against the base omits it and works everywhere except where the subclass is the object behind the reference, so the defect surfaces on one code path rather than at import time. The base is usually in another file, which is why the two declarations are almost never read side by side and why only a resolved inheritance chain can put them there.

Continue with evidence and references, or open the examples.