Skip to content

Commit 484b03c

Browse files
committed
rename overloads_invalid to overloads_definitions
1 parent 5eabe53 commit 484b03c

File tree

12 files changed

+161
-160
lines changed

12 files changed

+161
-160
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
conformant = "Partial"
2+
conformance_automated = "Fail"
3+
notes = """
4+
Does not allow an overload with no implementation in an abstract base class.
5+
"""
6+
errors_diff = """
7+
Line 49: Unexpected errors ['overloads_definitions.py:49: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]']
8+
Line 202: Unexpected errors ['overloads_definitions.py:202: error: Signature of "good_override" incompatible with supertype "Base" [override]']
9+
"""
10+
output = """
11+
overloads_definitions.py:14: error: Single overload definition, multiple required [misc]
12+
overloads_definitions.py:26: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
13+
overloads_definitions.py:49: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
14+
overloads_definitions.py:63: error: An overloaded function outside a stub file must have an implementation [no-overload-impl]
15+
overloads_definitions.py:78: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc]
16+
overloads_definitions.py:88: error: Overloaded function implementation does not accept all possible arguments of signature 1 [misc]
17+
overloads_definitions.py:88: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc]
18+
overloads_definitions.py:91: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc]
19+
overloads_definitions.py:133: error: @final should be applied only to overload implementation [misc]
20+
overloads_definitions.py:148: error: @final should be applied only to overload implementation [misc]
21+
overloads_definitions.py:176: error: Cannot override final attribute "final_method" (previously declared in base class "Base") [misc]
22+
overloads_definitions.py:176: error: Signature of "final_method" incompatible with supertype "Base" [override]
23+
overloads_definitions.py:176: note: Superclass:
24+
overloads_definitions.py:176: note: @overload
25+
overloads_definitions.py:176: note: def final_method(self, x: int) -> int
26+
overloads_definitions.py:176: note: @overload
27+
overloads_definitions.py:176: note: def final_method(self, x: str) -> str
28+
overloads_definitions.py:176: note: Subclass:
29+
overloads_definitions.py:176: note: def final_method(self, x: int | str) -> int | str
30+
overloads_definitions.py:183: error: Method "bad_override" is marked as an override, but no base method was found with this name [misc]
31+
overloads_definitions.py:202: error: Signature of "good_override" incompatible with supertype "Base" [override]
32+
overloads_definitions.py:202: note: Superclass:
33+
overloads_definitions.py:202: note: def good_override(self, x: int | str) -> int | str
34+
overloads_definitions.py:202: note: Subclass:
35+
overloads_definitions.py:202: note: @overload
36+
overloads_definitions.py:202: note: def good_override(self, x: int) -> int
37+
overloads_definitions.py:202: note: @overload
38+
overloads_definitions.py:202: note: def good_override(self, x: str) -> str
39+
overloads_definitions.py:217: error: Signature of "to_override" incompatible with supertype "Base" [override]
40+
overloads_definitions.py:217: note: Superclass:
41+
overloads_definitions.py:217: note: def to_override(self, x: int | str) -> int | str
42+
overloads_definitions.py:217: note: Subclass:
43+
overloads_definitions.py:217: note: @overload
44+
overloads_definitions.py:217: note: def to_override(self, x: int) -> int
45+
overloads_definitions.py:217: note: @overload
46+
overloads_definitions.py:217: note: def to_override(self, x: str) -> str
47+
"""

conformance/results/mypy/overloads_invalid.toml

Lines changed: 0 additions & 47 deletions
This file was deleted.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
conformant = "Partial"
2+
conformance_automated = "Fail"
3+
notes = """
4+
Does not allow an overload with no implementation in a Protocol or an abstract base class.
5+
Expects @final/@override on all overloads and implementation, instead of implementation only.
6+
"""
7+
errors_diff = """
8+
Line 217: Expected 1 errors
9+
Lines 148, 150: Expected error (tag 'invalid_final_2')
10+
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 211: Unexpected errors ['overloads_definitions.py:211:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
14+
"""
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.
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:176:4 Invalid override [40]: `overloads_definitions.Child.final_method` cannot override final method defined in `Base`.
29+
overloads_definitions.py:192:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
30+
overloads_definitions.py:192: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:211:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
32+
"""

conformance/results/pyre/overloads_invalid.toml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
conformant = "Partial"
2+
notes = """
3+
Allows @final/@override on all overloads and implementation; should be implementation-only.
4+
"""
5+
conformance_automated = "Fail"
6+
errors_diff = """
7+
Line 217: Expected 1 errors
8+
Lines 148, 150: Expected error (tag 'invalid_final_2')
9+
"""
10+
output = """
11+
overloads_definitions.py:15:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload)
12+
overloads_definitions.py:27:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation)
13+
overloads_definitions.py:64:9 - error: "not_abstract" is marked as overload, but no implementation is provided (reportNoOverloadImplementation)
14+
overloads_definitions.py:80:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload)
15+
overloads_definitions.py:88:9 - error: Overloaded implementation is not consistent with signature of overload 1
16+
  Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: int) -> int"
17+
    Parameter name mismatch: "x" versus "self"
18+
    Parameter 1: type "int" is incompatible with type "Self@C"
19+
      Type "int" is not assignable to type "Self@C"
20+
    Extra parameter "x" (reportInconsistentOverload)
21+
overloads_definitions.py:88:9 - error: Overloaded implementation is not consistent with signature of overload 2
22+
  Type "(self: Self@C, x: int | str) -> (int | str)" is not assignable to type "(x: str) -> str"
23+
    Parameter name mismatch: "x" versus "self"
24+
    Parameter 1: type "str" is incompatible with type "Self@C"
25+
      Type "str" is not assignable to type "Self@C"
26+
    Extra parameter "x" (reportInconsistentOverload)
27+
overloads_definitions.py:93:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload)
28+
overloads_definitions.py:97:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
29+
overloads_definitions.py:135:9 - error: Overload for "invalid_final" is marked @final but implementation is not (reportInconsistentOverload)
30+
overloads_definitions.py:176:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride)
31+
overloads_definitions.py:176:9 - error: Method "final_method" overrides class "Base" in an incompatible manner
32+
  Return type mismatch: base method returns type "int", override returns type "int | str"
33+
    Type "int | str" is not assignable to type "int"
34+
      "str" is not assignable to "int" (reportIncompatibleMethodOverride)
35+
overloads_definitions.py:192:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues)
36+
"""

conformance/results/pyright/overloads_invalid.toml

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
version = "pyright 1.1.391"
2-
test_duration = 1.6
2+
test_duration = 1.5

0 commit comments

Comments
 (0)