-
Notifications
You must be signed in to change notification settings - Fork 293
Expand file tree
/
Copy pathoverloads_evaluation.toml
More file actions
58 lines (58 loc) · 4.97 KB
/
overloads_evaluation.toml
File metadata and controls
58 lines (58 loc) · 4.97 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
conformant = "Partial"
notes = """
Does not expand boolean arguments to Literal[True] and Literal[False].
Does not expand enum arguments to literal variants.
Does not expand tuple arguments to possible combinations.
Does not handle unpacked arguments when checking for parameter type equivalence.
Does not evaluate Any in some cases where overload is ambiguous.
Evaluates Any in some cases where overload is not ambiguous.
"""
conformance_automated = "Fail"
errors_diff = """
Line 135: Unexpected errors ['overloads_evaluation.py:135: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]']
Line 136: Unexpected errors ['overloads_evaluation.py:136: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]']
Line 161: Unexpected errors ['overloads_evaluation.py:161: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]']
Line 162: Unexpected errors ['overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]']
Line 205: Unexpected errors ['overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]']
Line 206: Unexpected errors ['overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [assert-type]']
Line 268: Unexpected errors ['overloads_evaluation.py:268: error: Expression is of type "list[Any]", not "Any" [assert-type]']
Line 284: Unexpected errors ['overloads_evaluation.py:284: error: Expression is of type "list[Any]", not "Any" [assert-type]']
Line 306: Unexpected errors ['overloads_evaluation.py:306: error: Expression is of type "Any", not "float" [assert-type]']
Line 350: Unexpected errors ['overloads_evaluation.py:350: error: Expression is of type "list[Any]", not "Any" [assert-type]']
Line 395: Unexpected errors ['overloads_evaluation.py:395: error: Expression is of type "Any", not "int" [assert-type]']
Line 439: Unexpected errors ['overloads_evaluation.py:439: error: Expression is of type "Any", not "bool" [assert-type]']
"""
output = """
overloads_evaluation.py:38: error: All overload variants of "example1_1" require at least one argument [call-overload]
overloads_evaluation.py:38: note: Possible overload variants:
overloads_evaluation.py:38: note: def example1_1(x: int, y: str) -> int
overloads_evaluation.py:38: note: def example1_1(x: str) -> str
overloads_evaluation.py:46: error: No overload variant of "example1_1" matches argument types "int", "int" [call-overload]
overloads_evaluation.py:46: note: Possible overload variants:
overloads_evaluation.py:46: note: def example1_1(x: int, y: str) -> int
overloads_evaluation.py:46: note: def example1_1(x: str) -> str
overloads_evaluation.py:51: error: No overload variant of "example1_1" matches argument type "int" [call-overload]
overloads_evaluation.py:51: note: Possible overload variants:
overloads_evaluation.py:51: note: def example1_1(x: int, y: str) -> int
overloads_evaluation.py:51: note: def example1_1(x: str) -> str
overloads_evaluation.py:116: error: Argument 1 to "example2" has incompatible type "int | str"; expected "int" [arg-type]
overloads_evaluation.py:116: error: Argument 2 to "example2" has incompatible type "int | str"; expected "str" [arg-type]
overloads_evaluation.py:135: error: No overload variant of "expand_bool" matches argument type "bool" [call-overload]
overloads_evaluation.py:135: note: Possible overload variants:
overloads_evaluation.py:135: note: def expand_bool(x: Literal[False]) -> Literal[0]
overloads_evaluation.py:135: note: def expand_bool(x: Literal[True]) -> Literal[1]
overloads_evaluation.py:136: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]
overloads_evaluation.py:161: error: No overload variant of "expand_enum" matches argument type "Color" [call-overload]
overloads_evaluation.py:161: note: Possible overload variants:
overloads_evaluation.py:161: note: def expand_enum(x: Literal[Color.RED]) -> Literal[0]
overloads_evaluation.py:161: note: def expand_enum(x: Literal[Color.BLUE]) -> Literal[1]
overloads_evaluation.py:162: error: Expression is of type "Any", not "Literal[0, 1]" [assert-type]
overloads_evaluation.py:205: error: Argument 1 to "expand_tuple" has incompatible type "tuple[int, int | str]"; expected "tuple[int, int]" [arg-type]
overloads_evaluation.py:206: error: Expression is of type "int", not "int | str" [assert-type]
overloads_evaluation.py:268: error: Expression is of type "list[Any]", not "Any" [assert-type]
overloads_evaluation.py:284: error: Expression is of type "list[Any]", not "Any" [assert-type]
overloads_evaluation.py:306: error: Expression is of type "Any", not "float" [assert-type]
overloads_evaluation.py:350: error: Expression is of type "list[Any]", not "Any" [assert-type]
overloads_evaluation.py:395: error: Expression is of type "Any", not "int" [assert-type]
overloads_evaluation.py:439: error: Expression is of type "Any", not "bool" [assert-type]
"""