mkorpela / overrides

A decorator to automatically detect mismatch when overriding a method
Apache License 2.0
261 stars 32 forks source link

Overrides breakes SOLID Liskov rule? #95

Closed hubertqtf closed 2 years ago

hubertqtf commented 2 years ago

My issue: https://stackoverflow.com/questions/71500063/overrides-gets-error-is-not-a-valid-parameter Basically, i have an automation test environment, and my method that overrides generic-abstract adds extra non-default argument. In case the argument has default, it works, but with positional one, EnforceOverrides fails. I couldn't find simmilar issue, so I am writing here.

mkorpela commented 2 years ago

The answer in the stackoverflow is correct https://stackoverflow.com/a/71500109 You are breaking the Liskov substitution principle.