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
Copy file name to clipboardExpand all lines: conformance/results/pyre/classes_classvar.toml
+12-12Lines changed: 12 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,11 @@ classes_classvar.py:38:10 Invalid type parameters [24]: Generic type `CV` expect
15
15
classes_classvar.py:39:10 Invalid type [31]: Expression `typing.ClassVar[3]` is not a valid type.
16
16
classes_classvar.py:40:13 Unbound name [10]: Name `var` is used but not defined in the current scope.
17
17
classes_classvar.py:52:4 Incompatible attribute type [8]: Attribute `bad8` declared in class `ClassA` has type `List[str]` but is used as type `Dict[Variable[_KT], Variable[_VT]]`.
18
-
classes_classvar.py:65:8 Undefined attribute [16]: `ClassA` has no attribute `xx`.
19
-
classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.
20
-
classes_classvar.py:78:0 Assert type [70]: Expected `float` but got `typing.Any`.
21
-
classes_classvar.py:105:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead?
22
-
classes_classvar.py:134:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`.
18
+
classes_classvar.py:66:4 Uninitialized attribute [13]: Attribute `good5` is declared in class `ClassA` to have type `typing.Any` but is never initialized.
19
+
classes_classvar.py:71:8 Undefined attribute [16]: `ClassA` has no attribute `xx`.
20
+
classes_classvar.py:74:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.
21
+
classes_classvar.py:111:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead?
22
+
classes_classvar.py:140:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`.
23
23
"""
24
24
conformance_automated = "Fail"
25
25
errors_diff = """
@@ -28,11 +28,11 @@ Line 46: Expected 1 errors
28
28
Line 47: Expected 1 errors
29
29
Line 54: Expected 1 errors
30
30
Line 55: Expected 1 errors
31
-
Line 63: Expected 1 errors
32
-
Line 64: Expected 1 errors
33
-
Line 67: Expected 1 errors
34
-
Line 71: Expected 1 errors
35
-
Line 72: Expected 1 errors
36
-
Line 68: Unexpected errors ['classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.']
37
-
Line 78: Unexpected errors ['classes_classvar.py:78:0 Assert type [70]: Expected `float` but got `typing.Any`.']
31
+
Line 69: Expected 1 errors
32
+
Line 70: Expected 1 errors
33
+
Line 73: Expected 1 errors
34
+
Line 77: Expected 1 errors
35
+
Line 78: Expected 1 errors
36
+
Line 66: Unexpected errors ['classes_classvar.py:66:4 Uninitialized attribute [13]: Attribute `good5` is declared in class `ClassA` to have type `typing.Any` but is never initialized.']
37
+
Line 74: Unexpected errors ['classes_classvar.py:74:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.']
Copy file name to clipboardExpand all lines: conformance/results/pytype/classes_classvar.toml
+18-17Lines changed: 18 additions & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@ Does not reject use of TypeVar in ClassVar.
4
4
Does not reject use of ParamSpec in ClassVar.
5
5
Does not reject use of ClassVar as a generic type argument.
6
6
Rejects initialization of ClassVar if no type argument is provided.
7
+
Does not infer ClassVar with no type argument and no assigned value as Any.
7
8
Does not reject use of ClassVar in parameter type annotation.
8
9
Does not reject use of ClassVar in local variable annotation.
9
10
Does not reject use of ClassVar in instance variable annotation.
@@ -85,27 +86,27 @@ classes_classvar.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA
85
86
bad8: ClassVar[list[str]] = {} # E: type violation in initialization
86
87
\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m
87
88
88
-
classes_classvar.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]
89
+
classes_classvar.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]
89
90
90
91
good4: ClassVar = 3.1
91
92
\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m
92
93
93
-
classes_classvar.py:68:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type]
94
+
classes_classvar.py:74:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type]
94
95
95
96
return 3
96
97
\u001b[1m\u001b[31m~\u001b[39m\u001b[0m
97
98
98
-
classes_classvar.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <module>: ClassVar [assert-type]
99
+
classes_classvar.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <module>: ClassVar [assert-type]
classes_classvar.py:124:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]
104
+
classes_classvar.py:130:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]
104
105
105
106
z: CV = [""]
106
107
\u001b[1m\u001b[31m~\u001b[39m\u001b[0m
107
108
108
-
classes_classvar.py:134:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <module>: Type annotation for a does not match type of assignment [annotation-type-mismatch]
109
+
classes_classvar.py:140:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in <module>: Type annotation for a does not match type of assignment [annotation-type-mismatch]
109
110
110
111
a: ProtoA = ProtoAImpl() # E: y is not a ClassVar
111
112
\u001b[1m\u001b[31m~\u001b[39m\u001b[0m
@@ -118,17 +119,17 @@ Line 46: Expected 1 errors
118
119
Line 47: Expected 1 errors
119
120
Line 54: Expected 1 errors
120
121
Line 55: Expected 1 errors
121
-
Line 63: Expected 1 errors
122
-
Line 64: Expected 1 errors
123
-
Line 65: Expected 1 errors
124
-
Line 67: Expected 1 errors
122
+
Line 69: Expected 1 errors
123
+
Line 70: Expected 1 errors
125
124
Line 71: Expected 1 errors
126
-
Line 72: Expected 1 errors
127
-
Line 105: Expected 1 errors
125
+
Line 73: Expected 1 errors
126
+
Line 77: Expected 1 errors
127
+
Line 78: Expected 1 errors
128
+
Line 111: Expected 1 errors
128
129
Line 7: Unexpected errors ['classes_classvar.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in <module>: typing.TypeVarTuple not supported yet [not-supported-yet]']
129
130
Line 29: Unexpected errors ['classes_classvar.py:29:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in <module>: Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]']
130
-
Line 60: Unexpected errors ['classes_classvar.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]']
131
-
Line 68: Unexpected errors ['classes_classvar.py:68:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]']
132
-
Line 78: Unexpected errors ['classes_classvar.py:78:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in <module>: ClassVar [assert-type]']
133
-
Line 124: Unexpected errors ['classes_classvar.py:124:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]']
131
+
Line 63: Unexpected errors ['classes_classvar.py:63:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]']
132
+
Line 74: Unexpected errors ['classes_classvar.py:74:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]']
133
+
Line 84: Unexpected errors ['classes_classvar.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in <module>: ClassVar [assert-type]']
134
+
Line 130: Unexpected errors ['classes_classvar.py:130:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]']
0 commit comments