class A:
def foo() -> int:
return 42
class B(A):
def foo() -> int: # bad-override
return 100
ERROR sandbox.py:16:9-12: Class member `B.foo` overrides parent class `A` in an inconsistent manner [[bad-override](https://pyrefly.org/en/docs/error-kinds/#bad-override)]
`B.foo` has type `() -> int`, which is not assignable to `() -> int`, the type of `A.foo`
Describe the Bug
Pyrefly errors on the following:
with
The above error go away if we add
self(or any other parameter) to both functions. Also, annotating them with@staticmethodmakes the error goes away. Maybe, pyrefly is injecting some thing under the hood to make these fail?Sandbox Link
https://pyrefly.org/sandbox/?project=N4IgZglgNgpgziAXKOBDAdgEwEYHsAeAdAA4CeSIAxAAQDqMUAxrgLYzUAuunAFuwAqkATjDBRS1AMoYcBADS8IcakuqpqxVAHMYAHXQ0A7nxHVSuAK7VGGaoaEQOMBXB6pTM6rHfo1eCxycpMQQ6FoqvoIcPLjohPqUCdQAEjAeHtaWxLDUYDCoHBYiyrhgispoWHj4iEkAtNQA4jCBIqhQdRwQbEHE7Ix8jADWoeF5MDiow-XUAKpw7CIAbvlQAPocwTAAFACUnNyhcH2MgaF5QiKYvfAzMPh9DmzogYaOPLzsAJIAIgCiuXyhWKvAKdnYcAsxGIuCEgW2MEIWkIagCuGYLGyLWc1C0uE6%2BMwolCjggsQUMRWQgULUYuxmtAcTjUWGoQgskVI0VimSJ1EwEBEp3EETMliE1GwQlwhgWQn0%2BjA0pYvVGKkxsMCACp9IwoKg4MoAIK1XzUc1EspgXC4PbUOoAPgiHFN5rdbpEwN8ABYAEwK9B6g3KABC2yNu1dbstuRtdsdzqj7vNnqKvgAjAAGTMBkByEBkERiUiELgsKAUGiCIsiyqyfCZdCQLRFApkuJJSQwdg8DgcYhwRAAeiHhdE4kIsK0Q5g6CHmHRcCHzCbEBbQjbsSHsYlqCWqGgqGwORXzdbXR5uGIF-QcHi6DI3PQdSpcHb1AAvNRdCAAMyEdN-RAfQ8xAAJoDvMhKzmLooEcCQwA5U52zgAMY2tIQWAKNZ0AsFhsDSbYamdfYEzgDghCTNkWjTXIfwAOTwgjKOoYB8AAXx-ED2PzKYuhWAAxaAYAoOtqhIch2KAA
(Only applicable for extension issues) IDE Information
No response