KSP-RO / TestFlight

KSP Mod that provides a part research and reliability system
43 stars 32 forks source link

Examine use of new vs. override #173

Open Starstrider42 opened 7 years ago

Starstrider42 commented 7 years ago

Many TestFlight modules, such as the TestFlightFailure heirarchy, have non-virtual members that can be masked by subclasses. This masking leads to unexpected inconsistencies in how a class behaves in different contexts; in extreme cases, it even leads to unreachable code (e.g., TestFlightFailure_Engine.TestFlightEnabled never got called prior to the changes in #172).

The code base should be re-examined to determine whether redefined class members should mask or override base class members. Changing whether a member is virtual or not may expose previously hidden bugs, particularly when the change enables previously unused code.