Skip to content

Commit babbc6d

Browse files
committed
Fixed bug in conformance test.
Updated conformance results for latest versions of type checkers. Removed outdated references to "overlapping overloads" in spec.
1 parent f292575 commit babbc6d

18 files changed

+55
-123
lines changed

conformance/results/mypy/overloads_consistency.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ conformance_automated = "Pass"
33
errors_diff = """
44
"""
55
output = """
6-
overloads_consistency.py:27: error: Overloaded function implementation cannot produce return type of signature 2 [misc]
7-
overloads_consistency.py:43: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc]
6+
overloads_consistency.py:28: error: Overloaded function implementation cannot produce return type of signature 2 [misc]
7+
overloads_consistency.py:44: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc]
88
"""

conformance/results/mypy/overloads_overlap.toml

Lines changed: 0 additions & 8 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 = "mypy 1.15.0"
2-
test_duration = 1.7
2+
test_duration = 1.6

conformance/results/pyre/overloads_consistency.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ Does not apply decorator transforms before checking overload consistency.
44
"""
55
conformance_automated = "Fail"
66
errors_diff = """
7-
Line 107: Unexpected errors ['overloads_consistency.py:107:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`None`) is incompatible with the return type of the implementation (`bytes`).', 'overloads_consistency.py:107:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `107`.']
8-
Line 111: Unexpected errors ['overloads_consistency.py:111:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`str`) is incompatible with the return type of the implementation (`bytes`).', 'overloads_consistency.py:111:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `111`.', 'overloads_consistency.py:111:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
7+
Line 108: Unexpected errors ['overloads_consistency.py:108:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`None`) is incompatible with the return type of the implementation (`bytes`).', 'overloads_consistency.py:108:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `108`.']
8+
Line 112: Unexpected errors ['overloads_consistency.py:112:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`str`) is incompatible with the return type of the implementation (`bytes`).', 'overloads_consistency.py:112:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `112`.', 'overloads_consistency.py:112:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).']
99
"""
1010
output = """
11-
overloads_consistency.py:24:0 Incompatible overload [43]: The return type of overloaded function `return_type` (`str`) is incompatible with the return type of the implementation (`int`).
12-
overloads_consistency.py:40:0 Incompatible overload [43]: The implementation of `parameter_type` does not accept all possible arguments of overload defined on line `40`.
13-
overloads_consistency.py:107:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`None`) is incompatible with the return type of the implementation (`bytes`).
14-
overloads_consistency.py:107:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `107`.
15-
overloads_consistency.py:111:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`str`) is incompatible with the return type of the implementation (`bytes`).
16-
overloads_consistency.py:111:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `111`.
17-
overloads_consistency.py:111:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
11+
overloads_consistency.py:25:0 Incompatible overload [43]: The return type of overloaded function `return_type` (`str`) is incompatible with the return type of the implementation (`int`).
12+
overloads_consistency.py:41:0 Incompatible overload [43]: The implementation of `parameter_type` does not accept all possible arguments of overload defined on line `41`.
13+
overloads_consistency.py:108:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`None`) is incompatible with the return type of the implementation (`bytes`).
14+
overloads_consistency.py:108:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `108`.
15+
overloads_consistency.py:112:0 Incompatible overload [43]: The return type of overloaded function `decorated` (`str`) is incompatible with the return type of the implementation (`bytes`).
16+
overloads_consistency.py:112:0 Incompatible overload [43]: The implementation of `decorated` does not accept all possible arguments of overload defined on line `112`.
17+
overloads_consistency.py:112:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).
1818
"""

conformance/results/pyre/overloads_overlap.toml

Lines changed: 0 additions & 11 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 = "pyre 0.9.23"
2-
test_duration = 6.8
2+
test_duration = 7.4

conformance/results/pyright/overloads_consistency.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ conformance_automated = "Pass"
33
errors_diff = """
44
"""
55
output = """
6-
overloads_consistency.py:27:5 - error: Overloaded implementation is not consistent with signature of overload 2
6+
overloads_consistency.py:28:5 - error: Overloaded implementation is not consistent with signature of overload 2
77
  Function return type "str" is incompatible with type "int"
88
    "str" is not assignable to "int" (reportInconsistentOverload)
