Disallow inheritance from breaking generic constraints #22064
Labels
Generics
Inheritance
Invalid Code Acceptance
Everything related to compiler not complaining about invalid code
Summary
Inheriting from an object that has a constraint allows the constraint of the base class to be broken without warning.
Description
In the following example, either
IEraseConstraint[T] = object of BaseClass[T]
for it's lack of verbosity orIEraseConstraint[int]()
for its breaking of base class constrains, should be a compile time error or warning.Alternatives
No response
Examples
No response
Backwards Compatibility
No response
Links
No response
The text was updated successfully, but these errors were encountered: