This is incorrect, because it certainly violates the the principle of Liskov’s substitution.
In fact it seems that did not understand what the inheritance is for. It is not to eliminate repetitions, at most it is to have a DRY, which is different from not repeating.
First, if it is to eliminate repetition you must use composition and not inheritance. Inheritance should only be used when there is a relation of be a, that is to say, the derived class must be the same as the base class with something else. It must have nothing less, it must have nothing else. Inheritance at most eliminates repetition as a side effect.
Even the composition is to wonder if it should do so, probably should make a interface segregation, including because you are probably putting together unrelated things in fact.
This is ideal. The pragmatic knows when to violate everything and get more benefits than harm.
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful to you. You can also vote on any question or answer you find useful on the entire site.
– Maniero