You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| test.py:30:5:30:26 | Function Derived.meth3 | Overriding method 'meth3' has signature mismatch with $@. | test.py:11:5:11:20 | Function Base.meth3 | overridden method |
1
+
| test.py:24:5:24:26 | Function meth1 | This method requires 2 positional arguments, whereas overridden $@ requires 1. $@ correctly calls the base method, but does not match the signature of the overriding method. | test.py:5:5:5:20 | Function meth1 | Base.meth1 | test.py:15:9:15:20 | Attribute() | This call |
2
+
| test.py:27:5:27:20 | Function meth2 | This method requires 1 positional argument, whereas overridden $@ requires 2 positional arguments. $@ correctly calls the base method, but does not match the signature of the overriding method. | test.py:8:5:8:26 | Function meth2 | Base.meth2 | test.py:18:9:18:21 | Attribute() | This call |
3
+
| test.py:30:5:30:26 | Function meth3 | This method requires 2 positional arguments, whereas overridden $@ requires 1. | test.py:11:5:11:20 | Function meth3 | Base.meth3 | file://:0:0:0:0 | (none) | This call |
4
+
| test.py:69:5:69:24 | Function meth | This method requires 2 positional arguments, whereas overridden $@ requires 1. | test.py:64:5:64:19 | Function meth | BlameBase.meth | file://:0:0:0:0 | (none) | This call |
5
+
| test.py:74:5:74:24 | Function meth | This method requires 2 positional arguments, whereas overridden $@ requires 1. | test.py:64:5:64:19 | Function meth | BlameBase.meth | file://:0:0:0:0 | (none) | This call |
Copy file name to clipboardExpand all lines: python/ql/test/query-tests/Functions/overriding/test.py
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -21,13 +21,13 @@ def foo(self):
21
21
22
22
classDerived(Base):
23
23
24
-
defmeth1(self, spam):
24
+
defmeth1(self, spam):# $Alert[py/inheritance/signature-mismatch] # Has 1 more arg, base called in Base.foo
25
25
pass
26
26
27
-
defmeth2(self):
27
+
defmeth2(self):# $Alert[py/inheritance/signature-mismatch] # Has 1 fewer arg, base called in Base.foo
28
28
pass
29
29
30
-
defmeth3(self, eggs): #Incorrectly overridden and not called.
30
+
defmeth3(self, eggs): # $Alert[py/inheritance/signature-mismatch] # Has 1 more arg. Method is not called.
31
31
pass
32
32
33
33
defbar(self):
@@ -66,12 +66,12 @@ def meth(self):
66
66
67
67
classCorrect1(BlameBase):
68
68
69
-
defmeth(self, arg):
69
+
defmeth(self, arg):# $Alert[py/inheritance/signature-mismatch] # Has 1 more arg. The incorrect-overriden-method query would alert for the base method in this case.
70
70
pass
71
71
72
72
classCorrect2(BlameBase):
73
73
74
-
defmeth(self, arg):
74
+
defmeth(self, arg):# $Alert[py/inheritance/signature-mismatch] # Has 1 more arg
0 commit comments