class MyInterface(Protocol):
def my_method(self, x: int) -> int:
...
class ConcreteImplementation(MyInterface):
def my_method(self, x: int) -> int: #
return x * 2
I believe this should be allowed on protocol classes (probably ABC's as well?).
Yes, I could just not inherit from the Protocol class, but I want to guard against not implementing all methods in a complex interface.
Describe the Bug
When type-checking the following, Pyrefly gives an error:
"Class member
ConcreteImplementation.my_methodoverrides a member in a parent class but is missing an@overridedecorator Pyrefly[missing-override-decorator]"I believe this should be allowed on protocol classes (probably ABC's as well?).
Yes, I could just not inherit from the Protocol class, but I want to guard against not implementing all methods in a complex interface.
Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeS4ATrgLYAEALqcROgOZ0Q3G6UN0AFag1wBjXFAA66aaKio4cOgFlSASXQMYlMKlEwAFENwjxUAJSJpdG3UwwwdGqQD6NGAwAWuTAbgwoMAAaOnxETk1zOgBaAD4IhnDCZOlrW3tHf3EsNw9vX39AkNJwuAZKKLi6MsoklJkGuQUlAGFcdFFKDxg1blh3TVQGCHaDVQ0tHT0YSzSbDKdXdy8fPwDg0PDWBkr47at0WyO6LoYAV0pD-DoAKjoAJmkQIJAyLrAoUkIRGigKAGJBKR3p9qhgcAQ6NlIGwLkMRuhCNJAQBlGAwOieBgMYhwRAAenxbwcn0IvDY%2BJg6HxmDEcHx0IgsMo8Pa%2BLoYF4dFQADdUNBUNhYFD2jC4cN2nRcMQJeg4Ej0GQVuhojztHAEXQALx0SQgADMhAAjI8QNIANraaiUOAAXWkZ3QXB4fBgmGimAgXVEwzV2roAHImeheDAA9IQwxol0AI5nL1u6IAaxgpGien0in9AYA7qhLuH0DQIIpWGxorg1ZRKBB7B6YOIWSJKP69VbeHqngBfF56X0wABi0BgFDQWDwRDIIC7QA
(Only applicable for extension issues) IDE Information
No response