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
overloads_basic.py:66: error: Single overload definition, multiple required [misc]
11
+
overloads_basic.py:78: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
12
+
overloads_basic.py:101: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
13
+
overloads_basic.py:116: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc]
14
+
overloads_basic.py:126: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc]
15
+
overloads_basic.py:126: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc]
16
+
overloads_basic.py:129: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc]
9
17
"""
10
-
conformance_automated = "Pass"
18
+
conformance_automated = "Fail"
11
19
errors_diff = """
20
+
Line 101: Unexpected errors ['overloads_basic.py:101: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]']
Does not allow an overload with no implementation in a Protocol or an abstract base class.
3
4
"""
4
5
output = """
5
-
overloads_basic.py:37:2 Incompatible parameter type [6]: In call `Bytes.__getitem__`, for 1st positional argument, expected `int` but got `str`.
6
-
overloads_basic.py:63:0 Incompatible overload [43]: At least two overload signatures must be present.
7
-
overloads_basic.py:75:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation.
6
+
overloads_basic.py:41:2 Incompatible parameter type [6]: In call `Bytes.__getitem__`, for 1st positional argument, expected `int` but got `str`.
7
+
overloads_basic.py:67:0 Incompatible overload [43]: At least two overload signatures must be present.
8
+
overloads_basic.py:79:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation.
9
+
overloads_basic.py:92:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation.
10
+
overloads_basic.py:102:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.
11
+
overloads_basic.py:118:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `118`.
12
+
overloads_basic.py:123:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `123`.
13
+
overloads_basic.py:126:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
14
+
overloads_basic.py:131:4 Incompatible overload [43]: The implementation of `C.func6` does not accept all possible arguments of overload defined on line `131`.
15
+
overloads_basic.py:136:4 Incompatible overload [43]: The implementation of `C.func6` does not accept all possible arguments of overload defined on line `136`.
16
+
overloads_basic.py:139:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
8
17
"""
9
-
conformance_automated = "Pass"
18
+
conformance_automated = "Fail"
10
19
errors_diff = """
20
+
Line 92: Unexpected errors ['overloads_basic.py:92:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation.']
21
+
Line 102: Unexpected errors ['overloads_basic.py:102:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.']
Does not allow an overload with no implementation in an abstract base class.
4
+
"""
2
5
output = """
3
-
overloads_basic.py:37:1 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue)
4
-
overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice[Any, Any, Any]" in function "__getitem__"
6
+
overloads_basic.py:41:1 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue)
7
+
overloads_basic.py:41:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice[Any, Any, Any]" in function "__getitem__"
5
8
"Literal['']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType)
6
-
overloads_basic.py:63:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload)
7
-
overloads_basic.py:75:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation)
9
+
overloads_basic.py:67:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload)
10
+
overloads_basic.py:79:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation)
11
+
overloads_basic.py:102:9 - error: "func4" is marked as overload, but no implementation is provided (reportNoOverloadImplementation)
12
+
overloads_basic.py:118:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload)
13
+
overloads_basic.py:126:9 - error: Overloaded implementation is not consistent with signature of overload 1
14
+
Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: int) -> int"
15
+
Parameter name mismatch: "x" versus "self"
16
+
Parameter 1: type "int" is incompatible with type "Self@C"
17
+
Type "int" is not assignable to type "Self@C"
18
+
Extra parameter "x" (reportInconsistentOverload)
19
+
overloads_basic.py:126:9 - error: Overloaded implementation is not consistent with signature of overload 2
20
+
Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: str) -> str"
21
+
Parameter name mismatch: "x" versus "self"
22
+
Parameter 1: type "str" is incompatible with type "Self@C"
23
+
Type "str" is not assignable to type "Self@C"
24
+
Extra parameter "x" (reportInconsistentOverload)
25
+
overloads_basic.py:131:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload)
26
+
overloads_basic.py:139:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
8
27
"""
9
-
conformance_automated = "Pass"
28
+
conformance_automated = "Fail"
10
29
errors_diff = """
30
+
Line 102: Unexpected errors ['overloads_basic.py:102:9 - error: "func4" is marked as overload, but no implementation is provided (reportNoOverloadImplementation)']
Copy file name to clipboardExpand all lines: conformance/results/pytype/overloads_basic.toml
+36-7Lines changed: 36 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -2,28 +2,57 @@ conformant = "Partial"
2
2
notes = """
3
3
Does not reject a function with a single @overload signature.
4
4
Does not reject a function with @overload signature but no implementation.
5
+
Does not allow an overload with no implementation in a Protocol or an abstract base class.
6
+
Does not exempt overloads from checking of return type in body, when also decorated with `@staticmethod`.
7
+
Does not error on overloads inconsistently decorated with `@staticmethod` or `@classmethod`.
5
8
"""
6
9
output = """
7
-
overloads_basic.py:31:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __getitem__: bad return type [bad-return-type]
10
+
overloads_basic.py:35:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __getitem__: bad return type [bad-return-type]
8
11
9
12
return b""
10
13
\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m
11
14
12
-
overloads_basic.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <module>: unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands]
15
+
overloads_basic.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <module>: unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands]
13
16
14
17
b[""] # E: no matching overload
15
18
\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m
16
19
17
-
overloads_basic.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in map: bad return type [bad-return-type]
20
+
overloads_basic.py:62:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in map: bad return type [bad-return-type]
18
21
19
22
pass
20
23
\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m
21
24
25
+
overloads_basic.py:98:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable]
26
+
27
+
...
28
+
\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m
29
+
30
+
overloads_basic.py:108:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable]
31
+
32
+
...
33
+
\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m
34
+
35
+
overloads_basic.py:119:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type]
36
+
37
+
...
38
+
\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m
39
+
40
+
overloads_basic.py:124:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: bad return type [bad-return-type]
41
+
42
+
...
43
+
\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m
44
+
22
45
"""
23
46
conformance_automated = "Fail"
24
47
errors_diff = """
25
-
Lines 62, 63: Expected error (tag 'func1')
26
-
Lines 74, 75: Expected error (tag 'func2')
27
-
Line 31: Unexpected errors ['overloads_basic.py:31:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __getitem__: bad return type [bad-return-type]']
28
-
Line 58: Unexpected errors ['overloads_basic.py:58:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in map: bad return type [bad-return-type]']
Line 35: Unexpected errors ['overloads_basic.py:35:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __getitem__: bad return type [bad-return-type]']
53
+
Line 62: Unexpected errors ['overloads_basic.py:62:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in map: bad return type [bad-return-type]']
54
+
Line 98: Unexpected errors ["overloads_basic.py:98:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: @typing.overload-decorated 'MyProto.func3' object is not callable [not-callable]"]
55
+
Line 108: Unexpected errors ["overloads_basic.py:108:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: @typing.overload-decorated 'MyAbstractBase.func4' object is not callable [not-callable]"]
56
+
Line 119: Unexpected errors ['overloads_basic.py:119:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]']
57
+
Line 124: Unexpected errors ['overloads_basic.py:124:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: bad return type [bad-return-type]']
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not reject a function with a single @overload signature.</p><p>Does not reject a function with @overload signature but no implementation.</p></span></div></th>
670
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not allow an overload with no implementation in an abstract base class.</p></span></div></th>
671
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not allow an overload with no implementation in an abstract base class.</p></span></div></th>
672
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not allow an overload with no implementation in a Protocol or an abstract base class.</p></span></div></th>
673
+
<thclass="column col2 partially-conformant"><divclass="hover-text">Partial<spanclass="tooltip-text" id="bottom"><p>Does not reject a function with a single @overload signature.</p><p>Does not reject a function with @overload signature but no implementation.</p><p>Does not allow an overload with no implementation in a Protocol or an abstract base class.</p><p>Does not exempt overloads from checking of return type in body, when also decorated with `@staticmethod`.</p><p>Does not error on overloads inconsistently decorated with `@staticmethod`.</p></span></div></th>
0 commit comments