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