From f3991f9108038c56ea06df4bca80e3367b9ecefb Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Thu, 9 Oct 2025 10:42:56 -0700 Subject: [PATCH 1/8] Update unexpected_fails.py to allow omitting the `conformant` field for passing tests. --- conformance/src/unexpected_fails.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/conformance/src/unexpected_fails.py b/conformance/src/unexpected_fails.py index 96ccf3770..0e8453b19 100644 --- a/conformance/src/unexpected_fails.py +++ b/conformance/src/unexpected_fails.py @@ -21,8 +21,11 @@ except Exception as e: raise Exception(f"Error decoding {file}") from e try: - previous_pass = info["conformant"] == "Pass" new_pass = info["conformance_automated"] == "Pass" + if new_pass and "conformant" not in info: + previous_pass = True + else: + previous_pass = info["conformant"] == "Pass" except KeyError as e: raise Exception(f"Missing key in {file}") from e if previous_pass != new_pass: From 48ea301e3fe799f050d441eccea920efefc5059d Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Thu, 9 Oct 2025 10:46:27 -0700 Subject: [PATCH 2/8] Add pyrefly.toml. --- conformance/tests/pyrefly.toml | 1 + 1 file changed, 1 insertion(+) create mode 100644 conformance/tests/pyrefly.toml diff --git a/conformance/tests/pyrefly.toml b/conformance/tests/pyrefly.toml new file mode 100644 index 000000000..c9c44e591 --- /dev/null +++ b/conformance/tests/pyrefly.toml @@ -0,0 +1 @@ +# Empty configuration file to make sure pyrefly treats this directory as the project root. From 4932db20991033cefebdfaa5da13c4334c3f52bd Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Thu, 9 Oct 2025 10:47:04 -0700 Subject: [PATCH 3/8] Update results for pyrefly 0.36.2. --- .../results/pyrefly/aliases_explicit.toml | 2 +- .../results/pyrefly/aliases_implicit.toml | 2 +- .../results/pyrefly/aliases_recursive.toml | 18 +----- .../pyrefly/aliases_type_statement.toml | 4 +- .../pyrefly/aliases_typealiastype.toml | 61 +++++++------------ .../results/pyrefly/callables_kwargs.toml | 4 +- .../pyrefly/constructors_call_metaclass.toml | 4 +- .../pyrefly/constructors_callable.toml | 10 --- .../results/pyrefly/dataclasses_final.toml | 2 +- .../results/pyrefly/dataclasses_postinit.toml | 4 +- .../pyrefly/directives_deprecated.toml | 2 +- .../pyrefly/directives_reveal_type.toml | 4 -- .../results/pyrefly/enums_behaviors.toml | 4 +- .../results/pyrefly/enums_member_values.toml | 3 +- .../results/pyrefly/enums_members.toml | 11 +--- .../results/pyrefly/generics_basic.toml | 2 +- .../results/pyrefly/generics_defaults.toml | 4 +- .../pyrefly/generics_paramspec_basic.toml | 2 +- .../pyrefly/generics_self_advanced.toml | 8 +-- .../pyrefly/generics_self_attributes.toml | 4 +- .../pyrefly/generics_self_protocols.toml | 4 +- .../generics_syntax_compatibility.toml | 1 - .../pyrefly/generics_syntax_scoping.toml | 6 -- .../pyrefly/generics_type_erasure.toml | 10 +-- .../results/pyrefly/generics_upper_bound.toml | 4 +- .../pyrefly/literals_literalstring.toml | 8 +-- .../pyrefly/overloads_consistency.toml | 4 +- .../pyrefly/overloads_definitions.toml | 13 ++-- .../pyrefly/overloads_definitions_stub.toml | 12 ++-- .../results/pyrefly/overloads_evaluation.toml | 20 ------ .../results/pyrefly/protocols_explicit.toml | 4 +- .../results/pyrefly/protocols_generic.toml | 4 +- .../results/pyrefly/protocols_merging.toml | 4 +- .../results/pyrefly/protocols_self.toml | 6 +- .../pyrefly/qualifiers_final_decorator.toml | 4 +- .../results/pyrefly/specialtypes_none.toml | 2 +- .../pyrefly/typeddicts_extra_items.toml | 25 +------- .../results/pyrefly/typeddicts_readonly.toml | 12 ++-- .../typeddicts_readonly_inheritance.toml | 2 +- .../pyrefly/typeddicts_readonly_kwargs.toml | 2 +- conformance/results/pyrefly/version.toml | 2 +- conformance/results/results.html | 2 +- 42 files changed, 94 insertions(+), 212 deletions(-) diff --git a/conformance/results/pyrefly/aliases_explicit.toml b/conformance/results/pyrefly/aliases_explicit.toml index ced5ae989..3eaadf112 100644 --- a/conformance/results/pyrefly/aliases_explicit.toml +++ b/conformance/results/pyrefly/aliases_explicit.toml @@ -24,6 +24,6 @@ ERROR aliases_explicit.py:89:22-23: number literal cannot be used in annotations ERROR aliases_explicit.py:90:22-33: boolean operation cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:91:22-32: f-string cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:100:5-19: `TypeAlias[ListAlias, type[list[Unknown]]]` is not subscriptable [unsupported-operation] -ERROR aliases_explicit.py:101:6-20: Expected a callable, got TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]] [not-callable] +ERROR aliases_explicit.py:101:6-20: Expected a callable, got `TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]]` [not-callable] ERROR aliases_explicit.py:102:5-24: `TypeAlias[ListOrSetAlias, type[list[Unknown] | set[Unknown]]]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/aliases_implicit.toml b/conformance/results/pyrefly/aliases_implicit.toml index ee563bb49..7b1bfb607 100644 --- a/conformance/results/pyrefly/aliases_implicit.toml +++ b/conformance/results/pyrefly/aliases_implicit.toml @@ -26,6 +26,6 @@ ERROR aliases_implicit.py:115:10-24: Expected a type form, got instance of `Lite ERROR aliases_implicit.py:116:10-24: Expected a type form, got instance of `Literal[1]` [not-a-type] ERROR aliases_implicit.py:118:10-24: Expected a type form, got instance of `Literal['int']` [not-a-type] ERROR aliases_implicit.py:119:10-24: Expected a type form, got instance of `Literal['int | str']` [not-a-type] -ERROR aliases_implicit.py:133:6-20: Expected a callable, got type[list[Unknown] | set[Unknown]] [not-callable] +ERROR aliases_implicit.py:133:6-20: Expected a callable, got `type[list[Unknown] | set[Unknown]]` [not-callable] ERROR aliases_implicit.py:135:5-24: `type[list[Unknown] | set[Unknown]]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/aliases_recursive.toml b/conformance/results/pyrefly/aliases_recursive.toml index e227e2baf..a83dc7e6b 100644 --- a/conformance/results/pyrefly/aliases_recursive.toml +++ b/conformance/results/pyrefly/aliases_recursive.toml @@ -8,26 +8,12 @@ Line 39: Expected 1 errors Line 50: Expected 1 errors Line 51: Expected 1 errors Line 52: Expected 1 errors +Line 63: Expected 1 errors +Line 69: Expected 1 errors Line 72: Expected 1 errors Line 75: Expected 1 errors -Line 30: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveTuple']` [not-a-type]"] Line 42: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMapping']` [not-a-type]"] -Line 58: Unexpected errors ['Expected a type form, got instance of `_SpecialForm` [not-a-type]'] -Line 59: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] -Line 62: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] -Line 65: Unexpected errors ['Expected a type form, got instance of `_SpecialForm` [not-a-type]'] -Line 67: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] -Line 68: Unexpected errors ['`type[list[Unknown]]` is not subscriptable [unsupported-operation]'] """ output = """ -ERROR aliases_recursive.py:30:36-52: Expected a type form, got instance of `Literal['RecursiveTuple']` [not-a-type] ERROR aliases_recursive.py:42:45-63: Expected a type form, got instance of `Literal['RecursiveMapping']` [not-a-type] -ERROR aliases_recursive.py:58:26-54: Expected a type form, got instance of `_SpecialForm` [not-a-type] -ERROR aliases_recursive.py:59:25-47: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:62:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:63:5-27: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:65:26-63: Expected a type form, got instance of `_SpecialForm` [not-a-type] -ERROR aliases_recursive.py:67:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:68:5-34: `type[list[Unknown]]` is not subscriptable [unsupported-operation] -ERROR aliases_recursive.py:69:5-32: `type[list[Unknown]]` is not subscriptable [unsupported-operation] """ diff --git a/conformance/results/pyrefly/aliases_type_statement.toml b/conformance/results/pyrefly/aliases_type_statement.toml index a838d5576..f887262d2 100644 --- a/conformance/results/pyrefly/aliases_type_statement.toml +++ b/conformance/results/pyrefly/aliases_type_statement.toml @@ -6,7 +6,6 @@ Does not detect circular definitions. """ conformance_automated = "Fail" errors_diff = """ -Line 26: Expected 1 errors Line 82: Expected 1 errors Line 84: Expected 1 errors Lines 51, 52: Expected error (tag 'TA14') @@ -14,8 +13,9 @@ Lines 88, 89: Expected error (tag 'RTA6') """ output = """ ERROR aliases_type_statement.py:17:1-21: Object of class `TypeAliasType` has no attribute `bit_count` [missing-attribute] -ERROR aliases_type_statement.py:19:1-11: Expected a callable, got TypeAlias[GoodAlias1, type[int]] [not-callable] +ERROR aliases_type_statement.py:19:1-11: Expected a callable, got `TypeAlias[GoodAlias1, type[int]]` [not-callable] ERROR aliases_type_statement.py:23:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] +ERROR aliases_type_statement.py:26:18-28: Cannot use scoped type alias `GoodAlias1` as a base class. Use a legacy type alias instead: `GoodAlias1: TypeAlias = type[int]` [invalid-inheritance] ERROR aliases_type_statement.py:31:22-32: Expected class object, got `TypeAliasType` [invalid-argument] ERROR aliases_type_statement.py:37:22-62: function call cannot be used in annotations [invalid-annotation] ERROR aliases_type_statement.py:38:22-32: list literal cannot be used in annotations [invalid-annotation] diff --git a/conformance/results/pyrefly/aliases_typealiastype.toml b/conformance/results/pyrefly/aliases_typealiastype.toml index 80989c4cf..ddb3a209c 100644 --- a/conformance/results/pyrefly/aliases_typealiastype.toml +++ b/conformance/results/pyrefly/aliases_typealiastype.toml @@ -1,49 +1,30 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors Line 46: Expected 1 errors +Line 47: Expected 1 errors Line 48: Expected 1 errors -Line 52: Expected 1 errors -Line 53: Expected 1 errors -Line 54: Expected 1 errors -Line 55: Expected 1 errors -Line 56: Expected 1 errors -Line 57: Expected 1 errors -Line 58: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors -Line 61: Expected 1 errors -Line 62: Expected 1 errors -Line 63: Expected 1 errors -Line 64: Expected 1 errors -Line 17: Unexpected errors ['Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] -Line 18: Unexpected errors ['Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] -Line 19: Unexpected errors ['Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] -Line 22: Unexpected errors ["Expected a type form, got instance of `Literal['GoodAlias5[S, TStr, P]']` [not-a-type]"] -Line 23: Unexpected errors ['Argument `tuple[type[TypeVar[S]], type[TypeVar[TStr]], type[ParamSpec[P]], type[TypeVarTuple[Ts]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type]'] -Line 35: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] -Line 36: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] -Line 37: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] -Line 38: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]'] -Line 39: Unexpected errors ['Expected a type form, got instance of `GenericAlias` [not-a-type]', 'Expected an iterable, got `type[tuple[int, str, int]]` [not-iterable]'] +Line 66: Expected 1 errors """ output = """ -ERROR aliases_typealiastype.py:17:63-67: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:18:73-79: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:19:81-85: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:22:40-64: Expected a type form, got instance of `Literal['GoodAlias5[S, TStr, P]']` [not-a-type] -ERROR aliases_typealiastype.py:23:17-33: Argument `tuple[type[TypeVar[S]], type[TypeVar[TStr]], type[ParamSpec[P]], type[TypeVarTuple[Ts]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] ERROR aliases_typealiastype.py:32:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] -ERROR aliases_typealiastype.py:35:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:36:5-20: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:37:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:38:5-40: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:39:5-60: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:39:16-59: Expected an iterable, got `type[tuple[int, str, int]]` [not-iterable] -ERROR aliases_typealiastype.py:40:5-30: Expected a type form, got instance of `GenericAlias` [not-a-type] -ERROR aliases_typealiastype.py:43:61-65: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:45:57-65: Argument `tuple[type[TypeVar[S]], type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:47:74-78: Argument `tuple[type[TypeVar[T]]]` is not assignable to parameter `type_params` with type `tuple[ParamSpec | TypeVar | TypeVarTuple, ...]` in function `typing.TypeAliasType.__new__` [bad-argument-type] -ERROR aliases_typealiastype.py:66:47-57: `BadAlias21` is uninitialized [unbound-name] +ERROR aliases_typealiastype.py:40:5-30: Type `int` is not assignable to upper bound `str` of type variable `TStr` [bad-specialization] +ERROR aliases_typealiastype.py:43:40-47: Type variable `S` is out of scope for this `TypeAliasType` [type-alias-error] +ERROR aliases_typealiastype.py:44:40-47: Type variable `S` is out of scope for this `TypeAliasType` [type-alias-error] +ERROR aliases_typealiastype.py:45:45-65: Value for argument `type_params` must be a tuple literal [type-alias-error] +ERROR aliases_typealiastype.py:52:40-80: function call cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:53:40-50: list literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:54:42-55: tuple literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:55:42-65: list comprehension cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:56:42-52: dict literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:56:44-45: Could not find name `a` [unknown-name] +ERROR aliases_typealiastype.py:56:49-50: Could not find name `b` [unknown-name] +ERROR aliases_typealiastype.py:57:42-57: function call cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:58:42-50: invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:59:42-63: if expression cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:60:42-46: Expected `BadAlias16` to be a type alias, got `Literal[3]` [type-alias-error] +ERROR aliases_typealiastype.py:61:42-46: bool literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:62:42-43: number literal cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:63:42-53: boolean operation cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:64:42-52: f-string cannot be used in annotations [invalid-annotation] """ diff --git a/conformance/results/pyrefly/callables_kwargs.toml b/conformance/results/pyrefly/callables_kwargs.toml index 7e70cf52b..258047763 100644 --- a/conformance/results/pyrefly/callables_kwargs.toml +++ b/conformance/results/pyrefly/callables_kwargs.toml @@ -2,9 +2,8 @@ conformant = "Partial" notes = """ Does not reject overlap between unpacked TypedDict kwarg and named parameters """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 111: Expected 1 errors """ output = """ ERROR callables_kwargs.py:46:10-12: Missing argument `v1` in function `func1` [missing-argument] @@ -24,6 +23,7 @@ ERROR callables_kwargs.py:65:17-22: Multiple values for argument `v1` in functio ERROR callables_kwargs.py:101:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol3` [bad-assignment] ERROR callables_kwargs.py:102:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol4` [bad-assignment] ERROR callables_kwargs.py:103:19-24: `(**kwargs: Unpack[TypedDict[TD2]]) -> None` is not assignable to `TDProtocol5` [bad-assignment] +ERROR callables_kwargs.py:111:20-41: TypedDict key 'v1' in **kwargs overlaps with parameter 'v1' [bad-function-definition] ERROR callables_kwargs.py:122:21-30: `Unpack` in **kwargs annotation must be used only with a `TypedDict` [invalid-annotation] ERROR callables_kwargs.py:134:19-24: `(*, v1: int, v3: str, v2: str = '') -> None` is not assignable to `TDProtocol6` [bad-assignment] """ diff --git a/conformance/results/pyrefly/constructors_call_metaclass.toml b/conformance/results/pyrefly/constructors_call_metaclass.toml index 44d131a2c..5471a7404 100644 --- a/conformance/results/pyrefly/constructors_call_metaclass.toml +++ b/conformance/results/pyrefly/constructors_call_metaclass.toml @@ -3,6 +3,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR constructors_call_metaclass.py:51:7-9: Missing argument `x` in function `Class3.__new__` [missing-argument] -ERROR constructors_call_metaclass.py:65:7-9: Missing argument `x` in function `Class4.__new__` [missing-argument] +ERROR constructors_call_metaclass.py:54:7-9: Missing argument `x` in function `Class3.__new__` [missing-argument] +ERROR constructors_call_metaclass.py:68:7-9: Missing argument `x` in function `Class4.__new__` [missing-argument] """ diff --git a/conformance/results/pyrefly/constructors_callable.toml b/conformance/results/pyrefly/constructors_callable.toml index 42087455d..edbb81b14 100644 --- a/conformance/results/pyrefly/constructors_callable.toml +++ b/conformance/results/pyrefly/constructors_callable.toml @@ -18,28 +18,18 @@ Line 165: Unexpected errors ['assert_type(Class7[Any], Class7[str]) failed [asse Line 183: Unexpected errors ['assert_type(Class8[Any], Class8[str]) failed [assert-type]'] """ output = """ - constructors_callable.py:36:12-16: revealed type: (x: int) -> Class1 [reveal-type] ERROR constructors_callable.py:38:3-5: Missing argument `x` [missing-argument] ERROR constructors_callable.py:39:3-8: Missing argument `x` [missing-argument] ERROR constructors_callable.py:39:4-5: Unexpected keyword argument `y` [unexpected-keyword] - constructors_callable.py:49:12-16: revealed type: () -> Class2 [reveal-type] ERROR constructors_callable.py:51:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] ERROR constructors_callable.py:62:23-29: Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type] - constructors_callable.py:63:12-16: revealed type: (*args: Unknown, **kwargs: Unknown) -> Class3 [reveal-type] - constructors_callable.py:77:12-16: revealed type: (x: int) -> int [reveal-type] ERROR constructors_callable.py:79:3-5: Missing argument `x` [missing-argument] ERROR constructors_callable.py:80:3-8: Missing argument `x` [missing-argument] ERROR constructors_callable.py:80:4-5: Unexpected keyword argument `y` [unexpected-keyword] - constructors_callable.py:97:12-16: revealed type: (*args: Any, **kwargs: Any) -> NoReturn [reveal-type] - constructors_callable.py:125:12-16: revealed type: () -> Class6Proxy [reveal-type] ERROR constructors_callable.py:127:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] - constructors_callable.py:142:12-20: revealed type: () -> Any [reveal-type] ERROR constructors_callable.py:144:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] - constructors_callable.py:161:12-163:2: revealed type: (x: int) -> Class7[Unknown] [reveal-type] ERROR constructors_callable.py:164:12-32: assert_type(Class7[Any], Class7[int]) failed [assert-type] ERROR constructors_callable.py:165:12-33: assert_type(Class7[Any], Class7[str]) failed [assert-type] ERROR constructors_callable.py:165:16-18: Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type] - constructors_callable.py:182:12-16: revealed type: (x: list[Unknown], y: list[Unknown]) -> Class8[Unknown] [reveal-type] ERROR constructors_callable.py:183:12-41: assert_type(Class8[Any], Class8[str]) failed [assert-type] - constructors_callable.py:193:12-16: revealed type: (x: list[@_], y: list[@_]) -> Class9 [reveal-type] """ diff --git a/conformance/results/pyrefly/dataclasses_final.toml b/conformance/results/pyrefly/dataclasses_final.toml index 9afd7169e..eed3df1b9 100644 --- a/conformance/results/pyrefly/dataclasses_final.toml +++ b/conformance/results/pyrefly/dataclasses_final.toml @@ -5,10 +5,10 @@ Allows assignment to final attributes that are not initialized on the class conformance_automated = "Fail" errors_diff = """ Line 35: Expected 1 errors +Line 37: Expected 1 errors """ output = """ ERROR dataclasses_final.py:27:1-17: Cannot set field `final_classvar` [read-only] ERROR dataclasses_final.py:36:1-21: Cannot set field `final_with_default` [read-only] -ERROR dataclasses_final.py:37:1-19: Instance-only attribute `final_no_default` of class `D` is not visible on the class [no-access] ERROR dataclasses_final.py:38:1-21: Cannot set field `final_with_default` [read-only] """ diff --git a/conformance/results/pyrefly/dataclasses_postinit.toml b/conformance/results/pyrefly/dataclasses_postinit.toml index 7691703f0..5e94c099b 100644 --- a/conformance/results/pyrefly/dataclasses_postinit.toml +++ b/conformance/results/pyrefly/dataclasses_postinit.toml @@ -3,8 +3,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR dataclasses_postinit.py:19:9-22: `__post_init__` type `BoundMethod[DC1, (self: Self@DC1, x: int, y: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +ERROR dataclasses_postinit.py:19:9-22: `__post_init__` type `BoundMethod[DC1, (self: DC1, x: int, y: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] ERROR dataclasses_postinit.py:28:7-12: Object of class `DC1` has no attribute `x` [missing-attribute] ERROR dataclasses_postinit.py:29:7-12: Object of class `DC1` has no attribute `y` [missing-attribute] -ERROR dataclasses_postinit.py:36:9-22: `__post_init__` type `BoundMethod[DC2, (self: Self@DC2, x: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] +ERROR dataclasses_postinit.py:36:9-22: `__post_init__` type `BoundMethod[DC2, (self: DC2, x: int) -> None]` is not assignable to expected type `(x: int, y: str) -> object` generated from the dataclass's `InitVar` fields [bad-function-definition] """ diff --git a/conformance/results/pyrefly/directives_deprecated.toml b/conformance/results/pyrefly/directives_deprecated.toml index 74a726540..2b3718261 100644 --- a/conformance/results/pyrefly/directives_deprecated.toml +++ b/conformance/results/pyrefly/directives_deprecated.toml @@ -1,6 +1,7 @@ conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ +Line 18: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors Line 30: Expected 1 errors @@ -14,5 +15,4 @@ Line 69: Expected 1 errors Line 98: Expected 1 errors """ output = """ - directives_deprecated.py:18:44-47: `Ham` is deprecated [deprecated] """ diff --git a/conformance/results/pyrefly/directives_reveal_type.toml b/conformance/results/pyrefly/directives_reveal_type.toml index 2257de40a..5cd063da4 100644 --- a/conformance/results/pyrefly/directives_reveal_type.toml +++ b/conformance/results/pyrefly/directives_reveal_type.toml @@ -3,10 +3,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ - directives_reveal_type.py:14:16-19: revealed type: int | str [reveal-type] - directives_reveal_type.py:15:16-19: revealed type: list[int] [reveal-type] - directives_reveal_type.py:16:16-19: revealed type: Any [reveal-type] - directives_reveal_type.py:17:16-19: revealed type: ForwardReference [reveal-type] ERROR directives_reveal_type.py:19:16-18: reveal_type needs 1 positional argument, got 0 [bad-argument-count] ERROR directives_reveal_type.py:20:16-22: reveal_type needs 1 positional argument, got 2 [bad-argument-count] """ diff --git a/conformance/results/pyrefly/enums_behaviors.toml b/conformance/results/pyrefly/enums_behaviors.toml index 40b63a7e1..eb4cb98f1 100644 --- a/conformance/results/pyrefly/enums_behaviors.toml +++ b/conformance/results/pyrefly/enums_behaviors.toml @@ -2,12 +2,10 @@ conformant = "Partial" notes = """ Iterating an enum class gives Any """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 20: Unexpected errors ['assert_type(Any, Color) failed [assert-type]'] """ output = """ -ERROR enums_behaviors.py:20:16-30: assert_type(Any, Color) failed [assert-type] ERROR enums_behaviors.py:27:12-33: assert_type(Literal[Color.RED], Color) failed [assert-type] ERROR enums_behaviors.py:32:12-43: assert_type(Color, Literal[Color.BLUE]) failed [assert-type] ERROR enums_behaviors.py:44:21-26: Cannot extend final class `Shape` [invalid-inheritance] diff --git a/conformance/results/pyrefly/enums_member_values.toml b/conformance/results/pyrefly/enums_member_values.toml index 103ac0050..135c7a1b4 100644 --- a/conformance/results/pyrefly/enums_member_values.toml +++ b/conformance/results/pyrefly/enums_member_values.toml @@ -7,9 +7,8 @@ ERROR enums_member_values.py:21:12-43: assert_type(int, Literal[1]) failed [asse ERROR enums_member_values.py:22:12-41: assert_type(int, Literal[1]) failed [assert-type] ERROR enums_member_values.py:26:16-50: assert_type(int, Literal[1, 3]) failed [assert-type] ERROR enums_member_values.py:30:16-51: assert_type(int, Literal[1, 2, 3]) failed [assert-type] -ERROR enums_member_values.py:54:12-46: assert_type(tuple[Literal[1], float, float], Literal[1]) failed [assert-type] +ERROR enums_member_values.py:54:12-46: assert_type(Any, Literal[1]) failed [assert-type] ERROR enums_member_values.py:68:12-42: assert_type(auto, Literal[1]) failed [assert-type] ERROR enums_member_values.py:78:5-10: Enum member `GREEN` has type `str`, must match the `_value_` attribute annotation of `int` [bad-assignment] ERROR enums_member_values.py:85:24-29: `int` is not assignable to attribute `_value_` with type `str` [bad-assignment] -ERROR enums_member_values.py:96:12-41: assert_type(Ellipsis, int) failed [assert-type] """ diff --git a/conformance/results/pyrefly/enums_members.toml b/conformance/results/pyrefly/enums_members.toml index 5e14c87e0..7b0090a0d 100644 --- a/conformance/results/pyrefly/enums_members.toml +++ b/conformance/results/pyrefly/enums_members.toml @@ -4,28 +4,21 @@ Enum members that are aliases of other members do not resolved to the aliased me """ conformance_automated = "Fail" errors_diff = """ -Line 27: Unexpected errors ['assert_type(Any, str) failed [assert-type]', 'Instance-only attribute `genus` of class `Pet` is not visible on the class [missing-attribute]'] -Line 28: Unexpected errors ['assert_type(Any, str) failed [assert-type]', 'Instance-only attribute `species` of class `Pet` is not visible on the class [missing-attribute]'] Line 100: Unexpected errors ['assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type]'] """ output = """ -ERROR enums_members.py:27:12-28: assert_type(Any, str) failed [assert-type] -ERROR enums_members.py:27:13-22: Instance-only attribute `genus` of class `Pet` is not visible on the class [missing-attribute] -ERROR enums_members.py:28:12-30: assert_type(Any, str) failed [assert-type] -ERROR enums_members.py:28:13-24: Instance-only attribute `species` of class `Pet` is not visible on the class [missing-attribute] ERROR enums_members.py:50:5-8: Enum member `DOG` may not be annotated directly. Instead, annotate the `_value_` attribute. [invalid-annotation] ERROR enums_members.py:82:12-53: assert_type((x: Any) -> str, Any) failed [assert-type] ERROR enums_members.py:82:37-51: `Pet4.converter` is not a valid enum member [invalid-literal] ERROR enums_members.py:83:12-53: assert_type((x: int) -> int, Any) failed [assert-type] ERROR enums_members.py:83:37-51: `Pet4.transform` is not a valid enum member [invalid-literal] -ERROR enums_members.py:84:12-49: assert_type((self: Self) -> str, Any) failed [assert-type] +ERROR enums_members.py:84:12-49: assert_type((self: Pet4) -> str, Any) failed [assert-type] ERROR enums_members.py:84:35-47: `Pet4.species` is not a valid enum member [invalid-literal] -ERROR enums_members.py:85:12-45: assert_type((self: Self) -> None, Any) failed [assert-type] +ERROR enums_members.py:85:12-45: assert_type((self: Pet4) -> None, Any) failed [assert-type] ERROR enums_members.py:85:33-43: `Pet4.speak` is not a valid enum member [invalid-literal] ERROR enums_members.py:100:12-62: assert_type(Literal[TrafficLight.AMBER], Literal[TrafficLight.YELLOW]) failed [assert-type] ERROR enums_members.py:116:12-43: assert_type(nonmember[int], Any) failed [assert-type] ERROR enums_members.py:116:32-41: `Example.b` is not a valid enum member [invalid-literal] - enums_members.py:128:20-34: revealed type: int [reveal-type] ERROR enums_members.py:129:20-57: assert_type(int, Any) failed [assert-type] ERROR enums_members.py:129:43-55: `Example2.__B` is not a valid enum member [invalid-literal] ERROR enums_members.py:146:12-27: assert_type(Literal[Pet5.DOG], int) failed [assert-type] diff --git a/conformance/results/pyrefly/generics_basic.toml b/conformance/results/pyrefly/generics_basic.toml index 209981f5d..c0b28fb8e 100644 --- a/conformance/results/pyrefly/generics_basic.toml +++ b/conformance/results/pyrefly/generics_basic.toml @@ -6,7 +6,6 @@ Constrained type var resolves to subtype instead of explcitly listed constraint """ conformance_automated = "Fail" errors_diff = """ -Line 49: Expected 1 errors Line 34: Unexpected errors ['`+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation]', '`+` is not supported between `AnyStr` and `AnyStr` [unsupported-operation]', 'Returned type `bytes | Unknown` is not assignable to declared return type `AnyStr` [bad-return]'] Line 67: Unexpected errors ['assert_type(MyStr, str) failed [assert-type]'] Line 68: Unexpected errors ['assert_type(MyStr, str) failed [assert-type]', 'Argument `str` is not assignable to parameter `y` with type `MyStr` in function `concat` [bad-argument-type]'] @@ -17,6 +16,7 @@ ERROR generics_basic.py:34:12-17: `+` is not supported between `AnyStr` and `Any ERROR generics_basic.py:34:12-17: Returned type `bytes | Unknown` is not assignable to declared return type `AnyStr` [bad-return] ERROR generics_basic.py:40:15-16: Argument `bytes` is not assignable to parameter `y` with type `str` in function `concat` [bad-argument-type] ERROR generics_basic.py:41:15-16: Argument `str` is not assignable to parameter `y` with type `bytes` in function `concat` [bad-argument-type] +ERROR generics_basic.py:49:18-48: Expected at least 2 constraints in TypeVar `BadConstraint1`, got 1 [invalid-type-var] ERROR generics_basic.py:55:53-60: Type variable bounds and constraints must be concrete [invalid-annotation] ERROR generics_basic.py:67:16-35: assert_type(MyStr, str) failed [assert-type] ERROR generics_basic.py:68:16-35: assert_type(MyStr, str) failed [assert-type] diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml index 4b3618525..c25249aec 100644 --- a/conformance/results/pyrefly/generics_defaults.toml +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -6,7 +6,7 @@ conformance_automated = "Fail" errors_diff = """ Line 130: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] Line 169: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type]'] -Line 170: Unexpected errors ['assert_type(Any, int) failed [assert-type]', 'Instance-only attribute `attr` of class `Foo7` is not visible on the class [missing-attribute]'] +Line 170: Unexpected errors ['assert_type(Any, int) failed [assert-type]', 'Generic attribute `attr` of class `Foo7` is not visible on the class [missing-attribute]'] """ output = """ ERROR generics_defaults.py:24:7-31: Type parameter `T` without a default cannot follow type parameter `DefaultStrT` with a default [invalid-type-var] @@ -17,5 +17,5 @@ ERROR generics_defaults.py:130:12-27: assert_type(Any, int) failed [assert-type] ERROR generics_defaults.py:141:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] ERROR generics_defaults.py:169:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] ERROR generics_defaults.py:170:12-28: assert_type(Any, int) failed [assert-type] -ERROR generics_defaults.py:170:13-22: Instance-only attribute `attr` of class `Foo7` is not visible on the class [missing-attribute] +ERROR generics_defaults.py:170:13-22: Generic attribute `attr` of class `Foo7` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyrefly/generics_paramspec_basic.toml b/conformance/results/pyrefly/generics_paramspec_basic.toml index 5529454da..b446dd177 100644 --- a/conformance/results/pyrefly/generics_paramspec_basic.toml +++ b/conformance/results/pyrefly/generics_paramspec_basic.toml @@ -4,7 +4,7 @@ errors_diff = """ """ output = """ ERROR generics_paramspec_basic.py:10:13-31: ParamSpec must be assigned to a variable named `NotIt` [invalid-param-spec] -ERROR generics_paramspec_basic.py:15:18-19: `ParamSpec[P]` is not allowed in this context [invalid-annotation] +ERROR generics_paramspec_basic.py:15:18-19: `ParamSpec` is not allowed in this context [invalid-annotation] ERROR generics_paramspec_basic.py:23:14-15: `ParamSpec` is not allowed in this context [invalid-annotation] ERROR generics_paramspec_basic.py:23:20-21: `ParamSpec` is not allowed in this context [invalid-annotation] ERROR generics_paramspec_basic.py:27:14-33: `Concatenate[int, P]` is not allowed in this context [invalid-annotation] diff --git a/conformance/results/pyrefly/generics_self_advanced.toml b/conformance/results/pyrefly/generics_self_advanced.toml index f671925ce..fb11f7c63 100644 --- a/conformance/results/pyrefly/generics_self_advanced.toml +++ b/conformance/results/pyrefly/generics_self_advanced.toml @@ -2,14 +2,8 @@ conformant = "Pass" notes = """ Treats attributes not initialized on the class as instance-only """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 43: Unexpected errors ['assert_type(Any, list[Self]) failed [assert-type]', 'Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute]'] -Line 44: Unexpected errors ['assert_type(Any, Self) failed [assert-type]', 'Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute]'] """ output = """ -ERROR generics_self_advanced.py:43:20-39: assert_type(Any, list[Self]) failed [assert-type] -ERROR generics_self_advanced.py:43:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] -ERROR generics_self_advanced.py:44:20-36: assert_type(Any, Self) failed [assert-type] -ERROR generics_self_advanced.py:44:21-26: Instance-only attribute `a` of class `ChildB` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyrefly/generics_self_attributes.toml b/conformance/results/pyrefly/generics_self_attributes.toml index e93cf3661..f517911c8 100644 --- a/conformance/results/pyrefly/generics_self_attributes.toml +++ b/conformance/results/pyrefly/generics_self_attributes.toml @@ -2,10 +2,10 @@ conformant = "Partial" notes = """ Does not reject incorrect direct assignment to attribute w/ Self """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 32: Expected 1 errors """ output = """ ERROR generics_self_attributes.py:26:38-62: Argument `LinkedList[int]` is not assignable to parameter `next` with type `OrdinalLinkedList | None` in function `OrdinalLinkedList.__init__` [bad-argument-type] +ERROR generics_self_attributes.py:32:15-50: `LinkedList[int]` is not assignable to attribute `next` with type `OrdinalLinkedList | None` [bad-assignment] """ diff --git a/conformance/results/pyrefly/generics_self_protocols.toml b/conformance/results/pyrefly/generics_self_protocols.toml index 41968988b..39a401e5b 100644 --- a/conformance/results/pyrefly/generics_self_protocols.toml +++ b/conformance/results/pyrefly/generics_self_protocols.toml @@ -2,12 +2,10 @@ conformant = "Partial" notes = """ Protocol subtyping does not work with Self in return annotation """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 58: Unexpected errors ['Argument `ReturnConcreteShape` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type]'] """ output = """ -ERROR generics_self_protocols.py:58:19-40: Argument `ReturnConcreteShape` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] ERROR generics_self_protocols.py:61:19-34: Argument `BadReturnType` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] ERROR generics_self_protocols.py:64:19-41: Argument `ReturnDifferentClass` is not assignable to parameter `shape` with type `ShapeProtocol` in function `accepts_shape` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/generics_syntax_compatibility.toml b/conformance/results/pyrefly/generics_syntax_compatibility.toml index 1ed01bdef..d6e72a2c5 100644 --- a/conformance/results/pyrefly/generics_syntax_compatibility.toml +++ b/conformance/results/pyrefly/generics_syntax_compatibility.toml @@ -6,5 +6,4 @@ output = """ ERROR generics_syntax_compatibility.py:14:7-13: Class `ClassA` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var] ERROR generics_syntax_compatibility.py:14:22-23: Type parameter K is not included in the type parameter list [invalid-type-var] ERROR generics_syntax_compatibility.py:26:35-36: Type parameter K is not included in the type parameter list [invalid-type-var] -ERROR generics_syntax_compatibility.py:26:45-46: Type parameter K is not included in the type parameter list [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_syntax_scoping.toml b/conformance/results/pyrefly/generics_syntax_scoping.toml index c0270e159..f569cc931 100644 --- a/conformance/results/pyrefly/generics_syntax_scoping.toml +++ b/conformance/results/pyrefly/generics_syntax_scoping.toml @@ -7,9 +7,6 @@ errors_diff = """ Line 92: Expected 1 errors Line 95: Expected 1 errors Line 98: Expected 1 errors -Line 66: Unexpected errors ['Found `S`, but it was not the global scope [unknown-name]'] -Line 67: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] -Line 116: Unexpected errors ['assert_type(type[T], TypeVar) failed [assert-type]'] """ output = """ ERROR generics_syntax_scoping.py:14:20-31: Type variable bounds and constraints must be concrete [invalid-annotation] @@ -17,7 +14,4 @@ ERROR generics_syntax_scoping.py:18:26-27: Expected a type form, got instance of ERROR generics_syntax_scoping.py:35:7-8: `T` is uninitialized [unbound-name] ERROR generics_syntax_scoping.py:44:17-18: `T` is uninitialized [unbound-name] ERROR generics_syntax_scoping.py:44:17-18: Expected a type form, got instance of `int` [not-a-type] -ERROR generics_syntax_scoping.py:66:20-21: Found `S`, but it was not the global scope [unknown-name] -ERROR generics_syntax_scoping.py:67:24-32: assert_type(Any, int) failed [assert-type] -ERROR generics_syntax_scoping.py:116:24-36: assert_type(type[T], TypeVar) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_type_erasure.toml b/conformance/results/pyrefly/generics_type_erasure.toml index dbbeeacb5..efb957387 100644 --- a/conformance/results/pyrefly/generics_type_erasure.toml +++ b/conformance/results/pyrefly/generics_type_erasure.toml @@ -5,9 +5,9 @@ errors_diff = """ output = """ ERROR generics_type_erasure.py:38:16-18: Argument `Literal['']` is not assignable to parameter `label` with type `int | None` in function `Node.__init__` [bad-argument-type] ERROR generics_type_erasure.py:40:16-17: Argument `Literal[0]` is not assignable to parameter `label` with type `str | None` in function `Node.__init__` [bad-argument-type] -ERROR generics_type_erasure.py:42:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] -ERROR generics_type_erasure.py:43:1-16: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR generics_type_erasure.py:44:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [no-access] -ERROR generics_type_erasure.py:45:1-11: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR generics_type_erasure.py:46:1-15: Instance-only attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:42:1-16: Generic attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:43:1-16: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:44:1-11: Generic attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:45:1-11: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:46:1-15: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyrefly/generics_upper_bound.toml b/conformance/results/pyrefly/generics_upper_bound.toml index d2778f5c1..e0bcf1cd5 100644 --- a/conformance/results/pyrefly/generics_upper_bound.toml +++ b/conformance/results/pyrefly/generics_upper_bound.toml @@ -2,13 +2,13 @@ conformant = "Partial" notes = """ Instantiation is not validated against bound """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 51: Expected 1 errors """ output = """ ERROR generics_upper_bound.py:24:38-45: Type variable bounds and constraints must be concrete [invalid-annotation] ERROR generics_upper_bound.py:43:12-55: assert_type(list[int], list[int] | set[int]) failed [assert-type] ERROR generics_upper_bound.py:43:25-31: Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type] +ERROR generics_upper_bound.py:51:7-13: Type `int` is not assignable to upper bound `Sized` of type variable `ST` [bad-specialization] ERROR generics_upper_bound.py:56:38-49: TypeVar cannot have both constraints and bound [invalid-type-var] """ diff --git a/conformance/results/pyrefly/literals_literalstring.toml b/conformance/results/pyrefly/literals_literalstring.toml index 1e52195ae..ffe7f875c 100644 --- a/conformance/results/pyrefly/literals_literalstring.toml +++ b/conformance/results/pyrefly/literals_literalstring.toml @@ -2,11 +2,8 @@ conformant = "Partial" notes = """ LiteralString is sometimes converted to str """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 120: Expected 1 errors -Line 111: Unexpected errors ["assert_type(str, Literal['hello']) failed [assert-type]"] -Line 116: Unexpected errors ['assert_type(str, LiteralString) failed [assert-type]'] """ output = """ ERROR literals_literalstring.py:36:29-42: Invalid type inside literal, `LiteralString` [invalid-literal] @@ -15,8 +12,7 @@ ERROR literals_literalstring.py:43:23-24: `Literal['two']` is not assignable to ERROR literals_literalstring.py:66:25-47: `str` is not assignable to `LiteralString` [bad-assignment] ERROR literals_literalstring.py:74:25-26: `Literal[3]` is not assignable to `LiteralString` [bad-assignment] ERROR literals_literalstring.py:75:25-32: `Literal[b'test']` is not assignable to `LiteralString` [bad-assignment] -ERROR literals_literalstring.py:111:16-37: assert_type(str, Literal['hello']) failed [assert-type] -ERROR literals_literalstring.py:116:16-35: assert_type(str, LiteralString) failed [assert-type] +ERROR literals_literalstring.py:120:21-24: Type `str` is not assignable to upper bound `LiteralString` of type variable `TLiteral` [bad-specialization] ERROR literals_literalstring.py:134:51-52: Argument `str` is not assignable to parameter `value` with type `LiteralString` in function `Container.__init__` [bad-argument-type] ERROR literals_literalstring.py:171:21-24: `list[LiteralString]` is not assignable to `list[str]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/overloads_consistency.toml b/conformance/results/pyrefly/overloads_consistency.toml index c7e562825..da6c71193 100644 --- a/conformance/results/pyrefly/overloads_consistency.toml +++ b/conformance/results/pyrefly/overloads_consistency.toml @@ -3,6 +3,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR overloads_consistency.py:25:5-16: Overload return type `str` is not assignable to implementation return type `int` [invalid-overload] -ERROR overloads_consistency.py:41:5-19: Implementation signature `(x: int) -> int | str` does not accept all arguments that overload signature `(x: str) -> str` accepts [invalid-overload] +ERROR overloads_consistency.py:25:5-16: Overload return type `str` is not assignable to implementation return type `int` [inconsistent-overload] +ERROR overloads_consistency.py:41:5-19: Implementation signature `(x: int) -> int | str` does not accept all arguments that overload signature `(x: str) -> str` accepts [inconsistent-overload] """ diff --git a/conformance/results/pyrefly/overloads_definitions.toml b/conformance/results/pyrefly/overloads_definitions.toml index ab58e4fba..44bb654ff 100644 --- a/conformance/results/pyrefly/overloads_definitions.toml +++ b/conformance/results/pyrefly/overloads_definitions.toml @@ -5,11 +5,7 @@ Does not require some decorators that need to appear on every overload """ conformance_automated = "Fail" errors_diff = """ -Lines 71, 73, 78, 81: Expected error (tag 'func5') -Lines 121, 122, 123, 127: Expected error (tag 'invalid_final') -Lines 135, 136, 137, 141, 142: Expected error (tag 'invalid_final_2') Lines 170, 175, 181, 183: Expected error (tag 'override-final') -Lines 220, 221, 222, 225, 226: Expected error (tag 'override_impl') Line 49: Unexpected errors ['Overloaded function must have an implementation [invalid-overload]'] Line 176: Unexpected errors ['`final_method` is declared as final in parent class `Base` [bad-override]'] """ @@ -18,7 +14,14 @@ ERROR overloads_definitions.py:16:5-10: Overloaded function needs at least two @ ERROR overloads_definitions.py:28:5-10: Overloaded function must have an implementation [invalid-overload] ERROR overloads_definitions.py:49:9-14: Overloaded function must have an implementation [invalid-overload] ERROR overloads_definitions.py:59:9-21: Overloaded function must have an implementation [invalid-overload] -ERROR overloads_definitions.py:90:9-14: Implementation signature `(cls: type[Self@C], *args: int | str) -> int | str` does not accept all arguments that overload signature `(self: Self@C, x: str, /) -> str` accepts [invalid-overload] +ERROR overloads_definitions.py:81:9-14: If `@staticmethod` is present on any overload or the implementation, it should be on every overload and the implementation. [invalid-overload] +ERROR overloads_definitions.py:90:9-14: If `@classmethod` is present on any overload or the implementation, it should be on every overload and the implementation. [invalid-overload] +ERROR overloads_definitions.py:90:9-14: Implementation signature `(cls: type[Self@C], *args: int | str) -> int | str` does not accept all arguments that overload signature `(self: Self@C, x: str, /) -> str` accepts [inconsistent-overload] +ERROR overloads_definitions.py:123:9-22: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:137:9-24: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:142:9-24: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] ERROR overloads_definitions.py:176:9-21: `final_method` is declared as final in parent class `Base` [bad-override] ERROR overloads_definitions.py:191:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR overloads_definitions.py:222:9-20: `@override` should only be applied to the implementation of an overloaded function. [invalid-overload] +ERROR overloads_definitions.py:226:9-20: `@override` should only be applied to the implementation of an overloaded function. [invalid-overload] """ diff --git a/conformance/results/pyrefly/overloads_definitions_stub.toml b/conformance/results/pyrefly/overloads_definitions_stub.toml index 18ba0b318..479bf6bde 100644 --- a/conformance/results/pyrefly/overloads_definitions_stub.toml +++ b/conformance/results/pyrefly/overloads_definitions_stub.toml @@ -3,16 +3,16 @@ notes = """ Does not restrict some decorators to the first overload Does not require some decorators that need to appear on every overload """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 32, 33, 37: Expected error (tag 'func5') -Lines 39, 41, 44: Expected error (tag 'func6') -Lines 67, 69, 71, 72, 73: Expected error (tag 'invalid_final') -Lines 80, 82, 84, 85, 86: Expected error (tag 'invalid_final_2') -Lines 143, 146, 147, 149: Expected error (tag 'override_impl') """ output = """ ERROR overloads_definitions_stub.pyi:14:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] +ERROR overloads_definitions_stub.pyi:33:9-14: If `@staticmethod` is present on one overload, all overloads must have that decorator. [invalid-overload] +ERROR overloads_definitions_stub.pyi:44:9-14: If `@classmethod` is present on one overload, all overloads must have that decorator. [invalid-overload] +ERROR overloads_definitions_stub.pyi:73:9-22: If an overloaded function has no implementation, `@final` should be applied to the first overload only. [invalid-overload] +ERROR overloads_definitions_stub.pyi:86:9-24: If an overloaded function has no implementation, `@final` should be applied to the first overload only. [invalid-overload] ERROR overloads_definitions_stub.pyi:108:9-21: `final_method` is declared as final in parent class `Base` [bad-override] ERROR overloads_definitions_stub.pyi:122:9-21: Class member `Child.bad_override` is marked as an override, but no parent class has a matching attribute [bad-override] +ERROR overloads_definitions_stub.pyi:147:9-20: If an overloaded function has no implementation, `@override` should be applied to the first overload only. [invalid-overload] """ diff --git a/conformance/results/pyrefly/overloads_evaluation.toml b/conformance/results/pyrefly/overloads_evaluation.toml index 70360bd2e..2d0abc7cd 100644 --- a/conformance/results/pyrefly/overloads_evaluation.toml +++ b/conformance/results/pyrefly/overloads_evaluation.toml @@ -5,16 +5,6 @@ Does not perform argument expansion """ conformance_automated = "Fail" errors_diff = """ -Line 105: Unexpected errors ['No matching overload found for function `example2` [no-matching-overload]'] -Line 106: Unexpected errors ['assert_type(Any, int | str) failed [assert-type]'] -Line 134: Unexpected errors ['No matching overload found for function `expand_bool` [no-matching-overload]'] -Line 135: Unexpected errors ['assert_type(Any, Literal[0, 1]) failed [assert-type]'] -Line 160: Unexpected errors ['No matching overload found for function `expand_enum` [no-matching-overload]'] -Line 161: Unexpected errors ['assert_type(Any, Literal[0, 1]) failed [assert-type]'] -Line 180: Unexpected errors ['No matching overload found for function `expand_type_union` [no-matching-overload]'] -Line 181: Unexpected errors ['assert_type(Any, int | str) failed [assert-type]'] -Line 204: Unexpected errors ['No matching overload found for function `expand_tuple` [no-matching-overload]'] -Line 205: Unexpected errors ['assert_type(Any, int | str) failed [assert-type]'] Line 234: Unexpected errors ['assert_type(str, int) failed [assert-type]'] Line 264: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] Line 280: Unexpected errors ['assert_type(list[int], Any) failed [assert-type]'] @@ -24,17 +14,7 @@ output = """ ERROR overloads_evaluation.py:38:11-13: No matching overload found for function `example1_1` [no-matching-overload] ERROR overloads_evaluation.py:46:11-17: No matching overload found for function `example1_1` [no-matching-overload] ERROR overloads_evaluation.py:51:11-14: No matching overload found for function `example1_1` [no-matching-overload] -ERROR overloads_evaluation.py:105:20-29: No matching overload found for function `example2` [no-matching-overload] -ERROR overloads_evaluation.py:106:16-33: assert_type(Any, int | str) failed [assert-type] ERROR overloads_evaluation.py:115:13-22: No matching overload found for function `example2` [no-matching-overload] -ERROR overloads_evaluation.py:134:23-26: No matching overload found for function `expand_bool` [no-matching-overload] -ERROR overloads_evaluation.py:135:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] -ERROR overloads_evaluation.py:160:23-26: No matching overload found for function `expand_enum` [no-matching-overload] -ERROR overloads_evaluation.py:161:16-37: assert_type(Any, Literal[0, 1]) failed [assert-type] -ERROR overloads_evaluation.py:180:29-32: No matching overload found for function `expand_type_union` [no-matching-overload] -ERROR overloads_evaluation.py:181:16-33: assert_type(Any, int | str) failed [assert-type] -ERROR overloads_evaluation.py:204:24-32: No matching overload found for function `expand_tuple` [no-matching-overload] -ERROR overloads_evaluation.py:205:16-33: assert_type(Any, int | str) failed [assert-type] ERROR overloads_evaluation.py:234:16-27: assert_type(str, int) failed [assert-type] ERROR overloads_evaluation.py:264:16-27: assert_type(list[int], Any) failed [assert-type] ERROR overloads_evaluation.py:280:16-34: assert_type(list[int], Any) failed [assert-type] diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index 5e1815915..15d99d0e4 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -5,12 +5,12 @@ Does not check against abstract class instantiations conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors -Line 60: Expected 1 errors Line 90: Expected 1 errors Line 110: Expected 1 errors Line 135: Expected 1 errors -Line 165: Expected 1 errors """ output = """ ERROR protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] +ERROR protocols_explicit.py:60:10-20: Cannot instantiate `Point` because the following members are abstract: `intensity` [bad-instantiation] +ERROR protocols_explicit.py:165:17-19: Cannot instantiate `Concrete7A` because the following members are abstract: `method1` [bad-instantiation] """ diff --git a/conformance/results/pyrefly/protocols_generic.toml b/conformance/results/pyrefly/protocols_generic.toml index 908c30134..6b57cb6ef 100644 --- a/conformance/results/pyrefly/protocols_generic.toml +++ b/conformance/results/pyrefly/protocols_generic.toml @@ -2,9 +2,8 @@ conformant = "Partial" notes = """ Fails one protocol subtyping example involving @property """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 144: Unexpected errors ['`ConcreteHasProperty1` is not assignable to `HasPropertyProto` [bad-assignment]'] """ output = """ ERROR protocols_generic.py:40:24-35: `Concrete1` is not assignable to `Proto1[int, str]` [bad-assignment] @@ -13,7 +12,6 @@ ERROR protocols_generic.py:56:20-29: `Box[float]` is not assignable to `Box[int] ERROR protocols_generic.py:66:25-35: `Sender[int]` is not assignable to `Sender[float]` [bad-assignment] ERROR protocols_generic.py:74:28-36: `AttrProto[int]` is not assignable to `AttrProto[float]` [bad-assignment] ERROR protocols_generic.py:75:26-36: `AttrProto[float]` is not assignable to `AttrProto[int]` [bad-assignment] -ERROR protocols_generic.py:144:25-47: `ConcreteHasProperty1` is not assignable to `HasPropertyProto` [bad-assignment] ERROR protocols_generic.py:145:25-47: `ConcreteHasProperty2` is not assignable to `HasPropertyProto` [bad-assignment] ERROR protocols_generic.py:146:25-47: `ConcreteHasProperty3` is not assignable to `HasPropertyProto` [bad-assignment] ERROR protocols_generic.py:147:25-47: `ConcreteHasProperty4` is not assignable to `HasPropertyProto` [bad-assignment] diff --git a/conformance/results/pyrefly/protocols_merging.toml b/conformance/results/pyrefly/protocols_merging.toml index d24c0828f..3ec3374c6 100644 --- a/conformance/results/pyrefly/protocols_merging.toml +++ b/conformance/results/pyrefly/protocols_merging.toml @@ -2,14 +2,14 @@ conformant = "Partial" notes = """ Does not check against abstract class instantiations """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 82: Expected 1 errors """ output = """ ERROR protocols_merging.py:52:25-38: `SCConcrete2` is not assignable to `SizedAndClosable1` [bad-assignment] ERROR protocols_merging.py:53:25-38: `SCConcrete2` is not assignable to `SizedAndClosable2` [bad-assignment] ERROR protocols_merging.py:54:25-38: `SCConcrete2` is not assignable to `SizedAndClosable3` [bad-assignment] ERROR protocols_merging.py:67:16-33: If `Protocol` is included as a base class, all other bases must be protocols [invalid-inheritance] +ERROR protocols_merging.py:82:22-24: Cannot instantiate `SizedAndClosable4` because the following members are abstract: `close` [bad-instantiation] ERROR protocols_merging.py:83:24-37: `SCConcrete1` is not assignable to `SizedAndClosable4` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_self.toml b/conformance/results/pyrefly/protocols_self.toml index df568b19f..8aeaf74d7 100644 --- a/conformance/results/pyrefly/protocols_self.toml +++ b/conformance/results/pyrefly/protocols_self.toml @@ -2,12 +2,8 @@ conformant = "Partial" notes = """ Fails some protocol subtyping examples when self is annotated with a type var """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 32: Unexpected errors ['`One` is not assignable to variable `c` with type `Copyable` [bad-assignment]'] -Line 33: Unexpected errors ['`Other` is not assignable to variable `c` with type `Copyable` [bad-assignment]'] """ output = """ -ERROR protocols_self.py:32:5-10: `One` is not assignable to variable `c` with type `Copyable` [bad-assignment] -ERROR protocols_self.py:33:5-12: `Other` is not assignable to variable `c` with type `Copyable` [bad-assignment] """ diff --git a/conformance/results/pyrefly/qualifiers_final_decorator.toml b/conformance/results/pyrefly/qualifiers_final_decorator.toml index e4d7d3abb..4286f936b 100644 --- a/conformance/results/pyrefly/qualifiers_final_decorator.toml +++ b/conformance/results/pyrefly/qualifiers_final_decorator.toml @@ -2,9 +2,8 @@ conformant = "Partial" notes = """ Does not ban final decorator on overload when implementation exists """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 84, 85, 86: Expected error (tag 'Derived3-2') """ output = """ ERROR qualifiers_final_decorator.py:21:16-21: Cannot extend final class `Base1` [invalid-inheritance] @@ -13,6 +12,7 @@ ERROR qualifiers_final_decorator.py:60:9-16: `method2` is declared as final in p ERROR qualifiers_final_decorator.py:64:9-16: `method3` is declared as final in parent class `Base2` [bad-override] ERROR qualifiers_final_decorator.py:68:9-16: `method4` is declared as final in parent class `Base2` [bad-override] ERROR qualifiers_final_decorator.py:81:9-15: `method` is declared as final in parent class `Base3` [bad-override] +ERROR qualifiers_final_decorator.py:86:9-15: `@final` should only be applied to the implementation of an overloaded function. [invalid-overload] ERROR qualifiers_final_decorator.py:95:9-15: `method` is declared as final in parent class `Base4` [bad-override] ERROR qualifiers_final_decorator.py:118:9-15: `method` is declared as final in parent class `Base5_2` [bad-override] ERROR qualifiers_final_decorator.py:125:1-7: Decorator `@final` can only be used on methods. [invalid-decorator] diff --git a/conformance/results/pyrefly/specialtypes_none.toml b/conformance/results/pyrefly/specialtypes_none.toml index fcd2fb564..6d4c240e0 100644 --- a/conformance/results/pyrefly/specialtypes_none.toml +++ b/conformance/results/pyrefly/specialtypes_none.toml @@ -3,7 +3,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR specialtypes_none.py:21:7-17: Argument `type` is not assignable to parameter `val1` with type `None` in function `func1` [bad-argument-type] +ERROR specialtypes_none.py:21:7-17: Argument `type[NoneType]` is not assignable to parameter `val1` with type `None` in function `func1` [bad-argument-type] ERROR specialtypes_none.py:27:19-23: `None` is not assignable to `Iterable[Unknown]` [bad-assignment] ERROR specialtypes_none.py:41:7-11: Argument `None` is not assignable to parameter `val1` with type `type[None]` in function `func2` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/typeddicts_extra_items.toml b/conformance/results/pyrefly/typeddicts_extra_items.toml index 341dd6c96..695f8c31f 100644 --- a/conformance/results/pyrefly/typeddicts_extra_items.toml +++ b/conformance/results/pyrefly/typeddicts_extra_items.toml @@ -2,21 +2,12 @@ conformant = "Partial" notes = """ Does not fully support extra_items for typed dicts """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 129: Unexpected errors ['TypedDict `MovieEI` does not have key `year` [typed-dict-key-error]'] -Line 144: Unexpected errors ['Unexpected keyword argument `year` in function `unpack_extra` [unexpected-keyword]'] -Line 300: Unexpected errors ['`TypedDict[MovieExtraStr]` is not assignable to `Mapping[str, str]` [bad-assignment]'] -Line 304: Unexpected errors ['`TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int | str]` [bad-assignment]'] -Line 326: Unexpected errors ['`TypedDict[IntDict]` is not assignable to `dict[str, int]` [bad-assignment]'] -Line 330: Unexpected errors ['`TypedDict[IntDictWithNum]` is not assignable to `dict[str, int]` [bad-assignment]'] -Line 337: Unexpected errors ['Object of class `IntDictWithNum` has no attribute `clear` [missing-attribute]'] -Line 339: Unexpected errors ['assert_type(Any, tuple[str, int]) failed [assert-type]', 'Object of class `IntDictWithNum` has no attribute `popitem` [missing-attribute]'] -Line 343: Unexpected errors ['Cannot delete item in `TypedDict[IntDictWithNum]` [unsupported-operation]'] """ output = """ -ERROR typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] -ERROR typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict `extra_items` type `bool` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict key with type `bool` [typed-dict-key-error] +ERROR typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict key with type `bool` [typed-dict-key-error] ERROR typeddicts_extra_items.py:39:54-58: `None` is not assignable to TypedDict key `year` with type `int` [typed-dict-key-error] ERROR typeddicts_extra_items.py:49:7-16: Expected literal True or False for keyword `closed`, got instance of `bool` [bad-typed-dict] ERROR typeddicts_extra_items.py:67:7-20: Non-closed TypedDict cannot inherit from closed TypedDict `ClosedBase` [bad-typed-dict] @@ -27,9 +18,7 @@ ERROR typeddicts_extra_items.py:109:7-30: Closed TypedDict cannot inherit from T ERROR typeddicts_extra_items.py:114:50-63: `Required` is not allowed in this context [invalid-annotation] ERROR typeddicts_extra_items.py:117:57-73: `NotRequired` is not allowed in this context [invalid-annotation] ERROR typeddicts_extra_items.py:128:15-21: Key `name` in TypedDict `MovieEI` may not be deleted [delete-error] -ERROR typeddicts_extra_items.py:129:15-21: TypedDict `MovieEI` does not have key `year` [typed-dict-key-error] ERROR typeddicts_extra_items.py:143:48-52: Unexpected keyword argument `year` in function `unpack_no_extra` [unexpected-keyword] -ERROR typeddicts_extra_items.py:144:45-49: Unexpected keyword argument `year` in function `unpack_extra` [unexpected-keyword] ERROR typeddicts_extra_items.py:174:7-12: Cannot change the non-read-only extra items type of TypedDict `Parent` [bad-typed-dict] ERROR typeddicts_extra_items.py:185:5-9: TypedDict `MovieBase2` with non-read-only `extra_items` cannot be extended with required extra item `year` [typed-dict-key-error] ERROR typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [typed-dict-key-error] @@ -43,14 +32,6 @@ ERROR typeddicts_extra_items.py:268:14-24: `TypedDict[MovieNotClosed]` is not as ERROR typeddicts_extra_items.py:278:47-51: Unexpected keyword argument `year` in function `NonClosedMovie.__init__` [unexpected-keyword] ERROR typeddicts_extra_items.py:285:52-61: Keyword argument `language` with type `Literal['English']` is not assignable to kwargs type `int` in function `ExtraMovie.__init__` [bad-argument-type] ERROR typeddicts_extra_items.py:293:44-48: Unexpected keyword argument `year` in function `ClosedMovie.__init__` [unexpected-keyword] -ERROR typeddicts_extra_items.py:300:34-44: `TypedDict[MovieExtraStr]` is not assignable to `Mapping[str, str]` [bad-assignment] ERROR typeddicts_extra_items.py:303:34-44: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int]` [bad-assignment] -ERROR typeddicts_extra_items.py:304:44-54: `TypedDict[MovieExtraInt]` is not assignable to `Mapping[str, int | str]` [bad-assignment] -ERROR typeddicts_extra_items.py:326:25-26: `TypedDict[IntDict]` is not assignable to `dict[str, int]` [bad-assignment] -ERROR typeddicts_extra_items.py:330:32-53: `TypedDict[IntDictWithNum]` is not assignable to `dict[str, int]` [bad-assignment] -ERROR typeddicts_extra_items.py:337:1-28: Object of class `IntDictWithNum` has no attribute `clear` [missing-attribute] -ERROR typeddicts_extra_items.py:339:12-62: assert_type(Any, tuple[str, int]) failed [assert-type] -ERROR typeddicts_extra_items.py:339:13-42: Object of class `IntDictWithNum` has no attribute `popitem` [missing-attribute] -ERROR typeddicts_extra_items.py:343:9-35: Cannot delete item in `TypedDict[IntDictWithNum]` [unsupported-operation] ERROR typeddicts_extra_items.py:352:25-52: `dict[str, int]` is not assignable to `TypedDict[IntDict]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly.toml b/conformance/results/pyrefly/typeddicts_readonly.toml index 8b0f34d7a..08517495c 100644 --- a/conformance/results/pyrefly/typeddicts_readonly.toml +++ b/conformance/results/pyrefly/typeddicts_readonly.toml @@ -3,10 +3,10 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_readonly.py:24:1-14: Key `members` in TypedDict `Band` is read-only [read-only] -ERROR typeddicts_readonly.py:36:1-14: Key `members` in TypedDict `Band2` is read-only [read-only] -ERROR typeddicts_readonly.py:50:1-12: Key `title` in TypedDict `Movie1` is read-only [read-only] -ERROR typeddicts_readonly.py:51:1-11: Key `year` in TypedDict `Movie1` is read-only [read-only] -ERROR typeddicts_readonly.py:60:1-12: Key `title` in TypedDict `Movie2` is read-only [read-only] -ERROR typeddicts_readonly.py:61:1-11: Key `year` in TypedDict `Movie2` is read-only [read-only] +ERROR typeddicts_readonly.py:24:4-13: Key `members` in TypedDict `Band` is read-only [read-only] +ERROR typeddicts_readonly.py:36:4-13: Key `members` in TypedDict `Band2` is read-only [read-only] +ERROR typeddicts_readonly.py:50:4-11: Key `title` in TypedDict `Movie1` is read-only [read-only] +ERROR typeddicts_readonly.py:51:4-10: Key `year` in TypedDict `Movie1` is read-only [read-only] +ERROR typeddicts_readonly.py:60:4-11: Key `title` in TypedDict `Movie2` is read-only [read-only] +ERROR typeddicts_readonly.py:61:4-10: Key `year` in TypedDict `Movie2` is read-only [read-only] """ diff --git a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml index 1c90b6692..ad8d736e4 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_inheritance.toml @@ -10,7 +10,7 @@ Line 119: Expected 1 errors Line 132: Expected 1 errors """ output = """ -ERROR typeddicts_readonly_inheritance.py:36:1-11: Key `name` in TypedDict `Album2` is read-only [read-only] +ERROR typeddicts_readonly_inheritance.py:36:4-10: Key `name` in TypedDict `Album2` is read-only [read-only] ERROR typeddicts_readonly_inheritance.py:50:5-8: Class member `RecordShop.alt` overrides parent class `AlbumCollection` in an inconsistent manner [bad-override] ERROR typeddicts_readonly_inheritance.py:65:19-21: Missing required key `name` for TypedDict `RequiredName` [typed-dict-key-error] ERROR typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [typed-dict-key-error] diff --git a/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml b/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml index 7d4318302..0be703f17 100644 --- a/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyrefly/typeddicts_readonly_kwargs.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR typeddicts_readonly_kwargs.py:33:5-19: Key `key1` in TypedDict `ReadOnlyArgs` is read-only [read-only] +ERROR typeddicts_readonly_kwargs.py:33:12-18: Key `key1` in TypedDict `ReadOnlyArgs` is read-only [read-only] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index 7aed889a8..5542fe39a 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.30.0" +version = "pyrefly 0.36.2" diff --git a/conformance/results/results.html b/conformance/results/results.html index 35401d356..ffefce6cd 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -166,7 +166,7 @@

