From 684a6d213b46e1636def4b4efa2e9578461f0f2b Mon Sep 17 00:00:00 2001 From: yangdanny97 Date: Sun, 14 Jul 2024 18:35:58 -0400 Subject: [PATCH] update conformance tests to initialize uninitialized variables --- .../mypy/annotations_forward_refs.toml | 7 ++- .../results/mypy/classes_classvar.toml | 12 ++--- .../mypy/dataclasses_transform_class.toml | 12 ++--- .../mypy/dataclasses_transform_func.toml | 15 +++--- .../mypy/dataclasses_transform_meta.toml | 12 ++--- .../results/mypy/dataclasses_usage.toml | 6 +-- .../results/mypy/enums_member_values.toml | 4 +- conformance/results/mypy/enums_members.toml | 54 +++++++++---------- .../results/mypy/generics_scoping.toml | 20 +++---- .../results/mypy/generics_self_basic.toml | 2 +- .../results/mypy/generics_type_erasure.toml | 18 +++---- .../results/mypy/protocols_class_objects.toml | 16 +++--- .../results/mypy/protocols_explicit.toml | 12 ++--- .../results/mypy/specialtypes_never.toml | 8 +-- .../results/mypy/typeddicts_required.toml | 14 ++--- conformance/results/mypy/version.toml | 2 +- .../pyre/annotations_forward_refs.toml | 6 +-- .../results/pyre/classes_classvar.toml | 6 +-- .../pyre/dataclasses_transform_class.toml | 26 +++++---- .../pyre/dataclasses_transform_func.toml | 34 +++--------- .../pyre/dataclasses_transform_meta.toml | 22 ++++---- .../results/pyre/dataclasses_usage.toml | 20 +++---- .../results/pyre/enums_member_values.toml | 6 +-- conformance/results/pyre/enums_members.toml | 54 +++++++++---------- .../results/pyre/generics_scoping.toml | 11 ++-- .../results/pyre/generics_self_basic.toml | 4 +- .../results/pyre/generics_type_erasure.toml | 30 +++++------ .../results/pyre/protocols_class_objects.toml | 8 ++- .../results/pyre/protocols_explicit.toml | 19 ++----- .../results/pyre/specialtypes_never.toml | 28 +++++----- .../results/pyre/typeddicts_class_syntax.toml | 4 -- .../results/pyre/typeddicts_required.toml | 18 ++++--- conformance/results/pyre/version.toml | 2 +- .../results/pyright/classes_classvar.toml | 4 +- .../pyright/dataclasses_transform_class.toml | 12 ++--- .../pyright/dataclasses_transform_func.toml | 26 ++++++--- .../pyright/dataclasses_transform_meta.toml | 12 ++--- .../results/pyright/dataclasses_usage.toml | 8 +-- .../results/pyright/enums_member_values.toml | 6 +-- .../results/pyright/enums_members.toml | 44 ++++++++------- .../results/pyright/generics_scoping.toml | 8 +-- .../results/pyright/generics_self_basic.toml | 2 +- .../pyright/generics_type_erasure.toml | 14 ++--- .../pyright/protocols_class_objects.toml | 8 +-- .../results/pyright/protocols_explicit.toml | 24 ++++----- .../results/pyright/specialtypes_never.toml | 4 +- .../results/pyright/typeddicts_required.toml | 11 ++-- conformance/results/pyright/version.toml | 2 +- .../pytype/annotations_forward_refs.toml | 10 ++-- .../results/pytype/classes_classvar.toml | 8 +-- .../pytype/dataclasses_transform_class.toml | 26 ++++----- .../pytype/dataclasses_transform_func.toml | 24 ++++----- .../pytype/dataclasses_transform_meta.toml | 18 +++---- .../results/pytype/dataclasses_usage.toml | 6 +-- .../results/pytype/enums_member_values.toml | 6 ++- conformance/results/pytype/enums_members.toml | 51 +++++++++--------- .../results/pytype/generics_scoping.toml | 10 ++-- .../results/pytype/generics_self_basic.toml | 14 ++--- .../results/pytype/generics_type_erasure.toml | 4 +- .../pytype/protocols_class_objects.toml | 8 +-- .../results/pytype/protocols_explicit.toml | 10 ++-- .../results/pytype/specialtypes_never.toml | 16 +++--- .../results/pytype/typeddicts_required.toml | 6 +-- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 +-- conformance/tests/annotations_forward_refs.py | 3 ++ conformance/tests/classes_classvar.py | 3 ++ .../tests/dataclasses_transform_class.py | 3 ++ .../tests/dataclasses_transform_func.py | 14 +++++ .../tests/dataclasses_transform_meta.py | 3 ++ conformance/tests/dataclasses_usage.py | 7 ++- conformance/tests/enums_member_values.py | 3 ++ conformance/tests/enums_members.py | 4 ++ conformance/tests/generics_scoping.py | 6 +++ conformance/tests/generics_self_basic.py | 3 ++ conformance/tests/generics_type_erasure.py | 4 +- conformance/tests/protocols_class_objects.py | 3 ++ conformance/tests/protocols_explicit.py | 10 +++- conformance/tests/specialtypes_never.py | 4 ++ conformance/tests/typeddicts_class_syntax.py | 4 ++ conformance/tests/typeddicts_required.py | 3 ++ 81 files changed, 515 insertions(+), 486 deletions(-) diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index 53c4e301e..8c9137118 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -27,7 +27,9 @@ annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD annotations_forward_refs.py:87: note: Perhaps you need "Callable[...]" or a callback protocol? annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type] annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? -annotations_forward_refs.py:93: error: Expression is of type int?, not "int" [assert-type] +annotations_forward_refs.py:91: error: Variable "annotations_forward_refs.ClassD.ClassC" is not valid as a type [valid-type] +annotations_forward_refs.py:91: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type] """ conformance_automated = "Fail" errors_diff = """ @@ -37,5 +39,6 @@ Line 24: Expected 1 errors Line 25: Expected 1 errors Line 66: Expected 1 errors Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] -Line 93: Unexpected errors ['annotations_forward_refs.py:93: error: Expression is of type int?, not "int" [assert-type]'] +Line 91: Unexpected errors ['annotations_forward_refs.py:91: error: Variable "annotations_forward_refs.ClassD.ClassC" is not valid as a type [valid-type]'] +Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type]'] """ diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 91c26a60e..82c4756ba 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -22,12 +22,12 @@ classes_classvar.py:65: error: ClassVar can only be used for assignments in clas 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 +classes_classvar.py:105: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:134: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] +classes_classvar.py:134: note: "ProtoAImpl" is missing following "ProtoA" protocol member: +classes_classvar.py:134: note: z +classes_classvar.py:134: note: Protocol member ProtoA.x expected class variable, got instance variable +classes_classvar.py:134: note: Protocol member ProtoA.y expected class variable, got instance variable """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_transform_class.toml b/conformance/results/mypy/dataclasses_transform_class.toml index 73d6f16ce..8ca0e9aee 100644 --- a/conformance/results/mypy/dataclasses_transform_class.toml +++ b/conformance/results/mypy/dataclasses_transform_class.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ -dataclasses_transform_class.py:48: error: Cannot inherit non-frozen dataclass from a frozen one [misc] -dataclasses_transform_class.py:60: error: Property "id" defined in "Customer1" is read-only [misc] -dataclasses_transform_class.py:63: error: Too many positional arguments for "Customer1" [misc] -dataclasses_transform_class.py:69: error: Unsupported left operand type for < ("Customer1") [operator] -dataclasses_transform_class.py:79: error: Too many positional arguments for "Customer2" [misc] -dataclasses_transform_class.py:119: error: Property "id" defined in "Customer3" is read-only [misc] +dataclasses_transform_class.py:51: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_class.py:63: error: Property "id" defined in "Customer1" is read-only [misc] +dataclasses_transform_class.py:66: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_class.py:72: error: Unsupported left operand type for < ("Customer1") [operator] +dataclasses_transform_class.py:82: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_class.py:122: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_transform_func.toml b/conformance/results/mypy/dataclasses_transform_func.toml index c15824b79..e1ea0a9d2 100644 --- a/conformance/results/mypy/dataclasses_transform_func.toml +++ b/conformance/results/mypy/dataclasses_transform_func.toml @@ -4,15 +4,14 @@ Does not handle `kw_only=False` override when `kw_only_default=True`. Does not report error when `order=False` and comparison operators are used. """ output = """ -dataclasses_transform_func.py:53: error: Too many positional arguments for "Customer1" [misc] -dataclasses_transform_func.py:57: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] -dataclasses_transform_func.py:65: error: Unexpected keyword argument "salary" for "Customer1" [call-arg] -dataclasses_transform_func.py:71: error: Too many positional arguments for "Customer2" [misc] -dataclasses_transform_func.py:90: error: Cannot inherit non-frozen dataclass from a frozen one [misc] -dataclasses_transform_func.py:97: error: Property "id" defined in "Customer3" is read-only [misc] +dataclasses_transform_func.py:38: note: "Customer1" defined here +dataclasses_transform_func.py:68: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] +dataclasses_transform_func.py:76: error: Unexpected keyword argument "salary" for "Customer1" [call-arg] +dataclasses_transform_func.py:101: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_func.py:111: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 61: Expected 1 errors -Line 53: Unexpected errors ['dataclasses_transform_func.py:53: error: Too many positional arguments for "Customer1" [misc]'] +Line 72: Expected 1 errors +Line 82: Expected 1 errors """ diff --git a/conformance/results/mypy/dataclasses_transform_meta.toml b/conformance/results/mypy/dataclasses_transform_meta.toml index 27f979e0d..5d1966324 100644 --- a/conformance/results/mypy/dataclasses_transform_meta.toml +++ b/conformance/results/mypy/dataclasses_transform_meta.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ -dataclasses_transform_meta.py:48: error: Cannot inherit non-frozen dataclass from a frozen one [misc] -dataclasses_transform_meta.py:60: error: Property "id" defined in "Customer1" is read-only [misc] -dataclasses_transform_meta.py:63: error: Too many positional arguments for "Customer1" [misc] -dataclasses_transform_meta.py:70: error: Unsupported left operand type for < ("Customer1") [operator] -dataclasses_transform_meta.py:80: error: Too many positional arguments for "Customer2" [misc] -dataclasses_transform_meta.py:100: error: Property "id" defined in "Customer3" is read-only [misc] +dataclasses_transform_meta.py:51: error: Cannot inherit non-frozen dataclass from a frozen one [misc] +dataclasses_transform_meta.py:63: error: Property "id" defined in "Customer1" is read-only [misc] +dataclasses_transform_meta.py:66: error: Too many positional arguments for "Customer1" [misc] +dataclasses_transform_meta.py:73: error: Unsupported left operand type for < ("Customer1") [operator] +dataclasses_transform_meta.py:83: error: Too many positional arguments for "Customer2" [misc] +dataclasses_transform_meta.py:103: error: Property "id" defined in "Customer3" is read-only [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/dataclasses_usage.toml b/conformance/results/mypy/dataclasses_usage.toml index 72bf10a7c..94be9e451 100644 --- a/conformance/results/mypy/dataclasses_usage.toml +++ b/conformance/results/mypy/dataclasses_usage.toml @@ -12,9 +12,9 @@ dataclasses_usage.py:67: error: Attributes without a default cannot follow attri dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one [misc] dataclasses_usage.py:83: error: Too many arguments for "DC4" [call-arg] dataclasses_usage.py:88: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment] -dataclasses_usage.py:126: error: Too many arguments for "DC7" [call-arg] -dataclasses_usage.py:129: error: Missing positional argument "y" in call to "DC8" [call-arg] -dataclasses_usage.py:178: error: Too many arguments for "DC13" [call-arg] +dataclasses_usage.py:127: error: Too many arguments for "DC7" [call-arg] +dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" [call-arg] +dataclasses_usage.py:183: error: Missing positional argument "x_squared" in call to "DC13" [call-arg] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/enums_member_values.toml b/conformance/results/mypy/enums_member_values.toml index 87ec4a09c..9b2a3a6f1 100644 --- a/conformance/results/mypy/enums_member_values.toml +++ b/conformance/results/mypy/enums_member_values.toml @@ -11,6 +11,6 @@ output = """ enums_member_values.py:26: error: Expression is of type "Any", not "Literal[1, 3]" [assert-type] enums_member_values.py:54: error: Expression is of type "tuple[int, float, float]", not "Literal[1]" [assert-type] enums_member_values.py:68: error: Expression is of type "int", not "Literal[1]" [assert-type] -enums_member_values.py:85: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] -enums_member_values.py:96: error: Expression is of type "EllipsisType", not "int" [assert-type] +enums_member_values.py:88: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] +enums_member_values.py:99: error: Expression is of type "EllipsisType", not "int" [assert-type] """ diff --git a/conformance/results/mypy/enums_members.toml b/conformance/results/mypy/enums_members.toml index 1c6b709ba..a1d4ac3da 100644 --- a/conformance/results/mypy/enums_members.toml +++ b/conformance/results/mypy/enums_members.toml @@ -10,33 +10,33 @@ Does not support `_ignore_` mechanism (optional). """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors -Line 78: Expected 1 errors -Line 79: Expected 1 errors -Line 112: Expected 1 errors -Line 23: Unexpected errors ['enums_members.py:23: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]'] -Line 24: Unexpected errors ['enums_members.py:24: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]'] -Line 31: Unexpected errors ['enums_members.py:31: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]'] -Line 32: Unexpected errors ['enums_members.py:32: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]'] -Line 96: Unexpected errors ['enums_members.py:96: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]'] -Line 113: Unexpected errors ['enums_members.py:113: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]', 'enums_members.py:113: error: Parameter 1 of Literal[...] is invalid [valid-type]'] +Line 50: Expected 1 errors +Line 82: Expected 1 errors +Line 83: Expected 1 errors +Line 116: Expected 1 errors +Line 27: Unexpected errors ['enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type]'] +Line 28: Unexpected errors ['enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type]'] +Line 35: Unexpected errors ['enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type]'] +Line 36: Unexpected errors ['enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type]'] +Line 100: Unexpected errors ['enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type]'] +Line 117: Unexpected errors ['enums_members.py:117: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type]', 'enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type]'] """ output = """ -enums_members.py:23: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type] -enums_members.py:24: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type] -enums_members.py:31: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type] -enums_members.py:32: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type] -enums_members.py:80: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type] -enums_members.py:80: error: Parameter 1 of Literal[...] is invalid [valid-type] -enums_members.py:81: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type] -enums_members.py:81: error: Parameter 1 of Literal[...] is invalid [valid-type] -enums_members.py:96: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type] -enums_members.py:113: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type] -enums_members.py:113: error: Parameter 1 of Literal[...] is invalid [valid-type] -enums_members.py:124: note: Revealed type is "Any" -enums_members.py:124: note: 'reveal_type' always outputs 'Any' in unchecked functions -enums_members.py:125: error: Expression is of type "Any", not "Literal[Example2.__B]" [assert-type] -enums_members.py:125: note: "assert_type" expects everything to be "Any" in unchecked functions -enums_members.py:142: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type] -enums_members.py:143: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type] +enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str" [assert-type] +enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type] +enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type] +enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type] +enums_members.py:84: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type] +enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:85: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type] +enums_members.py:85: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:100: error: Expression is of type "Literal[TrafficLight.AMBER]", not "Literal[TrafficLight.YELLOW]" [assert-type] +enums_members.py:117: error: Expression is of type "member[Callable[[Example], None]]", not "Any" [assert-type] +enums_members.py:117: error: Parameter 1 of Literal[...] is invalid [valid-type] +enums_members.py:128: note: Revealed type is "Any" +enums_members.py:128: note: 'reveal_type' always outputs 'Any' in unchecked functions +enums_members.py:129: error: Expression is of type "Any", not "Literal[Example2.__B]" [assert-type] +enums_members.py:129: note: "assert_type" expects everything to be "Any" in unchecked functions +enums_members.py:146: error: Expression is of type "Literal[Pet5.DOG]", not "int" [assert-type] +enums_members.py:147: error: Expression is of type "Literal[Pet5.FISH]", not "int" [assert-type] """ diff --git a/conformance/results/mypy/generics_scoping.toml b/conformance/results/mypy/generics_scoping.toml index cffdc23b9..d9be0a027 100644 --- a/conformance/results/mypy/generics_scoping.toml +++ b/conformance/results/mypy/generics_scoping.toml @@ -14,16 +14,16 @@ generics_scoping.py:65: error: Free type variable expected in Generic[...] [mis generics_scoping.py:78: error: Type variable "generics_scoping.T" is unbound [valid-type] generics_scoping.py:78: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_scoping.py:78: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:84: error: Can't use bound type variable "T" to define generic alias [valid-type] -generics_scoping.py:88: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:88: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:88: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:89: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:89: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:89: note: (Hint: Use "T" in function signature to bind "T" inside a function) -generics_scoping.py:90: error: Type variable "generics_scoping.T" is unbound [valid-type] -generics_scoping.py:90: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_scoping.py:90: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:87: error: Can't use bound type variable "T" to define generic alias [valid-type] +generics_scoping.py:94: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:94: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:94: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:95: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:95: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:95: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound [valid-type] +generics_scoping.py:96: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_scoping.py:96: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/generics_self_basic.toml b/conformance/results/mypy/generics_self_basic.toml index 1c3ea6402..c902871c3 100644 --- a/conformance/results/mypy/generics_self_basic.toml +++ b/conformance/results/mypy/generics_self_basic.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ generics_self_basic.py:20: error: Incompatible return value type (got "Shape", expected "Self") [return-value] generics_self_basic.py:33: error: Incompatible return value type (got "Shape", expected "Self") [return-value] -generics_self_basic.py:64: error: Self type cannot have type arguments [misc] +generics_self_basic.py:67: error: Self type cannot have type arguments [misc] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/generics_type_erasure.toml b/conformance/results/mypy/generics_type_erasure.toml index 86e3cf0ae..78d330b9a 100644 --- a/conformance/results/mypy/generics_type_erasure.toml +++ b/conformance/results/mypy/generics_type_erasure.toml @@ -4,18 +4,18 @@ Infers Node[Never] instead of Node[Any] when argument is not provided. False negative on instance attribute access on type(node). """ output = """ -generics_type_erasure.py:17: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type] -generics_type_erasure.py:20: error: Expression is of type Never, not "Any" [assert-type] -generics_type_erasure.py:36: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] -generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type] -generics_type_erasure.py:40: error: Access to generic instance variables via class is ambiguous [misc] -generics_type_erasure.py:41: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type] +generics_type_erasure.py:22: error: Expression is of type Never, not "Any" [assert-type] +generics_type_erasure.py:38: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] +generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type] generics_type_erasure.py:42: error: Access to generic instance variables via class is ambiguous [misc] generics_type_erasure.py:43: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:44: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:45: error: Access to generic instance variables via class is ambiguous [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors -Line 17: Unexpected errors ['generics_type_erasure.py:17: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]'] -Line 20: Unexpected errors ['generics_type_erasure.py:20: error: Expression is of type Never, not "Any" [assert-type]'] +Line 46: Expected 1 errors +Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type]'] +Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type Never, not "Any" [assert-type]'] """ diff --git a/conformance/results/mypy/protocols_class_objects.toml b/conformance/results/mypy/protocols_class_objects.toml index 48cccc872..c2fae510f 100644 --- a/conformance/results/mypy/protocols_class_objects.toml +++ b/conformance/results/mypy/protocols_class_objects.toml @@ -12,14 +12,14 @@ protocols_class_objects.py:74: error: Incompatible types in assignment (expressi protocols_class_objects.py:74: note: Following member(s) of "ConcreteB" have conflicts: protocols_class_objects.py:74: note: prop1: expected "int", got "Callable[[ConcreteB], int]" protocols_class_objects.py:74: note: Only class variables allowed for class object access on protocols, prop1 is an instance variable of "ConcreteB" -protocols_class_objects.py:101: error: Incompatible types in assignment (expression has type "type[ConcreteC1]", variable has type "ProtoC1") [assignment] -protocols_class_objects.py:101: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object -protocols_class_objects.py:103: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC1") [assignment] -protocols_class_objects.py:103: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:103: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object -protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC2") [assignment] -protocols_class_objects.py:104: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:105: error: Incompatible types in assignment (expression has type "type[ConcreteC3]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "type[ConcreteC1]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:104: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object +protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:106: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" +protocols_class_objects.py:106: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object +protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC2") [assignment] +protocols_class_objects.py:107: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" +protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "type[ConcreteC3]", variable has type "ProtoC1") [assignment] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/protocols_explicit.toml b/conformance/results/mypy/protocols_explicit.toml index 46491e4d9..5c4cea2ea 100644 --- a/conformance/results/mypy/protocols_explicit.toml +++ b/conformance/results/mypy/protocols_explicit.toml @@ -5,12 +5,12 @@ Does not report unimplemented attributes for class that explicitly derives from output = """ protocols_explicit.py:27: error: Call to abstract method "draw" of "PColor" with trivial body via super() is unsafe [safe-super] protocols_explicit.py:56: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", base class "RGB" defined the type as "tuple[int, int, int]") [assignment] -protocols_explicit.py:59: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity", "other" and "transparency" [abstract] -protocols_explicit.py:86: error: Cannot instantiate abstract class "Concrete1" with abstract attributes "cm1" and "im1" [abstract] -protocols_explicit.py:104: error: Cannot instantiate abstract class "Concrete3" with abstract attributes "cm10", "cm11" and "im1" [abstract] -protocols_explicit.py:129: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] -protocols_explicit.py:159: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] +protocols_explicit.py:60: error: Cannot instantiate abstract class "Point" with abstract attributes "intensity" and "transparency" [abstract] +protocols_explicit.py:135: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] +protocols_explicit.py:165: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 90: Expected 1 errors +Line 110: Expected 1 errors """ diff --git a/conformance/results/mypy/specialtypes_never.toml b/conformance/results/mypy/specialtypes_never.toml index 04e942227..49ac22f1e 100644 --- a/conformance/results/mypy/specialtypes_never.toml +++ b/conformance/results/mypy/specialtypes_never.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ specialtypes_never.py:19: error: Implicit return in function which does not return [misc] -specialtypes_never.py:82: error: Incompatible types in assignment (expression has type "list[NoReturn]", variable has type "list[int]") [assignment] -specialtypes_never.py:82: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance -specialtypes_never.py:82: note: Consider using "Sequence" instead, which is covariant -specialtypes_never.py:101: error: Incompatible return value type (got "ClassC[NoReturn]", expected "ClassC[U]") [return-value] +specialtypes_never.py:86: error: Incompatible types in assignment (expression has type "list[NoReturn]", variable has type "list[int]") [assignment] +specialtypes_never.py:86: note: "List" is invariant -- see https://mypy.readthedocs.io/en/stable/common_issues.html#variance +specialtypes_never.py:86: note: Consider using "Sequence" instead, which is covariant +specialtypes_never.py:105: error: Incompatible return value type (got "ClassC[NoReturn]", expected "ClassC[U]") [return-value] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/typeddicts_required.toml b/conformance/results/mypy/typeddicts_required.toml index e4e89e9bf..885bf8575 100644 --- a/conformance/results/mypy/typeddicts_required.toml +++ b/conformance/results/mypy/typeddicts_required.toml @@ -4,14 +4,14 @@ Does not support nesting of `Annotated` and `Required` or `NotRequired`. """ output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:16: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:59: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:60: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:65: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:67: error: Required[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:62: error: Required[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:63: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type] """ conformance_automated = "Fail" errors_diff = """ -Line 65: Unexpected errors ['typeddicts_required.py:65: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 67: Unexpected errors ['typeddicts_required.py:67: error: Required[] can be only used in a TypedDict definition [valid-type]'] +Line 68: Unexpected errors ['typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type]'] +Line 70: Unexpected errors ['typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index b39cbad6f..39314b44d 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.10.1" -test_duration = 1.4 +test_duration = 1.2 diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index a2cc47c12..1e4ecf739 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -22,10 +22,9 @@ 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: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 ` +annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation ` """ conformance_automated = "Fail" errors_diff = """ @@ -36,7 +35,6 @@ Line 25: Expected 1 errors Line 54: Expected 1 errors Line 66: Expected 1 errors Line 89: Expected 1 errors -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 `'] +Line 103: Unexpected errors ['annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation `'] """ diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index b5dd9e022..52902aedc 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -18,9 +18,8 @@ classes_classvar.py:52:4 Incompatible attribute type [8]: Attribute `bad8` decla 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`. +classes_classvar.py:105:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? +classes_classvar.py:134:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. """ conformance_automated = "Fail" errors_diff = """ @@ -36,5 +35,4 @@ Line 71: Expected 1 errors 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.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_class.toml b/conformance/results/pyre/dataclasses_transform_class.toml index 3c0b52dbd..bdb113d36 100644 --- a/conformance/results/pyre/dataclasses_transform_class.toml +++ b/conformance/results/pyre/dataclasses_transform_class.toml @@ -4,21 +4,19 @@ Does not support field specifiers. Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_class.py:28:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized. -dataclasses_transform_class.py:48:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. -dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. -dataclasses_transform_class.py:60:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. -dataclasses_transform_class.py:63:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:69:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_class.py:79:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:87:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. -dataclasses_transform_class.py:108:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. -dataclasses_transform_class.py:119:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. +dataclasses_transform_class.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. +dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. +dataclasses_transform_class.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. +dataclasses_transform_class.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_class.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. +dataclasses_transform_class.py:82:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. +dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. +dataclasses_transform_class.py:122:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 28: Unexpected errors ['dataclasses_transform_class.py:28:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized.'] -Line 57: Unexpected errors ['dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] -Line 87: Unexpected errors ['dataclasses_transform_class.py:87:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] -Line 108: Unexpected errors ['dataclasses_transform_class.py:108:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] +Line 60: Unexpected errors ['dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] +Line 90: Unexpected errors ['dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] +Line 111: Unexpected errors ['dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_func.toml b/conformance/results/pyre/dataclasses_transform_func.toml index 2f69091f4..a50417b0b 100644 --- a/conformance/results/pyre/dataclasses_transform_func.toml +++ b/conformance/results/pyre/dataclasses_transform_func.toml @@ -8,36 +8,18 @@ output = """ dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`. dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized. -dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized. -dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. -dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized. -dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized. -dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_func.py:57:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`. -dataclasses_transform_func.py:61:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_func.py:65:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:71:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. -dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized. -dataclasses_transform_func.py:97:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. +dataclasses_transform_func.py:68:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`. +dataclasses_transform_func.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. +dataclasses_transform_func.py:76:7 Unexpected keyword [28]: Unexpected keyword argument `salary` to call `Customer1.__init__`. +dataclasses_transform_func.py:84:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. +dataclasses_transform_func.py:111:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Lines 89, 90: Expected error (tag 'Customer3Subclass') +Line 82: Expected 1 errors +Lines 100, 101: Expected error (tag 'Customer3Subclass') Line 20: Unexpected errors ['dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`.'] Line 25: Unexpected errors ["dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] Line 29: Unexpected errors ['dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.'] -Line 36: Unexpected errors ['dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.'] -Line 41: Unexpected errors ['dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.'] -Line 42: Unexpected errors ['dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.'] -Line 47: Unexpected errors ['dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.'] -Line 50: Unexpected errors ['dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 53: Unexpected errors ['dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.'] -Line 67: Unexpected errors ['dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 73: Unexpected errors ['dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] -Line 91: Unexpected errors ['dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.'] +Line 84: Unexpected errors ['dataclasses_transform_func.py:84:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_meta.toml b/conformance/results/pyre/dataclasses_transform_meta.toml index 66f13cb29..ffcce3b41 100644 --- a/conformance/results/pyre/dataclasses_transform_meta.toml +++ b/conformance/results/pyre/dataclasses_transform_meta.toml @@ -5,19 +5,17 @@ Incorrectly rejects frozen dataclass that inherits from non-frozen. Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_meta.py:26:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized. -dataclasses_transform_meta.py:40:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`. -dataclasses_transform_meta.py:48:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. -dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. -dataclasses_transform_meta.py:60:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. -dataclasses_transform_meta.py:63:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:70:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_meta.py:80:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:100:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. +dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`. +dataclasses_transform_meta.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. +dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. +dataclasses_transform_meta.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. +dataclasses_transform_meta.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_meta.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. +dataclasses_transform_meta.py:83:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_meta.py:103:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 26: Unexpected errors ['dataclasses_transform_meta.py:26:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized.'] -Line 40: Unexpected errors ['dataclasses_transform_meta.py:40:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`.'] -Line 57: Unexpected errors ['dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] +Line 43: Unexpected errors ['dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`.'] +Line 60: Unexpected errors ['dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] """ diff --git a/conformance/results/pyre/dataclasses_usage.toml b/conformance/results/pyre/dataclasses_usage.toml index c9c1c81c6..6bc116199 100644 --- a/conformance/results/pyre/dataclasses_usage.toml +++ b/conformance/results/pyre/dataclasses_usage.toml @@ -12,14 +12,11 @@ dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribu dataclasses_usage.py:83:5 Too many arguments [19]: Call `DC4.__init__` expects 1 positional argument, 2 were provided. dataclasses_usage.py:88:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC5` has type `int` but is used as type `str`. dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`. -dataclasses_usage.py:116:4 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized. -dataclasses_usage.py:126:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. -dataclasses_usage.py:129:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. -dataclasses_usage.py:172:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized. -dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. -dataclasses_usage.py:178:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -dataclasses_usage.py:204:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. -dataclasses_usage.py:212:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. +dataclasses_usage.py:127:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. +dataclasses_usage.py:130:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. +dataclasses_usage.py:183:0 Missing argument [20]: Call `DC13.__init__` expects argument `x_squared`. +dataclasses_usage.py:209:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. +dataclasses_usage.py:217:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. """ conformance_automated = "Fail" errors_diff = """ @@ -28,9 +25,6 @@ Lines 64, 67: Expected error (tag 'DC2') Lines 70, 73: Expected error (tag 'DC3') Line 72: Unexpected errors ['dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] Line 106: Unexpected errors ['dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`.'] -Line 116: Unexpected errors ['dataclasses_usage.py:116:4 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized.'] -Line 172: Unexpected errors ['dataclasses_usage.py:172:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.'] -Line 173: Unexpected errors ['dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] -Line 204: Unexpected errors ['dataclasses_usage.py:204:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] -Line 212: Unexpected errors ['dataclasses_usage.py:212:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`.'] +Line 209: Unexpected errors ['dataclasses_usage.py:209:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] +Line 217: Unexpected errors ['dataclasses_usage.py:217:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`.'] """ diff --git a/conformance/results/pyre/enums_member_values.toml b/conformance/results/pyre/enums_member_values.toml index 842417414..936663704 100644 --- a/conformance/results/pyre/enums_member_values.toml +++ b/conformance/results/pyre/enums_member_values.toml @@ -8,8 +8,7 @@ Does not evaluate literal types for auto values (optional). conformance_automated = "Fail" errors_diff = """ Line 78: Expected 1 errors -Line 85: Expected 1 errors -Line 76: Unexpected errors ['enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized.'] +Line 88: Expected 1 errors """ output = """ enums_member_values.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. @@ -18,6 +17,5 @@ enums_member_values.py:26:4 Incompatible parameter type [6]: In call `assert_typ enums_member_values.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[2], typing_extensions.Literal[3]]` but got `typing.Any`. enums_member_values.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. enums_member_values.py:68:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized. -enums_member_values.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +enums_member_values.py:99:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. """ diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml index 260feff43..914ecb99f 100644 --- a/conformance/results/pyre/enums_members.toml +++ b/conformance/results/pyre/enums_members.toml @@ -11,35 +11,31 @@ Does not support `_ignore_` mechanism (optional). """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors -Line 78: Expected 1 errors -Line 79: Expected 1 errors -Line 112: Expected 1 errors -Line 125: Expected 1 errors -Line 16: Unexpected errors ['enums_members.py:16:4 Uninitialized attribute [13]: Attribute `genus` is declared in class `Pet` to have type `Pet` but is never initialized.'] -Line 17: Unexpected errors ['enums_members.py:17:4 Uninitialized attribute [13]: Attribute `species` is declared in class `Pet` to have type `Pet` but is never initialized.'] -Line 23: Unexpected errors ['enums_members.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] -Line 24: Unexpected errors ['enums_members.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] -Line 31: Unexpected errors ['enums_members.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] -Line 32: Unexpected errors ['enums_members.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] -Line 96: Unexpected errors ['enums_members.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] -Line 113: Unexpected errors ['enums_members.py:113:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`.'] -Line 124: Unexpected errors ['enums_members.py:124:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final).'] -Line 135: Unexpected errors ['enums_members.py:135:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] +Line 50: Expected 1 errors +Line 82: Expected 1 errors +Line 83: Expected 1 errors +Line 116: Expected 1 errors +Line 129: Expected 1 errors +Line 27: Unexpected errors ['enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] +Line 28: Unexpected errors ['enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] +Line 35: Unexpected errors ['enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] +Line 36: Unexpected errors ['enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] +Line 100: Unexpected errors ['enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] +Line 117: Unexpected errors ['enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`.'] +Line 128: Unexpected errors ['enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final).'] +Line 139: Unexpected errors ['enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] """ output = """ -enums_members.py:16:4 Uninitialized attribute [13]: Attribute `genus` is declared in class `Pet` to have type `Pet` but is never initialized. -enums_members.py:17:4 Uninitialized attribute [13]: Attribute `species` is declared in class `Pet` to have type `Pet` but is never initialized. -enums_members.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. -enums_members.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. -enums_members.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. -enums_members.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. -enums_members.py:80:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.species]` but got `str`. -enums_members.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. -enums_members.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. -enums_members.py:113:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`. -enums_members.py:124:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final). -enums_members.py:135:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`. -enums_members.py:142:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. -enums_members.py:143:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. +enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. +enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. +enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. +enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. +enums_members.py:84:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.species]` but got `str`. +enums_members.py:85:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. +enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. +enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`. +enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final). +enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`. +enums_members.py:146:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. +enums_members.py:147:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. """ diff --git a/conformance/results/pyre/generics_scoping.toml b/conformance/results/pyre/generics_scoping.toml index 6b38cc47d..ae6cd48ca 100644 --- a/conformance/results/pyre/generics_scoping.toml +++ b/conformance/results/pyre/generics_scoping.toml @@ -11,13 +11,11 @@ generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`. generics_scoping.py:50:7 Invalid type variable [34]: The type variable `Variable[S]` isn't present in the function's parameters. generics_scoping.py:54:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[S]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[S]`. -generics_scoping.py:78:8 Uninitialized attribute [13]: Attribute `x` is declared in class `Outer.AlsoBad` to have type `typing.List[Variable[T]]` but is never initialized. generics_scoping.py:78:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. -generics_scoping.py:82:4 Uninitialized attribute [13]: Attribute `attr` is declared in class `Outer` to have type `Outer.Inner[Variable[T]]` but is never initialized. -generics_scoping.py:84:23 Undefined attribute [16]: `list` has no attribute `__getitem__`. -generics_scoping.py:88:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. -generics_scoping.py:89:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. -generics_scoping.py:90:0 Undefined attribute [16]: `list` has no attribute `__getitem__`. +generics_scoping.py:87:23 Undefined attribute [16]: `list` has no attribute `__getitem__`. +generics_scoping.py:94:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. +generics_scoping.py:95:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. +generics_scoping.py:96:0 Undefined attribute [16]: `list` has no attribute `__getitem__`. """ conformance_automated = "Fail" errors_diff = """ @@ -28,4 +26,3 @@ Line 15: Unexpected errors ["generics_scoping.py:15:0 Incompatible parameter typ Line 42: Unexpected errors ["generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['abc']`."] Line 43: Unexpected errors ["generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`."] """ -ignore_errors = ["Uninitialized attribute [13]"] diff --git a/conformance/results/pyre/generics_self_basic.toml b/conformance/results/pyre/generics_self_basic.toml index 41c5b5be9..8b64f8127 100644 --- a/conformance/results/pyre/generics_self_basic.toml +++ b/conformance/results/pyre/generics_self_basic.toml @@ -9,13 +9,11 @@ generics_self_basic.py:20:8 Incompatible return type [7]: Expected `Variable[_Se generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`. generics_self_basic.py:33:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. -generics_self_basic.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ -Line 64: Expected 1 errors +Line 67: Expected 1 errors Line 14: Unexpected errors ['generics_self_basic.py:14:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.', 'generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] Line 27: Unexpected errors ['generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] Line 40: Unexpected errors ['generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] -Line 59: Unexpected errors ['generics_self_basic.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized.'] """ diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index 2da356429..f2bc6919e 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -5,26 +5,24 @@ False negatives on instance attribute access on the type. Does not infer type of `DefaultDict` with explicit type parameters on constructor. """ output = """ -generics_type_erasure.py:12:4 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized. -generics_type_erasure.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. -generics_type_erasure.py:16:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. -generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`. -generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`. -generics_type_erasure.py:36:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. -generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. -generics_type_erasure.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`. +generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. +generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. +generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`. +generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`. +generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. +generics_type_erasure.py:40:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. +generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors -Line 41: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors -Line 12: Unexpected errors ['generics_type_erasure.py:12:4 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized.'] -Line 15: Unexpected errors ["generics_type_erasure.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] -Line 16: Unexpected errors ['generics_type_erasure.py:16:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] -Line 17: Unexpected errors ['generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] -Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`.'] -Line 54: Unexpected errors ['generics_type_erasure.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`.'] +Line 45: Expected 1 errors +Line 46: Expected 1 errors +Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] +Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] +Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] +Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`.'] +Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/protocols_class_objects.toml b/conformance/results/pyre/protocols_class_objects.toml index 228b0e384..9a640450a 100644 --- a/conformance/results/pyre/protocols_class_objects.toml +++ b/conformance/results/pyre/protocols_class_objects.toml @@ -7,17 +7,15 @@ Fails to report some class objects as incompatible with a protocol. output = """ protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`. protocols_class_objects.py:58:0 Incompatible variable type [9]: pa1 is declared to have type `ProtoA1` but is used as type `Type[ConcreteA]`. -protocols_class_objects.py:94:4 Uninitialized attribute [13]: Attribute `attr1` is declared in class `CMeta` to have type `int` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ Line 29: Expected 1 errors Line 34: Expected 1 errors Line 74: Expected 1 errors -Line 101: Expected 1 errors -Line 103: Expected 1 errors Line 104: Expected 1 errors -Line 105: Expected 1 errors +Line 106: Expected 1 errors +Line 107: Expected 1 errors +Line 108: Expected 1 errors Line 26: Unexpected errors ['protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`.'] -Line 94: Unexpected errors ['protocols_class_objects.py:94:4 Uninitialized attribute [13]: Attribute `attr1` is declared in class `CMeta` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/protocols_explicit.toml b/conformance/results/pyre/protocols_explicit.toml index 20d00e13e..0e7d70ef0 100644 --- a/conformance/results/pyre/protocols_explicit.toml +++ b/conformance/results/pyre/protocols_explicit.toml @@ -4,23 +4,14 @@ Does not report error when calling unimplemented protocol method from derived cl Does not report error when method is not implemented in derived class. """ output = """ -protocols_explicit.py:54:0 Uninitialized attribute [13]: Attribute `other` inherited from protocol `RGB` in class `Point` to have type `int` but is never initialized. -protocols_explicit.py:59:4 Invalid class instantiation [45]: Cannot instantiate abstract class `Point` with abstract method `intensity`. -protocols_explicit.py:82:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized. -protocols_explicit.py:82:0 Uninitialized attribute [13]: Attribute `im1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized. -protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `cm10` inherited from protocol `Proto2` in class `Concrete3` to have type `int` but is never initialized. -protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `cm11` inherited from protocol `Proto3` in class `Concrete3` to have type `int` but is never initialized. -protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `im1` inherited from protocol `Proto1` in class `Concrete3` to have type `int` but is never initialized. -protocols_explicit.py:159:6 Invalid class instantiation [45]: Cannot instantiate abstract class `Concrete7A` with abstract method `method1`. +protocols_explicit.py:60:4 Invalid class instantiation [45]: Cannot instantiate abstract class `Point` with abstract method `intensity`. +protocols_explicit.py:165:6 Invalid class instantiation [45]: Cannot instantiate abstract class `Concrete7A` with abstract method `method1`. """ conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors Line 56: Expected 1 errors -Line 86: Expected 1 errors -Line 104: Expected 1 errors -Line 129: Expected 1 errors -Line 54: Unexpected errors ['protocols_explicit.py:54:0 Uninitialized attribute [13]: Attribute `other` inherited from protocol `RGB` in class `Point` to have type `int` but is never initialized.'] -Line 82: Unexpected errors ['protocols_explicit.py:82:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized.', 'protocols_explicit.py:82:0 Uninitialized attribute [13]: Attribute `im1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized.'] -Line 97: Unexpected errors ['protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `cm10` inherited from protocol `Proto2` in class `Concrete3` to have type `int` but is never initialized.', 'protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `cm11` inherited from protocol `Proto3` in class `Concrete3` to have type `int` but is never initialized.', 'protocols_explicit.py:97:0 Uninitialized attribute [13]: Attribute `im1` inherited from protocol `Proto1` in class `Concrete3` to have type `int` but is never initialized.'] +Line 90: Expected 1 errors +Line 110: Expected 1 errors +Line 135: Expected 1 errors """ diff --git a/conformance/results/pyre/specialtypes_never.toml b/conformance/results/pyre/specialtypes_never.toml index 0a02bef8f..d65de23ed 100644 --- a/conformance/results/pyre/specialtypes_never.toml +++ b/conformance/results/pyre/specialtypes_never.toml @@ -4,25 +4,21 @@ Does not treat Never as compatible with all other types. """ output = """ specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`. -specialtypes_never.py:56:4 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `NoReturn` but is never initialized. -specialtypes_never.py:57:4 Uninitialized attribute [13]: Attribute `y` is declared in class `ClassA` to have type `typing.List[NoReturn]` but is never initialized. -specialtypes_never.py:64:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`. -specialtypes_never.py:65:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`. -specialtypes_never.py:66:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`. -specialtypes_never.py:82:4 Incompatible variable type [9]: v3 is declared to have type `List[int]` but is used as type `List[Never]`. -specialtypes_never.py:83:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`. -specialtypes_never.py:92:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`. -specialtypes_never.py:101:4 Incompatible return type [7]: Expected `ClassC[Variable[U]]` but got `ClassC[Never]`. +specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`. +specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`. +specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`. +specialtypes_never.py:86:4 Incompatible variable type [9]: v3 is declared to have type `List[int]` but is used as type `List[Never]`. +specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`. +specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`. +specialtypes_never.py:105:4 Incompatible return type [7]: Expected `ClassC[Variable[U]]` but got `ClassC[Never]`. """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 21: Unexpected errors ['specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`.'] -Line 56: Unexpected errors ['specialtypes_never.py:56:4 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `NoReturn` but is never initialized.'] -Line 57: Unexpected errors ['specialtypes_never.py:57:4 Uninitialized attribute [13]: Attribute `y` is declared in class `ClassA` to have type `typing.List[NoReturn]` but is never initialized.'] -Line 64: Unexpected errors ['specialtypes_never.py:64:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`.'] -Line 65: Unexpected errors ['specialtypes_never.py:65:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`.'] -Line 66: Unexpected errors ['specialtypes_never.py:66:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`.'] -Line 83: Unexpected errors ['specialtypes_never.py:83:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`.'] -Line 92: Unexpected errors ['specialtypes_never.py:92:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`.'] +Line 68: Unexpected errors ['specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`.'] +Line 69: Unexpected errors ['specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`.'] +Line 70: Unexpected errors ['specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`.'] +Line 87: Unexpected errors ['specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`.'] +Line 96: Unexpected errors ['specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`.'] """ diff --git a/conformance/results/pyre/typeddicts_class_syntax.toml b/conformance/results/pyre/typeddicts_class_syntax.toml index 86a0789e8..d9b364a2e 100644 --- a/conformance/results/pyre/typeddicts_class_syntax.toml +++ b/conformance/results/pyre/typeddicts_class_syntax.toml @@ -6,8 +6,6 @@ Does not report when other keyword argument is provided. Does not support generic TypedDict class. """ output = """ -typeddicts_class_syntax.py:58:4 Uninitialized attribute [13]: Attribute `name` is declared in class `GenericTypedDict` to have type `str` but is never initialized. -typeddicts_class_syntax.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `GenericTypedDict` to have type `Variable[T]` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ @@ -16,6 +14,4 @@ Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors -Line 58: Unexpected errors ['typeddicts_class_syntax.py:58:4 Uninitialized attribute [13]: Attribute `name` is declared in class `GenericTypedDict` to have type `str` but is never initialized.'] -Line 59: Unexpected errors ['typeddicts_class_syntax.py:59:4 Uninitialized attribute [13]: Attribute `value` is declared in class `GenericTypedDict` to have type `Variable[T]` but is never initialized.'] """ diff --git a/conformance/results/pyre/typeddicts_required.toml b/conformance/results/pyre/typeddicts_required.toml index 78870ad01..2d84becd8 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -7,15 +7,17 @@ Incorrectly complains about uninitialized attributes on TypedDict definitions. Incorrectly generates "attribute not initialized" errors for TypedDict fields. """ output = """ -typeddicts_required.py:12:4 Uninitialized attribute [13]: Attribute `x` is declared in class `NotTypedDict` to have type `Required[int]` but is never initialized. -typeddicts_required.py:71:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type. -typeddicts_required.py:74:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`. +typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`. +typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type. +typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`. """ conformance_automated = "Fail" errors_diff = """ -Line 16: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors -Line 71: Unexpected errors ['typeddicts_required.py:71:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type.'] -Line 74: Unexpected errors ['typeddicts_required.py:74:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`.'] +Line 12: Expected 1 errors +Line 19: Expected 1 errors +Line 62: Expected 1 errors +Line 63: Expected 1 errors +Line 15: Unexpected errors ['typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`.'] +Line 74: Unexpected errors ['typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type.'] +Line 77: Unexpected errors ['typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`.'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index fff2c3f20..08d300f7d 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 2.8 +test_duration = 1.9 diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index 3e50fc7c1..641aa6973 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -15,10 +15,10 @@ classes_classvar.py:65:18 - error: "ClassVar" is not allowed in this context classes_classvar.py:67:26 - error: "ClassVar" is not allowed in this context classes_classvar.py:71:8 - error: "ClassVar" is not allowed in this context classes_classvar.py:72:20 - error: "ClassVar" is not allowed in this context -classes_classvar.py:102:14 - error: Cannot assign to attribute "stats" for class "Starship" +classes_classvar.py:105:14 - error: Cannot assign to attribute "stats" for class "Starship"   Attribute "stats" cannot be assigned through a class instance because it is a ClassVar     Attribute "__set__" is unknown (reportAttributeAccessIssue) -classes_classvar.py:131:13 - error: Expression of type "ProtoAImpl" is incompatible with declared type "ProtoA" +classes_classvar.py:134:13 - error: Expression of type "ProtoAImpl" is incompatible with declared type "ProtoA"   "ProtoAImpl" is incompatible with protocol "ProtoA"     "x" is defined as a ClassVar in protocol     "y" is defined as a ClassVar in protocol (reportAssignmentType) diff --git a/conformance/results/pyright/dataclasses_transform_class.toml b/conformance/results/pyright/dataclasses_transform_class.toml index 76157c6d6..b7bf3083f 100644 --- a/conformance/results/pyright/dataclasses_transform_class.toml +++ b/conformance/results/pyright/dataclasses_transform_class.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ -dataclasses_transform_class.py:48:7 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) -dataclasses_transform_class.py:60:6 - error: Cannot assign to attribute "id" for class "Customer1" +dataclasses_transform_class.py:51:7 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) +dataclasses_transform_class.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1"   "Customer1" is frozen     Attribute "__set__" is unknown (reportAttributeAccessIssue) -dataclasses_transform_class.py:63:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_class.py:69:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) -dataclasses_transform_class.py:79:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_class.py:119:6 - error: Cannot assign to attribute "id" for class "Customer3" +dataclasses_transform_class.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) +dataclasses_transform_class.py:72:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) +dataclasses_transform_class.py:82:18 - error: Expected 0 positional arguments (reportCallIssue) +dataclasses_transform_class.py:122:6 - error: Cannot assign to attribute "id" for class "Customer3"   "Customer3" is frozen     Attribute "__set__" is unknown (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/dataclasses_transform_func.toml b/conformance/results/pyright/dataclasses_transform_func.toml index 55a0df3e3..ffe65cedd 100644 --- a/conformance/results/pyright/dataclasses_transform_func.toml +++ b/conformance/results/pyright/dataclasses_transform_func.toml @@ -1,15 +1,27 @@ conformant = "Pass" output = """ -dataclasses_transform_func.py:57:13 - error: Cannot assign to attribute "name" for class "Customer1" +dataclasses_transform_func.py:49:14 - error: Cannot assign to attribute "id" for class "Customer2*" +  "Customer2" is frozen +    Attribute "__set__" is unknown (reportAttributeAccessIssue) +dataclasses_transform_func.py:50:14 - error: Cannot assign to attribute "name" for class "Customer2*" +  "Customer2" is frozen +    Attribute "__set__" is unknown (reportAttributeAccessIssue) +dataclasses_transform_func.py:58:14 - error: Cannot assign to attribute "salary" for class "Customer2Subclass*" +  "Customer2Subclass" is frozen +    Attribute "__set__" is unknown (reportAttributeAccessIssue) +dataclasses_transform_func.py:68:13 - error: Cannot assign to attribute "name" for class "Customer1"   "Literal[3]" is incompatible with "str" (reportAttributeAccessIssue) -dataclasses_transform_func.py:61:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) -dataclasses_transform_func.py:65:36 - error: No parameter named "salary" (reportCallIssue) -dataclasses_transform_func.py:71:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_func.py:89:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) -dataclasses_transform_func.py:97:6 - error: Cannot assign to attribute "id" for class "Customer3" +dataclasses_transform_func.py:72:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) +dataclasses_transform_func.py:76:36 - error: No parameter named "salary" (reportCallIssue) +dataclasses_transform_func.py:100:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) +dataclasses_transform_func.py:111:6 - error: Cannot assign to attribute "id" for class "Customer3"   "Customer3" is frozen     Attribute "__set__" is unknown (reportAttributeAccessIssue) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 82: Expected 1 errors +Line 49: Unexpected errors ['dataclasses_transform_func.py:49:14 - error: Cannot assign to attribute "id" for class "Customer2*"'] +Line 50: Unexpected errors ['dataclasses_transform_func.py:50:14 - error: Cannot assign to attribute "name" for class "Customer2*"'] +Line 58: Unexpected errors ['dataclasses_transform_func.py:58:14 - error: Cannot assign to attribute "salary" for class "Customer2Subclass*"'] """ diff --git a/conformance/results/pyright/dataclasses_transform_meta.toml b/conformance/results/pyright/dataclasses_transform_meta.toml index 6e77a130f..d59747196 100644 --- a/conformance/results/pyright/dataclasses_transform_meta.toml +++ b/conformance/results/pyright/dataclasses_transform_meta.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ -dataclasses_transform_meta.py:48:36 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) -dataclasses_transform_meta.py:60:6 - error: Cannot assign to attribute "id" for class "Customer1" +dataclasses_transform_meta.py:51:36 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) +dataclasses_transform_meta.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1"   "Customer1" is frozen     Attribute "__set__" is unknown (reportAttributeAccessIssue) -dataclasses_transform_meta.py:63:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_meta.py:70:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) -dataclasses_transform_meta.py:80:18 - error: Expected 0 positional arguments (reportCallIssue) -dataclasses_transform_meta.py:100:6 - error: Cannot assign to attribute "id" for class "Customer3" +dataclasses_transform_meta.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) +dataclasses_transform_meta.py:73:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) +dataclasses_transform_meta.py:83:18 - error: Expected 0 positional arguments (reportCallIssue) +dataclasses_transform_meta.py:103:6 - error: Cannot assign to attribute "id" for class "Customer3"   "Customer3" is frozen     Attribute "__set__" is unknown (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/dataclasses_usage.toml b/conformance/results/pyright/dataclasses_usage.toml index e9c7365f3..c66d6444c 100644 --- a/conformance/results/pyright/dataclasses_usage.toml +++ b/conformance/results/pyright/dataclasses_usage.toml @@ -10,10 +10,10 @@ dataclasses_usage.py:73:5 - error: Fields without default values cannot appear a dataclasses_usage.py:83:13 - error: Expected 1 positional argument (reportCallIssue) dataclasses_usage.py:88:36 - error: Argument of type "type[str]" cannot be assigned to parameter "default_factory" of type "() -> _T@field" in function "field"   No overloaded function matches type "() -> int" (reportArgumentType) -dataclasses_usage.py:126:8 - error: Expected 1 positional argument (reportCallIssue) -dataclasses_usage.py:129:1 - error: Argument missing for parameter "y" (reportCallIssue) -dataclasses_usage.py:178:1 - error: Expected no arguments to "DC13" constructor (reportCallIssue) -dataclasses_usage.py:227:9 - error: Dataclass field without type annotation will cause runtime exception (reportGeneralTypeIssues) +dataclasses_usage.py:127:8 - error: Expected 1 positional argument (reportCallIssue) +dataclasses_usage.py:130:1 - error: Argument missing for parameter "y" (reportCallIssue) +dataclasses_usage.py:183:1 - error: Argument missing for parameter "x_squared" (reportCallIssue) +dataclasses_usage.py:232:9 - error: Dataclass field without type annotation will cause runtime exception (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/enums_member_values.toml b/conformance/results/pyright/enums_member_values.toml index 566fcd4f5..37c07313d 100644 --- a/conformance/results/pyright/enums_member_values.toml +++ b/conformance/results/pyright/enums_member_values.toml @@ -7,8 +7,8 @@ enums_member_values.py:50:12 - error: Argument missing for parameter "radius" (r enums_member_values.py:51:15 - error: Arguments missing for parameters "mass", "radius" (reportCallIssue) enums_member_values.py:54:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "Any" (reportAssertTypeFailure) enums_member_values.py:68:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "int" (reportAssertTypeFailure) -enums_member_values.py:78:13 - error: Expression of type "Literal['green']" is incompatible with declared type "int" -  "Literal['green']" is incompatible with "int" (reportAssignmentType) -enums_member_values.py:85:24 - error: Cannot assign to attribute "_value_" for class "Planet2*" +enums_member_values.py:78:13 - error: Argument of type "Literal['green']" cannot be assigned to parameter "value" of type "int" in function "__init__" +  "Literal['green']" is incompatible with "int" (reportArgumentType) +enums_member_values.py:88:24 - error: Cannot assign to attribute "_value_" for class "Planet2*"   "int" is incompatible with "str" (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/enums_members.toml b/conformance/results/pyright/enums_members.toml index db932d715..ef78691b0 100644 --- a/conformance/results/pyright/enums_members.toml +++ b/conformance/results/pyright/enums_members.toml @@ -2,27 +2,31 @@ conformant = "Pass" notes = """ Does not support `_ignore_` mechanism (optional). """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 19: Unexpected errors ['enums_members.py:19:11 - error: Argument missing for parameter "species" (reportCallIssue)'] +Line 20: Unexpected errors ['enums_members.py:20:11 - error: Argument missing for parameter "species" (reportCallIssue)'] """ output = """ -enums_members.py:46:5 - error: Type annotations are not allowed for enum members (reportGeneralTypeIssues) -enums_members.py:78:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) -enums_members.py:78:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:78:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) -enums_members.py:79:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: int) -> int" (reportAssertTypeFailure) -enums_members.py:79:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:79:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) -enums_members.py:80:13 - error: "assert_type" mismatch: expected "Unknown" but received "property" (reportAssertTypeFailure) -enums_members.py:80:35 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:81:13 - error: "assert_type" mismatch: expected "Unknown" but received "(self: Pet4) -> None" (reportAssertTypeFailure) -enums_members.py:81:33 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:112:13 - error: "assert_type" mismatch: expected "Unknown" but received "int" (reportAssertTypeFailure) -enums_members.py:112:32 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:124:21 - information: Type of "Example2.__B" is "Literal[2]" -enums_members.py:125:21 - error: "assert_type" mismatch: expected "Unknown" but received "Literal[2]" (reportAssertTypeFailure) -enums_members.py:125:43 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value -enums_members.py:125:52 - error: Variable not allowed in type expression (reportInvalidTypeForm) -enums_members.py:142:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.DOG]" (reportAssertTypeFailure) -enums_members.py:143:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.FISH]" (reportAssertTypeFailure) +enums_members.py:19:11 - error: Argument missing for parameter "species" (reportCallIssue) +enums_members.py:20:11 - error: Argument missing for parameter "species" (reportCallIssue) +enums_members.py:50:5 - error: Type annotations are not allowed for enum members (reportGeneralTypeIssues) +enums_members.py:82:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: Unknown) -> str" (reportAssertTypeFailure) +enums_members.py:82:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:82:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) +enums_members.py:83:13 - error: "assert_type" mismatch: expected "Unknown" but received "(x: int) -> int" (reportAssertTypeFailure) +enums_members.py:83:37 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:83:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) +enums_members.py:84:13 - error: "assert_type" mismatch: expected "Unknown" but received "property" (reportAssertTypeFailure) +enums_members.py:84:35 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:85:13 - error: "assert_type" mismatch: expected "Unknown" but received "(self: Pet4) -> None" (reportAssertTypeFailure) +enums_members.py:85:33 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:116:13 - error: "assert_type" mismatch: expected "Unknown" but received "int" (reportAssertTypeFailure) +enums_members.py:116:32 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:128:21 - information: Type of "Example2.__B" is "Literal[2]" +enums_members.py:129:21 - error: "assert_type" mismatch: expected "Unknown" but received "Literal[2]" (reportAssertTypeFailure) +enums_members.py:129:43 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value +enums_members.py:129:52 - error: Variable not allowed in type expression (reportInvalidTypeForm) +enums_members.py:146:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.DOG]" (reportAssertTypeFailure) +enums_members.py:147:13 - error: "assert_type" mismatch: expected "int" but received "Literal[Pet5.FISH]" (reportAssertTypeFailure) """ diff --git a/conformance/results/pyright/generics_scoping.toml b/conformance/results/pyright/generics_scoping.toml index 229fa95ab..fc1bd87c1 100644 --- a/conformance/results/pyright/generics_scoping.toml +++ b/conformance/results/pyright/generics_scoping.toml @@ -7,10 +7,10 @@ generics_scoping.py:54:19 - error: Type variable "S" has no meaning in this cont generics_scoping.py:65:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) generics_scoping.py:75:24 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) generics_scoping.py:78:17 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:84:5 - error: Generic type alias within class cannot use bound type variables T -generics_scoping.py:88:14 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:89:19 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -generics_scoping.py:90:6 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:87:5 - error: Generic type alias within class cannot use bound type variables T +generics_scoping.py:94:14 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:95:19 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) +generics_scoping.py:96:6 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_basic.toml b/conformance/results/pyright/generics_self_basic.toml index 3fa07521f..a7a676071 100644 --- a/conformance/results/pyright/generics_self_basic.toml +++ b/conformance/results/pyright/generics_self_basic.toml @@ -4,7 +4,7 @@ generics_self_basic.py:20:16 - error: Expression of type "Shape" is incompatible   Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) generics_self_basic.py:33:16 - error: Expression of type "Shape" is incompatible with return type "Self@Shape"   Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) -generics_self_basic.py:64:31 - error: Expected no type arguments for class "Self" (reportInvalidTypeArguments) +generics_self_basic.py:67:31 - error: Expected no type arguments for class "Self" (reportInvalidTypeArguments) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_type_erasure.toml b/conformance/results/pyright/generics_type_erasure.toml index 35398f2c1..caf122a4e 100644 --- a/conformance/results/pyright/generics_type_erasure.toml +++ b/conformance/results/pyright/generics_type_erasure.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -generics_type_erasure.py:36:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__" +generics_type_erasure.py:38:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__"   Type "Literal['']" is incompatible with type "int | None"     "Literal['']" is incompatible with "int"     "Literal['']" is incompatible with "None" (reportArgumentType) -generics_type_erasure.py:38:16 - error: Argument of type "Literal[0]" cannot be assigned to parameter "label" of type "str | None" in function "__init__" +generics_type_erasure.py:40:16 - error: Argument of type "Literal[0]" cannot be assigned to parameter "label" of type "str | None" in function "__init__"   Type "Literal[0]" is incompatible with type "str | None"     "Literal[0]" is incompatible with "str"     "Literal[0]" is incompatible with "None" (reportArgumentType) -generics_type_erasure.py:40:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:41:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:42:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:43:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:44:10 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:42:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:43:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:44:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:45:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:46:10 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_class_objects.toml b/conformance/results/pyright/protocols_class_objects.toml index f24e98e4e..47e31dabf 100644 --- a/conformance/results/pyright/protocols_class_objects.toml +++ b/conformance/results/pyright/protocols_class_objects.toml @@ -16,13 +16,13 @@ protocols_class_objects.py:58:16 - error: Expression of type "type[ConcreteA]" i protocols_class_objects.py:74:16 - error: Expression of type "type[ConcreteB]" is incompatible with declared type "ProtoB1"   "prop1" is an incompatible type     "property" is incompatible with "int" (reportAssignmentType) -protocols_class_objects.py:101:16 - error: Expression of type "type[ConcreteC1]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:104:16 - error: Expression of type "type[ConcreteC1]" is incompatible with declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:103:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:106:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:104:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC2" +protocols_class_objects.py:107:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC2"   "attr1" must be defined as a ClassVar to be compatible with protocol (reportAssignmentType) -protocols_class_objects.py:105:16 - error: Expression of type "type[ConcreteC3]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:108:16 - error: Expression of type "type[ConcreteC3]" is incompatible with declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_explicit.toml b/conformance/results/pyright/protocols_explicit.toml index c6b503d29..4ee4fca06 100644 --- a/conformance/results/pyright/protocols_explicit.toml +++ b/conformance/results/pyright/protocols_explicit.toml @@ -3,22 +3,20 @@ output = """ protocols_explicit.py:27:16 - error: Method "draw" cannot be called because it is abstract and unimplemented (reportAbstractUsage) protocols_explicit.py:56:32 - error: Cannot assign to attribute "rgb" for class "Point*"   "str" is incompatible with "int" (reportAttributeAccessIssue) -protocols_explicit.py:59:5 - error: Cannot instantiate abstract class "Point" -  "RGB.other" is not implemented +protocols_explicit.py:60:5 - error: Cannot instantiate abstract class "Point"   "RGB.intensity" is not implemented -  and 1 more... (reportAbstractUsage) -protocols_explicit.py:86:6 - error: Cannot instantiate abstract class "Concrete1" -  "Proto1.cm1" is not implemented -  "Proto1.im1" is not implemented (reportAbstractUsage) -protocols_explicit.py:104:6 - error: Cannot instantiate abstract class "Concrete3" -  "Proto2.cm10" is not implemented -  "Proto3.cm11" is not implemented -  and 1 more... (reportAbstractUsage) -protocols_explicit.py:129:6 - error: Cannot instantiate abstract class "Concrete5" +  "RGB.transparency" is not implemented (reportAbstractUsage) +protocols_explicit.py:85:14 - error: Cannot assign to attribute "cm1" for class "Concrete1*" +  Attribute "cm1" cannot be assigned through a class instance because it is a ClassVar +    Attribute "__set__" is unknown (reportAttributeAccessIssue) +protocols_explicit.py:135:6 - error: Cannot instantiate abstract class "Concrete5"   "Proto5.method1" is not implemented (reportAbstractUsage) -protocols_explicit.py:159:7 - error: Cannot instantiate abstract class "Concrete7A" +protocols_explicit.py:165:7 - error: Cannot instantiate abstract class "Concrete7A"   "Proto7.method1" is not implemented (reportAbstractUsage) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 90: Expected 1 errors +Line 110: Expected 1 errors +Line 85: Unexpected errors ['protocols_explicit.py:85:14 - error: Cannot assign to attribute "cm1" for class "Concrete1*"'] """ diff --git a/conformance/results/pyright/specialtypes_never.toml b/conformance/results/pyright/specialtypes_never.toml index 51770402b..b72b75c74 100644 --- a/conformance/results/pyright/specialtypes_never.toml +++ b/conformance/results/pyright/specialtypes_never.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ specialtypes_never.py:19:22 - error: Function with declared return type "NoReturn" cannot return "None" (reportReturnType) -specialtypes_never.py:82:21 - error: Expression of type "list[Never]" is incompatible with declared type "list[int]" +specialtypes_never.py:86:21 - error: Expression of type "list[Never]" is incompatible with declared type "list[int]"   "list[Never]" is incompatible with "list[int]"     Type parameter "_T@list" is invariant, but "Never" is not the same as "int"     Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) -specialtypes_never.py:101:12 - error: Expression of type "ClassC[Never]" is incompatible with return type "ClassC[U@func10]" +specialtypes_never.py:105:12 - error: Expression of type "ClassC[Never]" is incompatible with return type "ClassC[U@func10]"   "ClassC[Never]" is incompatible with "ClassC[U@func10]"     Type parameter "T@ClassC" is invariant, but "Never" is not the same as "U@func10" (reportReturnType) """ diff --git a/conformance/results/pyright/typeddicts_required.toml b/conformance/results/pyright/typeddicts_required.toml index 874099f4d..4205fdffe 100644 --- a/conformance/results/pyright/typeddicts_required.toml +++ b/conformance/results/pyright/typeddicts_required.toml @@ -1,10 +1,13 @@ conformant = "Pass" output = """ typeddicts_required.py:12:8 - error: "Required" is not allowed in this context -typeddicts_required.py:16:8 - error: "NotRequired" is not allowed in this context -typeddicts_required.py:59:8 - error: "Required" is not allowed in this context -typeddicts_required.py:60:8 - error: "Required" is not allowed in this context +typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*" +  "int" is incompatible with "Required[int]" (reportAttributeAccessIssue) +typeddicts_required.py:19:8 - error: "NotRequired" is not allowed in this context +typeddicts_required.py:62:8 - error: "Required" is not allowed in this context +typeddicts_required.py:63:8 - error: "Required" is not allowed in this context """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 15: Unexpected errors ['typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*"'] """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 95d61e3ae..c55d6d26e 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.371" -test_duration = 1.4 +test_duration = 1.6 diff --git a/conformance/results/pytype/annotations_forward_refs.toml b/conformance/results/pytype/annotations_forward_refs.toml index c9373b7cc..b2738be1a 100644 --- a/conformance/results/pytype/annotations_forward_refs.toml +++ b/conformance/results/pytype/annotations_forward_refs.toml @@ -25,8 +25,9 @@ File "annotations_forward_refs.py", line 80, in ClassD: Name 'ClassF' is not def File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation '' for str [invalid-annotation] File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation '' for x [invalid-annotation] File "annotations_forward_refs.py", line 89, in ClassD: Invalid type annotation '' for y [invalid-annotation] -File "annotations_forward_refs.py", line 93, in : Any [assert-type] -File "annotations_forward_refs.py", line 100, in : unexpected indent [python-compiler-error] +File "annotations_forward_refs.py", line 91, in ClassD: Invalid type annotation '' for ClassC [invalid-annotation] +File "annotations_forward_refs.py", line 96, in : Any [assert-type] +File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error] """ conformance_automated = "Fail" errors_diff = """ @@ -48,6 +49,7 @@ Line 55: Expected 1 errors Line 40: Unexpected errors ['File "annotations_forward_refs.py", line 40, in : invalid syntax [python-compiler-error]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'{}\\' for p5 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p15 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p9 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'-1\\' for p12 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'(int, str)\\' for p3 [invalid-annotation]'] Line 82: Unexpected errors ['File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation \\'\\' for str [invalid-annotation]'] Line 87: Unexpected errors ['File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation \\'\\' for x [invalid-annotation]'] -Line 93: Unexpected errors ['File "annotations_forward_refs.py", line 93, in : Any [assert-type]'] -Line 100: Unexpected errors ['File "annotations_forward_refs.py", line 100, in : unexpected indent [python-compiler-error]'] +Line 91: Unexpected errors ['File "annotations_forward_refs.py", line 91, in ClassD: Invalid type annotation \\'\\' for ClassC [invalid-annotation]'] +Line 96: Unexpected errors ['File "annotations_forward_refs.py", line 96, in : Any [assert-type]'] +Line 103: Unexpected errors ['File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error]'] """ diff --git a/conformance/results/pytype/classes_classvar.toml b/conformance/results/pytype/classes_classvar.toml index 409a82889..c79f592cb 100644 --- a/conformance/results/pytype/classes_classvar.toml +++ b/conformance/results/pytype/classes_classvar.toml @@ -23,8 +23,8 @@ File "classes_classvar.py", line 52, in ClassA: Type annotation for bad8 does no File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type] File "classes_classvar.py", line 78, in : ClassVar [assert-type] -File "classes_classvar.py", line 121, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 131, in : Type annotation for a does not match type of assignment [annotation-type-mismatch] +File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] +File "classes_classvar.py", line 134, in : Type annotation for a does not match type of assignment [annotation-type-mismatch] """ conformance_automated = "Fail" errors_diff = """ @@ -39,11 +39,11 @@ Line 65: Expected 1 errors Line 67: Expected 1 errors Line 71: Expected 1 errors Line 72: Expected 1 errors -Line 102: Expected 1 errors +Line 105: Expected 1 errors Line 7: Unexpected errors ['File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 29: Unexpected errors ['File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 60: Unexpected errors ['File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] Line 68: Unexpected errors ['File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type]'] Line 78: Unexpected errors ['File "classes_classvar.py", line 78, in : ClassVar [assert-type]'] -Line 121: Unexpected errors ['File "classes_classvar.py", line 121, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] +Line 124: Unexpected errors ['File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_class.toml b/conformance/results/pytype/dataclasses_transform_class.toml index c68dac896..8d25adeb7 100644 --- a/conformance/results/pytype/dataclasses_transform_class.toml +++ b/conformance/results/pytype/dataclasses_transform_class.toml @@ -4,22 +4,22 @@ Does not understand @dataclass_transform. """ output = """ File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 57, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 82, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 103, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 106, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] +File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] +File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet] """ conformance_automated = "Fail" errors_diff = """ -Line 48: Expected 1 errors -Line 60: Expected 1 errors +Line 51: Expected 1 errors Line 63: Expected 1 errors -Line 69: Expected 1 errors -Line 79: Expected 1 errors -Line 119: Expected 1 errors +Line 66: Expected 1 errors +Line 72: Expected 1 errors +Line 82: Expected 1 errors +Line 122: Expected 1 errors Line 23: Unexpected errors ['File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 57: Unexpected errors ['File "dataclasses_transform_class.py", line 57, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 82: Unexpected errors ['File "dataclasses_transform_class.py", line 82, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 103: Unexpected errors ['File "dataclasses_transform_class.py", line 103, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] -Line 106: Unexpected errors ['File "dataclasses_transform_class.py", line 106, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 85: Unexpected errors ['File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 106: Unexpected errors ['File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] +Line 109: Unexpected errors ['File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_func.toml b/conformance/results/pytype/dataclasses_transform_func.toml index 89a1ae2ee..a65237475 100644 --- a/conformance/results/pytype/dataclasses_transform_func.toml +++ b/conformance/results/pytype/dataclasses_transform_func.toml @@ -7,26 +7,20 @@ File "dataclasses_transform_func.py", line 13, in : Arguments to datacla File "dataclasses_transform_func.py", line 19, in : Arguments to dataclass_transform not supported yet [not-supported-yet] File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type] Called from (traceback): - line 89, in current file + line 100, in current file File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type] -File "dataclasses_transform_func.py", line 50, in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 53, in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "dataclasses_transform_func.py", line 57, in : Type annotation for name does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_func.py", line 65, in : Invalid keyword arguments (id, name, salary) to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 67, in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 71, in : Function Customer2.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "dataclasses_transform_func.py", line 76, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +File "dataclasses_transform_func.py", line 68, in : Type annotation for name does not match type of assignment [annotation-type-mismatch] +File "dataclasses_transform_func.py", line 76, in : Invalid keyword argument salary to function Customer1.__init__ [wrong-keyword-args] +File "dataclasses_transform_func.py", line 87, in : Arguments to dataclass_transform not supported yet [not-supported-yet] """ conformance_automated = "Fail" errors_diff = """ -Line 61: Expected 1 errors -Line 97: Expected 1 errors -Lines 89, 90: Expected error (tag 'Customer3Subclass') +Line 72: Expected 1 errors +Line 82: Expected 1 errors +Line 111: Expected 1 errors +Lines 100, 101: Expected error (tag 'Customer3Subclass') Line 13: Unexpected errors ['File "dataclasses_transform_func.py", line 13, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] Line 19: Unexpected errors ['File "dataclasses_transform_func.py", line 19, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] Line 30: Unexpected errors ['File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type]', 'File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type]'] -Line 50: Unexpected errors ['File "dataclasses_transform_func.py", line 50, in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args]'] -Line 53: Unexpected errors ['File "dataclasses_transform_func.py", line 53, in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 67: Unexpected errors ['File "dataclasses_transform_func.py", line 67, in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args]'] -Line 76: Unexpected errors ['File "dataclasses_transform_func.py", line 76, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 87: Unexpected errors ['File "dataclasses_transform_func.py", line 87, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_meta.toml b/conformance/results/pytype/dataclasses_transform_meta.toml index e89e4f407..bf8168419 100644 --- a/conformance/results/pytype/dataclasses_transform_meta.toml +++ b/conformance/results/pytype/dataclasses_transform_meta.toml @@ -4,18 +4,18 @@ Does not understand @dataclass_transform. """ output = """ File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_meta.py", line 57, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_meta.py", line 83, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] +File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet] """ conformance_automated = "Fail" errors_diff = """ -Line 48: Expected 1 errors -Line 60: Expected 1 errors +Line 51: Expected 1 errors Line 63: Expected 1 errors -Line 70: Expected 1 errors -Line 80: Expected 1 errors -Line 100: Expected 1 errors +Line 66: Expected 1 errors +Line 73: Expected 1 errors +Line 83: Expected 1 errors +Line 103: Expected 1 errors Line 21: Unexpected errors ['File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 57: Unexpected errors ['File "dataclasses_transform_meta.py", line 57, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 83: Unexpected errors ['File "dataclasses_transform_meta.py", line 83, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 86: Unexpected errors ['File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_usage.toml b/conformance/results/pytype/dataclasses_usage.toml index 02ba41ee1..853d5cc46 100644 --- a/conformance/results/pytype/dataclasses_usage.toml +++ b/conformance/results/pytype/dataclasses_usage.toml @@ -8,9 +8,9 @@ File "dataclasses_usage.py", line 64, in : In method __init__, non-defau File "dataclasses_usage.py", line 70, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] File "dataclasses_usage.py", line 83, in : Function DC4.__init__ expects 2 arg(s), got 3 [wrong-arg-count] File "dataclasses_usage.py", line 88, in DC5: Type annotation for a does not match type of assignment [annotation-type-mismatch] -File "dataclasses_usage.py", line 126, in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_usage.py", line 129, in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] -File "dataclasses_usage.py", line 178, in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] +File "dataclasses_usage.py", line 127, in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] +File "dataclasses_usage.py", line 130, in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] +File "dataclasses_usage.py", line 183, in : Missing parameter 'x_squared' in call to function DC13.__init__ [missing-parameter] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/enums_member_values.toml b/conformance/results/pytype/enums_member_values.toml index c562dce2a..8d75fa0d1 100644 --- a/conformance/results/pytype/enums_member_values.toml +++ b/conformance/results/pytype/enums_member_values.toml @@ -9,10 +9,12 @@ conformance_automated = "Fail" errors_diff = """ Line 78: Expected 1 errors Line 41: Unexpected errors ['File "enums_member_values.py", line 41, in : Missing parameter \\'mass\\' in call to function Planet.__init__ [missing-parameter]', 'File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 75: Unexpected errors ['File "enums_member_values.py", line 75, in : Function Color3.__init__ was called with the wrong arguments [wrong-arg-types]'] """ output = """ File "enums_member_values.py", line 41, in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter] File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types] -File "enums_member_values.py", line 85, in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] -File "enums_member_values.py", line 96, in : Any [assert-type] +File "enums_member_values.py", line 75, in : Function Color3.__init__ was called with the wrong arguments [wrong-arg-types] +File "enums_member_values.py", line 88, in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] +File "enums_member_values.py", line 99, in : Any [assert-type] """ diff --git a/conformance/results/pytype/enums_members.toml b/conformance/results/pytype/enums_members.toml index 3d3967c88..000700425 100644 --- a/conformance/results/pytype/enums_members.toml +++ b/conformance/results/pytype/enums_members.toml @@ -6,34 +6,35 @@ Does not support `_ignore_` mechanism (optional). """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors -Line 112: Expected 1 errors -Line 125: Expected 1 errors +Line 50: Expected 1 errors +Line 116: Expected 1 errors +Line 129: Expected 1 errors Line 7: Unexpected errors ['File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet]', 'File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet]'] -Line 31: Unexpected errors ['File "enums_members.py", line 31, in : _enums_members.Pet2 [assert-type]'] -Line 32: Unexpected errors ['File "enums_members.py", line 32, in : _enums_members.Pet2 [assert-type]'] -Line 103: Unexpected errors ['File "enums_members.py", line 103, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 104: Unexpected errors ['File "enums_members.py", line 104, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 106: Unexpected errors ['File "enums_members.py", line 106, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 124: Unexpected errors ['File "enums_members.py", line 124, in method: Example2 [reveal-type]'] +Line 35: Unexpected errors ['File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type]'] +Line 36: Unexpected errors ['File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type]'] +Line 107: Unexpected errors ['File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 108: Unexpected errors ['File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 110: Unexpected errors ['File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 128: Unexpected errors ['File "enums_members.py", line 128, in method: Example2 [reveal-type]'] """ output = """ File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet] File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet] -File "enums_members.py", line 31, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 32, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 78, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 78, in : Callable[[Any], Any] [assert-type] -File "enums_members.py", line 79, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 79, in : Callable[[int], int] [assert-type] -File "enums_members.py", line 80, in : property [assert-type] -File "enums_members.py", line 80, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 81, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 81, in : Callable[[Any], None] [assert-type] -File "enums_members.py", line 103, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 104, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 106, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 124, in method: Example2 [reveal-type] -File "enums_members.py", line 142, in : Pet5 [assert-type] -File "enums_members.py", line 143, in : Pet5 [assert-type] +File "enums_members.py", line 15, in : Function Pet.__init__ was called with the wrong arguments [wrong-arg-types] +File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type] +File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type] +File "enums_members.py", line 82, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 82, in : Callable[[Any], Any] [assert-type] +File "enums_members.py", line 83, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 83, in : Callable[[int], int] [assert-type] +File "enums_members.py", line 84, in : property [assert-type] +File "enums_members.py", line 84, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 85, in : Invalid type annotation 'Literal' [invalid-annotation] +File "enums_members.py", line 85, in : Callable[[Any], None] [assert-type] +File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] +File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] +File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] +File "enums_members.py", line 128, in method: Example2 [reveal-type] +File "enums_members.py", line 146, in : Pet5 [assert-type] +File "enums_members.py", line 147, in : Pet5 [assert-type] """ diff --git a/conformance/results/pytype/generics_scoping.toml b/conformance/results/pytype/generics_scoping.toml index a31965cd4..ec46810e8 100644 --- a/conformance/results/pytype/generics_scoping.toml +++ b/conformance/results/pytype/generics_scoping.toml @@ -10,15 +10,17 @@ File "generics_scoping.py", line 54, in Bar: Invalid type annotation 'List[S]' f File "generics_scoping.py", line 63, in fun_4: Invalid type annotation 'T' [invalid-annotation] File "generics_scoping.py", line 74, in : Invalid type annotation 'Outer' [invalid-annotation] File "generics_scoping.py", line 78, in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] -File "generics_scoping.py", line 88, in : Invalid type annotation 'T' for global_var1 [invalid-annotation] -File "generics_scoping.py", line 89, in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] +File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation 'T' [invalid-annotation] +File "generics_scoping.py", line 94, in : Invalid type annotation 'T' for global_var1 [invalid-annotation] +File "generics_scoping.py", line 95, in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] """ conformance_automated = "Fail" errors_diff = """ Line 65: Expected 1 errors Line 75: Expected 1 errors -Line 84: Expected 1 errors -Line 90: Expected 1 errors +Line 87: Expected 1 errors +Line 96: Expected 1 errors Line 63: Unexpected errors ['File "generics_scoping.py", line 63, in fun_4: Invalid type annotation \\'T\\' [invalid-annotation]'] Line 74: Unexpected errors ['File "generics_scoping.py", line 74, in : Invalid type annotation \\'Outer\\' [invalid-annotation]'] +Line 80: Unexpected errors ['File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation \\'T\\' [invalid-annotation]'] """ diff --git a/conformance/results/pytype/generics_self_basic.toml b/conformance/results/pytype/generics_self_basic.toml index f56e7ede2..717547ba0 100644 --- a/conformance/results/pytype/generics_self_basic.toml +++ b/conformance/results/pytype/generics_self_basic.toml @@ -14,14 +14,14 @@ File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-typ Called from (traceback): line 55, in current file File "generics_self_basic.py", line 40, in difference: Shape [assert-type] -File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type] +File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] Called from (traceback): - line 72, in object_with_concrete_type -File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type] + line 75, in object_with_concrete_type +File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] Called from (traceback): - line 71, in object_with_concrete_type -File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type] -File "generics_self_basic.py", line 64, in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] + line 74, in object_with_concrete_type +File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] +File "generics_self_basic.py", line 67, in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] """ conformance_automated = "Fail" errors_diff = """ @@ -30,5 +30,5 @@ Line 33: Expected 1 errors Line 14: Unexpected errors ['File "generics_self_basic.py", line 14, in set_scale: Shape [assert-type]', 'File "generics_self_basic.py", line 14, in set_scale: Circle [assert-type]'] Line 27: Unexpected errors ['File "generics_self_basic.py", line 27, in from_config: Type[Shape] [assert-type]', 'File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-type]'] Line 40: Unexpected errors ['File "generics_self_basic.py", line 40, in difference: Shape [assert-type]'] -Line 61: Unexpected errors ['File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 61, in set_value: bad return type [bad-return-type]'] +Line 64: Unexpected errors ['File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_type_erasure.toml b/conformance/results/pytype/generics_type_erasure.toml index c49e01d34..ac5e34ce1 100644 --- a/conformance/results/pytype/generics_type_erasure.toml +++ b/conformance/results/pytype/generics_type_erasure.toml @@ -4,11 +4,11 @@ NotImplementedError: ParameterizedClass """ conformance_automated = "Fail" errors_diff = """ -Line 36: Expected 1 errors Line 38: Expected 1 errors Line 40: Expected 1 errors -Line 41: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors +Line 45: Expected 1 errors +Line 46: Expected 1 errors """ diff --git a/conformance/results/pytype/protocols_class_objects.toml b/conformance/results/pytype/protocols_class_objects.toml index 7efa307ad..47965b7e5 100644 --- a/conformance/results/pytype/protocols_class_objects.toml +++ b/conformance/results/pytype/protocols_class_objects.toml @@ -6,6 +6,7 @@ Fails to report some class objects as incompatible with a protocol. """ output = """ File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type] +File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types] """ conformance_automated = "Fail" errors_diff = """ @@ -13,9 +14,10 @@ Line 29: Expected 1 errors Line 34: Expected 1 errors Line 58: Expected 1 errors Line 74: Expected 1 errors -Line 101: Expected 1 errors -Line 103: Expected 1 errors Line 104: Expected 1 errors -Line 105: Expected 1 errors +Line 106: Expected 1 errors +Line 107: Expected 1 errors +Line 108: Expected 1 errors Line 50: Unexpected errors ['File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type]'] +Line 100: Unexpected errors ['File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/protocols_explicit.toml b/conformance/results/pytype/protocols_explicit.toml index 0cbb6f139..8432b87e8 100644 --- a/conformance/results/pytype/protocols_explicit.toml +++ b/conformance/results/pytype/protocols_explicit.toml @@ -10,15 +10,15 @@ output = """ File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type] Called from (traceback): line 27, in draw -File "protocols_explicit.py", line 59, in : Can't instantiate Point with abstract methods intensity [not-instantiable] -File "protocols_explicit.py", line 159, in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] +File "protocols_explicit.py", line 60, in : Can't instantiate Point with abstract methods intensity [not-instantiable] +File "protocols_explicit.py", line 165, in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] """ conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors Line 56: Expected 1 errors -Line 86: Expected 1 errors -Line 104: Expected 1 errors -Line 129: Expected 1 errors +Line 90: Expected 1 errors +Line 110: Expected 1 errors +Line 135: Expected 1 errors Line 14: Unexpected errors ['File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index b2cb37252..bb2352598 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -5,18 +5,18 @@ Does not understand NoReturn or Never. output = """ File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type] -File "specialtypes_never.py", line 64, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 65, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 66, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 82, in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] +File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] +File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] +File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] +File "specialtypes_never.py", line 86, in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors -Line 101: Expected 1 errors +Line 105: Expected 1 errors Line 11: Unexpected errors ['File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] Line 21: Unexpected errors ['File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type]'] -Line 64: Unexpected errors ['File "specialtypes_never.py", line 64, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 65: Unexpected errors ['File "specialtypes_never.py", line 65, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] -Line 66: Unexpected errors ['File "specialtypes_never.py", line 66, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] +Line 68: Unexpected errors ['File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 69: Unexpected errors ['File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] +Line 70: Unexpected errors ['File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/typeddicts_required.toml b/conformance/results/pytype/typeddicts_required.toml index 117006670..ff1737fd6 100644 --- a/conformance/results/pytype/typeddicts_required.toml +++ b/conformance/results/pytype/typeddicts_required.toml @@ -10,7 +10,7 @@ RecursionError: maximum recursion depth exceeded conformance_automated = "Fail" errors_diff = """ Line 12: Expected 1 errors -Line 16: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors +Line 19: Expected 1 errors +Line 62: Expected 1 errors +Line 63: Expected 1 errors """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 3d4b9cdd9..b34e62bde 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 31.4 +test_duration = 34.3 diff --git a/conformance/results/results.html b/conformance/results/results.html index b7b4ebd80..59d415ec4 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

 
mypy 1.10.1
-
1.4sec
+
1.2sec
pyright 1.1.371
-
1.4sec
+
1.6sec
pyre 0.9.22
-
2.8sec
+
1.9sec
pytype 2024.04.11
-
31.4sec
+
34.3sec
diff --git a/conformance/tests/annotations_forward_refs.py b/conformance/tests/annotations_forward_refs.py index b64a8e936..be566e9ad 100644 --- a/conformance/tests/annotations_forward_refs.py +++ b/conformance/tests/annotations_forward_refs.py @@ -88,6 +88,9 @@ def int(self) -> None: # OK y: int = 0 # E: Refers to local int, which isn't a legal type expression + def __init__(self, ClassC: "ClassC") -> None: + self.ClassC = ClassC + assert_type(ClassD.str, str) assert_type(ClassD.x, int) diff --git a/conformance/tests/classes_classvar.py b/conformance/tests/classes_classvar.py index 56bb2a7dd..5e0c963b3 100644 --- a/conformance/tests/classes_classvar.py +++ b/conformance/tests/classes_classvar.py @@ -83,6 +83,9 @@ class BasicStarship: damage: int # Instance variable without default stats: ClassVar[dict[str, int]] = {} # Class variable + def __init__(self, damage: int) -> None: + self.damage = damage + class Starship: captain: str = "Picard" diff --git a/conformance/tests/dataclasses_transform_class.py b/conformance/tests/dataclasses_transform_class.py index bb33fbd0c..ad0aa8355 100644 --- a/conformance/tests/dataclasses_transform_class.py +++ b/conformance/tests/dataclasses_transform_class.py @@ -36,6 +36,9 @@ def __init_subclass__( ) -> None: ... + def __init__(self, not_a_field: str) -> None: + self.not_a_field = not_a_field + class Customer1(ModelBase, frozen=True): id: int = model_field() diff --git a/conformance/tests/dataclasses_transform_func.py b/conformance/tests/dataclasses_transform_func.py index c93cf4c00..7bc475af9 100644 --- a/conformance/tests/dataclasses_transform_func.py +++ b/conformance/tests/dataclasses_transform_func.py @@ -35,17 +35,28 @@ class Customer1: id: int name: str + def __init__(self, id: int, name: str) -> None: + self.id = id + self.name = name + @create_model(frozen=True) class Customer2: id: int name: str + def __init__(self, id: int, name: str) -> None: + self.id = id + self.name = name + @create_model(frozen=True) class Customer2Subclass(Customer2): salary: float + def __init__(self, salary: float) -> None: + self.salary = salary + c1_1 = Customer1(id=3, name="Sue") c1_1.id = 4 @@ -90,6 +101,9 @@ class Customer3: class Customer3Subclass(Customer3): # E[Customer3Subclass] age: int + def __init__(self, age: int) -> None: + self.age = age + c3_1 = Customer3(id=2, name="hi") diff --git a/conformance/tests/dataclasses_transform_meta.py b/conformance/tests/dataclasses_transform_meta.py index 4414ce725..dff70a2e4 100644 --- a/conformance/tests/dataclasses_transform_meta.py +++ b/conformance/tests/dataclasses_transform_meta.py @@ -25,6 +25,9 @@ def model_field( class ModelMeta(type): not_a_field: str + def __init__(self, not_a_field: str) -> None: + self.not_a_field = not_a_field + class ModelBase(metaclass=ModelMeta): def __init_subclass__( diff --git a/conformance/tests/dataclasses_usage.py b/conformance/tests/dataclasses_usage.py index 4338cfa02..5f101d8c9 100644 --- a/conformance/tests/dataclasses_usage.py +++ b/conformance/tests/dataclasses_usage.py @@ -117,6 +117,7 @@ class DC8(DC7): def __init__(self, a: DC7, y: int): self.__dict__ = a.__dict__ + self.y = y a = DC7(3) @@ -172,8 +173,12 @@ class DC13: x: int x_squared: int + def __init__(self, x: int, x_squared: int): + self.x = x + self.x_squared = x_squared + -# This should generate an error because there is no +# This should generate an error because there is no matching # override __init__ method and no synthesized __init__. DC13(3) # E diff --git a/conformance/tests/enums_member_values.py b/conformance/tests/enums_member_values.py index 741099596..9dee346f5 100644 --- a/conformance/tests/enums_member_values.py +++ b/conformance/tests/enums_member_values.py @@ -77,6 +77,9 @@ class Color3(Enum): RED = 1 # OK GREEN = "green" # E + def __init__(self, value: int) -> None: + self._value_ = value + class Planet2(Enum): _value_: str diff --git a/conformance/tests/enums_members.py b/conformance/tests/enums_members.py index 505cacfcc..52007e4d4 100644 --- a/conformance/tests/enums_members.py +++ b/conformance/tests/enums_members.py @@ -19,6 +19,10 @@ class Pet(Enum): # E?: Uninitialized attributes (pyre) CAT = 1 # Member attribute DOG = 2 # Member attribute + def __init__(self, genus: str, species: str) -> None: + self.genus = genus + self.species = species + assert_type(Pet.genus, str) assert_type(Pet.species, str) diff --git a/conformance/tests/generics_scoping.py b/conformance/tests/generics_scoping.py index fcdb1957e..9b6ec7d18 100644 --- a/conformance/tests/generics_scoping.py +++ b/conformance/tests/generics_scoping.py @@ -77,12 +77,18 @@ class Bad(Iterable[T]): # E class AlsoBad: x: list[T] # E + def __init__(self, x: list[T]) -> None: + self.x = x + class Inner(Iterable[S]): # OK ... attr: Inner[T] # OK alias: TypeAlias = list[T] # E + def __init__(self, attr: Inner[T]) -> None: + self.attr = attr + # Test unbound type variables at global scope global_var1: T # E diff --git a/conformance/tests/generics_self_basic.py b/conformance/tests/generics_self_basic.py index fd6a78719..b7da6a38d 100644 --- a/conformance/tests/generics_self_basic.py +++ b/conformance/tests/generics_self_basic.py @@ -58,6 +58,9 @@ class Circle(Shape): class Container(Generic[T]): value: T + def __init__(self, value: T) -> None: + self.value = value + def set_value(self, value: T) -> Self: ... # This should generate an error because Self isn't subscriptable. diff --git a/conformance/tests/generics_type_erasure.py b/conformance/tests/generics_type_erasure.py index f88af0e59..c7462259a 100644 --- a/conformance/tests/generics_type_erasure.py +++ b/conformance/tests/generics_type_erasure.py @@ -10,7 +10,9 @@ class Node(Generic[T]): label: T - def __init__(self, label: T | None = None) -> None: ... + def __init__(self, label: T | None = None) -> None: + if label is not None: + self.label = label assert_type(Node(''), Node[str]) assert_type(Node(0), Node[int]) diff --git a/conformance/tests/protocols_class_objects.py b/conformance/tests/protocols_class_objects.py index 73dc35775..7ffc5e7cb 100644 --- a/conformance/tests/protocols_class_objects.py +++ b/conformance/tests/protocols_class_objects.py @@ -93,6 +93,9 @@ class ConcreteC2: class CMeta(type): attr1: int + def __init__(self, attr1: int) -> None: + self.attr1 = attr1 + class ConcreteC3(metaclass=CMeta): pass diff --git a/conformance/tests/protocols_explicit.py b/conformance/tests/protocols_explicit.py index 98f88dce3..1e2763a61 100644 --- a/conformance/tests/protocols_explicit.py +++ b/conformance/tests/protocols_explicit.py @@ -54,6 +54,7 @@ def transparency(self) -> int: class Point(RGB): def __init__(self, red: int, green: int, blue: str) -> None: self.rgb = red, green, blue # E: 'blue' must be 'int' + self.other = 0 p = Point(0, 0, "") # E: Cannot instantiate abstract class @@ -80,7 +81,10 @@ class Proto3(Proto2, Protocol): class Concrete1(Proto1): - ... + def __init__(self): + self.cm1 = 1 + self.im1 = 1 + self.im3 = 3 c1 = Concrete1() # E: cannot instantiate abstract class @@ -98,7 +102,9 @@ class Concrete3(Proto1, Proto3): cm1 = 3 def __init__(self): - im1 = 0 + self.im1 = 0 + self.cm10 = 10 + self.cm11 = 11 c3 = Concrete3() # E: cannot instantiate abstract class diff --git a/conformance/tests/specialtypes_never.py b/conformance/tests/specialtypes_never.py index 339c6f000..41b624e38 100644 --- a/conformance/tests/specialtypes_never.py +++ b/conformance/tests/specialtypes_never.py @@ -56,6 +56,10 @@ class ClassA: x: NoReturn y: list[NoReturn] + def __init__(self, x: NoReturn, y: list[NoReturn]) -> None: + self.x = x + self.y = y + # Never is compatible with all types. diff --git a/conformance/tests/typeddicts_class_syntax.py b/conformance/tests/typeddicts_class_syntax.py index d2983b76a..2f1582c24 100644 --- a/conformance/tests/typeddicts_class_syntax.py +++ b/conformance/tests/typeddicts_class_syntax.py @@ -58,6 +58,10 @@ class GenericTypedDict(Generic[T]): name: str value: T + def __init__(self, name: str, value: T) -> None: + self.name = name + self.value = value + # > An empty TypedDict can be created by only including pass in the # > body (if there is a docstring, pass can be omitted): diff --git a/conformance/tests/typeddicts_required.py b/conformance/tests/typeddicts_required.py index d4cef0142..e38e6df86 100644 --- a/conformance/tests/typeddicts_required.py +++ b/conformance/tests/typeddicts_required.py @@ -11,6 +11,9 @@ class NotTypedDict: x: Required[int] # E: Required not allowed in this context + def __init__(self, x: int) -> None: + self.x = x + def func1( x: NotRequired[int], # E: NotRequired not allowed in this context