Skip to content

Commit

Permalink
Updated test results for pyre 0.9.22, mypy 1.10.1, and pyright 1.1.36… (
Browse files Browse the repository at this point in the history
#1788)

Updated test results for pyre 0.9.22, mypy 1.10.1, and pyright 1.1.369. The most substantive changes were with pyre, which fixed a bunch of bugs and improved error messages.
  • Loading branch information
erictraut authored Jun 29, 2024
1 parent 149e62b commit 5f8da04
Show file tree
Hide file tree
Showing 53 changed files with 368 additions and 374 deletions.
44 changes: 22 additions & 22 deletions conformance/results/mypy/classes_classvar.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,32 @@ Does not reject use of ClassVar in TypeAlias definition.
Does not infer type of ClassVar from assignment if no type is provided.
"""
output = """
classes_classvar.py:37: error: ClassVar[...] must have at most one type argument [valid-type]
classes_classvar.py:38: error: Invalid type: try using Literal[3] instead? [valid-type]
classes_classvar.py:39: error: Name "var" is not defined [name-defined]
classes_classvar.py:44: error: ClassVar cannot contain type variables [misc]
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 [name-defined]
classes_classvar.py:45: error: ClassVar cannot contain type variables [misc]
classes_classvar.py:51: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment]
classes_classvar.py:53: error: Variable should not be annotated with both ClassVar and Final [misc]
classes_classvar.py:54: error: Invalid type: ClassVar nested inside other type [valid-type]
classes_classvar.py:60: error: Invalid type: ClassVar nested inside other type [valid-type]
classes_classvar.py:62: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:46: error: ClassVar cannot contain type variables [misc]
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:61: error: Invalid type: ClassVar nested inside other type [valid-type]
classes_classvar.py:63: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:64: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:66: 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:77: error: Expression is of type "Any", not "float" [assert-type]
classes_classvar.py:101: error: Cannot assign to class variable "stats" via instance [misc]
classes_classvar.py:130: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment]
classes_classvar.py:130: note: "ProtoAImpl" is missing following "ProtoA" protocol member:
classes_classvar.py:130: note: z
classes_classvar.py:130: note: Protocol member ProtoA.x expected class variable, got instance variable
classes_classvar.py:130: note: Protocol member ProtoA.y expected class variable, got instance variable
classes_classvar.py:65: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:67: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:71: error: ClassVar can only be used for assignments in class body [misc]
classes_classvar.py:78: error: Expression is of type "Any", not "float" [assert-type]
classes_classvar.py:102: error: Cannot assign to class variable "stats" via instance [misc]
classes_classvar.py:131: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment]
classes_classvar.py:131: note: "ProtoAImpl" is missing following "ProtoA" protocol member:
classes_classvar.py:131: note: z
classes_classvar.py:131: note: Protocol member ProtoA.x expected class variable, got instance variable
classes_classvar.py:131: note: Protocol member ProtoA.y expected class variable, got instance variable
"""
conformance_automated = "Fail"
errors_diff = """
Line 46: Expected 1 errors
Line 71: Expected 1 errors
Line 60: Unexpected errors ['classes_classvar.py:60: error: Invalid type: ClassVar nested inside other type [valid-type]']
Line 77: Unexpected errors ['classes_classvar.py:77: error: Expression is of type "Any", not "float" [assert-type]']
Line 47: Expected 1 errors
Line 72: Expected 1 errors
Line 61: Unexpected errors ['classes_classvar.py:61: error: Invalid type: ClassVar nested inside other type [valid-type]']
Line 78: Unexpected errors ['classes_classvar.py:78: error: Expression is of type "Any", not "float" [assert-type]']
"""
10 changes: 5 additions & 5 deletions conformance/results/mypy/generics_paramspec_specialization.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
conformant = "Pass"
output = """
generics_paramspec_specialization.py:45: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc]
generics_paramspec_specialization.py:55: error: Argument 1 has incompatible type "str"; expected "int" [arg-type]
generics_paramspec_specialization.py:56: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type]
generics_paramspec_specialization.py:61: error: Argument 1 has incompatible type "str"; expected "int" [arg-type]
generics_paramspec_specialization.py:62: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type]
generics_paramspec_specialization.py:44: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "int" [misc]
generics_paramspec_specialization.py:54: error: Argument 1 has incompatible type "str"; expected "int" [arg-type]
generics_paramspec_specialization.py:55: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type]
generics_paramspec_specialization.py:60: error: Argument 1 has incompatible type "str"; expected "int" [arg-type]
generics_paramspec_specialization.py:61: error: Argument 3 has incompatible type "str"; expected "bool" [arg-type]
"""
conformance_automated = "Pass"
errors_diff = """
Expand Down
4 changes: 2 additions & 2 deletions conformance/results/mypy/version.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "mypy 1.10.0"
test_duration = 1.1
version = "mypy 1.10.1"
test_duration = 1.4
7 changes: 3 additions & 4 deletions conformance/results/pyre/aliases_typealiastype.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribut
aliases_typealiastype.py:27:45 Undefined attribute [16]: `list` has no attribute `__getitem__`.
aliases_typealiastype.py:32:6 Undefined attribute [16]: `TypeAliasType` has no attribute `other_attrib`.
aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type.
aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `...` is not defined as a type.
aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.
aliases_typealiastype.py:39:4 Invalid type [31]: Expression `$local_aliases_typealiastype$GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.
aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.
"""
conformance_automated = "Fail"
errors_diff = """
Expand Down Expand Up @@ -39,6 +38,6 @@ Line 17: Unexpected errors ['aliases_typealiastype.py:17:41 Undefined attribute
Line 22: Unexpected errors ['aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`.', 'aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.']
Line 27: Unexpected errors ['aliases_typealiastype.py:27:45 Undefined attribute [16]: `list` has no attribute `__getitem__`.']
Line 35: Unexpected errors ['aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type.']
Line 37: Unexpected errors ['aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `...` is not defined as a type.', 'aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.']
Line 39: Unexpected errors ['aliases_typealiastype.py:39:4 Invalid type [31]: Expression `$local_aliases_typealiastype$GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.']
Line 37: Unexpected errors ['aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.']
Line 39: Unexpected errors ['aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.']
"""
4 changes: 2 additions & 2 deletions conformance/results/pyre/annotations_forward_refs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ annotations_forward_refs.py:51:9 Invalid type [31]: Expression `"1"` is not a va
annotations_forward_refs.py:52:9 Invalid type [31]: Expression `"-1"` is not a valid type.
annotations_forward_refs.py:53:9 Invalid type [31]: Expression `"int or str"` is not a valid type.
annotations_forward_refs.py:55:9 Undefined or invalid type [11]: Annotation `types` is not defined as a type.
annotations_forward_refs.py:77:0 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized.
annotations_forward_refs.py:78:4 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized.
annotations_forward_refs.py:80:12 Undefined or invalid type [11]: Annotation `ClassF` is not defined as a type.
annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type.
annotations_forward_refs.py:100:7 Undefined or invalid type [11]: Annotation `
Expand All @@ -36,7 +36,7 @@ Line 25: Expected 1 errors
Line 54: Expected 1 errors
Line 66: Expected 1 errors
Line 89: Expected 1 errors
Line 77: Unexpected errors ['annotations_forward_refs.py:77:0 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized.']
Line 78: Unexpected errors ['annotations_forward_refs.py:78:4 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized.']
Line 87: Unexpected errors ['annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type.']
Line 100: Unexpected errors ['annotations_forward_refs.py:100:7 Undefined or invalid type [11]: Annotation `']
"""
2 changes: 1 addition & 1 deletion conformance/results/pyre/annotations_typeexpr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ output = """
annotations_typeexpr.py:88:8 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type.
annotations_typeexpr.py:89:8 Invalid type [31]: Expression `[int, str]` is not a valid type.
annotations_typeexpr.py:90:8 Invalid type [31]: Expression `(int, str)` is not a valid type.
annotations_typeexpr.py:91:8 Invalid type [31]: Expression `comprehension(int for generators(generator($target$i in range(1) if )))` is not a valid type.
annotations_typeexpr.py:91:8 Invalid type [31]: Expression `comprehension(int for generators(generator(i in range(1) if )))` is not a valid type.
annotations_typeexpr.py:92:8 Invalid type [31]: Expression `{ }` is not a valid type.
annotations_typeexpr.py:93:8 Invalid type [31]: Expression `lambda () (int)()` is not a valid type.
annotations_typeexpr.py:94:8 Invalid type [31]: Expression `[int][0]` is not a valid type.
Expand Down
5 changes: 3 additions & 2 deletions conformance/results/pyre/callables_annotation.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
conformant = "Partial"
notes = """
Does not evaluate correct type for `*args: int` parameter.
Does not reject illegal form `Callable[[...], int]`.
Does not correctly implement type compatibility rules for "...".
Does not treat "*args: Any, **kwargs: Any" as "...".
"""
Expand All @@ -15,10 +14,11 @@ callables_annotation.py:55:4 Invalid type [31]: Expression `typing.Callable[int]
callables_annotation.py:56:4 Invalid type [31]: Expression `typing.Callable[(int, int)]` is not a valid type.
callables_annotation.py:57:4 Invalid type [31]: Expression `typing.Callable[([], [int])]` is not a valid type.
callables_annotation.py:58:4 Invalid type [31]: Expression `typing.Callable[(int, int, int)]` is not a valid type.
callables_annotation.py:59:4 Undefined or invalid type [11]: Annotation `...` is not defined as a type.
callables_annotation.py:59:4 Invalid type [31]: Expression `typing.Callable[([...], int)]` is not a valid type.
callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type.
callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.
callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.
callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`.
callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`.
callables_annotation.py:159:4 Incompatible variable type [9]: err1 is declared to have type `Proto5[typing.Any]` but is used as type `Proto8`.
callables_annotation.py:166:0 Incompatible variable type [9]: Callback1 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.
Expand All @@ -39,6 +39,7 @@ Line 93: Expected 1 errors
Line 89: Unexpected errors ['callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type.']
Line 145: Unexpected errors ['callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.']
Line 151: Unexpected errors ['callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.']
Line 156: Unexpected errors ['callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`.']
Line 157: Unexpected errors ['callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`.']
Line 166: Unexpected errors ['callables_annotation.py:166:0 Incompatible variable type [9]: Callback1 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.']
Line 167: Unexpected errors ['callables_annotation.py:167:0 Incompatible variable type [9]: Callback2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.']
Expand Down
41 changes: 18 additions & 23 deletions conformance/results/pyre/classes_classvar.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,35 +11,30 @@ Does not reject use of ClassVar in type alias definition.
Does not infer type from initialization for bare ClassVar.
"""
output = """
classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad1` is declared in class `ClassA` to have type `typing.Any` but is never initialized.
classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad4` is declared in class `ClassA` to have type `Variable[T]` but is never initialized.
classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad5` is declared in class `ClassA` to have type `typing.List[Variable[T]]` but is never initialized.
classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad6` is declared in class `ClassA` to have type `typing.Callable[classes_classvar.P, typing.Any]` but is never initialized.
classes_classvar.py:37:10 Invalid type parameters [24]: Generic type `CV` expects 1 type parameter, received 2.
classes_classvar.py:38:10 Invalid type [31]: Expression `typing.ClassVar[3]` is not a valid type.
classes_classvar.py:39:13 Unbound name [10]: Name `var` is used but not defined in the current scope.
classes_classvar.py:51: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]]`.
classes_classvar.py:64:8 Undefined attribute [16]: `ClassA` has no attribute `xx`.
classes_classvar.py:67:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.
classes_classvar.py:77:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.
classes_classvar.py:80:0 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized.
classes_classvar.py:101:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead?
classes_classvar.py:130:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`.
classes_classvar.py:38:10 Invalid type parameters [24]: Generic type `CV` expects 1 type parameter, received 2.
classes_classvar.py:39:10 Invalid type [31]: Expression `typing.ClassVar[3]` is not a valid type.
classes_classvar.py:40:13 Unbound name [10]: Name `var` is used but not defined in the current scope.
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]]`.
classes_classvar.py:65:8 Undefined attribute [16]: `ClassA` has no attribute `xx`.
classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.
classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.
classes_classvar.py:83:4 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized.
classes_classvar.py:102:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead?
classes_classvar.py:131:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`.
"""
conformance_automated = "Fail"
errors_diff = """
Line 44: Expected 1 errors
Line 45: Expected 1 errors
Line 46: Expected 1 errors
Line 53: Expected 1 errors
Line 47: Expected 1 errors
Line 54: Expected 1 errors
Line 62: Expected 1 errors
Line 55: Expected 1 errors
Line 63: Expected 1 errors
Line 66: Expected 1 errors
Line 70: Expected 1 errors
Line 64: Expected 1 errors
Line 67: Expected 1 errors
Line 71: Expected 1 errors
Line 34: Unexpected errors ['classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad1` is declared in class `ClassA` to have type `typing.Any` but is never initialized.', 'classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad4` is declared in class `ClassA` to have type `Variable[T]` but is never initialized.', 'classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad5` is declared in class `ClassA` to have type `typing.List[Variable[T]]` but is never initialized.', 'classes_classvar.py:34:0 Uninitialized attribute [13]: Attribute `bad6` is declared in class `ClassA` to have type `typing.Callable[classes_classvar.P, typing.Any]` but is never initialized.']
Line 67: Unexpected errors ['classes_classvar.py:67:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.']
Line 77: Unexpected errors ['classes_classvar.py:77:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.']
Line 80: Unexpected errors ['classes_classvar.py:80:0 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized.']
Line 72: Expected 1 errors
Line 68: Unexpected errors ['classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.']
Line 78: Unexpected errors ['classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.']
Line 83: Unexpected errors ['classes_classvar.py:83:4 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized.']
"""
Loading

0 comments on commit 5f8da04

Please sign in to comment.