Python Type System Conformance Test Results

zuban 0.0.24
-
pyrefly 0.30.0
+
pyrefly 0.36.2
From f124c3375f9004180e3c323e6b1cf3c72e68e748 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Thu, 9 Oct 2025 11:25:47 -0700 Subject: [PATCH 4/8] Update manual conformance. --- conformance/results/pyre/namedtuples_define_class.toml | 9 --------- conformance/results/pyre/namedtuples_usage.toml | 3 --- conformance/results/pyrefly/callables_kwargs.toml | 4 ---- conformance/results/pyrefly/enums_behaviors.toml | 4 ---- conformance/results/pyrefly/generics_defaults.toml | 4 +++- .../results/pyrefly/generics_self_attributes.toml | 4 ---- conformance/results/pyrefly/generics_self_protocols.toml | 4 ---- conformance/results/pyrefly/generics_upper_bound.toml | 4 ---- conformance/results/pyrefly/literals_literalstring.toml | 4 ---- .../results/pyrefly/overloads_definitions_stub.toml | 5 ----- conformance/results/pyrefly/protocols_generic.toml | 4 ---- conformance/results/pyrefly/protocols_merging.toml | 4 ---- conformance/results/pyrefly/protocols_self.toml | 4 ---- conformance/results/pyrefly/protocols_variance.toml | 1 + .../results/pyrefly/qualifiers_final_decorator.toml | 4 ---- conformance/results/pyrefly/typeddicts_extra_items.toml | 4 ---- 16 files changed, 4 insertions(+), 62 deletions(-) diff --git a/conformance/results/pyre/namedtuples_define_class.toml b/conformance/results/pyre/namedtuples_define_class.toml index 3ce86df71..e6f039183 100644 --- a/conformance/results/pyre/namedtuples_define_class.toml +++ b/conformance/results/pyre/namedtuples_define_class.toml @@ -1,12 +1,3 @@ -conformant = "Partial" -notes = """ -Does not evaluate correct type for indexed named tuple instance with integer. -Does not evaluate correct type for indexed named tuple instance with slice. -Does not report out-of-range index access with named tuple instance. -Does not reject named tuple element with no default value after one with a default. -Incorrectly rejects assignment of named tuple to a tuple with compatible type. -Does not reject attempt to use NamedTuple with multiple inheritance. -""" output = """ namedtuples_define_class.py:32:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. namedtuples_define_class.py:33:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. diff --git a/conformance/results/pyre/namedtuples_usage.toml b/conformance/results/pyre/namedtuples_usage.toml index 785cef05a..9997fdec9 100644 --- a/conformance/results/pyre/namedtuples_usage.toml +++ b/conformance/results/pyre/namedtuples_usage.toml @@ -1,6 +1,3 @@ -conformant = "Partial" -notes = """ -""" output = """ namedtuples_usage.py:34:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. namedtuples_usage.py:35:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. diff --git a/conformance/results/pyrefly/callables_kwargs.toml b/conformance/results/pyrefly/callables_kwargs.toml index 258047763..ea7fa4326 100644 --- a/conformance/results/pyrefly/callables_kwargs.toml +++ b/conformance/results/pyrefly/callables_kwargs.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not reject overlap between unpacked TypedDict kwarg and named parameters -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/enums_behaviors.toml b/conformance/results/pyrefly/enums_behaviors.toml index eb4cb98f1..8d785714b 100644 --- a/conformance/results/pyrefly/enums_behaviors.toml +++ b/conformance/results/pyrefly/enums_behaviors.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Iterating an enum class gives Any -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml index c25249aec..e3166df30 100644 --- a/conformance/results/pyrefly/generics_defaults.toml +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -1,6 +1,8 @@ -conformant = "Pass" +conformant = "Partial" notes = """ Unsolved type var is not always resolved to default (optional) +Defaults are not bound by attribute access +Generic attribute is not visible on class """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pyrefly/generics_self_attributes.toml b/conformance/results/pyrefly/generics_self_attributes.toml index f517911c8..70866175a 100644 --- a/conformance/results/pyrefly/generics_self_attributes.toml +++ b/conformance/results/pyrefly/generics_self_attributes.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not reject incorrect direct assignment to attribute w/ Self -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/generics_self_protocols.toml b/conformance/results/pyrefly/generics_self_protocols.toml index 39a401e5b..befe1eef6 100644 --- a/conformance/results/pyrefly/generics_self_protocols.toml +++ b/conformance/results/pyrefly/generics_self_protocols.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Protocol subtyping does not work with Self in return annotation -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/generics_upper_bound.toml b/conformance/results/pyrefly/generics_upper_bound.toml index e0bcf1cd5..cfbb661e9 100644 --- a/conformance/results/pyrefly/generics_upper_bound.toml +++ b/conformance/results/pyrefly/generics_upper_bound.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Instantiation is not validated against bound -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/literals_literalstring.toml b/conformance/results/pyrefly/literals_literalstring.toml index ffe7f875c..d9f744fdc 100644 --- a/conformance/results/pyrefly/literals_literalstring.toml +++ b/conformance/results/pyrefly/literals_literalstring.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -LiteralString is sometimes converted to str -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/overloads_definitions_stub.toml b/conformance/results/pyrefly/overloads_definitions_stub.toml index 479bf6bde..d3bd427e3 100644 --- a/conformance/results/pyrefly/overloads_definitions_stub.toml +++ b/conformance/results/pyrefly/overloads_definitions_stub.toml @@ -1,8 +1,3 @@ -conformant = "Partial" -notes = """ -Does not restrict some decorators to the first overload -Does not require some decorators that need to appear on every overload -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/protocols_generic.toml b/conformance/results/pyrefly/protocols_generic.toml index 6b57cb6ef..86b534695 100644 --- a/conformance/results/pyrefly/protocols_generic.toml +++ b/conformance/results/pyrefly/protocols_generic.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Fails one protocol subtyping example involving @property -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/protocols_merging.toml b/conformance/results/pyrefly/protocols_merging.toml index 3ec3374c6..ad33e85e6 100644 --- a/conformance/results/pyrefly/protocols_merging.toml +++ b/conformance/results/pyrefly/protocols_merging.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not check against abstract class instantiations -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/protocols_self.toml b/conformance/results/pyrefly/protocols_self.toml index 8aeaf74d7..cdd4d0cd9 100644 --- a/conformance/results/pyrefly/protocols_self.toml +++ b/conformance/results/pyrefly/protocols_self.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Fails some protocol subtyping examples when self is annotated with a type var -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/protocols_variance.toml b/conformance/results/pyrefly/protocols_variance.toml index a9c170036..957bf05b5 100644 --- a/conformance/results/pyrefly/protocols_variance.toml +++ b/conformance/results/pyrefly/protocols_variance.toml @@ -1,3 +1,4 @@ +conformant = "Unsupported" conformance_automated = "Fail" errors_diff = """ Line 21: Expected 1 errors diff --git a/conformance/results/pyrefly/qualifiers_final_decorator.toml b/conformance/results/pyrefly/qualifiers_final_decorator.toml index 4286f936b..c129fa545 100644 --- a/conformance/results/pyrefly/qualifiers_final_decorator.toml +++ b/conformance/results/pyrefly/qualifiers_final_decorator.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not ban final decorator on overload when implementation exists -""" conformance_automated = "Pass" errors_diff = """ """ diff --git a/conformance/results/pyrefly/typeddicts_extra_items.toml b/conformance/results/pyrefly/typeddicts_extra_items.toml index 695f8c31f..1ae173356 100644 --- a/conformance/results/pyrefly/typeddicts_extra_items.toml +++ b/conformance/results/pyrefly/typeddicts_extra_items.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -Does not fully support extra_items for typed dicts -""" conformance_automated = "Pass" errors_diff = """ """ From 4c1bd695dab7ad2654e819270d83ab100c846434 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Thu, 9 Oct 2025 12:08:49 -0700 Subject: [PATCH 5/8] Fixes to tests for type errors and incorrect expectations. --- conformance/tests/enums_members.py | 4 ++-- conformance/tests/generics_defaults.py | 5 +++-- conformance/tests/generics_self_advanced.py | 6 ++++-- .../tests/generics_syntax_infer_variance.py | 14 ++++++++++++-- conformance/tests/generics_type_erasure.py | 8 +++++--- conformance/tests/overloads_definitions.py | 2 +- conformance/tests/protocols_explicit.py | 3 +-- conformance/tests/typeddicts_required.py | 3 --- 8 files changed, 28 insertions(+), 17 deletions(-) diff --git a/conformance/tests/enums_members.py b/conformance/tests/enums_members.py index 0dd8e5509..3a623d27e 100644 --- a/conformance/tests/enums_members.py +++ b/conformance/tests/enums_members.py @@ -16,8 +16,8 @@ class Pet(Enum): # E?: Uninitialized attributes (pyre) genus: str # Non-member attribute species: str # Non-member attribute - CAT = 1 # Member attribute - DOG = 2 # Member attribute + CAT = "felis", "catus" # Member attribute + DOG = "canis", "lupus" # Member attribute def __init__(self, genus: str, species: str) -> None: self.genus = genus diff --git a/conformance/tests/generics_defaults.py b/conformance/tests/generics_defaults.py index 7ac1f8ed3..241606c97 100644 --- a/conformance/tests/generics_defaults.py +++ b/conformance/tests/generics_defaults.py @@ -127,7 +127,8 @@ class Class_TypeVarTuple(Generic[*DefaultTs]): ... def func1(x: int | set[T4]) -> T4: ... -assert_type(func1(0), int) +assert_type(func1(0), int) # E[optional-default-use] +assert_type(func1(0), Any) # E[optional-default-use] # > A ``TypeVar`` that immediately follows a ``TypeVarTuple`` is not allowed @@ -167,4 +168,4 @@ def meth(self, /) -> Self: assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) -assert_type(Foo7.attr, int) +assert_type(Foo7().attr, int) diff --git a/conformance/tests/generics_self_advanced.py b/conformance/tests/generics_self_advanced.py index ef4f6af70..8eb9a9c15 100644 --- a/conformance/tests/generics_self_advanced.py +++ b/conformance/tests/generics_self_advanced.py @@ -39,7 +39,9 @@ def method2(self) -> None: @classmethod def method3(cls) -> None: + a = cls.a # E?: zuban errors on accessing `Self` in a classmethod + a_elem = cls.a[0] # E?: zuban errors on accessing `Self` in a classmethod assert_type(cls, type[Self]) - assert_type(cls.a, list[Self]) - assert_type(cls.a[0], Self) + assert_type(a, list[Self]) + assert_type(a_elem, Self) assert_type(cls.method1(), Self) diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index 62d14ccb5..50d42616e 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -4,7 +4,7 @@ # Specification: https://peps.python.org/pep-0695/#auto-variance-for-typevar -from typing import Final, Generic, Iterator, Sequence, TypeVar +from typing import Final, Generic, Iterator, overload, Sequence, TypeVar from dataclasses import dataclass @@ -30,7 +30,17 @@ def __iter__(self) -> Iterator[T]: class ShouldBeCovariant2(Sequence[T]): - pass + @overload + def __getitem__(self, index: int) -> T: + ... + @overload + def __getitem__(self, index: slice) -> Sequence[T]: + ... + def __getitem__(self, index: int | slice) -> T | Sequence[T]: + ... + + def __len__(self) -> int: + ... vco2_1: ShouldBeCovariant2[float] = ShouldBeCovariant2[int]() # OK diff --git a/conformance/tests/generics_type_erasure.py b/conformance/tests/generics_type_erasure.py index c7462259a..415fa7c07 100644 --- a/conformance/tests/generics_type_erasure.py +++ b/conformance/tests/generics_type_erasure.py @@ -1,6 +1,6 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#instantiating-generic-classes-and-type-erasure -from typing import Any, TypeVar, Generic, assert_type +from typing import Any, Never, TypeVar, Generic, assert_type T = TypeVar("T") @@ -16,10 +16,12 @@ def __init__(self, label: T | None = None) -> None: assert_type(Node(''), Node[str]) assert_type(Node(0), Node[int]) -assert_type(Node(), Node[Any]) +assert_type(Node(), Node[Any]) # E[any-or-never1] +assert_type(Node(), Node[Never]) # E[any-or-never1] assert_type(Node(0).label, int) -assert_type(Node().label, Any) +assert_type(Node().label, Any) # E[any-or-never2] +assert_type(Node().label, Never) # E[any-or-never2] # > In case the inferred type uses [Any] but the intended type is more specific, # > you can use an annotation to force the type of the variable, e.g.: diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index 8870cd3e6..f223203c9 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -173,7 +173,7 @@ class Child(Base): # E[override-final] # questions of override LSP compatibility and focus only on the override): @overload # E[override-final] - def final_method(self, x: int) -> int: ... + def final_method(self, x: int) -> int: ... # E[override-final] @overload def final_method(self, x: str) -> str: ... diff --git a/conformance/tests/protocols_explicit.py b/conformance/tests/protocols_explicit.py index 1e2763a61..70fd56445 100644 --- a/conformance/tests/protocols_explicit.py +++ b/conformance/tests/protocols_explicit.py @@ -82,7 +82,6 @@ class Proto3(Proto2, Protocol): class Concrete1(Proto1): def __init__(self): - self.cm1 = 1 self.im1 = 1 self.im3 = 3 @@ -107,7 +106,7 @@ def __init__(self): self.cm11 = 11 -c3 = Concrete3() # E: cannot instantiate abstract class +c3 = Concrete3() class Concrete4(Proto1, Proto3): diff --git a/conformance/tests/typeddicts_required.py b/conformance/tests/typeddicts_required.py index e38e6df86..d4cef0142 100644 --- a/conformance/tests/typeddicts_required.py +++ b/conformance/tests/typeddicts_required.py @@ -11,9 +11,6 @@ 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 From a01b0a461e82148a27f7384898aa8ad656439f33 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Thu, 9 Oct 2025 12:17:14 -0700 Subject: [PATCH 6/8] Regenerate results. --- .../results/mypy/classes_classvar.toml | 6 +- .../mypy/constructors_call_metaclass.toml | 20 +- .../mypy/dataclasses_transform_converter.toml | 2 +- .../results/mypy/enums_member_values.toml | 1 - conformance/results/mypy/generics_basic.toml | 2 +- .../results/mypy/generics_defaults.toml | 20 +- .../results/mypy/generics_scoping.toml | 8 +- .../results/mypy/generics_self_advanced.toml | 12 +- .../mypy/generics_syntax_infer_variance.toml | 209 +++++++++--------- .../results/mypy/generics_type_erasure.toml | 14 +- .../mypy/generics_typevartuple_basic.toml | 4 +- .../generics_typevartuple_specialization.toml | 4 +- .../results/mypy/protocols_explicit.toml | 9 +- conformance/results/mypy/tuples_unpacked.toml | 6 +- .../results/mypy/typeddicts_required.toml | 6 +- conformance/results/mypy/version.toml | 2 +- .../pyre/constructors_call_metaclass.toml | 6 +- .../results/pyre/generics_defaults.toml | 35 +-- .../results/pyre/generics_self_advanced.toml | 12 +- .../pyre/generics_syntax_infer_variance.toml | 37 ++-- .../results/pyre/generics_type_erasure.toml | 20 +- .../results/pyre/protocols_explicit.toml | 9 +- .../results/pyre/typeddicts_required.toml | 10 +- .../results/pyrefly/generics_defaults.toml | 12 +- .../generics_syntax_infer_variance.toml | 30 +-- .../pyrefly/generics_type_erasure.toml | 16 +- .../pyrefly/overloads_definitions.toml | 2 - .../results/pyrefly/protocols_explicit.toml | 7 +- .../results/pyrefly/typeddicts_required.toml | 12 +- .../results/pyright/aliases_newtype.toml | 2 +- .../pyright/constructors_call_metaclass.toml | 4 +- .../pyright/dataclasses_match_args.toml | 9 +- .../results/pyright/enums_members.toml | 6 +- .../results/pyright/generics_defaults.toml | 4 +- .../generics_syntax_infer_variance.toml | 39 ++-- .../pyright/generics_type_erasure.toml | 16 +- .../results/pyright/protocols_explicit.toml | 13 +- .../pyright/typeddicts_extra_items.toml | 10 +- .../results/pyright/typeddicts_required.toml | 11 +- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 44 ++-- .../results/zuban/generics_defaults.toml | 15 +- .../results/zuban/generics_self_advanced.toml | 6 +- .../zuban/generics_syntax_infer_variance.toml | 40 ++-- .../results/zuban/generics_type_erasure.toml | 14 +- .../results/zuban/protocols_explicit.toml | 13 +- .../results/zuban/qualifiers_annotated.toml | 8 +- .../results/zuban/typeddicts_required.toml | 6 +- 48 files changed, 380 insertions(+), 415 deletions(-) diff --git a/conformance/results/mypy/classes_classvar.toml b/conformance/results/mypy/classes_classvar.toml index 0072d63f1..fd95469f5 100644 --- a/conformance/results/mypy/classes_classvar.toml +++ b/conformance/results/mypy/classes_classvar.toml @@ -9,8 +9,6 @@ output = """ classes_classvar.py:38: error: ClassVar[...] must have at most one type argument [valid-type] classes_classvar.py:39: error: Invalid type: try using Literal[3] instead? [valid-type] classes_classvar.py:40: error: Name "var" is not defined [name-defined] -classes_classvar.py:45: error: ClassVar cannot contain type variables [misc] -classes_classvar.py:46: error: ClassVar cannot contain type variables [misc] classes_classvar.py:52: error: Incompatible types in assignment (expression has type "dict[Never, Never]", variable has type "list[str]") [assignment] classes_classvar.py:54: error: Variable should not be annotated with both ClassVar and Final [misc] classes_classvar.py:55: error: Invalid type: ClassVar nested inside other type [valid-type] @@ -22,6 +20,7 @@ classes_classvar.py:73: error: ClassVar can only be used for assignments in clas classes_classvar.py:77: error: ClassVar can only be used for assignments in class body [misc] classes_classvar.py:78: error: ClassVar[...] can't be used inside a type alias [valid-type] classes_classvar.py:111: error: Cannot assign to class variable "stats" via instance [misc] +classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc] classes_classvar.py:140: error: Incompatible types in assignment (expression has type "ProtoAImpl", variable has type "ProtoA") [assignment] classes_classvar.py:140: note: "ProtoAImpl" is missing following "ProtoA" protocol member: classes_classvar.py:140: note: z @@ -30,6 +29,9 @@ classes_classvar.py:140: note: Protocol member ProtoA.y expected class variable, """ conformance_automated = "Fail" errors_diff = """ +Line 45: Expected 1 errors +Line 46: Expected 1 errors Line 47: Expected 1 errors Line 67: Unexpected errors ['classes_classvar.py:67: error: Invalid type: ClassVar nested inside other type [valid-type]'] +Line 130: Unexpected errors ['classes_classvar.py:130: error: All protocol members must have explicitly declared types [misc]'] """ diff --git a/conformance/results/mypy/constructors_call_metaclass.toml b/conformance/results/mypy/constructors_call_metaclass.toml index 355939b52..8ee382dfc 100644 --- a/conformance/results/mypy/constructors_call_metaclass.toml +++ b/conformance/results/mypy/constructors_call_metaclass.toml @@ -5,16 +5,16 @@ Does not skip evaluation of __new__ and __init__ if custom metaclass call return """ conformance_automated = "Fail" errors_diff = """ -Line 23: Unexpected errors ['constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [assert-type]', 'constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg]'] -Line 36: Unexpected errors ['constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [assert-type]', 'constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg]'] -Line 43: Unexpected errors ['constructors_call_metaclass.py:43: error: Argument 2 for "super" not an instance of argument 1 [misc]'] +Line 26: Unexpected errors ['constructors_call_metaclass.py:26: error: Expression is of type "Class1", not "Never" [assert-type]', 'constructors_call_metaclass.py:26: error: Missing positional argument "x" in call to "Class1" [call-arg]'] +Line 39: Unexpected errors ['constructors_call_metaclass.py:39: error: Expression is of type "Class2", not "int | Meta2" [assert-type]', 'constructors_call_metaclass.py:39: error: Missing positional argument "x" in call to "Class2" [call-arg]'] +Line 46: Unexpected errors ['constructors_call_metaclass.py:46: error: Argument 2 for "super" not an instance of argument 1 [misc]'] """ output = """ -constructors_call_metaclass.py:23: error: Expression is of type "Class1", not "Never" [assert-type] -constructors_call_metaclass.py:23: error: Missing positional argument "x" in call to "Class1" [call-arg] -constructors_call_metaclass.py:36: error: Expression is of type "Class2", not "int | Meta2" [assert-type] -constructors_call_metaclass.py:36: error: Missing positional argument "x" in call to "Class2" [call-arg] -constructors_call_metaclass.py:43: error: Argument 2 for "super" not an instance of argument 1 [misc] -constructors_call_metaclass.py:51: error: Missing positional argument "x" in call to "Class3" [call-arg] -constructors_call_metaclass.py:65: error: Missing positional argument "x" in call to "Class4" [call-arg] +constructors_call_metaclass.py:26: error: Expression is of type "Class1", not "Never" [assert-type] +constructors_call_metaclass.py:26: error: Missing positional argument "x" in call to "Class1" [call-arg] +constructors_call_metaclass.py:39: error: Expression is of type "Class2", not "int | Meta2" [assert-type] +constructors_call_metaclass.py:39: error: Missing positional argument "x" in call to "Class2" [call-arg] +constructors_call_metaclass.py:46: error: Argument 2 for "super" not an instance of argument 1 [misc] +constructors_call_metaclass.py:54: error: Missing positional argument "x" in call to "Class3" [call-arg] +constructors_call_metaclass.py:68: error: Missing positional argument "x" in call to "Class4" [call-arg] """ diff --git a/conformance/results/mypy/dataclasses_transform_converter.toml b/conformance/results/mypy/dataclasses_transform_converter.toml index bd9b1b6d5..cc316bee1 100644 --- a/conformance/results/mypy/dataclasses_transform_converter.toml +++ b/conformance/results/mypy/dataclasses_transform_converter.toml @@ -44,5 +44,5 @@ dataclasses_transform_converter.py:121: error: Argument 4 to "DC2" has incompati dataclasses_transform_converter.py:121: error: Argument 5 to "DC2" has incompatible type "str"; expected "int" [arg-type] dataclasses_transform_converter.py:121: error: Argument 6 to "DC2" has incompatible type "tuple[tuple[str, str], tuple[str, str]]"; expected "dict[str, str]" [arg-type] dataclasses_transform_converter.py:130: error: Argument "converter" to "model_field" has incompatible type "Callable[[str], int]"; expected "Callable[[int], int]" [arg-type] -dataclasses_transform_converter.py:133: error: Cannot infer type argument 1 of "model_field" [misc] +dataclasses_transform_converter.py:133: error: Cannot infer value of type parameter "S" of "model_field" [misc] """ diff --git a/conformance/results/mypy/enums_member_values.toml b/conformance/results/mypy/enums_member_values.toml index 87ec4a09c..f6ddcffe7 100644 --- a/conformance/results/mypy/enums_member_values.toml +++ b/conformance/results/mypy/enums_member_values.toml @@ -12,5 +12,4 @@ enums_member_values.py:26: error: Expression is of type "Any", not "Literal[1, 3 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] """ diff --git a/conformance/results/mypy/generics_basic.toml b/conformance/results/mypy/generics_basic.toml index 322d9ff72..3c95445b9 100644 --- a/conformance/results/mypy/generics_basic.toml +++ b/conformance/results/mypy/generics_basic.toml @@ -12,7 +12,7 @@ generics_basic.py:162: error: Free type variable expected in Generic[...] [misc generics_basic.py:163: error: Free type variable expected in Protocol[...] [misc] generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] -generics_basic.py:208: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc] +generics_basic.py:208: error: Dynamic metaclass not supported for "GenericMetaInstance" [metaclass] generics_basic.py:208: error: Type variable "generics_basic.T" is unbound [valid-type] generics_basic.py:208: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_basic.py:208: note: (Hint: Use "T" in function signature to bind "T" inside a function) diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index bc4145c45..ba432041c 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -14,17 +14,16 @@ generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Defa generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] -generics_defaults.py:154: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] -generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] +generics_defaults.py:131: error: Expression is of type "int", not "Any" [assert-type] +generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] -generics_defaults.py:170: error: Expression is of type "Any", not "int" [assert-type] -generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc] +generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] +generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] """ conformance_automated = "Fail" errors_diff = """ -Line 141: Expected 1 errors +Line 142: Expected 1 errors Line 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[DefaultStrT, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[str, DefaultIntT]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[float, DefaultBoolT]]", not "type[OneDefault[float, bool]]" [assert-type]'] @@ -35,8 +34,7 @@ Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of ty Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[int, complex, str, int, DefaultBoolT]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[DefaultP]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]'] Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*DefaultTs]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] -Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] -Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Any", not "int" [assert-type]', 'generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc]'] +Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 156: Unexpected errors ['generics_defaults.py:156: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:156: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_scoping.toml b/conformance/results/mypy/generics_scoping.toml index d9be0a027..3c3e0054e 100644 --- a/conformance/results/mypy/generics_scoping.toml +++ b/conformance/results/mypy/generics_scoping.toml @@ -1,7 +1,3 @@ -conformant = "Partial" -notes = """ -False negative on generic class nested within generic class with same type variable. -""" output = """ generics_scoping.py:29: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" [arg-type] generics_scoping.py:50: error: Type variable "generics_scoping.S" is unbound [valid-type] @@ -11,6 +7,7 @@ generics_scoping.py:54: error: Type variable "generics_scoping.S" is unbound [v generics_scoping.py:54: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) generics_scoping.py:54: note: (Hint: Use "S" in function signature to bind "S" inside a function) generics_scoping.py:65: error: Free type variable expected in Generic[...] [misc] +generics_scoping.py:75: error: Type variable "T" is bound by an outer class [valid-type] 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) @@ -25,7 +22,6 @@ generics_scoping.py:96: error: Type variable "generics_scoping.T" is unbound [v 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" +conformance_automated = "Pass" errors_diff = """ -Line 75: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_self_advanced.toml b/conformance/results/mypy/generics_self_advanced.toml index b8cb3c16c..3a75fda02 100644 --- a/conformance/results/mypy/generics_self_advanced.toml +++ b/conformance/results/mypy/generics_self_advanced.toml @@ -8,17 +8,13 @@ Does not retain `Self` when accessing attribute through `type[Self]`. output = """ generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type] generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type] -generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type] -generics_self_advanced.py:43: error: Expression is of type "list[Any]", not "list[Self]" [assert-type] -generics_self_advanced.py:44: error: Expression is of type "Any", not "Self" [assert-type] -generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type] +generics_self_advanced.py:44: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type] +generics_self_advanced.py:47: error: Expression is of type "ChildB", not "Self" [assert-type] """ conformance_automated = "Fail" errors_diff = """ Line 35: Unexpected errors ['generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type]'] Line 38: Unexpected errors ['generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type]'] -Line 42: Unexpected errors ['generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]'] -Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Expression is of type "list[Any]", not "list[Self]" [assert-type]'] -Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Expression is of type "Any", not "Self" [assert-type]'] -Line 45: Unexpected errors ['generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type]'] +Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]'] +Line 47: Unexpected errors ['generics_self_advanced.py:47: error: Expression is of type "ChildB", not "Self" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index 4a4ecc71f..81b7b1da2 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -19,83 +19,89 @@ generics_syntax_infer_variance.py:29: error: "ShouldBeCovariant1" expects no typ generics_syntax_infer_variance.py:29: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc] generics_syntax_infer_variance.py:32: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:32: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:36: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:37: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:37: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:40: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:41: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:41: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:34: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:34: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:37: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:37: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:39: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:39: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:47: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:47: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc] generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc] generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:51: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:66: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:70: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:75: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:86: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:102: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:103: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:117: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:118: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:121: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:125: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:126: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:127: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:128: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] -generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:148: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:151: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:155: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:51: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:55: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:55: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:56: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:56: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:60: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:61: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:61: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:75: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:76: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:76: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:80: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:80: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:84: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:84: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:88: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:89: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:91: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:95: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:95: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:96: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:96: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:100: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:104: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:104: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:108: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:108: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:112: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:112: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:113: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:113: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:116: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:117: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:117: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:120: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:120: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:127: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:128: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:131: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:131: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:131: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:135: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:135: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:136: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:136: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:137: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:137: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:138: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:138: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:146: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:154: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_syntax_infer_variance.py:157: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:158: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:158: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:161: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:161: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:165: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:165: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:166: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:166: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] """ conformance_automated = "Fail" errors_diff = """ @@ -107,31 +113,34 @@ Line 21: Unexpected errors ['generics_syntax_infer_variance.py:21: error: Variab Line 24: Unexpected errors ['generics_syntax_infer_variance.py:24: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28: error: "ShouldBeCovariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:28: error: The type "type[ShouldBeCovariant1]" is not generic and not indexable [misc]'] Line 32: Unexpected errors ['generics_syntax_infer_variance.py:32: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:36: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc]'] -Line 40: Unexpected errors ['generics_syntax_infer_variance.py:40: error: Free type variable expected in Generic[...] [misc]'] -Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:41: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] -Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] +Line 34: Unexpected errors ['generics_syntax_infer_variance.py:34: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 37: Unexpected errors ['generics_syntax_infer_variance.py:37: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 39: Unexpected errors ['generics_syntax_infer_variance.py:39: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 46: Unexpected errors ['generics_syntax_infer_variance.py:46: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant2]" is not generic and not indexable [misc]'] Line 50: Unexpected errors ['generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc]'] -Line 51: Unexpected errors ['generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 65: Unexpected errors ['generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc]'] -Line 66: Unexpected errors ['generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 70: Unexpected errors ['generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] -Line 78: Unexpected errors ['generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc]'] -Line 79: Unexpected errors ['generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 81: Unexpected errors ['generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] -Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]'] -Line 90: Unexpected errors ['generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 94: Unexpected errors ['generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 98: Unexpected errors ['generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc]'] -Line 107: Unexpected errors ['generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 110: Unexpected errors ['generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 113: Unexpected errors ['generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 121: Unexpected errors ['generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] -Line 147: Unexpected errors ['generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc]'] -Line 148: Unexpected errors ['generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 151: Unexpected errors ['generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] +Line 51: Unexpected errors ['generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:51: error: "ShouldBeCovariant2" expects no type arguments, but 1 given [type-arg]'] +Line 55: Unexpected errors ['generics_syntax_infer_variance.py:55: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:55: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] +Line 60: Unexpected errors ['generics_syntax_infer_variance.py:60: error: Free type variable expected in Generic[...] [misc]'] +Line 61: Unexpected errors ['generics_syntax_infer_variance.py:61: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 75: Unexpected errors ['generics_syntax_infer_variance.py:75: error: Free type variable expected in Generic[...] [misc]'] +Line 76: Unexpected errors ['generics_syntax_infer_variance.py:76: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 80: Unexpected errors ['generics_syntax_infer_variance.py:80: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 84: Unexpected errors ['generics_syntax_infer_variance.py:84: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:84: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] +Line 88: Unexpected errors ['generics_syntax_infer_variance.py:88: error: Free type variable expected in Generic[...] [misc]'] +Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 91: Unexpected errors ['generics_syntax_infer_variance.py:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 95: Unexpected errors ['generics_syntax_infer_variance.py:95: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:95: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] +Line 99: Unexpected errors ['generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc]'] +Line 100: Unexpected errors ['generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 104: Unexpected errors ['generics_syntax_infer_variance.py:104: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 108: Unexpected errors ['generics_syntax_infer_variance.py:108: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 116: Unexpected errors ['generics_syntax_infer_variance.py:116: error: Free type variable expected in Generic[...] [misc]'] +Line 117: Unexpected errors ['generics_syntax_infer_variance.py:117: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 120: Unexpected errors ['generics_syntax_infer_variance.py:120: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 123: Unexpected errors ['generics_syntax_infer_variance.py:123: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 131: Unexpected errors ['generics_syntax_infer_variance.py:131: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:131: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] +Line 157: Unexpected errors ['generics_syntax_infer_variance.py:157: error: Free type variable expected in Generic[...] [misc]'] +Line 158: Unexpected errors ['generics_syntax_infer_variance.py:158: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 161: Unexpected errors ['generics_syntax_infer_variance.py:161: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 166: Unexpected errors ['generics_syntax_infer_variance.py:166: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:166: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] """ diff --git a/conformance/results/mypy/generics_type_erasure.toml b/conformance/results/mypy/generics_type_erasure.toml index 46c739fee..df265bbde 100644 --- a/conformance/results/mypy/generics_type_erasure.toml +++ b/conformance/results/mypy/generics_type_erasure.toml @@ -5,17 +5,15 @@ False negative on instance attribute access on type(node). """ output = """ 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:23: error: Expression is of type "Never", not "Any" [assert-type] +generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] +generics_type_erasure.py:42: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type] 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] +generics_type_erasure.py:46: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:47: error: Access to generic instance variables via class is ambiguous [misc] """ conformance_automated = "Fail" errors_diff = """ -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]'] +Line 48: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_typevartuple_basic.toml b/conformance/results/mypy/generics_typevartuple_basic.toml index 1219f7a88..e127cd54d 100644 --- a/conformance/results/mypy/generics_typevartuple_basic.toml +++ b/conformance/results/mypy/generics_typevartuple_basic.toml @@ -15,8 +15,8 @@ generics_typevartuple_basic.py:59: error: TypeVarTuple "Shape" is only valid wit generics_typevartuple_basic.py:65: error: Unexpected keyword argument "covariant" for "TypeVarTuple" [misc] generics_typevartuple_basic.py:66: error: Too many positional arguments for "TypeVarTuple" [misc] generics_typevartuple_basic.py:67: error: Unexpected keyword argument "bound" for "TypeVarTuple" [misc] -generics_typevartuple_basic.py:99: error: Cannot infer type argument 1 of "multiply" [misc] -generics_typevartuple_basic.py:100: error: Cannot infer type argument 1 of "multiply" [misc] +generics_typevartuple_basic.py:99: error: Cannot infer value of type parameter "Shape" of "multiply" [misc] +generics_typevartuple_basic.py:100: error: Cannot infer value of type parameter "Shape" of "multiply" [misc] generics_typevartuple_basic.py:106: error: Can only use one type var tuple in a class def [misc] """ conformance_automated = "Fail" diff --git a/conformance/results/mypy/generics_typevartuple_specialization.toml b/conformance/results/mypy/generics_typevartuple_specialization.toml index 68c021237..7d23a81f1 100644 --- a/conformance/results/mypy/generics_typevartuple_specialization.toml +++ b/conformance/results/mypy/generics_typevartuple_specialization.toml @@ -10,8 +10,8 @@ generics_typevartuple_specialization.py:109: error: Type application is only sup generics_typevartuple_specialization.py:109: error: Unpack is only valid in a variadic position [valid-type] generics_typevartuple_specialization.py:110: error: Type application is only supported for generic classes [misc] generics_typevartuple_specialization.py:110: error: Unpack is only valid in a variadic position [valid-type] -generics_typevartuple_specialization.py:121: error: More than one Unpack in a type is not allowed [misc] -generics_typevartuple_specialization.py:122: error: More than one Unpack in a type is not allowed [misc] +generics_typevartuple_specialization.py:121: error: More than one variadic Unpack in a type is not allowed [misc] +generics_typevartuple_specialization.py:122: error: More than one variadic Unpack in a type is not allowed [misc] generics_typevartuple_specialization.py:127: error: Bad number of arguments for type alias, expected at least 2, given 1 [type-arg] generics_typevartuple_specialization.py:163: error: TypeVarTuple cannot be split [type-arg] """ diff --git a/conformance/results/mypy/protocols_explicit.toml b/conformance/results/mypy/protocols_explicit.toml index 5c4cea2ea..80ef20393 100644 --- a/conformance/results/mypy/protocols_explicit.toml +++ b/conformance/results/mypy/protocols_explicit.toml @@ -6,11 +6,10 @@ 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: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] +protocols_explicit.py:89: error: Cannot instantiate abstract class "Concrete1" with abstract attribute "cm1" [abstract] +protocols_explicit.py:134: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] +protocols_explicit.py:164: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 90: Expected 1 errors -Line 110: Expected 1 errors """ diff --git a/conformance/results/mypy/tuples_unpacked.toml b/conformance/results/mypy/tuples_unpacked.toml index bb864687a..12dee95c6 100644 --- a/conformance/results/mypy/tuples_unpacked.toml +++ b/conformance/results/mypy/tuples_unpacked.toml @@ -3,9 +3,9 @@ notes = """ "More than one unpack" error is missing in some cases. """ output = """ -tuples_unpacked.py:40: error: More than one Unpack in a type is not allowed [misc] -tuples_unpacked.py:51: error: More than one Unpack in a type is not allowed [misc] -tuples_unpacked.py:59: error: More than one Unpack in a type is not allowed [misc] +tuples_unpacked.py:40: error: More than one variadic Unpack in a type is not allowed [misc] +tuples_unpacked.py:51: error: More than one variadic Unpack in a type is not allowed [misc] +tuples_unpacked.py:59: error: More than one variadic Unpack in a type is not allowed [misc] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/typeddicts_required.toml b/conformance/results/mypy/typeddicts_required.toml index 96ef50072..85c143e90 100644 --- a/conformance/results/mypy/typeddicts_required.toml +++ b/conformance/results/mypy/typeddicts_required.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ typeddicts_required.py:12: 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[]" type cannot be nested [valid-type] -typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [valid-type] +typeddicts_required.py:16: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:59: error: "Required[]" type cannot be nested [valid-type] +typeddicts_required.py:60: error: "NotRequired[]" type cannot be nested [valid-type] """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index b72d4180d..7ce901e6d 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1 +1 @@ -version = "mypy 1.17.1" +version = "mypy 1.18.2" diff --git a/conformance/results/pyre/constructors_call_metaclass.toml b/conformance/results/pyre/constructors_call_metaclass.toml index 9fb54b5f8..2eb021bba 100644 --- a/conformance/results/pyre/constructors_call_metaclass.toml +++ b/conformance/results/pyre/constructors_call_metaclass.toml @@ -4,8 +4,10 @@ Does not evaluate __new__ if metaclass __call__ is defined. """ conformance_automated = "Fail" errors_diff = """ -Line 51: Expected 1 errors -Line 65: Expected 1 errors +Line 54: Expected 1 errors +Line 68: Expected 1 errors +Line 69: Unexpected errors ['constructors_call_metaclass.py:69:0 Assert type [70]: Expected `Class4` but got `typing.Any`.'] """ output = """ +constructors_call_metaclass.py:69:0 Assert type [70]: Expected `Class4` but got `typing.Any`. """ diff --git a/conformance/results/pyre/generics_defaults.toml b/conformance/results/pyre/generics_defaults.toml index b39853185..b758eed33 100644 --- a/conformance/results/pyre/generics_defaults.toml +++ b/conformance/results/pyre/generics_defaults.toml @@ -53,24 +53,26 @@ generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class generics_defaults.py:99:67 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVarTuple`. generics_defaults.py:127:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type. generics_defaults.py:130:0 Assert type [70]: Expected `int` but got `unknown`. -generics_defaults.py:141:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. -generics_defaults.py:141:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. -generics_defaults.py:151:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. -generics_defaults.py:151:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. -generics_defaults.py:154:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. -generics_defaults.py:154:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. -generics_defaults.py:154:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:131:0 Assert type [70]: Expected `typing.Any` but got `unknown`. +generics_defaults.py:142:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. +generics_defaults.py:142:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. +generics_defaults.py:152:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. +generics_defaults.py:152:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. -generics_defaults.py:155:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. -generics_defaults.py:169:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. -generics_defaults.py:169:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. -generics_defaults.py:170:0 Assert type [70]: Expected `int` but got `unknown`. +generics_defaults.py:155:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. +generics_defaults.py:155:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:156:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`. +generics_defaults.py:156:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:170:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. +generics_defaults.py:170:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. +generics_defaults.py:171:0 Assert type [70]: Expected `int` but got `unknown`. """ conformance_automated = "Fail" errors_diff = """ Line 50: Expected 1 errors Line 107: Expected 1 errors Line 114: Expected 1 errors +Lines 130, 131: Expected exactly one error (tag 'optional-default-use') Line 27: Unexpected errors ['generics_defaults.py:27:20 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type.'] Line 30: Unexpected errors ['generics_defaults.py:30:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`.', 'generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] Line 31: Unexpected errors ['generics_defaults.py:31:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] @@ -101,9 +103,10 @@ Line 96: Unexpected errors ['generics_defaults.py:96:0 Assert type [70]: Expecte Line 99: Unexpected errors ['generics_defaults.py:99:67 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVarTuple`.'] Line 127: Unexpected errors ['generics_defaults.py:127:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type.'] Line 130: Unexpected errors ['generics_defaults.py:130:0 Assert type [70]: Expected `int` but got `unknown`.'] -Line 151: Unexpected errors ["generics_defaults.py:151:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`.", 'generics_defaults.py:151:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] -Line 154: Unexpected errors ['generics_defaults.py:154:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:154:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:154:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 155: Unexpected errors ['generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:155:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] -Line 169: Unexpected errors ['generics_defaults.py:169:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:169:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] -Line 170: Unexpected errors ['generics_defaults.py:170:0 Assert type [70]: Expected `int` but got `unknown`.'] +Line 131: Unexpected errors ['generics_defaults.py:131:0 Assert type [70]: Expected `typing.Any` but got `unknown`.'] +Line 152: Unexpected errors ["generics_defaults.py:152:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`.", 'generics_defaults.py:152:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] +Line 155: Unexpected errors ['generics_defaults.py:155:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:155:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:155:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 156: Unexpected errors ['generics_defaults.py:156:0 Assert type [70]: Expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:156:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 170: Unexpected errors ['generics_defaults.py:170:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:170:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] +Line 171: Unexpected errors ['generics_defaults.py:171:0 Assert type [70]: Expected `int` but got `unknown`.'] """ diff --git a/conformance/results/pyre/generics_self_advanced.toml b/conformance/results/pyre/generics_self_advanced.toml index f298efb4c..7729c370c 100644 --- a/conformance/results/pyre/generics_self_advanced.toml +++ b/conformance/results/pyre/generics_self_advanced.toml @@ -8,9 +8,9 @@ generics_self_advanced.py:25:7 Undefined or invalid type [11]: Annotation `Self` generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`. generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`. generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`. -generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`. -generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`. -generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`. +generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`. +generics_self_advanced.py:46:8 Assert type [70]: Expected `unknown` but got `typing.Any`. +generics_self_advanced.py:47:8 Assert type [70]: Expected `unknown` but got `ChildB`. """ conformance_automated = "Fail" errors_diff = """ @@ -18,7 +18,7 @@ Line 25: Unexpected errors ['generics_self_advanced.py:25:7 Undefined or invalid Line 35: Unexpected errors ['generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] Line 37: Unexpected errors ['generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] Line 38: Unexpected errors ['generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] -Line 42: Unexpected errors ['generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`.'] -Line 44: Unexpected errors ['generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] -Line 45: Unexpected errors ['generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] +Line 44: Unexpected errors ['generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`.'] +Line 46: Unexpected errors ['generics_self_advanced.py:46:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] +Line 47: Unexpected errors ['generics_self_advanced.py:47:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] """ diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index 2894b29bd..6339780b7 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -7,27 +7,24 @@ output = """ generics_syntax_infer_variance.py:15:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. generics_syntax_infer_variance.py:17:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. generics_syntax_infer_variance.py:29:0 Incompatible variable type [9]: vco1_2 is declared to have type `ShouldBeCovariant1[int]` but is used as type `ShouldBeCovariant1[float]`. -generics_syntax_infer_variance.py:36:36 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`. -generics_syntax_infer_variance.py:37:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. -generics_syntax_infer_variance.py:37:34 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`. -generics_syntax_infer_variance.py:46:0 Incompatible variable type [9]: vco3_2 is declared to have type `ShouldBeCovariant3[int]` but is used as type `ShouldBeCovariant3[float]`. -generics_syntax_infer_variance.py:75:0 Incompatible variable type [9]: vo5_2 is declared to have type `ShouldBeCovariant5[int]` but is used as type `ShouldBeCovariant5[float]`. -generics_syntax_infer_variance.py:86:0 Incompatible variable type [9]: vo6_2 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. -generics_syntax_infer_variance.py:102:0 Incompatible variable type [9]: vinv1_1 is declared to have type `ShouldBeInvariant1[float]` but is used as type `ShouldBeInvariant1[int]`. -generics_syntax_infer_variance.py:103:0 Incompatible variable type [9]: vinv1_2 is declared to have type `ShouldBeInvariant1[int]` but is used as type `ShouldBeInvariant1[float]`. -generics_syntax_infer_variance.py:117:0 Incompatible variable type [9]: vinv2_1 is declared to have type `ShouldBeInvariant2[float]` but is used as type `ShouldBeInvariant2[int]`. -generics_syntax_infer_variance.py:118:0 Incompatible variable type [9]: vinv2_2 is declared to have type `ShouldBeInvariant2[int]` but is used as type `ShouldBeInvariant2[float]`. -generics_syntax_infer_variance.py:125:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. -generics_syntax_infer_variance.py:126:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. -generics_syntax_infer_variance.py:127:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. -generics_syntax_infer_variance.py:128:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. -generics_syntax_infer_variance.py:133:7 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_syntax_infer_variance.py:155:0 Incompatible variable type [9]: vcontra1_1 is declared to have type `ShouldBeContravariant1[float]` but is used as type `ShouldBeContravariant1[int]`. +generics_syntax_infer_variance.py:47:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. +generics_syntax_infer_variance.py:56:0 Incompatible variable type [9]: vco3_2 is declared to have type `ShouldBeCovariant3[int]` but is used as type `ShouldBeCovariant3[float]`. +generics_syntax_infer_variance.py:85:0 Incompatible variable type [9]: vo5_2 is declared to have type `ShouldBeCovariant5[int]` but is used as type `ShouldBeCovariant5[float]`. +generics_syntax_infer_variance.py:96:0 Incompatible variable type [9]: vo6_2 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. +generics_syntax_infer_variance.py:112:0 Incompatible variable type [9]: vinv1_1 is declared to have type `ShouldBeInvariant1[float]` but is used as type `ShouldBeInvariant1[int]`. +generics_syntax_infer_variance.py:113:0 Incompatible variable type [9]: vinv1_2 is declared to have type `ShouldBeInvariant1[int]` but is used as type `ShouldBeInvariant1[float]`. +generics_syntax_infer_variance.py:127:0 Incompatible variable type [9]: vinv2_1 is declared to have type `ShouldBeInvariant2[float]` but is used as type `ShouldBeInvariant2[int]`. +generics_syntax_infer_variance.py:128:0 Incompatible variable type [9]: vinv2_2 is declared to have type `ShouldBeInvariant2[int]` but is used as type `ShouldBeInvariant2[float]`. +generics_syntax_infer_variance.py:135:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. +generics_syntax_infer_variance.py:136:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. +generics_syntax_infer_variance.py:137:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. +generics_syntax_infer_variance.py:138:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. +generics_syntax_infer_variance.py:143:7 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_syntax_infer_variance.py:165:0 Incompatible variable type [9]: vcontra1_1 is declared to have type `ShouldBeContravariant1[float]` but is used as type `ShouldBeContravariant1[int]`. """ conformance_automated = "Fail" errors_diff = """ -Line 136: Expected 1 errors -Line 144: Expected 1 errors -Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36:36 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`.'] -Line 133: Unexpected errors ["generics_syntax_infer_variance.py:133:7 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]`."] +Line 146: Expected 1 errors +Line 154: Expected 1 errors +Line 143: Unexpected errors ["generics_syntax_infer_variance.py:143:7 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]`."] """ diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index af4f56c41..b14cb7abe 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -9,21 +9,25 @@ output = """ generics_type_erasure.py:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`. -generics_type_erasure.py:21:0 Assert type [70]: 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 Assert type [70]: Expected `bytes` but got `typing.Any`. +generics_type_erasure.py:20:0 Assert type [70]: Expected `Node[Never]` but got `Node[Variable[T]]`. +generics_type_erasure.py:22:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`. +generics_type_erasure.py:24:0 Assert type [70]: Expected `Never` but got `typing.Any`. +generics_type_erasure.py:40:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. +generics_type_erasure.py:42:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. +generics_type_erasure.py:58:0 Assert type [70]: Expected `bytes` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ -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 +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Lines 19, 20: Expected exactly one error (tag 'any-or-never1') Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] -Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`.'] -Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Assert type [70]: Expected `bytes` but got `typing.Any`.'] +Line 20: Unexpected errors ['generics_type_erasure.py:20:0 Assert type [70]: Expected `Node[Never]` but got `Node[Variable[T]]`.'] +Line 22: Unexpected errors ['generics_type_erasure.py:22:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`.'] +Line 58: Unexpected errors ['generics_type_erasure.py:58:0 Assert type [70]: Expected `bytes` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/protocols_explicit.toml b/conformance/results/pyre/protocols_explicit.toml index 0e7d70ef0..5a36eda0d 100644 --- a/conformance/results/pyre/protocols_explicit.toml +++ b/conformance/results/pyre/protocols_explicit.toml @@ -5,13 +5,14 @@ Does not report error when method is not implemented in derived class. """ output = """ 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`. +protocols_explicit.py:83:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized. +protocols_explicit.py:164: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 90: Expected 1 errors -Line 110: Expected 1 errors -Line 135: Expected 1 errors +Line 89: Expected 1 errors +Line 134: Expected 1 errors +Line 83: Unexpected errors ['protocols_explicit.py:83:0 Uninitialized attribute [13]: Attribute `cm1` inherited from protocol `Proto1` in class `Concrete1` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/typeddicts_required.toml b/conformance/results/pyre/typeddicts_required.toml index 60e6c0ce5..923f2b19e 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -7,13 +7,11 @@ Incorrectly complains about uninitialized attributes on TypedDict definitions. Incorrectly generates "attribute not initialized" errors for TypedDict fields. """ output = """ -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:12:4 Uninitialized attribute [13]: Attribute `x` is declared in class `NotTypedDict` to have type `Required[int]` but is never initialized. """ conformance_automated = "Fail" errors_diff = """ -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 16: Expected 1 errors +Line 59: Expected 1 errors +Line 60: Expected 1 errors """ diff --git a/conformance/results/pyrefly/generics_defaults.toml b/conformance/results/pyrefly/generics_defaults.toml index e3166df30..3216033da 100644 --- a/conformance/results/pyrefly/generics_defaults.toml +++ b/conformance/results/pyrefly/generics_defaults.toml @@ -1,14 +1,10 @@ conformant = "Partial" notes = """ -Unsolved type var is not always resolved to default (optional) Defaults are not bound by attribute access -Generic attribute is not visible on class """ conformance_automated = "Fail" errors_diff = """ -Line 130: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] -Line 169: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type]'] -Line 170: Unexpected errors ['assert_type(Any, int) failed [assert-type]', 'Generic attribute `attr` of class `Foo7` is not visible on the class [missing-attribute]'] +Line 170: Unexpected errors ['assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type]'] """ output = """ ERROR generics_defaults.py:24:7-31: Type parameter `T` without a default cannot follow type parameter `DefaultStrT` with a default [invalid-type-var] @@ -16,8 +12,6 @@ ERROR generics_defaults.py:50:1-20: Expected 5 type arguments for `AllTheDefault ERROR generics_defaults.py:107:51-54: Expected default `int` of `Invalid1` to be assignable to the upper bound of `str` [invalid-type-var] ERROR generics_defaults.py:114:52-55: Expected default `int` of `Invalid2` to be one of the following constraints: `float`, `str` [invalid-type-var] ERROR generics_defaults.py:130:12-27: assert_type(Any, int) failed [assert-type] -ERROR generics_defaults.py:141:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] -ERROR generics_defaults.py:169:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] -ERROR generics_defaults.py:170:12-28: assert_type(Any, int) failed [assert-type] -ERROR generics_defaults.py:170:13-22: Generic attribute `attr` of class `Foo7` is not visible on the class [missing-attribute] +ERROR generics_defaults.py:142:7-11: TypeVar `T5` with a default cannot follow TypeVarTuple `Ts` [invalid-type-var] +ERROR generics_defaults.py:170:12-57: assert_type([DefaultIntT](Foo7[DefaultIntT]) -> Foo7[DefaultIntT], (Foo7[int]) -> Foo7[int]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/generics_syntax_infer_variance.toml b/conformance/results/pyrefly/generics_syntax_infer_variance.toml index eec9124da..422d6031b 100644 --- a/conformance/results/pyrefly/generics_syntax_infer_variance.toml +++ b/conformance/results/pyrefly/generics_syntax_infer_variance.toml @@ -6,19 +6,19 @@ output = """ ERROR generics_syntax_infer_variance.py:15:36-55: Contradictory variance specifications [invalid-type-var] ERROR generics_syntax_infer_variance.py:17:40-59: Contradictory variance specifications [invalid-type-var] ERROR generics_syntax_infer_variance.py:29:35-62: `ShouldBeCovariant1[float]` is not assignable to `ShouldBeCovariant1[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:37:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:46:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:75:34-64: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:86:34-64: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:102:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:103:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:117:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:118:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:125:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:126:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:127:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:128:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:136:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:144:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] -ERROR generics_syntax_infer_variance.py:155:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:47:35-62: `ShouldBeCovariant2[float]` is not assignable to `ShouldBeCovariant2[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:56:35-62: `ShouldBeCovariant3[float]` is not assignable to `ShouldBeCovariant3[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:85:34-64: `ShouldBeCovariant5[float]` is not assignable to `ShouldBeCovariant5[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:96:34-64: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:112:38-64: `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:113:36-66: `ShouldBeInvariant1[float]` is not assignable to `ShouldBeInvariant1[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:127:38-64: `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:128:36-66: `ShouldBeInvariant2[float]` is not assignable to `ShouldBeInvariant2[int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:135:43-73: `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[float, str]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:136:41-73: `ShouldBeInvariant3[float, str]` is not assignable to `ShouldBeInvariant3[int, str]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:137:43-73: `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:138:41-73: `ShouldBeInvariant3[str, float]` is not assignable to `ShouldBeInvariant3[str, int]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:146:38-64: `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:154:38-64: `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[float]` [bad-assignment] +ERROR generics_syntax_infer_variance.py:165:45-75: `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[float]` [bad-assignment] """ diff --git a/conformance/results/pyrefly/generics_type_erasure.toml b/conformance/results/pyrefly/generics_type_erasure.toml index efb957387..6b484fa21 100644 --- a/conformance/results/pyrefly/generics_type_erasure.toml +++ b/conformance/results/pyrefly/generics_type_erasure.toml @@ -3,11 +3,13 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR generics_type_erasure.py:38:16-18: Argument `Literal['']` is not assignable to parameter `label` with type `int | None` in function `Node.__init__` [bad-argument-type] -ERROR generics_type_erasure.py:40:16-17: Argument `Literal[0]` is not assignable to parameter `label` with type `str | None` in function `Node.__init__` [bad-argument-type] -ERROR generics_type_erasure.py:42:1-16: Generic attribute `label` of class `Node` is not visible on the class [no-access] -ERROR generics_type_erasure.py:43:1-16: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR generics_type_erasure.py:44:1-11: Generic attribute `label` of class `Node` is not visible on the class [no-access] -ERROR generics_type_erasure.py:45:1-11: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR generics_type_erasure.py:46:1-15: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:20:12-33: assert_type(Node[Any], Node[Never]) failed [assert-type] +ERROR generics_type_erasure.py:24:12-33: assert_type(Any, Never) failed [assert-type] +ERROR generics_type_erasure.py:40:16-18: Argument `Literal['']` is not assignable to parameter `label` with type `int | None` in function `Node.__init__` [bad-argument-type] +ERROR generics_type_erasure.py:42:16-17: Argument `Literal[0]` is not assignable to parameter `label` with type `str | None` in function `Node.__init__` [bad-argument-type] +ERROR generics_type_erasure.py:44:1-16: Generic attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:45:1-16: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:46:1-11: Generic attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:47:1-11: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:48:1-15: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyrefly/overloads_definitions.toml b/conformance/results/pyrefly/overloads_definitions.toml index 44bb654ff..302bc4a2c 100644 --- a/conformance/results/pyrefly/overloads_definitions.toml +++ b/conformance/results/pyrefly/overloads_definitions.toml @@ -5,9 +5,7 @@ Does not require some decorators that need to appear on every overload """ conformance_automated = "Fail" errors_diff = """ -Lines 170, 175, 181, 183: Expected error (tag 'override-final') Line 49: Unexpected errors ['Overloaded function must have an implementation [invalid-overload]'] -Line 176: Unexpected errors ['`final_method` is declared as final in parent class `Base` [bad-override]'] """ output = """ ERROR overloads_definitions.py:16:5-10: Overloaded function needs at least two @overload declarations [invalid-overload] diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index 15d99d0e4..bdb414d48 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -5,12 +5,11 @@ Does not check against abstract class instantiations conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors -Line 90: Expected 1 errors -Line 110: Expected 1 errors -Line 135: Expected 1 errors +Line 89: Expected 1 errors +Line 134: Expected 1 errors """ output = """ ERROR protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] ERROR protocols_explicit.py:60:10-20: Cannot instantiate `Point` because the following members are abstract: `intensity` [bad-instantiation] -ERROR protocols_explicit.py:165:17-19: Cannot instantiate `Concrete7A` because the following members are abstract: `method1` [bad-instantiation] +ERROR protocols_explicit.py:164:17-19: Cannot instantiate `Concrete7A` because the following members are abstract: `method1` [bad-instantiation] """ diff --git a/conformance/results/pyrefly/typeddicts_required.toml b/conformance/results/pyrefly/typeddicts_required.toml index cd9d0280d..8af582147 100644 --- a/conformance/results/pyrefly/typeddicts_required.toml +++ b/conformance/results/pyrefly/typeddicts_required.toml @@ -4,13 +4,13 @@ Does not handle recursive typed dicts in functional syntax """ conformance_automated = "Fail" errors_diff = """ -Line 74: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type]"] +Line 71: Unexpected errors ["Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type]"] """ output = """ ERROR typeddicts_required.py:12:5-6: `Required` may only be used for TypedDict members [invalid-annotation] -ERROR typeddicts_required.py:19:8-19: `NotRequired` is only allowed inside a class body [invalid-annotation] -ERROR typeddicts_required.py:19:8-24: `NotRequired` is not allowed in this context [invalid-annotation] -ERROR typeddicts_required.py:62:8-31: Duplicate qualifier `Required` [invalid-annotation] -ERROR typeddicts_required.py:63:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] -ERROR typeddicts_required.py:74:75-91: Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type] +ERROR typeddicts_required.py:16:8-19: `NotRequired` is only allowed inside a class body [invalid-annotation] +ERROR typeddicts_required.py:16:8-24: `NotRequired` is not allowed in this context [invalid-annotation] +ERROR typeddicts_required.py:59:8-31: Duplicate qualifier `Required` [invalid-annotation] +ERROR typeddicts_required.py:60:8-34: Cannot combine `Required` and `NotRequired` for a TypedDict field [invalid-annotation] +ERROR typeddicts_required.py:71:75-91: Expected a type form, got instance of `Literal['RecursiveMovie']` [not-a-type] """ diff --git a/conformance/results/pyright/aliases_newtype.toml b/conformance/results/pyright/aliases_newtype.toml index 00a5767c3..4e70b6d53 100644 --- a/conformance/results/pyright/aliases_newtype.toml +++ b/conformance/results/pyright/aliases_newtype.toml @@ -12,7 +12,7 @@ aliases_newtype.py:23:16 - error: Argument of type "type[UserId]" cannot be assi     "FunctionType" is not assignable to "UnionType"     "FunctionType" is not assignable to "tuple[_ClassInfo, ...]" (reportArgumentType) aliases_newtype.py:23:16 - error: Second argument to "isinstance" must be a class or tuple of classes -  Class created with NewType cannot be used with instance and class checks (reportArgumentType) +  Type created with NewType cannot be used with instance and class checks (reportArgumentType) aliases_newtype.py:26:21 - error: Base class "UserId" is marked final and cannot be subclassed (reportGeneralTypeIssues) aliases_newtype.py:35:1 - error: NewType must be assigned to a variable with the same name (reportGeneralTypeIssues) aliases_newtype.py:41:19 - error: Expected no type arguments for class "GoodNewType1" (reportInvalidTypeArguments) diff --git a/conformance/results/pyright/constructors_call_metaclass.toml b/conformance/results/pyright/constructors_call_metaclass.toml index 0736d700b..96498014e 100644 --- a/conformance/results/pyright/constructors_call_metaclass.toml +++ b/conformance/results/pyright/constructors_call_metaclass.toml @@ -2,7 +2,7 @@ conformant = "Pass" errors_diff = """ """ output = """ -constructors_call_metaclass.py:51:1 - error: Argument missing for parameter "x" (reportCallIssue) -constructors_call_metaclass.py:65:1 - error: Argument missing for parameter "x" (reportCallIssue) +constructors_call_metaclass.py:54:1 - error: Argument missing for parameter "x" (reportCallIssue) +constructors_call_metaclass.py:68:1 - error: Argument missing for parameter "x" (reportCallIssue) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/dataclasses_match_args.toml b/conformance/results/pyright/dataclasses_match_args.toml index e85cc6da0..570ca46c9 100644 --- a/conformance/results/pyright/dataclasses_match_args.toml +++ b/conformance/results/pyright/dataclasses_match_args.toml @@ -1,10 +1,7 @@ -conformant = "Partial" -notes = """ -Generates __match_args__ when match_args=False. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 42: Expected 1 errors """ output = """ +dataclasses_match_args.py:42:5 - error: Cannot access attribute "__match_args__" for class "type[DC4]" +  Attribute "__match_args__" is unknown (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/enums_members.toml b/conformance/results/pyright/enums_members.toml index 54a2c1b82..d09aadcdd 100644 --- a/conformance/results/pyright/enums_members.toml +++ b/conformance/results/pyright/enums_members.toml @@ -2,14 +2,10 @@ conformant = "Pass" notes = """ Does not support `_ignore_` mechanism (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" 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: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 (reportInvalidTypeForm) diff --git a/conformance/results/pyright/generics_defaults.toml b/conformance/results/pyright/generics_defaults.toml index 16b3cc3c1..55f1dd651 100644 --- a/conformance/results/pyright/generics_defaults.toml +++ b/conformance/results/pyright/generics_defaults.toml @@ -4,8 +4,8 @@ generics_defaults.py:24:7 - error: "T" cannot appear after "DefaultStrT" in type generics_defaults.py:50:16 - error: Too few type arguments provided for "AllTheDefaults"; expected 2 but received 1 (reportInvalidTypeArguments) generics_defaults.py:107:51 - error: TypeVar default type must be a subtype of the bound type (reportGeneralTypeIssues) generics_defaults.py:114:52 - error: TypeVar default type must be one of the constrained types (reportGeneralTypeIssues) -generics_defaults.py:141:7 - error: TypeVar "T5" has a default value and cannot follow TypeVarTuple "Ts" (reportGeneralTypeIssues) -generics_defaults.py:170:18 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_defaults.py:131:13 - error: "assert_type" mismatch: expected "Any" but received "int" (reportAssertTypeFailure) +generics_defaults.py:142:7 - error: TypeVar "T5" has a default value and cannot follow TypeVarTuple "Ts" (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index 05f4c0d51..a871ffee0 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -6,64 +6,57 @@ generics_syntax_infer_variance.py:29:35 - error: Type "ShouldBeCovariant1[float]   "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:36:37 - error: Cannot instantiate abstract class "ShouldBeCovariant2" -  "Collection.__len__" is not implemented -  "Sequence.__getitem__" is not implemented (reportAbstractUsage) -generics_syntax_infer_variance.py:37:35 - error: Cannot instantiate abstract class "ShouldBeCovariant2" -  "Collection.__len__" is not implemented -  "Sequence.__getitem__" is not implemented (reportAbstractUsage) -generics_syntax_infer_variance.py:37:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]" +generics_syntax_infer_variance.py:47:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]"   "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:46:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]" +generics_syntax_infer_variance.py:56:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]"   "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:75:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]" +generics_syntax_infer_variance.py:85:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]"   "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:86:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]" +generics_syntax_infer_variance.py:96:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]"   "ShouldBeCovariant6[float]" is not assignable to "ShouldBeCovariant6[int]"     Type parameter "T@ShouldBeCovariant6" is covariant, but "float" is not a subtype of "int"       "float" is not assignable to "int" (reportAssignmentType) -generics_syntax_infer_variance.py:102:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]" +generics_syntax_infer_variance.py:112:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]"   "ShouldBeInvariant1[int]" is not assignable to "ShouldBeInvariant1[float]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:103:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]" +generics_syntax_infer_variance.py:113:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]"   "ShouldBeInvariant1[float]" is not assignable to "ShouldBeInvariant1[int]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:117:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]" +generics_syntax_infer_variance.py:127:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]"   "ShouldBeInvariant2[int]" is not assignable to "ShouldBeInvariant2[float]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:118:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]" +generics_syntax_infer_variance.py:128:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]"   "ShouldBeInvariant2[float]" is not assignable to "ShouldBeInvariant2[int]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:125:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]" +generics_syntax_infer_variance.py:135:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]"   "ShouldBeInvariant3[int, str]" is not assignable to "ShouldBeInvariant3[float, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:126:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]" +generics_syntax_infer_variance.py:136:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]"   "ShouldBeInvariant3[float, str]" is not assignable to "ShouldBeInvariant3[int, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:127:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]" +generics_syntax_infer_variance.py:137:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]"   "ShouldBeInvariant3[str, int]" is not assignable to "ShouldBeInvariant3[str, float]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:128:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]" +generics_syntax_infer_variance.py:138:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]"   "ShouldBeInvariant3[str, float]" is not assignable to "ShouldBeInvariant3[str, int]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:136:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]" +generics_syntax_infer_variance.py:146:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]"   "ShouldBeInvariant4[int]" is not assignable to "ShouldBeInvariant4[float]"     Type parameter "T@ShouldBeInvariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:144:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]" +generics_syntax_infer_variance.py:154:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]"   "ShouldBeInvariant5[int]" is not assignable to "ShouldBeInvariant5[float]"     Type parameter "T@ShouldBeInvariant5" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:155:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]" +generics_syntax_infer_variance.py:165:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]"   "ShouldBeContravariant1[int]" is not assignable to "ShouldBeContravariant1[float]"     Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float"       "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36:37 - error: Cannot instantiate abstract class "ShouldBeCovariant2"'] """ diff --git a/conformance/results/pyright/generics_type_erasure.toml b/conformance/results/pyright/generics_type_erasure.toml index cbbc0d1c6..aba916ddf 100644 --- a/conformance/results/pyright/generics_type_erasure.toml +++ b/conformance/results/pyright/generics_type_erasure.toml @@ -1,18 +1,20 @@ conformant = "Pass" output = """ -generics_type_erasure.py:38:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__" +generics_type_erasure.py:20:13 - error: "assert_type" mismatch: expected "Node[Never]" but received "Node[Unknown]" (reportAssertTypeFailure) +generics_type_erasure.py:24:13 - error: "assert_type" mismatch: expected "Never" but received "Unknown" (reportAssertTypeFailure) +generics_type_erasure.py:40:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__"   Type "Literal['']" is not assignable to type "int | None"     "Literal['']" is not assignable to "int"     "Literal['']" is not assignable to "None" (reportArgumentType) -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__" +generics_type_erasure.py:42:16 - error: Argument of type "Literal[0]" cannot be assigned to parameter "label" of type "str | None" in function "__init__"   Type "Literal[0]" is not assignable to type "str | None"     "Literal[0]" is not assignable to "str"     "Literal[0]" is not assignable to "None" (reportArgumentType) -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) +generics_type_erasure.py:44:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:45:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:46:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:47:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) +generics_type_erasure.py:48:10 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_explicit.toml b/conformance/results/pyright/protocols_explicit.toml index cdb926916..aad78c2f3 100644 --- a/conformance/results/pyright/protocols_explicit.toml +++ b/conformance/results/pyright/protocols_explicit.toml @@ -6,16 +6,13 @@ protocols_explicit.py:56:32 - error: Cannot assign to attribute "rgb" for class protocols_explicit.py:60:5 - error: Cannot instantiate abstract class "Point"   "RGB.intensity" is not implemented   "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 (reportAttributeAccessIssue) -protocols_explicit.py:135:6 - error: Cannot instantiate abstract class "Concrete5" +protocols_explicit.py:89:6 - error: Cannot instantiate abstract class "Concrete1" +  "Proto1.cm1" is not implemented (reportAbstractUsage) +protocols_explicit.py:134:6 - error: Cannot instantiate abstract class "Concrete5"   "Proto5.method1" is not implemented (reportAbstractUsage) -protocols_explicit.py:165:7 - error: Cannot instantiate abstract class "Concrete7A" +protocols_explicit.py:164:7 - error: Cannot instantiate abstract class "Concrete7A"   "Proto7.method1" is not implemented (reportAbstractUsage) """ -conformance_automated = "Fail" +conformance_automated = "Pass" 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/typeddicts_extra_items.toml b/conformance/results/pyright/typeddicts_extra_items.toml index d54c48d99..0eb4f16ba 100644 --- a/conformance/results/pyright/typeddicts_extra_items.toml +++ b/conformance/results/pyright/typeddicts_extra_items.toml @@ -1,11 +1,5 @@ -conformant = "Partial" -notes = """ -Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 67: Expected 1 errors -Line 73: Expected 1 errors """ output = """ typeddicts_extra_items.py:15:45 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie" @@ -15,6 +9,8 @@ typeddicts_extra_items.py:22:55 - error: Type "dict[str, str | int]" is not assi typeddicts_extra_items.py:39:54 - error: Type "dict[str, str | None]" is not assignable to declared type "InheritedMovie"   "None" is not assignable to "int" (reportAssignmentType) typeddicts_extra_items.py:49:35 - error: Expected "closed" parameter to have a value of True or False (reportGeneralTypeIssues) +typeddicts_extra_items.py:67:40 - error: Base class "ClosedBase" is not an open TypedDict; closed=False is not allowed (reportGeneralTypeIssues) +typeddicts_extra_items.py:73:44 - error: Base class "ExtraItemsBase" is not an open TypedDict; closed=False is not allowed (reportGeneralTypeIssues) typeddicts_extra_items.py:91:7 - error: Base class "MovieA" is a TypedDict that limits the type of extra items to type "Never"   Cannot add item "age" (reportIncompatibleVariableOverride) typeddicts_extra_items.py:94:7 - error: Base class "MovieB" is a TypedDict that limits the type of extra items to type "Never" diff --git a/conformance/results/pyright/typeddicts_required.toml b/conformance/results/pyright/typeddicts_required.toml index 9f041f9fc..b612b7c02 100644 --- a/conformance/results/pyright/typeddicts_required.toml +++ b/conformance/results/pyright/typeddicts_required.toml @@ -1,13 +1,10 @@ conformant = "Pass" output = """ typeddicts_required.py:12:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) -typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*" -  "int" is not assignable to "Required" (reportAttributeAccessIssue) -typeddicts_required.py:19:8 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) -typeddicts_required.py:62:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) -typeddicts_required.py:63:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) +typeddicts_required.py:16:8 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) +typeddicts_required.py:59:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) +typeddicts_required.py:60:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) """ -conformance_automated = "Fail" +conformance_automated = "Pass" 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 60d8230bc..739cc3b7f 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1 +1 @@ -version = "pyright 1.1.404" +version = "pyright 1.1.406" diff --git a/conformance/results/results.html b/conformance/results/results.html index ffefce6cd..928cb1f23 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,9 +158,9 @@