9-
overloads_consistency.py:43:5 - error: Overloaded implementation is not consistent with signature of overload 2
9+
overloads_consistency.py:44:5 - error: Overloaded implementation is not consistent with signature of overload 2
1010
  Type "(x: int) -> (int | str)" is not assignable to type "(x: str) -> str"
1111
    Parameter 1: type "str" is incompatible with type "int"
1212
      "str" is not assignable to "int" (reportInconsistentOverload)

conformance/results/pyright/overloads_definitions.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ Allows @final/@override on all overloads and implementation; should be implement
55
conformance_automated = "Fail"
66
errors_diff = """
77
Line 245: Expected 1 errors
8-
Lines 148, 150: Expected error (tag 'invalid_final_2')
8+
Line 155: Unexpected errors ['overloads_definitions.py:155:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload)']
9+
Line 247: Unexpected errors ['overloads_definitions.py:247:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload)']
10+
Line 252: Unexpected errors ['overloads_definitions.py:252:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload)']
911
"""
1012
output = """
1113
overloads_definitions.py:15:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload)
@@ -26,7 +28,11 @@ overloads_definitions.py:88:9 - error: Overloaded implementation is not consiste
2628
    Extra parameter "x" (reportInconsistentOverload)
2729
overloads_definitions.py:93:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload)
2830
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)
31+
overloads_definitions.py:135:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload)
32+
overloads_definitions.py:150:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload)
33+
overloads_definitions.py:155:9 - error: @final decorator should be applied only to the implementation (reportInconsistentOverload)
3034
overloads_definitions.py:204:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride)
3135
overloads_definitions.py:220:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues)
36+
overloads_definitions.py:247:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload)
37+
overloads_definitions.py:252:9 - error: @override decorator should be applied only to the implementation (reportInconsistentOverload)
3238
"""

conformance/results/pyright/overloads_definitions_stub.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,19 @@ Does not enforce @override when correctly used with an overloaded method in a st
66
conformance_automated = "Fail"
77
errors_diff = """
88
Line 168: Expected 1 errors
9-
Lines 80, 82, 85, 87: Expected error (tag 'invalid_final')
109
Lines 96, 98, 101: Expected error (tag 'invalid_final_2')
11-
Lines 140, 142: Expected error (tag 'bad_override')
10+
Line 103: Unexpected errors ['overloads_definitions_stub.pyi:103:9 - error: Only the first overload should be marked @final (reportInconsistentOverload)']
11+
Line 174: Unexpected errors ['overloads_definitions_stub.pyi:174:9 - error: Only the first overload should be marked @override (reportInconsistentOverload)']
1212
"""
1313
output = """
1414
overloads_definitions_stub.pyi:14:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload)
1515
overloads_definitions_stub.pyi:38:9 - error: Overloads for "func5" use @staticmethod inconsistently (reportInconsistentOverload)
1616
overloads_definitions_stub.pyi:38:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
1717
overloads_definitions_stub.pyi:48:9 - error: Overloads for "func6" use @classmethod inconsistently (reportInconsistentOverload)
1818
overloads_definitions_stub.pyi:52:15 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)
19+
overloads_definitions_stub.pyi:87:9 - error: Only the first overload should be marked @final (reportInconsistentOverload)
20+
overloads_definitions_stub.pyi:103:9 - error: Only the first overload should be marked @final (reportInconsistentOverload)
1921
overloads_definitions_stub.pyi:133:9 - error: Method "final_method" cannot override final method defined in class "Base" (reportIncompatibleMethodOverride)
22+
overloads_definitions_stub.pyi:142:9 - error: Method "bad_override" is marked as override, but no base method of same name is present (reportGeneralTypeIssues)
23+
overloads_definitions_stub.pyi:174:9 - error: Only the first overload should be marked @override (reportInconsistentOverload)
2024
"""

