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
Tweaked overload conformance tests to permit errors to appear in a few additional places (#1956)
Tweaked overload conformance tests to permit errors to appear in a few additional places.
Updated conformance results for pyright, which passes the overload conformance tests in the latest version.
Copy file name to clipboardExpand all lines: conformance/results/mypy/overloads_definitions.toml
+14-14
Original file line number
Diff line number
Diff line change
@@ -5,20 +5,20 @@ Does not allow an overload with no implementation in an abstract base class.
5
5
Allows @override to be on all overloads and implementation, instead of just implementation.
6
6
"""
7
7
errors_diff = """
8
-
Line 245: Expected 1 errors
9
-
Line 49: Unexpected errors ['overloads_definitions.py:49: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]']
Line 47: Unexpected errors ['overloads_definitions.py:47: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]']
10
10
"""
11
11
output = """
12
-
overloads_definitions.py:14: error: Single overload definition, multiple required [misc]
13
-
overloads_definitions.py:26: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
14
-
overloads_definitions.py:49: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
15
-
overloads_definitions.py:63: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
16
-
overloads_definitions.py:78: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc]
17
-
overloads_definitions.py:88: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc]
18
-
overloads_definitions.py:88: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc]
19
-
overloads_definitions.py:91: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc]
20
-
overloads_definitions.py:133: error: @final should be applied only to overload implementation [misc]
21
-
overloads_definitions.py:148: error: @final should be applied only to overload implementation [misc]
22
-
overloads_definitions.py:196: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc]
23
-
overloads_definitions.py:211: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc]
12
+
overloads_definitions.py:15: error: Single overload definition, multiple required [misc]
13
+
overloads_definitions.py:27: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
14
+
overloads_definitions.py:47: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
15
+
overloads_definitions.py:58: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
16
+
overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc]
17
+
overloads_definitions.py:81: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc]
18
+
overloads_definitions.py:81: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc]
19
+
overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc]
20
+
overloads_definitions.py:121: error: @final should be applied only to overload implementation [misc]
21
+
overloads_definitions.py:135: error: @final should be applied only to overload implementation [misc]
22
+
overloads_definitions.py:175: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc]
23
+
overloads_definitions.py:190: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc]
Line 40: Unexpected errors ['overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation.']
11
-
Line 51: Unexpected errors ['overloads_definitions.py:51:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.']
12
-
Line 128: Unexpected errors ['overloads_definitions.py:128:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
13
-
Line 239: Unexpected errors ['overloads_definitions.py:239:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
11
+
Line 49: Unexpected errors ['overloads_definitions.py:49:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.']
12
+
Line 117: Unexpected errors ['overloads_definitions.py:117:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
13
+
Line 215: Unexpected errors ['overloads_definitions.py:215:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
14
14
"""
15
15
output = """
16
-
overloads_definitions.py:15:0 Incompatible overload [43]: At least two overload signatures must be present.
17
-
overloads_definitions.py:27:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation.
16
+
overloads_definitions.py:16:0 Incompatible overload [43]: At least two overload signatures must be present.
17
+
overloads_definitions.py:28:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation.
18
18
overloads_definitions.py:40:4 Missing overload implementation [42]: Overloaded function `MyProto.func3` must have an implementation.
19
-
overloads_definitions.py:51:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.
20
-
overloads_definitions.py:64:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.not_abstract` must have an implementation.
21
-
overloads_definitions.py:80:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `80`.
22
-
overloads_definitions.py:85:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `85`.
23
-
overloads_definitions.py:88:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
24
-
overloads_definitions.py:97:4 Incompatible overload [43]: The implementation of `C.func6` does not accept all possible arguments of overload defined on line `97`.
25
-
overloads_definitions.py:97:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
26
-
overloads_definitions.py:128:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
27
-
overloads_definitions.py:139:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
28
-
overloads_definitions.py:204:4 Invalid override [40]: `overloads_definitions.Child.final_method` cannot override final method defined in `Base`.
29
-
overloads_definitions.py:220:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
30
-
overloads_definitions.py:220:4 Invalid override [40]: `overloads_definitions.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`.
31
-
overloads_definitions.py:239:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
19
+
overloads_definitions.py:49:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.func4` must have an implementation.
20
+
overloads_definitions.py:59:4 Missing overload implementation [42]: Overloaded function `MyAbstractBase.not_abstract` must have an implementation.
21
+
overloads_definitions.py:73:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `73`.
22
+
overloads_definitions.py:78:4 Incompatible overload [43]: The implementation of `C.func5` does not accept all possible arguments of overload defined on line `78`.
23
+
overloads_definitions.py:81:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
24
+
overloads_definitions.py:90:4 Incompatible overload [43]: The implementation of `C.func6` does not accept all possible arguments of overload defined on line `90`.
25
+
overloads_definitions.py:90:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
26
+
overloads_definitions.py:117:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
27
+
overloads_definitions.py:127:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
28
+
overloads_definitions.py:181:4 Invalid override [40]: `overloads_definitions.Child.final_method` cannot override final method defined in `Base`.
29
+
overloads_definitions.py:198:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
30
+
overloads_definitions.py:198:4 Invalid override [40]: `overloads_definitions.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`.
31
+
overloads_definitions.py:215:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
Line 75: Unexpected errors ['overloads_definitions_stub.pyi:75:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
12
-
Line 91: Unexpected errors ['overloads_definitions_stub.pyi:91:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
13
-
Line 146: Unexpected errors ['overloads_definitions_stub.pyi:146:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
14
-
Line 162: Unexpected errors ['overloads_definitions_stub.pyi:162:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
15
-
Line 174: Unexpected errors ['overloads_definitions_stub.pyi:174:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
Line 63: Unexpected errors ['overloads_definitions_stub.pyi:63:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
11
+
Line 76: Unexpected errors ['overloads_definitions_stub.pyi:76:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
12
+
Line 125: Unexpected errors ['overloads_definitions_stub.pyi:125:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
13
+
Line 138: Unexpected errors ['overloads_definitions_stub.pyi:138:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
16
14
"""
17
15
output = """
18
16
overloads_definitions_stub.pyi:14:0 Incompatible overload [43]: At least two overload signatures must be present.
19
-
overloads_definitions_stub.pyi:43:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
20
-
overloads_definitions_stub.pyi:52:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
21
-
overloads_definitions_stub.pyi:75:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
22
-
overloads_definitions_stub.pyi:91:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
23
-
overloads_definitions_stub.pyi:142:4 Invalid override [40]: `overloads_definitions_stub.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`.
24
-
overloads_definitions_stub.pyi:146:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
25
-
overloads_definitions_stub.pyi:162:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
26
-
overloads_definitions_stub.pyi:174:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
17
+
overloads_definitions_stub.pyi:37:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
18
+
overloads_definitions_stub.pyi:44:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
19
+
overloads_definitions_stub.pyi:63:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
20
+
overloads_definitions_stub.pyi:76:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
21
+
overloads_definitions_stub.pyi:122:4 Invalid override [40]: `overloads_definitions_stub.Child.bad_override` is decorated with @override, but no method of the same name exists in superclasses of `Child`.
22
+
overloads_definitions_stub.pyi:125:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
23
+
overloads_definitions_stub.pyi:138:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
24
+
overloads_definitions_stub.pyi:147:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
0 commit comments