Python Type System Conformance Test Results

- - @@ -267,7 +267,7 @@

Python Type System Conformance Test Results

- + @@ -312,7 +312,7 @@

Python Type System Conformance Test Results

- + @@ -330,7 +330,7 @@

Python Type System Conformance Test Results

- + @@ -344,7 +344,7 @@

Python Type System Conformance Test Results

- + @@ -442,7 +442,7 @@

Python Type System Conformance Test Results

- + @@ -480,7 +480,7 @@

Python Type System Conformance Test Results

- + - + @@ -603,7 +603,7 @@

Python Type System Conformance Test Results

- + @@ -611,14 +611,14 @@

Python Type System Conformance Test Results

- + - + @@ -646,7 +646,7 @@

Python Type System Conformance Test Results

- + @@ -660,7 +660,7 @@

Python Type System Conformance Test Results

- + - + @@ -767,7 +767,7 @@

Python Type System Conformance Test Results

- + @@ -833,7 +833,7 @@

Python Type System Conformance Test Results

- + @@ -920,10 +920,10 @@

Python Type System Conformance Test Results

- + - + @@ -1032,7 +1032,7 @@

Python Type System Conformance Test Results

- + @@ -1053,7 +1053,7 @@

Python Type System Conformance Test Results

- + @@ -1065,7 +1065,7 @@

