Skip to content

Commit 7005b74

Browse files
authored
Allow highlighting decorators instead of function signatures (#1958)
1 parent b729bfc commit 7005b74

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

conformance/tests/classes_override.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ def method2(self, x: str) -> str:
4949
def method2(self, x: int | str) -> int | str: # OK
5050
return 0
5151

52-
@override
53-
def method3(self) -> int: # E: no matching signature in ancestor
52+
@override # E[method3]
53+
def method3(self) -> int: # E[method3]: no matching signature in ancestor
5454
return 1
5555

5656
@overload # E[method4]
@@ -61,7 +61,7 @@ def method4(self, x: int) -> int:
6161
def method4(self, x: str) -> str:
6262
...
6363

64-
@override
64+
@override # E[method4]
6565
def method4(self, x: int | str) -> int | str: # E[method4]: no matching signature in ancestor
6666
return 0
6767

@@ -75,18 +75,18 @@ def method5(self): # OK
7575
# > only normal methods but also @property, @staticmethod, and @classmethod.
7676

7777
@staticmethod
78-
@override
79-
def static_method1() -> int: # E: no matching signature in ancestor
78+
@override # E[static_method1]
79+
def static_method1() -> int: # E[static_method1]: no matching signature in ancestor
8080
return 1
8181

8282
@classmethod
83-
@override
84-
def class_method1(cls) -> int: # E: no matching signature in ancestor
83+
@override # E[class_method1]
84+
def class_method1(cls) -> int: # E[class_method1]: no matching signature in ancestor
8585
return 1
8686

8787
@property
88-
@override
89-
def property1(self) -> int: # E: no matching signature in ancestor
88+
@override # E[property1]
89+
def property1(self) -> int: # E[property1]: no matching signature in ancestor
9090
return 1
9191

9292

0 commit comments

Comments
 (0)