conformance/results/pyright/overloads_evaluation.toml

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,8 @@ Does not expand enum arguments to literal variants.
55
Does not expand tuple arguments to possible combinations.
66
Does not prefer variadic match to indeterminate-length unpacked argument.
77
"""
8-
conformance_automated = "Fail"
8+
conformance_automated = "Pass"
99
errors_diff = """
10-
Line 106: Unexpected errors ['overloads_evaluation.py:106:12 - error: No overloads for "expand_bool" match the provided arguments (reportCallIssue)', 'overloads_evaluation.py:106:24 - error: Argument of type "bool" cannot be assigned to parameter "x" of type "Literal[True]" in function "expand_bool"']
11-
Line 107: Unexpected errors ['overloads_evaluation.py:107:17 - error: "assert_type" mismatch: expected "Literal[0, 1]" but received "Unknown" (reportAssertTypeFailure)']
12-
Line 129: Unexpected errors ['overloads_evaluation.py:129:12 - error: No overloads for "expand_enum" match the provided arguments (reportCallIssue)', 'overloads_evaluation.py:129:24 - error: Argument of type "Color" cannot be assigned to parameter "x" of type "Literal[Color.BLUE]" in function "expand_enum"']
13-
Line 130: Unexpected errors ['overloads_evaluation.py:130:17 - error: "assert_type" mismatch: expected "Literal[0, 1]" but received "Unknown" (reportAssertTypeFailure)']
14-
Line 169: Unexpected errors ['overloads_evaluation.py:169:12 - error: No overloads for "expand_tuple" match the provided arguments (reportCallIssue)', 'overloads_evaluation.py:169:29 - error: Argument of type "tuple[Literal[1], int | str]" cannot be assigned to parameter "x" of type "tuple[int, str]" in function "expand_tuple"']
15-
Line 170: Unexpected errors ['overloads_evaluation.py:170:17 - error: "assert_type" mismatch: expected "int | str" but received "Unknown" (reportAssertTypeFailure)']
16-
Line 196: Unexpected errors ['overloads_evaluation.py:196:17 - error: "assert_type" mismatch: expected "int" but received "str" (reportAssertTypeFailure)']
1710
"""
1811
output = """
1912
overloads_evaluation.py:32:1 - error: No overloads for "example1" match the provided arguments
@@ -29,18 +22,4 @@ overloads_evaluation.py:89:14 - error: Argument of type "int | str" cannot be as
2922
overloads_evaluation.py:89:17 - error: Argument of type "int | str" cannot be assigned to parameter "y" of type "int" in function "example2"
3023
  Type "int | str" is not assignable to type "int"
3124
    "str" is not assignable to "int" (reportArgumentType)
32-
overloads_evaluation.py:106:12 - error: No overloads for "expand_bool" match the provided arguments (reportCallIssue)
33-
overloads_evaluation.py:106:24 - error: Argument of type "bool" cannot be assigned to parameter "x" of type "Literal[True]" in function "expand_bool"
34-
  "bool" is not assignable to type "Literal[True]" (reportArgumentType)
35-
overloads_evaluation.py:107:17 - error: "assert_type" mismatch: expected "Literal[0, 1]" but received "Unknown" (reportAssertTypeFailure)
36-
overloads_evaluation.py:129:12 - error: No overloads for "expand_enum" match the provided arguments (reportCallIssue)
37-
overloads_evaluation.py:129:24 - error: Argument of type "Color" cannot be assigned to parameter "x" of type "Literal[Color.BLUE]" in function "expand_enum"
38-
  "Color" is not assignable to type "Literal[Color.BLUE]" (reportArgumentType)
39-
overloads_evaluation.py:130:17 - error: "assert_type" mismatch: expected "Literal[0, 1]" but received "Unknown" (reportAssertTypeFailure)
40-
overloads_evaluation.py:169:12 - error: No overloads for "expand_tuple" match the provided arguments (reportCallIssue)
41-
overloads_evaluation.py:169:29 - error: Argument of type "tuple[Literal[1], int | str]" cannot be assigned to parameter "x" of type "tuple[int, str]" in function "expand_tuple"
42-
  Type "int | str" is not assignable to type "str"
43-
    "int" is not assignable to "str" (reportArgumentType)
44-
overloads_evaluation.py:170:17 - error: "assert_type" mismatch: expected "int | str" but received "Unknown" (reportAssertTypeFailure)
45-
overloads_evaluation.py:196:17 - error: "assert_type" mismatch: expected "int" but received "str" (reportAssertTypeFailure)
4625
"""

0 commit comments

Comments
 (0)