Python Type System Conformance Test Results

- + diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml index 63d7f7d88..978478b80 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -6,18 +6,17 @@ ParamSpec after TypeVarTuple is not always handled correctly """ conformance_automated = "Fail" errors_diff = """ -Line 141: Expected 1 errors -Line 154: Unexpected errors ['generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] -Line 169: Unexpected errors ['generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] -Line 170: Unexpected errors ['generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc]'] +Line 142: Expected 1 errors +Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] """ output = """ generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type arguments, but 1 given [type-arg] generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] -generics_defaults.py:154: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc] -generics_defaults.py:154: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] -generics_defaults.py:169: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] -generics_defaults.py:170: error: Access to generic instance variables via class is ambiguous [misc] +generics_defaults.py:131: error: Expression is of type "int", not "Any" [misc] +generics_defaults.py:155: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc] +generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] """ diff --git a/conformance/results/zuban/generics_self_advanced.toml b/conformance/results/zuban/generics_self_advanced.toml index 16e410b4f..cad7a4d67 100644 --- a/conformance/results/zuban/generics_self_advanced.toml +++ b/conformance/results/zuban/generics_self_advanced.toml @@ -2,12 +2,10 @@ conformant = "Pass" notes = """ True positive: Writing to a variable that contains Self (with a class) should error """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous [misc]'] -Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous [misc]'] """ output = """ +generics_self_advanced.py:42: error: Access to generic instance variables via class is ambiguous [misc] generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous [misc] -generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous [misc] """ diff --git a/conformance/results/zuban/generics_syntax_infer_variance.toml b/conformance/results/zuban/generics_syntax_infer_variance.toml index f6f762210..796dcd31a 100644 --- a/conformance/results/zuban/generics_syntax_infer_variance.toml +++ b/conformance/results/zuban/generics_syntax_infer_variance.toml @@ -4,28 +4,30 @@ Final is handled a bit different (questionable if this is an issue) """ conformance_automated = "Fail" errors_diff = """ -Line 79: Unexpected errors ['generics_syntax_infer_variance.py:79: error: Final name declared in class body cannot depend on type variables [misc]'] -Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment]'] +Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Final name declared in class body cannot depend on type variables [misc]'] +Line 95: Unexpected errors ['generics_syntax_infer_variance.py:95: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment]'] """ output = """ generics_syntax_infer_variance.py:15: error: Cannot use covariant with infer_variance [misc] generics_syntax_infer_variance.py:17: error: Cannot use contravariant with infer_variance [misc] generics_syntax_infer_variance.py:29: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") [assignment] -generics_syntax_infer_variance.py:37: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] -generics_syntax_infer_variance.py:46: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] -generics_syntax_infer_variance.py:75: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] -generics_syntax_infer_variance.py:79: error: Final name declared in class body cannot depend on type variables [misc] -generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment] -generics_syntax_infer_variance.py:86: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] -generics_syntax_infer_variance.py:102: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] -generics_syntax_infer_variance.py:103: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] -generics_syntax_infer_variance.py:117: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") [assignment] -generics_syntax_infer_variance.py:118: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") [assignment] -generics_syntax_infer_variance.py:125: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") [assignment] -generics_syntax_infer_variance.py:126: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") [assignment] -generics_syntax_infer_variance.py:127: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") [assignment] -generics_syntax_infer_variance.py:128: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") [assignment] -generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] -generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:155: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") [assignment] +generics_syntax_infer_variance.py:39: note: If the method is meant to be abstract, use @abc.abstractmethod +generics_syntax_infer_variance.py:42: note: If the method is meant to be abstract, use @abc.abstractmethod +generics_syntax_infer_variance.py:47: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] +generics_syntax_infer_variance.py:56: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] +generics_syntax_infer_variance.py:85: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] +generics_syntax_infer_variance.py:89: error: Final name declared in class body cannot depend on type variables [misc] +generics_syntax_infer_variance.py:95: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[int]", variable has type "ShouldBeCovariant6[float]") [assignment] +generics_syntax_infer_variance.py:96: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] +generics_syntax_infer_variance.py:112: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] +generics_syntax_infer_variance.py:113: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] +generics_syntax_infer_variance.py:127: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[int]", variable has type "ShouldBeInvariant2[float]") [assignment] +generics_syntax_infer_variance.py:128: error: Incompatible types in assignment (expression has type "ShouldBeInvariant2[float]", variable has type "ShouldBeInvariant2[int]") [assignment] +generics_syntax_infer_variance.py:135: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[int, str]", variable has type "ShouldBeInvariant3[float, str]") [assignment] +generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[float, str]", variable has type "ShouldBeInvariant3[int, str]") [assignment] +generics_syntax_infer_variance.py:137: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, int]", variable has type "ShouldBeInvariant3[str, float]") [assignment] +generics_syntax_infer_variance.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant3[str, float]", variable has type "ShouldBeInvariant3[str, int]") [assignment] +generics_syntax_infer_variance.py:146: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:154: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_syntax_infer_variance.py:165: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") [assignment] """ diff --git a/conformance/results/zuban/generics_type_erasure.toml b/conformance/results/zuban/generics_type_erasure.toml index 403b62d09..21ebd0b1f 100644 --- a/conformance/results/zuban/generics_type_erasure.toml +++ b/conformance/results/zuban/generics_type_erasure.toml @@ -2,19 +2,17 @@ conformant = "Pass" notes = """ True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [misc]'] -Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [misc]'] """ output = """ generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [misc] -generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [misc] -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:23: error: Expression is of type "Never", not "Any" [misc] +generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] +generics_type_erasure.py:42: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type] 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] generics_type_erasure.py:46: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:47: error: Access to generic instance variables via class is ambiguous [misc] +generics_type_erasure.py:48: error: Access to generic instance variables via class is ambiguous [misc] """ diff --git a/conformance/results/zuban/protocols_explicit.toml b/conformance/results/zuban/protocols_explicit.toml index 4a0f7c2a4..259623c10 100644 --- a/conformance/results/zuban/protocols_explicit.toml +++ b/conformance/results/zuban/protocols_explicit.toml @@ -1,16 +1,11 @@ -conformant = "Pass" -conformance_automated = "Fail" -notes = """ -Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated. -""" +conformance_automated = "Pass" errors_diff = """ -Line 90: Expected 1 errors -Line 110: Expected 1 errors """ 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]", variable has type "tuple[int, int, int]") [assignment] 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] +protocols_explicit.py:89: error: Cannot instantiate abstract class "Concrete1" with abstract attribute "cm1" [abstract] +protocols_explicit.py:134: error: Cannot instantiate abstract class "Concrete5" with abstract attribute "method1" [abstract] +protocols_explicit.py:164: error: Cannot instantiate abstract class "Concrete7A" with abstract attribute "method1" [abstract] """ diff --git a/conformance/results/zuban/qualifiers_annotated.toml b/conformance/results/zuban/qualifiers_annotated.toml index 03e563a7a..1074d8db7 100644 --- a/conformance/results/zuban/qualifiers_annotated.toml +++ b/conformance/results/zuban/qualifiers_annotated.toml @@ -17,10 +17,10 @@ qualifiers_annotated.py:47: error: Invalid type: try using Literal[1] instead? qualifiers_annotated.py:48: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:49: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:59: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] -qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] -qualifiers_annotated.py:72: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] -qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] -qualifiers_annotated.py:80: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] +qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] +qualifiers_annotated.py:72: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] +qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] +qualifiers_annotated.py:80: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] qualifiers_annotated.py:86: error: "_SpecialForm" not callable [operator] qualifiers_annotated.py:87: error: "_SpecialForm" not callable [operator] qualifiers_annotated.py:88: error: "" not callable [operator] diff --git a/conformance/results/zuban/typeddicts_required.toml b/conformance/results/zuban/typeddicts_required.toml index 71d502073..c83d715f6 100644 --- a/conformance/results/zuban/typeddicts_required.toml +++ b/conformance/results/zuban/typeddicts_required.toml @@ -3,7 +3,7 @@ errors_diff = """ """ output = """ typeddicts_required.py:12: 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[]" type cannot be nested [misc] -typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [misc] +typeddicts_required.py:16: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:59: error: "Required[]" type cannot be nested [misc] +typeddicts_required.py:60: error: "NotRequired[]" type cannot be nested [misc] """ From f6b4eae962ac3b25250803ec50dd63b066c2354b Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Thu, 9 Oct 2025 17:08:09 -0700 Subject: [PATCH 7/8] Address review comments. --- .../results/mypy/generics_self_advanced.toml | 8 ++++---- .../results/mypy/generics_type_erasure.toml | 14 +++++++------ .../results/pyre/generics_self_advanced.toml | 12 +++++------ .../results/pyre/generics_type_erasure.toml | 20 ++++++++----------- .../pyrefly/generics_type_erasure.toml | 16 +++++++-------- .../pyright/generics_type_erasure.toml | 16 +++++++-------- conformance/results/results.html | 4 ++-- .../results/zuban/generics_self_advanced.toml | 10 ++++++---- .../results/zuban/generics_type_erasure.toml | 18 +++++++++-------- conformance/tests/generics_self_advanced.py | 6 ++---- conformance/tests/generics_type_erasure.py | 6 ++---- 11 files changed, 62 insertions(+), 68 deletions(-) diff --git a/conformance/results/mypy/generics_self_advanced.toml b/conformance/results/mypy/generics_self_advanced.toml index 3a75fda02..92f523341 100644 --- a/conformance/results/mypy/generics_self_advanced.toml +++ b/conformance/results/mypy/generics_self_advanced.toml @@ -8,13 +8,13 @@ Does not retain `Self` when accessing attribute through `type[Self]`. output = """ generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type] generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type] -generics_self_advanced.py:44: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type] -generics_self_advanced.py:47: error: Expression is of type "ChildB", not "Self" [assert-type] +generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type] +generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type] """ conformance_automated = "Fail" errors_diff = """ Line 35: Unexpected errors ['generics_self_advanced.py:35: error: Expression is of type "ChildB", not "Self" [assert-type]'] Line 38: Unexpected errors ['generics_self_advanced.py:38: error: Expression is of type "ChildB", not "Self" [assert-type]'] -Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]'] -Line 47: Unexpected errors ['generics_self_advanced.py:47: error: Expression is of type "ChildB", not "Self" [assert-type]'] +Line 42: Unexpected errors ['generics_self_advanced.py:42: error: Expression is of type "type[ChildB]", not "type[Self]" [assert-type]'] +Line 45: Unexpected errors ['generics_self_advanced.py:45: error: Expression is of type "ChildB", not "Self" [assert-type]'] """ diff --git a/conformance/results/mypy/generics_type_erasure.toml b/conformance/results/mypy/generics_type_erasure.toml index df265bbde..46c739fee 100644 --- a/conformance/results/mypy/generics_type_erasure.toml +++ b/conformance/results/mypy/generics_type_erasure.toml @@ -5,15 +5,17 @@ False negative on instance attribute access on type(node). """ output = """ generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [assert-type] -generics_type_erasure.py:23: error: Expression is of type "Never", not "Any" [assert-type] -generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] -generics_type_erasure.py:42: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-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] -generics_type_erasure.py:46: error: Access to generic instance variables via class is ambiguous [misc] -generics_type_erasure.py:47: error: Access to generic instance variables via class is ambiguous [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 48: Expected 1 errors +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/pyre/generics_self_advanced.toml b/conformance/results/pyre/generics_self_advanced.toml index 7729c370c..f298efb4c 100644 --- a/conformance/results/pyre/generics_self_advanced.toml +++ b/conformance/results/pyre/generics_self_advanced.toml @@ -8,9 +8,9 @@ generics_self_advanced.py:25:7 Undefined or invalid type [11]: Annotation `Self` generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`. generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`. generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`. -generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`. -generics_self_advanced.py:46:8 Assert type [70]: Expected `unknown` but got `typing.Any`. -generics_self_advanced.py:47:8 Assert type [70]: Expected `unknown` but got `ChildB`. +generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`. +generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`. +generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`. """ conformance_automated = "Fail" errors_diff = """ @@ -18,7 +18,7 @@ Line 25: Unexpected errors ['generics_self_advanced.py:25:7 Undefined or invalid Line 35: Unexpected errors ['generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] Line 37: Unexpected errors ['generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] Line 38: Unexpected errors ['generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] -Line 44: Unexpected errors ['generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`.'] -Line 46: Unexpected errors ['generics_self_advanced.py:46:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] -Line 47: Unexpected errors ['generics_self_advanced.py:47:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] +Line 42: Unexpected errors ['generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`.'] +Line 44: Unexpected errors ['generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] +Line 45: Unexpected errors ['generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] """ diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index b14cb7abe..af4f56c41 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -9,25 +9,21 @@ output = """ generics_type_erasure.py:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`. -generics_type_erasure.py:20:0 Assert type [70]: Expected `Node[Never]` but got `Node[Variable[T]]`. -generics_type_erasure.py:22:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`. -generics_type_erasure.py:24:0 Assert type [70]: Expected `Never` but got `typing.Any`. -generics_type_erasure.py:40:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. -generics_type_erasure.py:42:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. -generics_type_erasure.py:58:0 Assert type [70]: Expected `bytes` but got `typing.Any`. +generics_type_erasure.py:21:0 Assert type [70]: 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 Assert type [70]: Expected `bytes` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ +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 -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Lines 19, 20: Expected exactly one error (tag 'any-or-never1') Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] -Line 20: Unexpected errors ['generics_type_erasure.py:20:0 Assert type [70]: Expected `Node[Never]` but got `Node[Variable[T]]`.'] -Line 22: Unexpected errors ['generics_type_erasure.py:22:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`.'] -Line 58: Unexpected errors ['generics_type_erasure.py:58:0 Assert type [70]: Expected `bytes` but got `typing.Any`.'] +Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`.'] +Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Assert type [70]: Expected `bytes` but got `typing.Any`.'] """ diff --git a/conformance/results/pyrefly/generics_type_erasure.toml b/conformance/results/pyrefly/generics_type_erasure.toml index 6b484fa21..efb957387 100644 --- a/conformance/results/pyrefly/generics_type_erasure.toml +++ b/conformance/results/pyrefly/generics_type_erasure.toml @@ -3,13 +3,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR generics_type_erasure.py:20:12-33: assert_type(Node[Any], Node[Never]) failed [assert-type] -ERROR generics_type_erasure.py:24:12-33: assert_type(Any, Never) failed [assert-type] -ERROR generics_type_erasure.py:40:16-18: Argument `Literal['']` is not assignable to parameter `label` with type `int | None` in function `Node.__init__` [bad-argument-type] -ERROR generics_type_erasure.py:42:16-17: Argument `Literal[0]` is not assignable to parameter `label` with type `str | None` in function `Node.__init__` [bad-argument-type] -ERROR generics_type_erasure.py:44:1-16: Generic attribute `label` of class `Node` is not visible on the class [no-access] -ERROR generics_type_erasure.py:45:1-16: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR generics_type_erasure.py:46:1-11: Generic attribute `label` of class `Node` is not visible on the class [no-access] -ERROR generics_type_erasure.py:47:1-11: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] -ERROR generics_type_erasure.py:48:1-15: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:38:16-18: Argument `Literal['']` is not assignable to parameter `label` with type `int | None` in function `Node.__init__` [bad-argument-type] +ERROR generics_type_erasure.py:40:16-17: Argument `Literal[0]` is not assignable to parameter `label` with type `str | None` in function `Node.__init__` [bad-argument-type] +ERROR generics_type_erasure.py:42:1-16: Generic attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:43:1-16: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:44:1-11: Generic attribute `label` of class `Node` is not visible on the class [no-access] +ERROR generics_type_erasure.py:45:1-11: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] +ERROR generics_type_erasure.py:46:1-15: Generic attribute `label` of class `Node` is not visible on the class [missing-attribute] """ diff --git a/conformance/results/pyright/generics_type_erasure.toml b/conformance/results/pyright/generics_type_erasure.toml index aba916ddf..cbbc0d1c6 100644 --- a/conformance/results/pyright/generics_type_erasure.toml +++ b/conformance/results/pyright/generics_type_erasure.toml @@ -1,20 +1,18 @@ conformant = "Pass" output = """ -generics_type_erasure.py:20:13 - error: "assert_type" mismatch: expected "Node[Never]" but received "Node[Unknown]" (reportAssertTypeFailure) -generics_type_erasure.py:24:13 - error: "assert_type" mismatch: expected "Never" but received "Unknown" (reportAssertTypeFailure) -generics_type_erasure.py:40: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 not assignable to type "int | None"     "Literal['']" is not assignable to "int"     "Literal['']" is not assignable to "None" (reportArgumentType) -generics_type_erasure.py:42: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 not assignable to type "str | None"     "Literal[0]" is not assignable to "str"     "Literal[0]" is not assignable to "None" (reportArgumentType) -generics_type_erasure.py:44:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:45:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:46:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:47:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) -generics_type_erasure.py:48: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/results.html b/conformance/results/results.html index 928cb1f23..68b02c4ad 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -322,7 +322,7 @@

