diff --git a/conformance/results/pyrefly/aliases_explicit.toml b/conformance/results/pyrefly/aliases_explicit.toml index e6476ef7..b56c8707 100644 --- a/conformance/results/pyrefly/aliases_explicit.toml +++ b/conformance/results/pyrefly/aliases_explicit.toml @@ -8,21 +8,21 @@ ERROR aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[GoodType ERROR aliases_explicit.py:69:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] ERROR aliases_explicit.py:70:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] ERROR aliases_explicit.py:71:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] -ERROR aliases_explicit.py:79:21-61: function call cannot be used in annotations [invalid-annotation] -ERROR aliases_explicit.py:80:21-31: list literal cannot be used in annotations [invalid-annotation] -ERROR aliases_explicit.py:81:21-34: tuple literal cannot be used in annotations [invalid-annotation] -ERROR aliases_explicit.py:82:21-44: list comprehension cannot be used in annotations [invalid-annotation] -ERROR aliases_explicit.py:83:21-31: dict literal cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:79:21-61: Function call cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:80:21-31: List literal cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:81:21-34: Tuple literal cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:82:21-44: List comprehension cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:83:21-31: Dict literal cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:83:23-24: Could not find name `a` [unknown-name] ERROR aliases_explicit.py:83:28-29: Could not find name `b` [unknown-name] -ERROR aliases_explicit.py:84:21-36: function call cannot be used in annotations [invalid-annotation] -ERROR aliases_explicit.py:85:21-29: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR aliases_explicit.py:86:21-42: if expression cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:84:21-36: Function call cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:85:21-29: Invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:86:21-42: If expression cannot be used in annotations [invalid-annotation] ERROR aliases_explicit.py:87:21-25: Expected `BadTypeAlias9` to be a type alias, got `Literal[3]` [invalid-type-alias] -ERROR aliases_explicit.py:88:22-26: bool literal cannot be used in annotations [invalid-annotation] -ERROR aliases_explicit.py:89:22-23: number literal cannot be used in annotations [invalid-annotation] -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:88:22-26: Bool literal cannot be used in annotations [invalid-annotation] +ERROR aliases_explicit.py:89:22-23: Number literal cannot be used in annotations [invalid-annotation] +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:102:5-24: `TypeAlias[ListOrSetAlias, 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 db4db25a..0f805c8d 100644 --- a/conformance/results/pyrefly/aliases_recursive.toml +++ b/conformance/results/pyrefly/aliases_recursive.toml @@ -1,17 +1,17 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 19: Expected 1 errors -Line 20: Expected 1 errors -Line 38: Expected 1 errors -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 """ output = """ +ERROR aliases_recursive.py:19:12-29: `dict[str, complex | Json]` is not assignable to `dict[str, Json] | float | int | list[Json] | str | None` [bad-assignment] +ERROR aliases_recursive.py:20:12-19: `list[complex | Json]` is not assignable to `dict[str, Json] | float | int | list[Json] | str | None` [bad-assignment] +ERROR aliases_recursive.py:38:22-50: `tuple[Literal[1], tuple[Literal['1'], Literal[1]], tuple[Literal[1], tuple[Literal[1], list[int]]]]` is not assignable to `int | str | tuple[RecursiveTuple, ...]` [bad-assignment] +ERROR aliases_recursive.py:39:22-30: `tuple[Literal[1], list[int]]` is not assignable to `int | str | tuple[RecursiveTuple, ...]` [bad-assignment] +ERROR aliases_recursive.py:50:24-34: `dict[str, list[int]]` is not assignable to `Mapping[str, RecursiveMapping] | int | str` [bad-assignment] +ERROR aliases_recursive.py:51:24-55: `dict[str, list[int] | RecursiveMapping]` is not assignable to `Mapping[str, RecursiveMapping] | int | str` [bad-assignment] +ERROR aliases_recursive.py:52:24-83: `dict[str, dict[str, list[int] | RecursiveMapping] | RecursiveMapping]` is not assignable to `Mapping[str, RecursiveMapping] | int | str` [bad-assignment] +ERROR aliases_recursive.py:63:30-43: `list[list[float] | str | GenericTypeAlias1[str]]` is not assignable to `list[str | GenericTypeAlias1[str]]` [bad-assignment] +ERROR aliases_recursive.py:69:35-64: `list[int | list[int | list[int | list[float] | str | GenericTypeAlias2[str, int]] | str | GenericTypeAlias2[str, int]] | str | GenericTypeAlias2[str, int]]` is not assignable to `list[int | str | GenericTypeAlias2[str, int]]` [bad-assignment] +ERROR aliases_recursive.py:72:29-57: Found cyclic self-reference in `RecursiveUnion` [invalid-type-alias] +ERROR aliases_recursive.py:75:31-61: Found cyclic self-reference in `MutualReference1` [invalid-type-alias] """ diff --git a/conformance/results/pyrefly/aliases_type_statement.toml b/conformance/results/pyrefly/aliases_type_statement.toml index 7d23523e..b5846841 100644 --- a/conformance/results/pyrefly/aliases_type_statement.toml +++ b/conformance/results/pyrefly/aliases_type_statement.toml @@ -1,14 +1,6 @@ -conformant = "Partial" -notes = """ -Does not reject redeclaration of type alias with the same name. -Does not detect circular definitions. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 82: Expected 1 errors -Line 84: Expected 1 errors -Lines 51, 52: Expected error (tag 'TA14') -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] @@ -16,24 +8,28 @@ ERROR aliases_type_statement.py:19:1-11: Expected a callable, got `TypeAlias[Goo 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] -ERROR aliases_type_statement.py:39:22-35: tuple literal cannot be used in annotations [invalid-annotation] -ERROR aliases_type_statement.py:40:22-45: list comprehension cannot be used in annotations [invalid-annotation] -ERROR aliases_type_statement.py:41:22-32: dict literal cannot be used in annotations [invalid-annotation] +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] +ERROR aliases_type_statement.py:39:22-35: Tuple literal cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:40:22-45: List comprehension cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:41:22-32: Dict literal cannot be used in annotations [invalid-annotation] ERROR aliases_type_statement.py:41:24-25: Could not find name `a` [unknown-name] ERROR aliases_type_statement.py:41:29-30: Could not find name `b` [unknown-name] -ERROR aliases_type_statement.py:42:22-37: function call cannot be used in annotations [invalid-annotation] -ERROR aliases_type_statement.py:43:22-30: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR aliases_type_statement.py:44:22-43: if expression cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:42:22-37: Function call cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:43:22-30: Invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:44:22-43: If expression cannot be used in annotations [invalid-annotation] ERROR aliases_type_statement.py:45:22-26: Expected `BadTypeAlias9` to be a type alias, got `Literal[1]` [invalid-type-alias] -ERROR aliases_type_statement.py:46:23-27: bool literal cannot be used in annotations [invalid-annotation] -ERROR aliases_type_statement.py:47:23-24: number literal cannot be used in annotations [invalid-annotation] -ERROR aliases_type_statement.py:48:23-34: boolean operation cannot be used in annotations [invalid-annotation] -ERROR aliases_type_statement.py:49:23-33: f-string cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:46:23-27: Bool literal cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:47:23-24: Number literal cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:48:23-34: Boolean operation cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:49:23-33: F-string cannot be used in annotations [invalid-annotation] +ERROR aliases_type_statement.py:52:6-20: Cannot redefine existing type alias `BadTypeAlias14` [redefinition] ERROR aliases_type_statement.py:56:5-30: `type` statement is not allowed in this context [invalid-syntax] ERROR aliases_type_statement.py:62:15-25: Type parameters used in `TA1` but not declared [invalid-type-var] ERROR aliases_type_statement.py:67:12-20: Type parameters used in `TA2` but not declared [invalid-type-var] ERROR aliases_type_statement.py:77:7-41: `str` is not assignable to upper bound `int` of type variable `S` [bad-specialization] ERROR aliases_type_statement.py:79:7-41: `int` is not assignable to upper bound `str` of type variable `T` [bad-specialization] +ERROR aliases_type_statement.py:82:28-47: Found cyclic self-reference in `RecursiveTypeAlias3` [invalid-type-alias] +ERROR aliases_type_statement.py:84:31-59: Found cyclic self-reference in `RecursiveTypeAlias4` [invalid-type-alias] +ERROR aliases_type_statement.py:89:28-47: Found cyclic self-reference in `RecursiveTypeAlias7` [invalid-type-alias] """ diff --git a/conformance/results/pyrefly/aliases_typealiastype.toml b/conformance/results/pyrefly/aliases_typealiastype.toml index 3a09d2cd..ff8d0590 100644 --- a/conformance/results/pyrefly/aliases_typealiastype.toml +++ b/conformance/results/pyrefly/aliases_typealiastype.toml @@ -4,30 +4,31 @@ Does not detect circular definitions. """ conformance_automated = "Fail" errors_diff = """ -Line 46: Expected 1 errors -Line 47: Expected 1 errors Line 48: Expected 1 errors Line 66: Expected 1 errors """ output = """ ERROR aliases_typealiastype.py:32:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] ERROR aliases_typealiastype.py:40:5-30: `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` [invalid-type-alias] -ERROR aliases_typealiastype.py:44:40-47: Type variable `S` is out of scope for this `TypeAliasType` [invalid-type-alias] +ERROR aliases_typealiastype.py:43:13-66: Type variable `S` is out of scope for this `TypeAliasType` [invalid-type-alias] +ERROR aliases_typealiastype.py:44:13-48: Type variable `S` is out of scope for this `TypeAliasType` [invalid-type-alias] ERROR aliases_typealiastype.py:45:45-65: Value for argument `type_params` must be a tuple literal [invalid-type-alias] -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:46:41-50: Found cyclic self-reference in `BadAlias4` [invalid-type-alias] +ERROR aliases_typealiastype.py:47:40-60: Found cyclic self-reference in `BadAlias5` [invalid-type-alias] +ERROR aliases_typealiastype.py:49:40-49: Found cyclic self-reference in `BadAlias7` [invalid-type-alias] +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: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]` [invalid-type-alias] -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] +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/aliases_variance.toml b/conformance/results/pyrefly/aliases_variance.toml index bd3d6dcd..95a6d949 100644 --- a/conformance/results/pyrefly/aliases_variance.toml +++ b/conformance/results/pyrefly/aliases_variance.toml @@ -1,10 +1,10 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 24: Expected 1 errors -Line 28: Expected 1 errors -Line 32: Expected 1 errors -Line 44: Expected 1 errors """ output = """ +ERROR aliases_variance.py:24:16-28: Type variable `T_co` is Covariant but is used in invariant position [invalid-variance] +ERROR aliases_variance.py:28:16-31: Type variable `T_co` is Covariant but is used in invariant position [invalid-variance] +ERROR aliases_variance.py:32:16-31: Type variable `T_co` is Covariant but is used in invariant position [invalid-variance] +ERROR aliases_variance.py:44:16-41: Type variable `T_contra` is Contravariant but is used in invariant position [invalid-variance] """ diff --git a/conformance/results/pyrefly/annotations_forward_refs.toml b/conformance/results/pyrefly/annotations_forward_refs.toml index fc48f82b..77859140 100644 --- a/conformance/results/pyrefly/annotations_forward_refs.toml +++ b/conformance/results/pyrefly/annotations_forward_refs.toml @@ -5,26 +5,26 @@ Does not reject some type forms that require quotes. """ conformance_automated = "Fail" errors_diff = """ -Line 24: Expected 1 errors -Line 25: Expected 1 errors Line 87: Unexpected errors ['Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type]'] Line 96: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] """ output = """ -ERROR annotations_forward_refs.py:41:10-50: function call cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:42:10-20: list literal cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:43:10-20: tuple literal cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:44:10-33: list comprehension cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:45:10-12: dict literal cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:46:10-26: function call cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:47:10-18: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:48:10-31: if expression cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:24:7-21: `|` union syntax does not work with string literals [invalid-annotation] +ERROR annotations_forward_refs.py:25:7-21: `|` union syntax does not work with string literals [invalid-annotation] +ERROR annotations_forward_refs.py:41:10-50: Function call cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:42:10-20: List literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:43:10-20: Tuple literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:44:10-33: List comprehension cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:45:10-12: Dict literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:46:10-26: Function call cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:47:10-18: Invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:48:10-31: If expression cannot be used in annotations [invalid-annotation] ERROR annotations_forward_refs.py:49:10-14: Expected a type form, got instance of `Literal[1]` [not-a-type] -ERROR annotations_forward_refs.py:50:11-15: bool literal cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:51:11-12: number literal cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:52:11-13: unary operation cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:53:11-21: boolean operation cannot be used in annotations [invalid-annotation] -ERROR annotations_forward_refs.py:54:11-17: f-string cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:50:11-15: Bool literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:51:11-12: Number literal cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:52:11-13: Unary operation cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:53:11-21: Boolean operation cannot be used in annotations [invalid-annotation] +ERROR annotations_forward_refs.py:54:11-17: F-string cannot be used in annotations [invalid-annotation] ERROR annotations_forward_refs.py:55:11-16: Expected a type form, got instance of `Module[types]` [not-a-type] ERROR annotations_forward_refs.py:80:14-20: Could not find name `ClassF` [unknown-name] ERROR annotations_forward_refs.py:87:9-12: Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type] diff --git a/conformance/results/pyrefly/annotations_typeexpr.toml b/conformance/results/pyrefly/annotations_typeexpr.toml index 3411fda3..16dd4131 100644 --- a/conformance/results/pyrefly/annotations_typeexpr.toml +++ b/conformance/results/pyrefly/annotations_typeexpr.toml @@ -3,19 +3,19 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR annotations_typeexpr.py:88:9-49: function call cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:89:9-19: list literal cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:90:9-19: tuple literal cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:91:9-32: list comprehension cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:92:9-11: dict literal cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:93:9-24: function call cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:94:9-17: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:95:9-30: if expression cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:88:9-49: Function call cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:89:9-19: List literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:90:9-19: Tuple literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:91:9-32: List comprehension cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:92:9-11: Dict literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:93:9-24: Function call cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:94:9-17: Invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:95:9-30: If expression cannot be used in annotations [invalid-annotation] ERROR annotations_typeexpr.py:96:9-13: Expected a type form, got instance of `Literal[3]` [not-a-type] -ERROR annotations_typeexpr.py:97:10-14: bool literal cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:98:10-11: number literal cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:99:10-12: unary operation cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:100:10-20: boolean operation cannot be used in annotations [invalid-annotation] -ERROR annotations_typeexpr.py:101:10-16: f-string cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:97:10-14: Bool literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:98:10-11: Number literal cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:99:10-12: Unary operation cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:100:10-20: Boolean operation cannot be used in annotations [invalid-annotation] +ERROR annotations_typeexpr.py:101:10-16: F-string cannot be used in annotations [invalid-annotation] ERROR annotations_typeexpr.py:102:10-15: Expected a type form, got instance of `Module[types]` [not-a-type] """ diff --git a/conformance/results/pyrefly/classes_classvar.toml b/conformance/results/pyrefly/classes_classvar.toml index c33207e4..551f730b 100644 --- a/conformance/results/pyrefly/classes_classvar.toml +++ b/conformance/results/pyrefly/classes_classvar.toml @@ -4,7 +4,7 @@ errors_diff = """ """ output = """ ERROR classes_classvar.py:38:11-29: Expected 1 type argument for `ClassVar`, got 2 [invalid-annotation] -ERROR classes_classvar.py:39:14-15: number literal cannot be used in annotations [invalid-annotation] +ERROR classes_classvar.py:39:14-15: Number literal cannot be used in annotations [invalid-annotation] ERROR classes_classvar.py:40:14-17: Could not find name `var` [unknown-name] ERROR classes_classvar.py:45:20-21: `ClassVar` arguments may not contain any type variables [invalid-annotation] ERROR classes_classvar.py:46:20-27: `ClassVar` arguments may not contain any type variables [invalid-annotation] diff --git a/conformance/results/pyrefly/constructors_call_init.toml b/conformance/results/pyrefly/constructors_call_init.toml index 01d35f16..05593e0a 100644 --- a/conformance/results/pyrefly/constructors_call_init.toml +++ b/conformance/results/pyrefly/constructors_call_init.toml @@ -1,14 +1,11 @@ -conformant = "Partial" -notes = """ -Does not reject class-scoped type var in self param annotation -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 107: Expected 1 errors """ output = """ ERROR constructors_call_init.py:21:13-16: Argument `float` is not assignable to parameter `x` with type `int` in function `Class1.__init__` [bad-argument-type] ERROR constructors_call_init.py:42:8-20: Argument `Class2[@_]` is not assignable to parameter `x` with type `Class3 | None` in function `Class2.__init__` [bad-argument-type] ERROR constructors_call_init.py:56:12-14: Argument `Class4[str]` is not assignable to parameter `self` with type `Class4[int]` in function `Class4.__init__` [bad-argument-type] +ERROR constructors_call_init.py:107:9-17: `__init__` method self type cannot reference class type parameters `T2`, `T1` [invalid-annotation] ERROR constructors_call_init.py:130:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] """ diff --git a/conformance/results/pyrefly/constructors_call_type.toml b/conformance/results/pyrefly/constructors_call_type.toml index 149cd688..fd4d14c6 100644 --- a/conformance/results/pyrefly/constructors_call_type.toml +++ b/conformance/results/pyrefly/constructors_call_type.toml @@ -1,13 +1,6 @@ -conformant = "Partial" -notes = """ -Does not check TypeVar type constructor using upper bound's __new__ -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 64: Expected 1 errors -Line 72: Expected 1 errors -Line 81: Expected 1 errors -Line 82: Expected 1 errors """ output = """ ERROR constructors_call_type.py:30:8-10: Missing argument `x` in function `Meta1.__call__` [missing-argument] @@ -17,4 +10,9 @@ ERROR constructors_call_type.py:40:8-10: Missing argument `y` in function `Class ERROR constructors_call_type.py:50:8-10: Missing argument `x` in function `Class3.__init__` [missing-argument] ERROR constructors_call_type.py:50:8-10: Missing argument `y` in function `Class3.__init__` [missing-argument] ERROR constructors_call_type.py:59:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] +ERROR constructors_call_type.py:64:9-10: Expected 0 positional arguments, got 1 [bad-argument-count] +ERROR constructors_call_type.py:72:8-10: Missing argument `x` in function `Meta1.__call__` [missing-argument] +ERROR constructors_call_type.py:72:8-10: Missing argument `y` in function `Meta1.__call__` [missing-argument] +ERROR constructors_call_type.py:81:8-11: Missing argument `y` in function `Class2.__new__` [missing-argument] +ERROR constructors_call_type.py:82:12-13: Argument `Literal[2]` is not assignable to parameter `y` with type `str` in function `Class2.__new__` [bad-argument-type] """ diff --git a/conformance/results/pyrefly/constructors_callable.toml b/conformance/results/pyrefly/constructors_callable.toml index d3200470..2bc52252 100644 --- a/conformance/results/pyrefly/constructors_callable.toml +++ b/conformance/results/pyrefly/constructors_callable.toml @@ -6,14 +6,9 @@ Converting constructor to callable uses __new__ signature instead of __init__ """ conformance_automated = "Fail" errors_diff = """ -Line 66: Expected 1 errors -Line 67: Expected 1 errors -Line 68: Expected 1 errors Line 186: Expected 1 errors Line 197: Expected 1 errors -Line 63: Unexpected errors ['Argument `type[Class3]` is not assignable to parameter `cb` with type `(*args: Unknown, **kwargs: Unknown) -> Class3` in function `accepts_callable` [bad-argument-type]'] -Line 166: Unexpected errors ['assert_type(Class7[Any], Class7[int]) failed [assert-type]'] -Line 167: Unexpected errors ['assert_type(Class7[Any], Class7[str]) failed [assert-type]', "Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type]"] +Line 167: Unexpected errors ['assert_type(Class7[int], Class7[str]) failed [assert-type]', "Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type]"] Line 185: Unexpected errors ['assert_type(Class8[Any], Class8[str]) failed [assert-type]'] """ output = """ @@ -21,14 +16,16 @@ 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] ERROR constructors_callable.py:51:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR constructors_callable.py:63: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] +ERROR constructors_callable.py:66:3-5: Missing argument `x` [missing-argument] +ERROR constructors_callable.py:67:3-8: Missing argument `x` [missing-argument] +ERROR constructors_callable.py:67:4-5: Unexpected keyword argument `y` [unexpected-keyword] +ERROR constructors_callable.py:68:7-8: Expected 1 positional argument, got 2 [bad-argument-count] ERROR constructors_callable.py:81:3-5: Missing argument `x` [missing-argument] ERROR constructors_callable.py:82:3-8: Missing argument `x` [missing-argument] ERROR constructors_callable.py:82:4-5: Unexpected keyword argument `y` [unexpected-keyword] ERROR constructors_callable.py:129:4-5: Expected 0 positional arguments, got 1 [bad-argument-count] ERROR constructors_callable.py:146:8-9: Expected 0 positional arguments, got 1 [bad-argument-count] -ERROR constructors_callable.py:166:12-32: assert_type(Class7[Any], Class7[int]) failed [assert-type] -ERROR constructors_callable.py:167:12-33: assert_type(Class7[Any], Class7[str]) failed [assert-type] +ERROR constructors_callable.py:167:12-33: assert_type(Class7[int], Class7[str]) failed [assert-type] ERROR constructors_callable.py:167:16-18: Argument `Literal['']` is not assignable to parameter `x` with type `int` [bad-argument-type] ERROR constructors_callable.py:185:12-41: assert_type(Class8[Any], Class8[str]) failed [assert-type] """ diff --git a/conformance/results/pyrefly/dataclasses_descriptors.toml b/conformance/results/pyrefly/dataclasses_descriptors.toml index 5dd3ce5b..e2ae83bf 100644 --- a/conformance/results/pyrefly/dataclasses_descriptors.toml +++ b/conformance/results/pyrefly/dataclasses_descriptors.toml @@ -5,16 +5,16 @@ notes = """ """ conformance_automated = "Fail" errors_diff = """ -Line 32: Unexpected errors ['Data descriptor `y` has incompatible default: `__get__` returns `Desc1 | int` which is not assignable to `__set__` value type `int`. The class-level descriptor value cannot be used as a default. [bad-class-definition]'] -Line 58: Unexpected errors ['Non-data descriptor `z` in dataclass is unsound. The dataclass __init__ writes to the instance dict, shadowing the descriptor. Add a __set__ method to make it a data descriptor. [bad-class-definition]'] +Line 32: Unexpected errors ['Cannot set field `y` to data descriptor `Desc1` with inconsistent types [bad-class-definition]'] +Line 58: Unexpected errors ['Cannot set field `z` to non-data descriptor `Desc2` [bad-class-definition]'] Line 61: Unexpected errors ['assert_type(Desc2[int], list[int]) failed [assert-type]'] Line 62: Unexpected errors ['assert_type(Desc2[str], list[str]) failed [assert-type]'] Line 66: Unexpected errors ['assert_type(Desc2[int], int) failed [assert-type]'] Line 67: Unexpected errors ['assert_type(Desc2[str], str) failed [assert-type]'] """ output = """ -ERROR dataclasses_descriptors.py:32:5-6: Data descriptor `y` has incompatible default: `__get__` returns `Desc1 | int` which is not assignable to `__set__` value type `int`. The class-level descriptor value cannot be used as a default. [bad-class-definition] -ERROR dataclasses_descriptors.py:58:5-6: Non-data descriptor `z` in dataclass is unsound. The dataclass __init__ writes to the instance dict, shadowing the descriptor. Add a __set__ method to make it a data descriptor. [bad-class-definition] +ERROR dataclasses_descriptors.py:32:5-6: Cannot set field `y` to data descriptor `Desc1` with inconsistent types [bad-class-definition] +ERROR dataclasses_descriptors.py:58:5-6: Cannot set field `z` to non-data descriptor `Desc2` [bad-class-definition] ERROR dataclasses_descriptors.py:61:12-30: assert_type(Desc2[int], list[int]) failed [assert-type] ERROR dataclasses_descriptors.py:62:12-30: assert_type(Desc2[str], list[str]) failed [assert-type] ERROR dataclasses_descriptors.py:66:12-24: assert_type(Desc2[int], int) failed [assert-type] diff --git a/conformance/results/pyrefly/dataclasses_postinit.toml b/conformance/results/pyrefly/dataclasses_postinit.toml index 5e94c099..45efdbd1 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: 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 `(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: 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 `(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/enums_members.toml b/conformance/results/pyrefly/enums_members.toml index d88831c9..491f60a2 100644 --- a/conformance/results/pyrefly/enums_members.toml +++ b/conformance/results/pyrefly/enums_members.toml @@ -8,7 +8,7 @@ ERROR enums_members.py:82:20-34: `Pet4.converter` is not a valid enum member [in ERROR enums_members.py:83:20-34: `Pet4.transform` is not a valid enum member [invalid-literal] ERROR enums_members.py:84:18-30: `Pet4.species` is not a valid enum member [invalid-literal] ERROR enums_members.py:85:16-26: `Pet4.speak` is not a valid enum member [invalid-literal] -ERROR enums_members.py:116:12-43: assert_type(nonmember[int], Any) failed [assert-type] +ERROR enums_members.py:116:12-43: assert_type(int, Any) failed [assert-type] ERROR enums_members.py:116:32-41: `Example.b` is not a valid enum member [invalid-literal] 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] diff --git a/conformance/results/pyrefly/generics_base_class.toml b/conformance/results/pyrefly/generics_base_class.toml index 3c9ace88..b1434372 100644 --- a/conformance/results/pyrefly/generics_base_class.toml +++ b/conformance/results/pyrefly/generics_base_class.toml @@ -1,10 +1,6 @@ -conformant = "Partial" -notes = """ -Does not reject inconsistent ordering of type variables in different base classes. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 98: Expected 1 errors """ output = """ ERROR generics_base_class.py:26:26-27: Argument `SymbolTable` is not assignable to parameter `x` with type `dict[str, list[object]]` in function `takes_dict_incorrect` [bad-argument-type] @@ -13,4 +9,5 @@ ERROR generics_base_class.py:30:8-15: Expected a type argument for `Generic` [in ERROR generics_base_class.py:49:22-42: Expected 1 type argument for `LinkedList`, got 2 [bad-specialization] ERROR generics_base_class.py:61:18-34: Expected 1 type argument for `MyDict`, got 2 [bad-specialization] ERROR generics_base_class.py:68:28-29: Duplicated type parameter declaration `T` [invalid-inheritance] +ERROR generics_base_class.py:98:7-15: Class `BadChild` has inconsistent type arguments for base class `Grandparent`: `Grandparent[T1, T2]` and `Grandparent[T2, T1]` [invalid-inheritance] """ diff --git a/conformance/results/pyrefly/generics_self_usage.toml b/conformance/results/pyrefly/generics_self_usage.toml index fc359e78..7505dd88 100644 --- a/conformance/results/pyrefly/generics_self_usage.toml +++ b/conformance/results/pyrefly/generics_self_usage.toml @@ -4,17 +4,19 @@ Does not implement some restrictions on where Self can be used """ conformance_automated = "Fail" errors_diff = """ -Line 73: Expected 1 errors -Line 76: Expected 1 errors Line 82: Expected 1 errors Line 87: Expected 1 errors -Line 103: Expected 1 errors -Line 108: Expected 1 errors -Line 113: Expected 1 errors -Line 118: Expected 1 errors -Line 123: Expected 1 errors -Line 127: Expected 1 errors """ output = """ +ERROR generics_self_usage.py:73:14-18: `Self` must appear within a class [invalid-annotation] +ERROR generics_self_usage.py:73:23-27: `Self` must appear within a class [invalid-annotation] +ERROR generics_self_usage.py:76:6-10: `Self` must appear within a class [invalid-annotation] +ERROR generics_self_usage.py:103:15-19: `Self` must appear within a class [invalid-annotation] +ERROR generics_self_usage.py:105:12-16: `Self` must appear within a class [invalid-annotation] ERROR generics_self_usage.py:105:12-16: Invalid base class: `Self` [invalid-inheritance] +ERROR generics_self_usage.py:108:30-34: `Self` must appear within a class [invalid-annotation] +ERROR generics_self_usage.py:113:9-13: `Self` cannot be used in a static method [invalid-annotation] +ERROR generics_self_usage.py:118:9-25: `Self` cannot be used in a static method [invalid-annotation] +ERROR generics_self_usage.py:123:37-41: `Self` cannot be used in a metaclass [invalid-annotation] +ERROR generics_self_usage.py:127:42-46: `Self` cannot be used in a metaclass [invalid-annotation] """ diff --git a/conformance/results/pyrefly/generics_variance.toml b/conformance/results/pyrefly/generics_variance.toml index e1eb80ee..5469aad4 100644 --- a/conformance/results/pyrefly/generics_variance.toml +++ b/conformance/results/pyrefly/generics_variance.toml @@ -1,19 +1,19 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 77: Expected 1 errors -Line 81: Expected 1 errors -Line 93: Expected 1 errors -Line 105: Expected 1 errors -Line 113: Expected 1 errors -Line 163: Expected 1 errors -Line 167: Expected 1 errors -Line 191: Expected 1 errors -Lines 125, 126: Expected error (tag 'CoContra_Child2') -Lines 131, 132: Expected error (tag 'CoContra_Child3') -Lines 141, 142: Expected error (tag 'CoContra_Child5') -Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') """ output = """ ERROR generics_variance.py:14:36-54: Contradictory variance specifications [invalid-type-var] +ERROR generics_variance.py:77:14-23: Type variable `T_co` is Covariant but is used in invariant position [invalid-variance] +ERROR generics_variance.py:81:14-27: Type variable `T_contra` is Contravariant but is used in invariant position [invalid-variance] +ERROR generics_variance.py:93:17-29: Type variable `T_contra` is Contravariant but is used in covariant position [invalid-variance] +ERROR generics_variance.py:105:21-33: Type variable `T_co` is Covariant but is used in contravariant position [invalid-variance] +ERROR generics_variance.py:113:21-37: Type variable `T_co` is Covariant but is used in contravariant position [invalid-variance] +ERROR generics_variance.py:126:5-25: Type variable `T_co` is Covariant but is used in contravariant position [invalid-variance] +ERROR generics_variance.py:132:5-33: Type variable `T_contra` is Contravariant but is used in covariant position [invalid-variance] +ERROR generics_variance.py:142:5-33: Type variable `T_co` is Covariant but is used in contravariant position [invalid-variance] +ERROR generics_variance.py:163:26-54: Type variable `T_contra` is Contravariant but is used in covariant position [invalid-variance] +ERROR generics_variance.py:167:30-58: Type variable `T_co` is Covariant but is used in contravariant position [invalid-variance] +ERROR generics_variance.py:191:33-70: Type variable `T_contra` is Contravariant but is used in covariant position [invalid-variance] +ERROR generics_variance.py:196:5-42: Type variable `T_co` is Covariant but is used in contravariant position [invalid-variance] """ diff --git a/conformance/results/pyrefly/protocols_class_objects.toml b/conformance/results/pyrefly/protocols_class_objects.toml index e18c3614..1dc760ac 100644 --- a/conformance/results/pyrefly/protocols_class_objects.toml +++ b/conformance/results/pyrefly/protocols_class_objects.toml @@ -1,17 +1,14 @@ -conformant = "Partial" -notes = """ -Does not require concrete classes to be passed to type[Proto] -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 104: Expected 1 errors -Line 106: Expected 1 errors -Line 107: Expected 1 errors -Line 108: Expected 1 errors """ output = """ ERROR protocols_class_objects.py:29:5-10: Argument `type[Proto]` is not assignable to parameter `cls` with type `type[Proto]` in function `fun` [bad-argument-type] ERROR protocols_class_objects.py:34:7-12: `type[Proto]` is not assignable to variable `var` with type `type[Proto]` [bad-assignment] ERROR protocols_class_objects.py:58:16-25: `type[ConcreteA]` is not assignable to `ProtoA1` [bad-assignment] ERROR protocols_class_objects.py:74:16-25: `type[ConcreteB]` is not assignable to `ProtoB1` [bad-assignment] +ERROR protocols_class_objects.py:104:16-26: `type[ConcreteC1]` is not assignable to `ProtoC1` [bad-assignment] +ERROR protocols_class_objects.py:106:16-26: `type[ConcreteC2]` is not assignable to `ProtoC1` [bad-assignment] +ERROR protocols_class_objects.py:107:16-26: `type[ConcreteC2]` is not assignable to `ProtoC2` [bad-assignment] +ERROR protocols_class_objects.py:108:16-26: `type[ConcreteC3]` is not assignable to `ProtoC1` [bad-assignment] """ diff --git a/conformance/results/pyrefly/protocols_definition.toml b/conformance/results/pyrefly/protocols_definition.toml index d2dd01e6..766d78c3 100644 --- a/conformance/results/pyrefly/protocols_definition.toml +++ b/conformance/results/pyrefly/protocols_definition.toml @@ -1,19 +1,14 @@ -conformant = "Partial" -notes = """ -Incorrectly handles some ClassVar examples in Protocol subtyping -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 116: Expected 1 errors -Line 117: Expected 1 errors -Line 79: Unexpected errors ['`Concrete` is not assignable to `Template` [bad-assignment]'] """ output = """ ERROR protocols_definition.py:30:11-14: Argument `list[int]` is not assignable to parameter `things` with type `Iterable[SupportsClose]` in function `close_all` [bad-argument-type] -ERROR protocols_definition.py:67:14-18: Instance or class variables within a Protocol class must be explicitly declared within the class body [protocol-implicitly-defined-attribute] -ERROR protocols_definition.py:79:17-38: `Concrete` is not assignable to `Template` [bad-assignment] +ERROR protocols_definition.py:67:14-18: Protocol variables must be explicitly declared in the class body [protocol-implicitly-defined-attribute] ERROR protocols_definition.py:114:22-38: `Concrete2_Bad1` is not assignable to `Template2` [bad-assignment] ERROR protocols_definition.py:115:22-38: `Concrete2_Bad2` is not assignable to `Template2` [bad-assignment] +ERROR protocols_definition.py:116:22-38: `Concrete2_Bad3` is not assignable to `Template2` [bad-assignment] +ERROR protocols_definition.py:117:22-38: `Concrete2_Bad4` is not assignable to `Template2` [bad-assignment] ERROR protocols_definition.py:156:22-38: `Concrete3_Bad1` is not assignable to `Template3` [bad-assignment] ERROR protocols_definition.py:157:22-38: `Concrete3_Bad2` is not assignable to `Template3` [bad-assignment] ERROR protocols_definition.py:158:22-38: `Concrete3_Bad3` is not assignable to `Template3` [bad-assignment] diff --git a/conformance/results/pyrefly/protocols_variance.toml b/conformance/results/pyrefly/protocols_variance.toml index 635689e8..b91c48ca 100644 --- a/conformance/results/pyrefly/protocols_variance.toml +++ b/conformance/results/pyrefly/protocols_variance.toml @@ -1,13 +1,13 @@ -conformant = "Unsupported" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 21: Expected 1 errors -Line 40: Expected 1 errors -Line 56: Expected 1 errors -Line 66: Expected 1 errors -Line 104: Expected 1 errors -Lines 61, 62: Expected error (tag 'covariant_in_input') -Lines 71, 72: Expected error (tag 'contravariant_in_output') """ output = """ + WARN protocols_variance.py:21:7-17: Type variable `T1` in class `AnotherBox` is declared as invariant, but could be covariant based on its usage [variance-mismatch] + WARN protocols_variance.py:40:7-16: Type variable `T3` in class `Protocol2` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] + WARN protocols_variance.py:56:7-16: Type variable `T1` in class `Protocol4` is declared as invariant, but could be contravariant based on its usage [variance-mismatch] +ERROR protocols_variance.py:62:9-11: Type variable `T1_co` is Covariant but is used in contravariant position [invalid-variance] + WARN protocols_variance.py:66:7-16: Type variable `T1` in class `Protocol6` is declared as invariant, but could be covariant based on its usage [variance-mismatch] +ERROR protocols_variance.py:72:9-11: Type variable `T1_contra` is Contravariant but is used in covariant position [invalid-variance] + WARN protocols_variance.py:104:7-17: Type variable `T1` in class `Protocol12` is declared as invariant, but could be covariant based on its usage [variance-mismatch] """ diff --git a/conformance/results/pyrefly/qualifiers_annotated.toml b/conformance/results/pyrefly/qualifiers_annotated.toml index 6b383cda..692aad31 100644 --- a/conformance/results/pyrefly/qualifiers_annotated.toml +++ b/conformance/results/pyrefly/qualifiers_annotated.toml @@ -12,20 +12,20 @@ Line 87: Expected 1 errors Line 88: Expected 1 errors """ output = """ -ERROR qualifiers_annotated.py:38:17-27: list literal cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:39:17-30: tuple literal cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:40:17-40: list comprehension cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:41:17-27: dict literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:38:17-27: List literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:39:17-30: Tuple literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:40:17-40: List comprehension cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:41:17-27: Dict literal cannot be used in annotations [invalid-annotation] ERROR qualifiers_annotated.py:41:19-20: Could not find name `a` [unknown-name] ERROR qualifiers_annotated.py:41:24-25: Could not find name `b` [unknown-name] -ERROR qualifiers_annotated.py:42:17-32: function call cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:43:17-25: invalid subscript expression cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:44:17-38: if expression cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:42:17-32: Function call cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:43:17-25: Invalid subscript expression cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:44:17-38: If expression cannot be used in annotations [invalid-annotation] ERROR qualifiers_annotated.py:45:17-21: Could not find name `var1` [unknown-name] -ERROR qualifiers_annotated.py:46:17-21: bool literal cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:47:18-19: number literal cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:48:18-29: boolean operation cannot be used in annotations [invalid-annotation] -ERROR qualifiers_annotated.py:49:18-28: f-string cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:46:17-21: Bool literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:47:18-19: Number literal cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:48:18-29: Boolean operation cannot be used in annotations [invalid-annotation] +ERROR qualifiers_annotated.py:49:18-28: F-string cannot be used in annotations [invalid-annotation] ERROR qualifiers_annotated.py:59:8-22: `Annotated` needs at least one piece of metadata in addition to the type [invalid-annotation] ERROR qualifiers_annotated.py:86:1-10: Expected a callable, got `type[Annotated]` [not-callable] """ diff --git a/conformance/results/pyrefly/qualifiers_final_annotation.toml b/conformance/results/pyrefly/qualifiers_final_annotation.toml index a2e7f1d2..b29ac8ce 100644 --- a/conformance/results/pyrefly/qualifiers_final_annotation.toml +++ b/conformance/results/pyrefly/qualifiers_final_annotation.toml @@ -7,8 +7,6 @@ errors_diff = """ Line 34: Expected 1 errors Line 38: Expected 1 errors Line 107: Expected 1 errors -Line 166: Expected 1 errors -Line 170: Expected 1 errors Line 131: Unexpected errors ['Expected first item to be a string literal [invalid-argument]', 'Expected first item to be a string literal [invalid-argument]'] Line 133: Unexpected errors ['Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword]', 'Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword]'] """ @@ -20,7 +18,7 @@ ERROR qualifiers_final_annotation.py:62:9-17: Cannot set field `id3` [read-only] ERROR qualifiers_final_annotation.py:63:9-17: Cannot set field `id4` [read-only] ERROR qualifiers_final_annotation.py:65:9-17: Cannot set field `ID7` [read-only] ERROR qualifiers_final_annotation.py:67:9-17: Cannot set field `ID7` [read-only] -ERROR qualifiers_final_annotation.py:71:8-11: `RATE` is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:71:8-11: Cannot assign to variable `RATE` because it is marked final [bad-assignment] ERROR qualifiers_final_annotation.py:81:1-18: Cannot set field `DEFAULT_ID` [read-only] ERROR qualifiers_final_annotation.py:94:5-17: `BORDER_WIDTH` is declared as final in parent class `ClassC` [bad-override] ERROR qualifiers_final_annotation.py:108:19-27: `ClassVar` may not be nested inside `Final` [invalid-annotation] @@ -34,10 +32,12 @@ ERROR qualifiers_final_annotation.py:133:8-9: Unexpected keyword argument `y` in ERROR qualifiers_final_annotation.py:134:3-4: Unexpected keyword argument `a` in function `N.__new__` [unexpected-keyword] ERROR qualifiers_final_annotation.py:135:3-4: Unexpected keyword argument `x` in function `N.__new__` [unexpected-keyword] ERROR qualifiers_final_annotation.py:135:9-10: Unexpected keyword argument `y` in function `N.__new__` [unexpected-keyword] -ERROR qualifiers_final_annotation.py:141:11-12: `ID1` is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:141:11-12: Cannot assign to variable `ID1` because it is marked final [bad-assignment] ERROR qualifiers_final_annotation.py:145:5-11: Cannot assign to variable `x` because it is marked final [bad-assignment] ERROR qualifiers_final_annotation.py:147:15-16: Cannot assign to variable `x` because it is marked final [bad-assignment] ERROR qualifiers_final_annotation.py:149:14-23: Cannot assign to variable `x` because it is marked final [bad-assignment] ERROR qualifiers_final_annotation.py:152:10-26: Cannot assign to variable `x` because it is marked final [bad-assignment] ERROR qualifiers_final_annotation.py:155:5-11: Cannot assign to variable `x` because it is marked final [bad-assignment] +ERROR qualifiers_final_annotation.py:166:1-4: Cannot assign to `TEN` because it is imported as final [bad-assignment] +ERROR qualifiers_final_annotation.py:170:1-3: Cannot assign to `PI` because it is imported as final [bad-assignment] """ diff --git a/conformance/results/pyrefly/specialtypes_type.toml b/conformance/results/pyrefly/specialtypes_type.toml index e4aa8623..e5bf63e0 100644 --- a/conformance/results/pyrefly/specialtypes_type.toml +++ b/conformance/results/pyrefly/specialtypes_type.toml @@ -8,8 +8,8 @@ ERROR specialtypes_type.py:70:7-15: Argument `type[Callable]` is not assignable ERROR specialtypes_type.py:76:12-26: Expected 1 type argument for `type`, got 2 [bad-specialization] ERROR specialtypes_type.py:117:5-14: Class `object` has no class attribute `unknown` [missing-attribute] ERROR specialtypes_type.py:120:5-14: Class `object` has no class attribute `unknown` [missing-attribute] -ERROR specialtypes_type.py:143:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA1, type[type[Any]]] (trying to access unknown) [internal-error] -ERROR specialtypes_type.py:144:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA2, type[type[Any]]] (trying to access unknown) [internal-error] -ERROR specialtypes_type.py:145:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA3, type[type[Any]]] (trying to access unknown) [internal-error] -ERROR specialtypes_type.py:146:1-12: TODO: Expr::attr_infer_for_type attribute base undefined for type: TypeAlias[TA4, type[type[Any]]] (trying to access unknown) [internal-error] +ERROR specialtypes_type.py:143:1-12: Class `type` has no class attribute `unknown` [missing-attribute] +ERROR specialtypes_type.py:144:1-12: Class `type` has no class attribute `unknown` [missing-attribute] +ERROR specialtypes_type.py:145:1-12: Class `type` has no class attribute `unknown` [missing-attribute] +ERROR specialtypes_type.py:146:1-12: Class `type` has no class attribute `unknown` [missing-attribute] """ diff --git a/conformance/results/pyrefly/typeddicts_alt_syntax.toml b/conformance/results/pyrefly/typeddicts_alt_syntax.toml index 6f018049..6781d845 100644 --- a/conformance/results/pyrefly/typeddicts_alt_syntax.toml +++ b/conformance/results/pyrefly/typeddicts_alt_syntax.toml @@ -6,10 +6,10 @@ output = """ ERROR typeddicts_alt_syntax.py:23:1-14: Expected valid functional typed dictionary definition [invalid-argument] ERROR typeddicts_alt_syntax.py:27:45-46: Expected first item to be a string literal [invalid-argument] ERROR typeddicts_alt_syntax.py:31:27-38: Expected string literal "BadTypedDict3" [invalid-argument] -ERROR typeddicts_alt_syntax.py:35:72-83: Unrecognized argument `other` for typed dictionary definition [invalid-argument] +ERROR typeddicts_alt_syntax.py:35:72-83: Unrecognized keyword argument `other` in typed dictionary definition [invalid-argument] ERROR typeddicts_alt_syntax.py:41:1-7: Expected valid functional typed dictionary definition [invalid-argument] -ERROR typeddicts_alt_syntax.py:41:30-38: Unrecognized argument `name` for typed dictionary definition [invalid-argument] -ERROR typeddicts_alt_syntax.py:41:40-48: Unrecognized argument `year` for typed dictionary definition [invalid-argument] +ERROR typeddicts_alt_syntax.py:41:30-38: Unrecognized keyword argument `name` in typed dictionary definition [invalid-argument] +ERROR typeddicts_alt_syntax.py:41:40-48: Unrecognized keyword argument `year` in typed dictionary definition [invalid-argument] ERROR typeddicts_alt_syntax.py:44:11-17: Key `name` is not defined in TypedDict `Movie2` [bad-typed-dict-key] ERROR typeddicts_alt_syntax.py:44:35-41: Key `year` is not defined in TypedDict `Movie2` [bad-typed-dict-key] ERROR typeddicts_alt_syntax.py:45:11-17: Key `name` is not defined in TypedDict `Movie2` [bad-typed-dict-key] diff --git a/conformance/results/pyrefly/typeddicts_extra_items.toml b/conformance/results/pyrefly/typeddicts_extra_items.toml index 1f75ab69..a641dc91 100644 --- a/conformance/results/pyrefly/typeddicts_extra_items.toml +++ b/conformance/results/pyrefly/typeddicts_extra_items.toml @@ -17,7 +17,7 @@ ERROR typeddicts_extra_items.py:117:57-73: `NotRequired` is not allowed in this ERROR typeddicts_extra_items.py:128:15-21: Key `name` in TypedDict `MovieEI` may not be deleted [unsupported-delete] ERROR typeddicts_extra_items.py:143:48-52: Unexpected keyword argument `year` in function `unpack_no_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` [bad-typed-dict-key] +ERROR typeddicts_extra_items.py:185:5-9: Cannot add required field `year` to TypedDict `MovieBase2` with non-read-only `extra_items` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:188:5-9: `int` is not consistent with `extra_items` type `int | None` of TypedDict `MovieBase2` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:197:5-14: `str` is not assignable to `extra_items` type `int | None` of TypedDict `BookBase` [bad-typed-dict-key] ERROR typeddicts_extra_items.py:215:22-30: `MovieDetails` is not assignable to `MovieBase2` [bad-assignment] diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index a3db676c..d8470f38 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.50.0" +version = "pyrefly 0.53.0" diff --git a/conformance/results/results.html b/conformance/results/results.html index 72964529..bebbce60 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -176,9 +176,9 @@
Does not detect inconsistent type variable ordering.
Does not reject inconsistent ordering of type variables in different base classes.
Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.
Does not reject type alias defined in function scope.
Does not reject redeclaration of type alias with the same name.
Does not detect circular definitions.
Incorrectly rejects some recursive type aliases using TypeAliasType.
Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.
Does not require concrete classes to be passed to type[Proto]
Does not detect protocol mismatch if concrete method is missing annotations.
Does not detect protocol mismatch if concrete method's parameters are position-only.
Incorrectly handles some ClassVar examples in Protocol subtyping
Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.
Does not report errors during binding to self parameter of __init__ method.
Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.
Does not reject class-scoped type var in self param annotation
Does not honor metaclass __call__ method when evaluating constructor call.
Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.
Does not validate call to custom metaclass __call__ method through type[T].
Does not check TypeVar type constructor using upper bound's __new__
Does not generate a union type for __new__ and __init__ when converting class to callable.
Does not ignore __init__ based on __new__ return type when converting class to callable.
Does not support __new__ return type that is different from class being constructed.