Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions conformance/results/mypy/classes_classvar.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,34 @@ Rejects `ClassVar` nested in `Annotated`.
Does not reject use of `ClassVar` in `TypeAlias` definition.
"""
output = """
classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [valid-type]
classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? [valid-type]
classes_classvar.py:40: error: Name "var" is not defined; did you mean "var1" or "vars"? [name-defined]
classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment]
classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc]
classes_classvar.py:55: error: Invalid type: ClassVar nested inside other type [valid-type]
classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]
classes_classvar.py:69: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:70: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:40: error: ClassVar[...] must have at most one type argument [valid-type]
classes_classvar.py:41: error: Invalid type: try using Literal[3] instead? [valid-type]
classes_classvar.py:42: error: Name "var" is not defined; did you mean "var1" or "vars"? [name-defined]
classes_classvar.py:54: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment]
classes_classvar.py:56: error: Variable should not be annotated with both ClassVar and Final [misc]
classes_classvar.py:57: error: Invalid type: ClassVar nested inside other type [valid-type]
classes_classvar.py:69: error: Invalid type: ClassVar nested inside other type [valid-type]
classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:72: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:73: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:78: error: ClassVar[...] can't be used inside a type alias [valid-type]
classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc]
classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc]
classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment]
classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member:
classes_classvar.py:140: note: z
classes_classvar.py:140: note: Protocol member ProtoA.x expected class variable, got instance variable
classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, got instance variable
classes_classvar.py:75: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:79: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:80: error: ClassVar[...] can't be used inside a type alias [valid-type]
classes_classvar.py:89: error: ClassVar[...] can't be used inside a TypedDict [valid-type]
classes_classvar.py:94: error: ClassVar[...] can't be used inside a NamedTuple [valid-type]
classes_classvar.py:127: error: Cannot assign to class variable "stats" via instance [misc]
classes_classvar.py:146: error: All protocol members must have explicitly declared types [misc]
classes_classvar.py:156: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment]
classes_classvar.py:156: note: "ProtoAImpl" is missing following "ProtoA" protocol member:
classes_classvar.py:156: note: z
classes_classvar.py:156: note: Protocol member ProtoA.x expected class variable, got instance variable
classes_classvar.py:156: note: Protocol member ProtoA.y expected class variable, got instance variable
"""
conformance_automated = "Fail"
errors_diff = """
Line 45: Expected 1 errors
Line 46: Expected 1 errors
Line 47: Expected 1 errors
Line 67: Unexpected errors ['classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]']
Line 130: Unexpected errors ['classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc]']
Line 48: Expected 1 errors
Line 49: Expected 1 errors
Line 69: Unexpected errors ['classes_classvar.py:69: error: Invalid type: ClassVar nested inside other type [valid-type]']
Line 146: Unexpected errors ['classes_classvar.py:146: error: All protocol members must have explicitly declared types [misc]']
"""
34 changes: 18 additions & 16 deletions conformance/results/mypy/qualifiers_final_annotation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,27 @@ qualifiers_final_annotation.py:107: error: Final can be only used as an outermos
qualifiers_final_annotation.py:108: error: Variable should not be annotated with both ClassVar and Final [misc]
qualifiers_final_annotation.py:118: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]
qualifiers_final_annotation.py:121: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]
qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name [misc]
qualifiers_final_annotation.py:133: error: Unexpected keyword argument "x" for "N" [call-arg]
qualifiers_final_annotation.py:133: error: Unexpected keyword argument "y" for "N" [call-arg]
qualifiers_final_annotation.py:134: error: Unexpected keyword argument "a" for "N" [call-arg]
qualifiers_final_annotation.py:135: error: Unexpected keyword argument "x" for "N" [call-arg]
qualifiers_final_annotation.py:135: error: Unexpected keyword argument "y" for "N" [call-arg]
qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" [misc]
qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" [misc]
qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" [misc]
qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment]
qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" [misc]
qualifiers_final_annotation.py:166: error: Cannot assign to final name "TEN" [misc]
qualifiers_final_annotation.py:170: error: Cannot assign to final name "PI" [misc]
qualifiers_final_annotation.py:131: error: Final[...] can't be used inside a TypedDict [valid-type]
qualifiers_final_annotation.py:136: error: Final[...] can't be used inside a NamedTuple [valid-type]
qualifiers_final_annotation.py:145: error: Invalid "NamedTuple()" field name [misc]
qualifiers_final_annotation.py:147: error: Unexpected keyword argument "x" for "N" [call-arg]
qualifiers_final_annotation.py:147: error: Unexpected keyword argument "y" for "N" [call-arg]
qualifiers_final_annotation.py:148: error: Unexpected keyword argument "a" for "N" [call-arg]
qualifiers_final_annotation.py:149: error: Unexpected keyword argument "x" for "N" [call-arg]
qualifiers_final_annotation.py:149: error: Unexpected keyword argument "y" for "N" [call-arg]
qualifiers_final_annotation.py:155: error: Cannot assign to final name "ID1" [misc]
qualifiers_final_annotation.py:159: error: Cannot assign to final name "x" [misc]
qualifiers_final_annotation.py:161: error: Cannot assign to final name "x" [misc]
qualifiers_final_annotation.py:166: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment]
qualifiers_final_annotation.py:169: error: Cannot assign to final name "x" [misc]
qualifiers_final_annotation.py:180: error: Cannot assign to final name "TEN" [misc]
qualifiers_final_annotation.py:184: error: Cannot assign to final name "PI" [misc]
"""
conformance_automated = "Fail"
errors_diff = """
Line 149: Expected 1 errors
Line 163: Expected 1 errors
Line 59: Unexpected errors ['qualifiers_final_annotation.py:59: error: Cannot assign to final attribute "ID6" [misc]']
Line 96: Unexpected errors ['qualifiers_final_annotation.py:96: error: Cannot assign to final name "__private" [misc]']
Line 131: Unexpected errors ['qualifiers_final_annotation.py:131: error: Invalid "NamedTuple()" field name [misc]']
Line 133: Unexpected errors ['qualifiers_final_annotation.py:133: error: Unexpected keyword argument "x" for "N" [call-arg]', 'qualifiers_final_annotation.py:133: error: Unexpected keyword argument "y" for "N" [call-arg]']
Line 145: Unexpected errors ['qualifiers_final_annotation.py:145: error: Invalid "NamedTuple()" field name [misc]']
Line 147: Unexpected errors ['qualifiers_final_annotation.py:147: error: Unexpected keyword argument "x" for "N" [call-arg]', 'qualifiers_final_annotation.py:147: error: Unexpected keyword argument "y" for "N" [call-arg]']
"""
40 changes: 23 additions & 17 deletions conformance/results/pycroscope/classes_classvar.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
conformance_automated = "Pass"
conformant = "Partial"
notes = """
Does not reject use of `ClassVar` as a qualifier for a NamedTuple field.
"""
conformance_automated = "Fail"
errors_diff = """
Line 94: Expected 1 errors
"""
output = """
./classes_classvar.py:38:10: Invalid type annotation (<class 'int'>, <class 'str'>) [invalid_annotation]
./classes_classvar.py:39:10: Invalid type annotation 3 [invalid_annotation]
./classes_classvar.py:40:13: Undefined name: var [undefined_name]
./classes_classvar.py:45:10: ClassVar type cannot include type parameters [classvar_type_parameters]
./classes_classvar.py:46:10: ClassVar type cannot include type parameters [classvar_type_parameters]
./classes_classvar.py:40:10: Invalid type annotation (<class 'int'>, <class 'str'>) [invalid_annotation]
./classes_classvar.py:41:10: Invalid type annotation 3 [invalid_annotation]
./classes_classvar.py:42:13: Undefined name: var [undefined_name]
./classes_classvar.py:47:10: ClassVar type cannot include type parameters [classvar_type_parameters]
./classes_classvar.py:52:4: Incompatible assignment: expected list[str], got Literal[{}] [incompatible_assignment]
./classes_classvar.py:54:10: Final cannot be combined with ClassVar [invalid_qualifier]
./classes_classvar.py:55:11: Unrecognized annotation typing.ClassVar[<class 'int'>] [invalid_annotation]
./classes_classvar.py:69:25: Unexpected ClassVar annotation [invalid_qualifier]
./classes_classvar.py:70:11: ClassVar can only be used for assignments in class body [invalid_qualifier]
./classes_classvar.py:71:17: ClassVar can only be used for assignments in class body [invalid_qualifier]
./classes_classvar.py:73:25: Unexpected ClassVar annotation [invalid_qualifier]
./classes_classvar.py:77:7: ClassVar can only be used for assignments in class body [invalid_qualifier]
./classes_classvar.py:78:19: ClassVar cannot be used in type aliases [invalid_qualifier]
./classes_classvar.py:111:0: Cannot assign to class variable 'stats' via instance [incompatible_assignment]
./classes_classvar.py:140:0: Incompatible assignment: expected ./classes_classvar.py.ProtoA, got ./classes_classvar.py.ProtoAImpl [incompatible_assignment]
./classes_classvar.py:48:10: ClassVar type cannot include type parameters [classvar_type_parameters]
./classes_classvar.py:49:10: ClassVar type cannot include type parameters [classvar_type_parameters]
./classes_classvar.py:54:4: Incompatible assignment: expected list[str], got Literal[{}] [incompatible_assignment]
./classes_classvar.py:56:10: Final cannot be combined with ClassVar [invalid_qualifier]
./classes_classvar.py:57:11: Unrecognized annotation typing.ClassVar[<class 'int'>] [invalid_annotation]
./classes_classvar.py:71:25: Unexpected ClassVar annotation [invalid_qualifier]
./classes_classvar.py:72:11: ClassVar can only be used for assignments in class body [invalid_qualifier]
./classes_classvar.py:73:17: ClassVar can only be used for assignments in class body [invalid_qualifier]
./classes_classvar.py:75:25: Unexpected ClassVar annotation [invalid_qualifier]
./classes_classvar.py:79:7: ClassVar can only be used for assignments in class body [invalid_qualifier]
./classes_classvar.py:80:19: ClassVar cannot be used in type aliases [invalid_qualifier]
./classes_classvar.py:89:7: Unexpected ClassVar annotation [invalid_qualifier]
./classes_classvar.py:127:0: Cannot assign to class variable 'stats' via instance [incompatible_assignment]
./classes_classvar.py:156:0: Incompatible assignment: expected ./classes_classvar.py.ProtoA, got ./classes_classvar.py.ProtoAImpl [incompatible_assignment]
"""
24 changes: 13 additions & 11 deletions conformance/results/pycroscope/qualifiers_final_annotation.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@ output = """
./qualifiers_final_annotation.py:108:12: Final cannot be combined with ClassVar [invalid_qualifier]
./qualifiers_final_annotation.py:118:3: Unrecognized annotation typing.Final[<class 'int'>] [invalid_annotation]
./qualifiers_final_annotation.py:121:13: Unexpected Final annotation [invalid_qualifier]
./qualifiers_final_annotation.py:134:0: In call to pycroscope.signature.N: Missing required argument 'x' [incompatible_call]
./qualifiers_final_annotation.py:135:4: Incompatible argument type for x: expected int but got Literal[''] [incompatible_argument]
./qualifiers_final_annotation.py:135:10: Incompatible argument type for y: expected int but got Literal[''] [incompatible_argument]
./qualifiers_final_annotation.py:141:4: Cannot assign to final name ID1 [incompatible_assignment]
./qualifiers_final_annotation.py:145:4: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:147:9: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:149:8: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:152:29: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:155:8: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:166:0: Cannot assign to final name TEN [incompatible_assignment]
./qualifiers_final_annotation.py:170:0: Cannot assign to final name PI [incompatible_assignment]
./qualifiers_final_annotation.py:131:7: Unexpected Final annotation [invalid_qualifier]
./qualifiers_final_annotation.py:136:4: Final class attributes without initializers must be assigned in __init__ [invalid_qualifier]
./qualifiers_final_annotation.py:148:0: In call to pycroscope.signature.N: Missing required argument 'x' [incompatible_call]
./qualifiers_final_annotation.py:149:4: Incompatible argument type for x: expected int but got Literal[''] [incompatible_argument]
./qualifiers_final_annotation.py:149:10: Incompatible argument type for y: expected int but got Literal[''] [incompatible_argument]
./qualifiers_final_annotation.py:155:4: Cannot assign to final name ID1 [incompatible_assignment]
./qualifiers_final_annotation.py:159:4: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:161:9: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:163:8: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:166:29: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:169:8: Cannot assign to final name x [incompatible_assignment]
./qualifiers_final_annotation.py:180:0: Cannot assign to final name TEN [incompatible_assignment]
./qualifiers_final_annotation.py:184:0: Cannot assign to final name PI [incompatible_assignment]
"""
44 changes: 23 additions & 21 deletions conformance/results/pyrefly/classes_classvar.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,27 @@ conformance_automated = "Pass"
errors_diff = """
"""
output = """
ERROR classes_classvar.py:38:11-29: Expected 1 type argument for `ClassVar`, got 2 [invalid-annotation]
ERROR classes_classvar.py:39:14-15: Number literal cannot be used in annotations [invalid-annotation]
ERROR classes_classvar.py:40:14-17: Could not find name `var` [unknown-name]
ERROR classes_classvar.py:45:20-21: `ClassVar` arguments may not contain any type variables [invalid-annotation]
ERROR classes_classvar.py:46:20-27: `ClassVar` arguments may not contain any type variables [invalid-annotation]
ERROR classes_classvar.py:47:20-36: `ClassVar` arguments may not contain any type variables [invalid-annotation]
ERROR classes_classvar.py:52:33-35: `dict[@_, @_]` is not assignable to `list[str]` [bad-assignment]
ERROR classes_classvar.py:54:17-30: `ClassVar` may not be nested inside `Final` [invalid-annotation]
ERROR classes_classvar.py:55:17-30: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:69:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation]
ERROR classes_classvar.py:69:26-39: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:70:12-20: `ClassVar` is only allowed inside a class body [invalid-annotation]
ERROR classes_classvar.py:70:12-25: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:71:9-16: Cannot set field `xx` [read-only]
ERROR classes_classvar.py:73:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation]
ERROR classes_classvar.py:73:26-39: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:77:8-16: `ClassVar` is only allowed inside a class body [invalid-annotation]
ERROR classes_classvar.py:77:8-21: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:78:20-33: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:111:1-19: Cannot set field `stats` [read-only]
ERROR classes_classvar.py:140:13-25: `ProtoAImpl` is not assignable to `ProtoA` [bad-assignment]
ERROR classes_classvar.py:40:11-29: Expected 1 type argument for `ClassVar`, got 2 [invalid-annotation]
ERROR classes_classvar.py:41:14-15: Number literal cannot be used in annotations [invalid-annotation]
ERROR classes_classvar.py:42:14-17: Could not find name `var` [unknown-name]
ERROR classes_classvar.py:47:20-21: `ClassVar` arguments may not contain any type variables [invalid-annotation]
ERROR classes_classvar.py:48:20-27: `ClassVar` arguments may not contain any type variables [invalid-annotation]
ERROR classes_classvar.py:49:20-36: `ClassVar` arguments may not contain any type variables [invalid-annotation]
ERROR classes_classvar.py:54:33-35: `dict[@_, @_]` is not assignable to `list[str]` [bad-assignment]
ERROR classes_classvar.py:56:17-30: `ClassVar` may not be nested inside `Final` [invalid-annotation]
ERROR classes_classvar.py:57:17-30: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:71:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation]
ERROR classes_classvar.py:71:26-39: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:72:12-20: `ClassVar` is only allowed inside a class body [invalid-annotation]
ERROR classes_classvar.py:72:12-25: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:73:9-16: Cannot set field `xx` [read-only]
ERROR classes_classvar.py:75:26-34: `ClassVar` is only allowed inside a class body [invalid-annotation]
ERROR classes_classvar.py:75:26-39: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:79:8-16: `ClassVar` is only allowed inside a class body [invalid-annotation]
ERROR classes_classvar.py:79:8-21: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:80:20-33: `ClassVar` is not allowed in this context [invalid-annotation]
ERROR classes_classvar.py:89:5-6: `ClassVar` may not be used for TypedDict members [invalid-annotation]
ERROR classes_classvar.py:94:5-6: `ClassVar` may not be used for NamedTuple members [invalid-annotation]
ERROR classes_classvar.py:127:1-19: Cannot set field `stats` [read-only]
ERROR classes_classvar.py:156:13-25: `ProtoAImpl` is not assignable to `ProtoA` [bad-assignment]
"""
Loading