Python Type System Conformance Test Results

- + @@ -385,7 +385,7 @@

Python Type System Conformance Test Results

- + diff --git a/conformance/results/zuban/generics_self_advanced.toml b/conformance/results/zuban/generics_self_advanced.toml index cad7a4d67..a6a7caadb 100644 --- a/conformance/results/zuban/generics_self_advanced.toml +++ b/conformance/results/zuban/generics_self_advanced.toml @@ -1,11 +1,13 @@ -conformant = "Pass" +conformant = "Partial" notes = """ -True positive: Writing to a variable that contains Self (with a class) should error +Doesn't allow accessing `Self` in a classmethod """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 43: Unexpected errors ['generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous [misc]'] +Line 44: Unexpected errors ['generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous [misc]'] """ output = """ -generics_self_advanced.py:42: error: Access to generic instance variables via class is ambiguous [misc] generics_self_advanced.py:43: error: Access to generic instance variables via class is ambiguous [misc] +generics_self_advanced.py:44: error: Access to generic instance variables via class is ambiguous [misc] """ diff --git a/conformance/results/zuban/generics_type_erasure.toml b/conformance/results/zuban/generics_type_erasure.toml index 21ebd0b1f..ae8e9d615 100644 --- a/conformance/results/zuban/generics_type_erasure.toml +++ b/conformance/results/zuban/generics_type_erasure.toml @@ -1,18 +1,20 @@ -conformant = "Pass" +conformant = "Partial" notes = """ -True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any) +Infers Node[Never] instead of Node[Any] when argument is not provided. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 19: Unexpected errors ['generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [misc]'] +Line 22: Unexpected errors ['generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [misc]'] """ output = """ generics_type_erasure.py:19: error: Expression is of type "Node[Never]", not "Node[Any]" [misc] -generics_type_erasure.py:23: error: Expression is of type "Never", not "Any" [misc] -generics_type_erasure.py:40: error: Argument 1 to "Node" has incompatible type "str"; expected "int | None" [arg-type] -generics_type_erasure.py:42: error: Argument 1 to "Node" has incompatible type "int"; expected "str | None" [arg-type] +generics_type_erasure.py:22: error: Expression is of type "Never", not "Any" [misc] +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] generics_type_erasure.py:46: error: Access to generic instance variables via class is ambiguous [misc] -generics_type_erasure.py:47: error: Access to generic instance variables via class is ambiguous [misc] -generics_type_erasure.py:48: error: Access to generic instance variables via class is ambiguous [misc] """ diff --git a/conformance/tests/generics_self_advanced.py b/conformance/tests/generics_self_advanced.py index 8eb9a9c15..ef4f6af70 100644 --- a/conformance/tests/generics_self_advanced.py +++ b/conformance/tests/generics_self_advanced.py @@ -39,9 +39,7 @@ def method2(self) -> None: @classmethod def method3(cls) -> None: - a = cls.a # E?: zuban errors on accessing `Self` in a classmethod - a_elem = cls.a[0] # E?: zuban errors on accessing `Self` in a classmethod assert_type(cls, type[Self]) - assert_type(a, list[Self]) - assert_type(a_elem, Self) + assert_type(cls.a, list[Self]) + assert_type(cls.a[0], Self) assert_type(cls.method1(), Self) diff --git a/conformance/tests/generics_type_erasure.py b/conformance/tests/generics_type_erasure.py index 415fa7c07..bfd02f6d7 100644 --- a/conformance/tests/generics_type_erasure.py +++ b/conformance/tests/generics_type_erasure.py @@ -16,12 +16,10 @@ def __init__(self, label: T | None = None) -> None: assert_type(Node(''), Node[str]) assert_type(Node(0), Node[int]) -assert_type(Node(), Node[Any]) # E[any-or-never1] -assert_type(Node(), Node[Never]) # E[any-or-never1] +assert_type(Node(), Node[Any]) assert_type(Node(0).label, int) -assert_type(Node().label, Any) # E[any-or-never2] -assert_type(Node().label, Never) # E[any-or-never2] +assert_type(Node().label, Any) # > In case the inferred type uses [Any] but the intended type is more specific, # > you can use an annotation to force the type of the variable, e.g.: From baf8e338c375d39dddd5b7b288a3b1496c072d82 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Thu, 9 Oct 2025 17:16:14 -0700 Subject: [PATCH 8/8] Remove no-longer-needed import. --- conformance/tests/generics_type_erasure.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/generics_type_erasure.py b/conformance/tests/generics_type_erasure.py index bfd02f6d7..c7462259a 100644 --- a/conformance/tests/generics_type_erasure.py +++ b/conformance/tests/generics_type_erasure.py @@ -1,6 +1,6 @@ # Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#instantiating-generic-classes-and-type-erasure -from typing import Any, Never, TypeVar, Generic, assert_type +from typing import Any, TypeVar, Generic, assert_type T = TypeVar("T")
 
mypy 1.17.1
+
mypy 1.18.2
pyright 1.1.404
+
pyright 1.1.406
pyre 0.9.25
Pass
Unsupported

Does not support generic defaults.

Partial

Does not reject TypeVars with defaults after a TypeVarTuple

Type parameter defaults are not bound by attribute access

ParamSpec after TypeVarTuple is not always handled correctly

Pass*

Unsolved type var is not always resolved to default (optional)

Partial

Defaults are not bound by attribute access

     generics_defaults_referential Partial Pass
     generics_scoping
Partial

False negative on generic class nested within generic class with same type variable.

Pass Pass
Partial

False negative on generic class nested within generic function with same type variable.

False negative on generic class nested within generic class with same type variable.

False negative on assert_type uses.

Partial

False negative on generic class nested within generic class with same type variable.

Pass
Unsupported

Does not understand `Self` type.

Pass
Partial

Does not reject incorrect direct assignment to attribute w/ Self

Pass
     generics_self_basic Pass Pass
Partial

Does not reject protocol compatibility due to method `Self` return type.

Pass
Partial

Protocol subtyping does not work with Self in return annotation

Pass
     generics_self_usage Pass Pass
Partial

False positives on valid type expression (`list[T]`) in `bound`.

Does not complain when bound is used alongside type constraints.

Partial

Does not reject use of type variable within an upper bound.

Partial

Instantiation is not validated against bound

Pass
     generics_variance
Partial

Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

Pass
Partial

Reports error for overloaded method implementation marked @final if its overloads do not.

Does not report error for overloaded @final method defined in stub file.

Reports misleading error when overload is marked @final but implementation is not.

Pass
Partial

Does not ban final decorator on overload when implementation exists

Pass
Class type compatibility @@ -566,7 +566,7 @@

Python Type System Conformance Test Results

Pass
Partial

Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used.

Pass
Partial

LiteralString is sometimes converted to str

Pass
     literals_parameterizations
Partial

Does not reject tuple within Literal.

Pass*

Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

Pass
Partial

Does not report error when calling unimplemented protocol method from derived class.

Does not report error when method is not implemented in derived class.

Pass*

Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

Pass
Unsupported

Does not check against abstract class instantiations

     protocols_generic Pass
Partial

Does not reject the use of Protocol and Generic together as base classes.

Does not detect protocol mismatch when method-scoped TypeVar is used in protocol.

Pass
Partial

Fails one protocol subtyping example involving @property

Pass
     protocols_merging Pass Pass Pass Pass
Partial

Does not check against abstract class instantiations

Pass
     protocols_modules Pass Pass Pass Pass
Partial

Fails some protocol subtyping examples when self is annotated with a type var

Pass
     protocols_subtyping Pass Pass
Unsupported

Does not detect incorrect TypeVar variance within generic protocols.

PassUnknownUnsupported
Callables @@ -677,7 +677,7 @@

Python Type System Conformance Test Results

Pass Pass Pass
Partial

Does not reject overlap between unpacked TypedDict kwarg and named parameters

Pass
     callables_protocol Pass Pass
Partial

Expects @final and @override to be present on all overloads, not just first.

Pass
Partial

Does not restrict some decorators to the first overload

Does not require some decorators that need to appear on every overload

Pass
     overloads_evaluation
Partial

Does not expand boolean arguments to Literal[True] and Literal[False].

Does not expand enum arguments to literal variants.

Does not expand tuple arguments to possible combinations.

Does not evaluate Any in some cases where overload is ambiguous.

Evaluates Any in some cases where overload is not ambiguous.

     dataclasses_match_args Pass
Partial

Generates __match_args__ when match_args=False.

Pass
Partial

Adds kw-only fields to __match_args__.

Pass Pass
     typeddicts_extra_items
Unsupported

Not supported.

Partial

Does not flag illegal use of `closed=False` when inheriting from a non-open TypedDict.

Pass
Unsupported

Not supported.

Pass
Partial

Does not fully support extra_items for typed dicts

Pass
     typeddicts_final Pass
     namedtuples_define_class
Partial

Does not reject override of named tuple attribute in child class.

Pass
Partial

Does not evaluate correct type for indexed named tuple instance with integer.

Does not evaluate correct type for indexed named tuple instance with slice.

Does not report out-of-range index access with named tuple instance.

Does not reject named tuple element with no default value after one with a default.

Incorrectly rejects assignment of named tuple to a tuple with compatible type.

Does not reject attempt to use NamedTuple with multiple inheritance.

Pass
Partial

Does not reject override of named tuple attribute in child class.

Pass
     namedtuples_usage
Partial

Does not reject attempt to delete named tuple field by name.

PassPartialPass Pass Pass
Pass Pass Pass
Partial

Iterating an enum class gives Any

Pass
     enums_definition Pass
Partial

Does not infer the type of an unannotated `self` parameter to be type `Self`.

Does not retain `Self` when calling method that returns `Self`.

Does not infer the type of an unannotated `cls` parameter to be type `type[Self]`.

Does not retain `Self` when accessing attribute through `type[Self]`.

Pass
Partial

Does not handle use of `Self` within class body correctly.

False negatives on assert_type uses.

Pass*

True positive: Writing to a variable that contains Self (with a class) should error

Partial

Doesn't allow accessing `Self` in a classmethod

Pass*

Treats attributes not initialized on the class as instance-only

     generics_self_attributes
Partial

Infers Node[Never] instead of Node[Any] when argument is not provided.

False negative on instance attribute access on type(node).

Pass
Partial

Does not erase unspecified type variables to `Any` prior to `assert_type` handling.

False negatives on instance attribute access on the type.

Does not infer type of `DefaultDict` with explicit type parameters on constructor.

False negatives on assert_type uses.

Pass*

True positive: Undefined type vars should be inferred as Never not Any (avoiding to introduce Any)

Partial

Infers Node[Never] instead of Node[Any] when argument is not provided.

Pass
     generics_typevartuple_args