Teaching Case — A Redefinition That Redefined Nothing
A redefinition is the one construct where a typo does not fail. `part redefines engien : TurboEngine;` does not replace the inherited `engine` — it silently declares a SECOND feature beside it, so the specialized vehicle has two engines. The compartment lists a part called `engien` in exactly the font it would list a correct one, and the inherited engine is not drawn at all because inherited features usually are not. The second finding here is the sibling defect: a redefinition that widens the multiplicity it replaces, so the specialization stops requiring what its supertype required.
package Vehicles {
part def Engine;
part def TurboEngine :> Engine;
part def Wheel;
part def Vehicle {
part engine : Engine;
part wheels : Wheel[4];
}
part def SportVehicle :> Vehicle {
// Redefines nothing. `Vehicle` declares `engine`, not `engien`, so
// this declares a new feature and the inherited one survives beside it.
part redefines engien : TurboEngine;
// A widening, not a narrowing: the supertype requires exactly four
// wheels and this permits none. Same compartment row, four characters
// different.
part redefines wheels : Wheel[0..*];
}
}