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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 13 additions & 10 deletions conformance/results/pyrefly/aliases_implicit.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,5 @@
conformant = "Partial"
notes = """
Does not reject invalid syntax in implicit type aliases.
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 106: Expected 1 errors
Line 111: Expected 1 errors
Line 112: Expected 1 errors
Line 113: Expected 1 errors
Line 117: Expected 1 errors
"""
output = """
ERROR aliases_implicit.py:76:9-28: `type[int | None]` is not subscriptable [unsupported-operation]
Expand All @@ -17,14 +8,26 @@ ERROR aliases_implicit.py:78:9-33: Expected 1 type argument for `GoodTypeAlias4`
ERROR aliases_implicit.py:79:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization]
ERROR aliases_implicit.py:80:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec]
ERROR aliases_implicit.py:81:9-29: `str` is not assignable to upper bound `float` of type variable `TFloat` [bad-specialization]
ERROR aliases_implicit.py:106:9-22: `BadTypeAlias1` is not a valid type alias: Function call cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:107:9-22: Expected a type form, got instance of `list[type[int] | type[str]]` [not-a-type]
ERROR aliases_implicit.py:107:9-22: `BadTypeAlias2` is not a valid type alias: List literal cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:108:9-22: Expected a type form, got instance of `tuple[tuple[type[int], type[str]]]` [not-a-type]
ERROR aliases_implicit.py:108:9-22: `BadTypeAlias3` is not a valid type alias: Tuple literal cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:109:9-22: Expected a type form, got instance of `list[type[int]]` [not-a-type]
ERROR aliases_implicit.py:109:9-22: `BadTypeAlias4` is not a valid type alias: List comprehension cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:110:9-22: Expected a type form, got instance of `dict[str, str]` [not-a-type]
ERROR aliases_implicit.py:110:9-22: `BadTypeAlias5` is not a valid type alias: Dict literal cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:111:9-22: `BadTypeAlias6` is not a valid type alias: Function call cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:112:9-22: `BadTypeAlias7` is not a valid type alias: Invalid subscript expression cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:113:9-22: `BadTypeAlias8` is not a valid type alias: If expression cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:114:9-22: Expected a type form, got instance of `Literal[3]` [not-a-type]
ERROR aliases_implicit.py:115:10-24: Expected a type form, got instance of `Literal[True]` [not-a-type]
ERROR aliases_implicit.py:115:10-24: `BadTypeAlias10` is not a valid type alias: Bool literal cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:116:10-24: Expected a type form, got instance of `Literal[1]` [not-a-type]
ERROR aliases_implicit.py:116:10-24: `BadTypeAlias11` is not a valid type alias: Number literal cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:117:10-24: `BadTypeAlias12` is not a valid type alias: Boolean operation cannot be used in annotations [invalid-annotation]
ERROR aliases_implicit.py:118:10-24: Expected a type form, got instance of `Literal['int']` [not-a-type]
ERROR aliases_implicit.py:118:10-24: `BadTypeAlias13` is not a valid type alias: F-string cannot be used in annotations [invalid-annotation]
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:135:5-24: `type[list[Unknown] | set[Unknown]]` is not subscriptable [unsupported-operation]
Expand Down
2 changes: 2 additions & 0 deletions conformance/results/pyrefly/annotations_forward_refs.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Line 87: Unexpected errors ['Expected a type form, got instance of `(self: Self@
Line 96: Unexpected errors ['assert_type(Unknown, int) failed [assert-type]']
"""
output = """
ERROR annotations_forward_refs.py:23:12-18: `ClassA` is uninitialized [unbound-name]
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]
Expand All @@ -20,6 +21,7 @@ ERROR annotations_forward_refs.py:46:10-26: Function call cannot be used in anno
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:49:10-14: `var1` is not a valid type alias: Number literal 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]
Expand Down
1 change: 1 addition & 0 deletions conformance/results/pyrefly/annotations_typeexpr.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ ERROR annotations_typeexpr.py:93:9-24: Function call cannot be used in annotatio
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:96:9-13: `var1` is not a valid type alias: Number literal 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]
Expand Down
8 changes: 0 additions & 8 deletions conformance/results/pyrefly/dataclasses_descriptors.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,8 @@ conformance_automated = "Fail"
errors_diff = """
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: 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]
ERROR dataclasses_descriptors.py:67:12-24: assert_type(Desc2[str], str) failed [assert-type]
"""
1 change: 1 addition & 0 deletions conformance/results/pyrefly/dataclasses_usage.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@ ERROR dataclasses_usage.py:89:14-40: `str` is not assignable to `int` [bad-assig
ERROR dataclasses_usage.py:128:8-9: Expected 1 positional argument, got 2 in function `DC7.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:131:4-7: Missing argument `y` in function `DC8.__init__` [missing-argument]
ERROR dataclasses_usage.py:180:6-7: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count]
ERROR dataclasses_usage.py:229:5-6: `y` is a dataclass field but has no type annotation [bad-class-definition]
ERROR dataclasses_usage.py:246:12-13: Expected 2 positional arguments, got 3 in function `DC19.__init__` [bad-argument-count]
"""
24 changes: 9 additions & 15 deletions conformance/results/pyrefly/directives_disjoint_base.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
conformance_automated = "Fail"
conformant = "Unsupported"
notes = """
Does not support PEP 800 disjoint-base semantics.
"""
conformance_automated = "Pass"
errors_diff = """
Line 69: Expected 1 errors
Line 73: Expected 1 errors
Line 77: Expected 1 errors
Line 118: Expected 1 errors
Line 123: Expected 1 errors
Line 60: Unexpected errors ['Named tuples do not support multiple inheritance [invalid-inheritance]']
"""
output = """
ERROR directives_disjoint_base.py:60:7-18: Named tuples do not support multiple inheritance [invalid-inheritance]
ERROR directives_disjoint_base.py:81:7-17: Named tuples do not support multiple inheritance [invalid-inheritance]
ERROR directives_disjoint_base.py:105:7-24: Class `IncompatibleSlots` has multiple base classes with non-empty `__slots__` (`SlotBase1`, `SlotBase2`), which causes a TypeError at runtime [invalid-inheritance]
ERROR directives_disjoint_base.py:113:1-15: `() -> None` is not assignable to upper bound `type[object]` of type variable `_TC` [bad-specialization]
ERROR directives_disjoint_base.py:69:7-19: Class `LeftAndRight` inherits from incompatible disjoint bases `Left`, `Right` [invalid-inheritance]
ERROR directives_disjoint_base.py:73:7-24: Class `LeftChildAndRight` inherits from incompatible disjoint bases `LeftChild`, `Right` [invalid-inheritance]
ERROR directives_disjoint_base.py:77:7-27: Class `LeftAndRightViaChild` inherits from incompatible disjoint bases `Left`, `Right` [invalid-inheritance]
ERROR directives_disjoint_base.py:81:7-17: Class `LeftRecord` inherits from incompatible disjoint bases `Left`, `Record` [invalid-inheritance]
ERROR directives_disjoint_base.py:105:7-24: Class `IncompatibleSlots` inherits from incompatible disjoint bases `SlotBase1`, `SlotBase2` [invalid-inheritance]
ERROR directives_disjoint_base.py:113:1-15: `@disjoint_base` cannot be applied to a function [bad-function-definition]
ERROR directives_disjoint_base.py:118:1-15: `@disjoint_base` cannot be applied to a TypedDict [bad-class-definition]
ERROR directives_disjoint_base.py:123:1-15: `@disjoint_base` cannot be applied to a Protocol [bad-class-definition]
"""
10 changes: 3 additions & 7 deletions conformance/results/pyrefly/generics_self_basic.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
conformant = "Partial"
notes = """
Return annotation of Self allows returning the concrete instance of the current class.
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 20: Expected 1 errors
Line 33: Expected 1 errors
"""
output = """
ERROR generics_self_basic.py:20:16-23: Returned type `Shape` is not assignable to declared return type `Self@Shape` [bad-return]
ERROR generics_self_basic.py:33:16-23: Returned type `Shape` is not assignable to declared return type `Self@Shape` [bad-return]
ERROR generics_self_basic.py:68:26-35: `Self` may not be subscripted [invalid-annotation]
"""
8 changes: 2 additions & 6 deletions conformance/results/pyrefly/generics_self_usage.toml
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
conformant = "Partial"
notes = """
Does not implement some restrictions on where Self can be used
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 87: 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:82:9-37: `Self` cannot be used when `self` has an explicit TypeVar annotation [invalid-annotation]
ERROR generics_self_usage.py:87:16-22: Returned type `Foo3` is not assignable to declared return type `Self@Foo3` [bad-return]
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]
Expand Down
6 changes: 3 additions & 3 deletions conformance/results/pyrefly/typeddicts_extra_items.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ conformance_automated = "Pass"
errors_diff = """
"""
output = """
ERROR typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict key with type `bool` [bad-typed-dict-key]
ERROR typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict key with type `bool` [bad-typed-dict-key]
ERROR typeddicts_extra_items.py:39:54-58: `None` is not assignable to TypedDict key `year` with type `int` [bad-typed-dict-key]
ERROR typeddicts_extra_items.py:15:45-49: `Literal[1982]` is not assignable to TypedDict key with type `bool` [bad-assignment]
ERROR typeddicts_extra_items.py:22:55-59: `Literal[1982]` is not assignable to TypedDict key with type `bool` [bad-assignment]
ERROR typeddicts_extra_items.py:39:54-58: `None` is not assignable to TypedDict key `year` with type `int` [bad-assignment]
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]
ERROR typeddicts_extra_items.py:73:7-20: Non-closed TypedDict cannot inherit from TypedDict `ExtraItemsBase` with extra items [bad-typed-dict]
Expand Down
6 changes: 3 additions & 3 deletions conformance/results/pyrefly/typeddicts_operations.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ conformance_automated = "Pass"
errors_diff = """
"""
output = """
ERROR typeddicts_operations.py:22:17-21: `Literal[1982]` is not assignable to TypedDict key `name` with type `str` [bad-typed-dict-key]
ERROR typeddicts_operations.py:23:17-19: `Literal['']` is not assignable to TypedDict key `year` with type `int` [bad-typed-dict-key]
ERROR typeddicts_operations.py:22:17-21: `Literal[1982]` is not assignable to TypedDict key `name` with type `str` [bad-assignment]
ERROR typeddicts_operations.py:23:17-19: `Literal['']` is not assignable to TypedDict key `year` with type `int` [bad-assignment]
ERROR typeddicts_operations.py:24:7-14: TypedDict `Movie` does not have key `other` [bad-typed-dict-key]
ERROR typeddicts_operations.py:26:13-20: TypedDict `Movie` does not have key `other` [bad-typed-dict-key]
ERROR typeddicts_operations.py:28:9-33: Missing required key `year` for TypedDict `Movie` [bad-typed-dict-key]
ERROR typeddicts_operations.py:29:42-48: `float` is not assignable to TypedDict key `year` with type `int` [bad-typed-dict-key]
ERROR typeddicts_operations.py:29:42-48: `float` is not assignable to TypedDict key `year` with type `int` [bad-assignment]
ERROR typeddicts_operations.py:32:36-43: Key `other` is not defined in TypedDict `Movie` [bad-typed-dict-key]
ERROR typeddicts_operations.py:37:20-52: Missing required key `name` for TypedDict `Movie` [bad-typed-dict-key]
ERROR typeddicts_operations.py:37:21-33: Expected string literal key, got `str` [bad-typed-dict-key]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ output = """
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` [bad-typed-dict-key]
ERROR typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [bad-typed-dict-key]
ERROR typeddicts_readonly_inheritance.py:83:15-16: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [bad-typed-dict-key]
ERROR typeddicts_readonly_inheritance.py:82:14-15: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [bad-assignment]
ERROR typeddicts_readonly_inheritance.py:83:15-16: `Literal[3]` is not assignable to TypedDict key `ident` with type `str` [bad-assignment]
ERROR typeddicts_readonly_inheritance.py:84:5-7: Missing required key `ident` for TypedDict `User` [bad-typed-dict-key]
ERROR typeddicts_readonly_inheritance.py:94:5-6: TypedDict field `a` in `F3` cannot be marked read-only; parent TypedDict `F1` defines it as mutable [bad-typed-dict-key]
ERROR typeddicts_readonly_inheritance.py:98:5-6: TypedDict field `a` in `F4` must remain required because parent TypedDict `F1` defines it as required [bad-typed-dict-key]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ ERROR typeddicts_type_consistency.py:76:22-24: `B3` is not assignable to `dict[s
ERROR typeddicts_type_consistency.py:77:25-27: `B3` is not assignable to `dict[str, object]` [bad-assignment]
ERROR typeddicts_type_consistency.py:78:22-24: `B3` is not assignable to `dict[Any, Any]` [bad-assignment]
ERROR typeddicts_type_consistency.py:82:25-27: `B3` is not assignable to `Mapping[str, int]` [bad-assignment]
ERROR typeddicts_type_consistency.py:126:56-57: `Literal[1]` is not assignable to TypedDict key `inner_key` with type `str` [bad-typed-dict-key]
ERROR typeddicts_type_consistency.py:126:56-57: `Literal[1]` is not assignable to TypedDict key `inner_key` with type `str` [bad-assignment]
"""
2 changes: 1 addition & 1 deletion conformance/results/pyrefly/typeddicts_usage.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ errors_diff = """
"""
output = """
ERROR typeddicts_usage.py:23:7-17: TypedDict `Movie` does not have key `director` [bad-typed-dict-key]
ERROR typeddicts_usage.py:24:17-23: `Literal['1982']` is not assignable to TypedDict key `year` with type `int` [bad-typed-dict-key]
ERROR typeddicts_usage.py:24:17-23: `Literal['1982']` is not assignable to TypedDict key `year` with type `int` [bad-assignment]
ERROR typeddicts_usage.py:28:17-56: Missing required key `name` for TypedDict `Movie` [bad-typed-dict-key]
ERROR typeddicts_usage.py:28:18-25: Key `title` is not defined in TypedDict `Movie` [bad-typed-dict-key]
ERROR typeddicts_usage.py:35:22-27: TypedDict `Movie` not allowed as second argument to isinstance() [invalid-argument]
Expand Down
14 changes: 2 additions & 12 deletions conformance/results/pyrefly/typeforms_typeform.toml
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
conformant = "Partial"
notes = """
Does not allow assigning a TypeForm to types.GenericAlias.
Does not allow passing a forward reference to a function accepting a TypeForm.
"""
conformance_automated = "Fail"
conformance_automated = "Pass"
errors_diff = """
Line 49: Unexpected errors ['`type[list[int]]` is not assignable to `GenericAlias` [bad-assignment]', 'Expected `v2_actual` to be a type alias, got `GenericAlias` [invalid-type-alias]']
Line 58: Unexpected errors ["Argument `Literal['int']` is not assignable to parameter `x` with type `TypeForm[Any]` in function `func1` [bad-argument-type]"]
"""
output = """
ERROR typeforms_typeform.py:23:30-39: `type[int | str]` is not assignable to `TypeForm[str | None]` [bad-assignment]
ERROR typeforms_typeform.py:24:30-46: `type[list[str | None]]` is not assignable to `TypeForm[str | None]` [bad-assignment]
ERROR typeforms_typeform.py:49:33-42: `type[list[int]]` is not assignable to `GenericAlias` [bad-assignment]
ERROR typeforms_typeform.py:49:33-42: Expected `v2_actual` to be a type alias, got `GenericAlias` [invalid-type-alias]
ERROR typeforms_typeform.py:58:7-12: Argument `Literal['int']` is not assignable to parameter `x` with type `TypeForm[Any]` in function `func1` [bad-argument-type]
ERROR typeforms_typeform.py:59:7-19: Argument `Literal['not a type']` is not assignable to parameter `x` with type `TypeForm[Any]` in function `func1` [bad-argument-type]
ERROR typeforms_typeform.py:67:18-25: `tuple[@_, ...]` is not assignable to `TypeForm[Any]` [bad-assignment]
ERROR typeforms_typeform.py:67:18-25: `tuple[Unknown, ...]` is not assignable to `TypeForm[Any]` [bad-assignment]
ERROR typeforms_typeform.py:68:18-24: `tuple[Literal[1], Literal[2]]` is not assignable to `TypeForm[Any]` [bad-assignment]
ERROR typeforms_typeform.py:69:18-19: `Literal[1]` is not assignable to `TypeForm[Any]` [bad-assignment]
ERROR typeforms_typeform.py:70:18-22: `type[Self]` is not assignable to `TypeForm[Any]` [bad-assignment]
Expand Down
2 changes: 1 addition & 1 deletion conformance/results/pyrefly/version.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "pyrefly 1.0.0"
version = "pyrefly 1.1.0"
2 changes: 1 addition & 1 deletion conformance/results/pyright/version.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "pyright 1.1.409"
version = "pyright 1.1.410"
Loading