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
Updated conformance results for pyright 1.1.364. (#1744)
This version of pyright fixes one conformance issue detected by the "dataclasses_final" test. It also rewords some existing error messages, which accounts for the other changes.
Fixed a recent regression in the "dataclasses_final" test due to auto-formatting.
Copy file name to clipboardExpand all lines: conformance/results/mypy/dataclasses_final.toml
+1-5Lines changed: 1 addition & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -6,13 +6,9 @@ Doesn't support Final nested inside ClassVar.
6
6
conformance_automated = "Fail"
7
7
errors_diff = """
8
8
Line 27: Expected 1 errors
9
-
Line 38: Expected 1 errors
10
-
Line 41: Expected 1 errors
11
9
Line 16: Unexpected errors ['dataclasses_final.py:16: error: Final name must be initialized with a value [misc]']
12
10
Line 18: Unexpected errors ['dataclasses_final.py:18: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]']
13
11
Line 24: Unexpected errors ['dataclasses_final.py:24: error: Expression is of type "Any", not "int" [assert-type]']
14
-
Line 37: Unexpected errors ['dataclasses_final.py:37: error: Cannot access final instance attribute "final_no_default" on class object [misc]', 'dataclasses_final.py:37: error: Cannot assign to final attribute "final_no_default" [misc]']
15
-
Line 40: Unexpected errors ['dataclasses_final.py:40: error: Cannot assign to final attribute "final_with_default" [misc]']
16
12
"""
17
13
output = """
18
14
dataclasses_final.py:16: error: Final name must be initialized with a value [misc]
@@ -22,5 +18,5 @@ dataclasses_final.py:35: error: Cannot assign to final attribute "final_no_defau
22
18
dataclasses_final.py:36: error: Cannot assign to final attribute "final_with_default" [misc]
23
19
dataclasses_final.py:37: error: Cannot access final instance attribute "final_no_default" on class object [misc]
24
20
dataclasses_final.py:37: error: Cannot assign to final attribute "final_no_default" [misc]
25
-
dataclasses_final.py:40: error: Cannot assign to final attribute "final_with_default" [misc]
21
+
dataclasses_final.py:38: error: Cannot assign to final attribute "final_with_default" [misc]
Copy file name to clipboardExpand all lines: conformance/results/pyre/dataclasses_final.toml
+1-5Lines changed: 1 addition & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -4,12 +4,8 @@ Mis-handles Final nested inside ClassVar.
4
4
"""
5
5
conformance_automated = "Fail"
6
6
errors_diff = """
7
-
Line 38: Expected 1 errors
8
-
Line 41: Expected 1 errors
9
7
Line 18: Unexpected errors ['dataclasses_final.py:18:4 Incompatible attribute type [8]: Attribute `final_classvar` declared in class `D` has type `Final[int]` but is used as type `int`.', 'dataclasses_final.py:18:4 Invalid type [31]: Expression `Final[int]` is not a valid type. Final cannot be nested.']
10
8
Line 24: Unexpected errors ['dataclasses_final.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Final[int]`.']
11
-
Line 37: Unexpected errors ['dataclasses_final.py:37:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_no_default`.']
12
-
Line 40: Unexpected errors ['dataclasses_final.py:40:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_with_default`.']
13
9
"""
14
10
output = """
15
11
dataclasses_final.py:18:4 Incompatible attribute type [8]: Attribute `final_classvar` declared in class `D` has type `Final[int]` but is used as type `int`.
Line 18: Unexpected errors ['dataclasses_final.py:18:30 - error: "Final" is not allowed in this context', 'dataclasses_final.py:18:44 - error: Expression of type "Literal[4]" is incompatible with declared type "Final"']
10
-
Line 24: Unexpected errors ['dataclasses_final.py:24:13 - error: "assert_type" mismatch: expected "int" but received "Final" (reportAssertTypeFailure)']
11
-
Line 37: Unexpected errors ['dataclasses_final.py:37:3 - error: Cannot assign to attribute "final_no_default" for class "type[D]"']
12
-
Line 40: Unexpected errors ['dataclasses_final.py:40:3 - error: Cannot assign to attribute "final_with_default" for class "type[D]"']
13
4
"""
14
5
output = """
15
-
dataclasses_final.py:18:30 - error: "Final" is not allowed in this context
16
-
dataclasses_final.py:18:44 - error: Expression of type "Literal[4]" is incompatible with declared type "Final"
17
-
"Literal[4]" is incompatible with "Final" (reportAssignmentType)
18
-
dataclasses_final.py:24:13 - error: "assert_type" mismatch: expected "int" but received "Final" (reportAssertTypeFailure)
19
-
dataclasses_final.py:27:20 - error: Cannot assign to attribute "final_classvar" for class "type[D]"
20
-
"Literal[10]" is incompatible with "Final" (reportAttributeAccessIssue)
6
+
dataclasses_final.py:27:3 - error: Cannot assign to attribute "final_classvar" for class "type[D]"
7
+
"final_classvar" is declared as Final and cannot be reassigned
8
+
Attribute "__set__" is unknown (reportAttributeAccessIssue)
21
9
dataclasses_final.py:35:3 - error: Cannot assign to attribute "final_no_default" for class "D"
22
10
"final_no_default" is declared as Final and cannot be reassigned
23
11
Attribute "__set__" is unknown (reportAttributeAccessIssue)
Copy file name to clipboardExpand all lines: conformance/results/pyright/qualifiers_annotated.toml
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -17,9 +17,9 @@ qualifiers_annotated.py:52:18 - error: Expected type expression but received "Li
17
17
qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm)
18
18
qualifiers_annotated.py:54:18 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues)
19
19
qualifiers_annotated.py:64:8 - error: Expected one type argument and one or more annotations for "Annotated"
20
-
qualifiers_annotated.py:76:24 - error: Expression of type "type[int]" is incompatible with declared type "type[Any]" (reportAssignmentType)
20
+
qualifiers_annotated.py:76:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType)
21
21
qualifiers_annotated.py:77:24 - error: Expression of type "SmallInt" is incompatible with declared type "type[Any]" (reportAssignmentType)
22
-
qualifiers_annotated.py:84:7 - error: Argument of type "type[str]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType)
22
+
qualifiers_annotated.py:84:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType)
23
23
qualifiers_annotated.py:85:7 - error: Argument of type "SmallInt" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType)
24
24
qualifiers_annotated.py:91:1 - error: "Annotated" cannot be instantiated (reportCallIssue)
25
25
qualifiers_annotated.py:92:1 - error: Object of type "type[Annotated]" is not callable (reportCallIssue)
Attribute "__set__" is unknown (reportAttributeAccessIssue)
26
26
qualifiers_final_annotation.py:94:5 - error: "BORDER_WIDTH" cannot be redeclared because parent class "ClassC" declares it as Final (reportGeneralTypeIssues)
27
27
qualifiers_final_annotation.py:107:22 - error: "Final" is not allowed in this context
28
-
qualifiers_final_annotation.py:107:31 - error: Expression of type "Literal[1]" is incompatible with declared type "Final"
29
-
"Literal[1]" is incompatible with "Final" (reportAssignmentType)
30
28
qualifiers_final_annotation.py:108:19 - error: "ClassVar" is not allowed in this context
31
29
qualifiers_final_annotation.py:118:9 - error: "Final" is not allowed in this context
32
30
qualifiers_final_annotation.py:121:14 - error: "Final" is not allowed in this context
Copy file name to clipboardExpand all lines: conformance/results/pytype/dataclasses_final.toml
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,13 @@ Doesn't handle Final nested inside ClassVar.
5
5
errors_diff = """
6
6
Line 27: Expected 1 errors
7
7
Line 35: Expected 1 errors
8
-
Line 38: Expected 1 errors
9
-
Line 41: Expected 1 errors
8
+
Line 37: Expected 1 errors
10
9
Line 18: Unexpected errors ['File "dataclasses_final.py", line 18, in D: Invalid use of typing.Final [final-error]', 'File "dataclasses_final.py", line 18, in D: Invalid type annotation \\'ClassVar[Final[int]]\\' [invalid-annotation]']
11
-
Line 40: Unexpected errors ['File "dataclasses_final.py", line 40, in <module>: Assigning to attribute final_with_default, which was annotated with Final [final-error]']
12
10
"""
13
11
output = """
14
12
File "dataclasses_final.py", line 18, in D: Invalid use of typing.Final [final-error]
15
13
File "dataclasses_final.py", line 18, in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation]
16
14
File "dataclasses_final.py", line 36, in <module>: Assigning to attribute final_with_default, which was annotated with Final [final-error]
17
-
File "dataclasses_final.py", line 40, in <module>: Assigning to attribute final_with_default, which was annotated with Final [final-error]
15
+
File "dataclasses_final.py", line 38, in <module>: Assigning to attribute final_with_default, which was annotated with Final [final-error]
0 commit comments