-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit
[mutable-override]
for covariant override of attribute with me…
…thod (#18058) Fixes #18052 Given: ```python # flags: --enable-error-code=mutable-override from typing import Callable class Parent: func: Callable[[str], None] class Child(Parent): def func(self, x: object) -> None: pass ``` Before: ``` Success: no issues found in 1 source file ``` After: ``` main.py:7 error: Covariant override of a mutable attribute (base class "Parent" defined the type as "Callable[[str], None]", override has type "Callable[[object], None]") Found 1 error in 1 file (checked 1 source file) ```
- Loading branch information
1 parent
80843fe
commit 7f09f0c
Showing
2 changed files
with
84 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters