diff --git a/conformance/results/pyre/aliases_explicit.toml b/conformance/results/pyre/aliases_explicit.toml index 6206b5b46..473b04ee3 100644 --- a/conformance/results/pyre/aliases_explicit.toml +++ b/conformance/results/pyre/aliases_explicit.toml @@ -15,12 +15,6 @@ aliases_explicit.py:26:0 Incompatible variable type [9]: GoodTypeAlias12 is decl aliases_explicit.py:26:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. aliases_explicit.py:41:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type. aliases_explicit.py:44:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias12` is not defined as a type. -aliases_explicit.py:51:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `UnionType`. -aliases_explicit.py:53:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], typing.Any]`. -aliases_explicit.py:54:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int], Type[int], Type[str]]`. -aliases_explicit.py:57:29 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[List[Type[Union[int, str]]], None]`. -aliases_explicit.py:60:30 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[typing.Any, None]`. -aliases_explicit.py:62:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `UnionType`. aliases_explicit.py:80:0 Incompatible variable type [9]: BadTypeAlias2 is declared to have type `TA` but is used as type `List[Type[Union[int, str]]]`. aliases_explicit.py:81:0 Incompatible variable type [9]: BadTypeAlias3 is declared to have type `TA` but is used as type `Tuple[Tuple[Type[int], Type[str]]]`. aliases_explicit.py:82:0 Incompatible variable type [9]: BadTypeAlias4 is declared to have type `TA` but is used as type `List[Type[int]]`. @@ -50,11 +44,5 @@ Line 23: Unexpected errors ['aliases_explicit.py:23:0 Incompatible variable type Line 26: Unexpected errors ['aliases_explicit.py:26:0 Incompatible variable type [9]: GoodTypeAlias12 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'aliases_explicit.py:26:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] Line 41: Unexpected errors ['aliases_explicit.py:41:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type.'] Line 44: Unexpected errors ['aliases_explicit.py:44:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias12` is not defined as a type.'] -Line 51: Unexpected errors ['aliases_explicit.py:51:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `UnionType`.'] -Line 53: Unexpected errors ['aliases_explicit.py:53:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], typing.Any]`.'] -Line 54: Unexpected errors ['aliases_explicit.py:54:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int], Type[int], Type[str]]`.'] -Line 57: Unexpected errors ['aliases_explicit.py:57:29 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[List[Type[Union[int, str]]], None]`.'] -Line 60: Unexpected errors ['aliases_explicit.py:60:30 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[typing.Any, None]`.'] -Line 62: Unexpected errors ['aliases_explicit.py:62:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `UnionType`.'] Line 97: Unexpected errors ['aliases_explicit.py:97:16 Call error [29]: `TA` is not a function.'] """ diff --git a/conformance/results/pyre/aliases_implicit.toml b/conformance/results/pyre/aliases_implicit.toml index a94010bbf..1d00603e1 100644 --- a/conformance/results/pyre/aliases_implicit.toml +++ b/conformance/results/pyre/aliases_implicit.toml @@ -12,11 +12,6 @@ aliases_implicit.py:38:26 Incompatible parameter type [6]: In call `typing.Gener aliases_implicit.py:42:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. aliases_implicit.py:54:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type. aliases_implicit.py:58:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias13` is not defined as a type. -aliases_implicit.py:62:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `UnionType`. -aliases_implicit.py:64:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], typing.Any]`. -aliases_implicit.py:65:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int], Type[int], Type[str]]`. -aliases_implicit.py:68:29 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[List[Type[Union[int, str]]], None]`. -aliases_implicit.py:72:30 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[typing.Any, None]`. aliases_implicit.py:106:8 Undefined or invalid type [11]: Annotation `BadTypeAlias1` is not defined as a type. aliases_implicit.py:107:8 Undefined or invalid type [11]: Annotation `BadTypeAlias2` is not defined as a type. aliases_implicit.py:108:8 Undefined or invalid type [11]: Annotation `BadTypeAlias3` is not defined as a type. @@ -31,6 +26,7 @@ aliases_implicit.py:116:9 Undefined or invalid type [11]: Annotation `BadTypeAli aliases_implicit.py:117:9 Undefined or invalid type [11]: Annotation `BadTypeAlias12` is not defined as a type. aliases_implicit.py:118:9 Undefined or invalid type [11]: Annotation `BadTypeAlias13` is not defined as a type. aliases_implicit.py:119:9 Undefined or invalid type [11]: Annotation `BadTypeAlias14` is not defined as a type. +aliases_implicit.py:131:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ @@ -46,9 +42,5 @@ Line 38: Unexpected errors ['aliases_implicit.py:38:26 Incompatible parameter ty Line 42: Unexpected errors ['aliases_implicit.py:42:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] Line 54: Unexpected errors ['aliases_implicit.py:54:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type.'] Line 58: Unexpected errors ['aliases_implicit.py:58:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias13` is not defined as a type.'] -Line 62: Unexpected errors ['aliases_implicit.py:62:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `UnionType`.'] -Line 64: Unexpected errors ['aliases_implicit.py:64:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], typing.Any]`.'] -Line 65: Unexpected errors ['aliases_implicit.py:65:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int], Type[int], Type[str]]`.'] -Line 68: Unexpected errors ['aliases_implicit.py:68:29 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[List[Type[Union[int, str]]], None]`.'] -Line 72: Unexpected errors ['aliases_implicit.py:72:30 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[typing.Any, None]`.'] +Line 131: Unexpected errors ['aliases_implicit.py:131:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/aliases_recursive.toml b/conformance/results/pyre/aliases_recursive.toml index 84b1d9975..a87f4cf4d 100644 --- a/conformance/results/pyre/aliases_recursive.toml +++ b/conformance/results/pyre/aliases_recursive.toml @@ -6,14 +6,13 @@ Does not properly handle specialization of generic recursive type aliases. output = """ aliases_recursive.py:19:0 Incompatible variable type [9]: j4 is declared to have type `aliases_recursive.Json (resolves to Union[None, Dict[str, Json], List[Json], float, int, str])` but is used as type `Dict[str, complex]`. aliases_recursive.py:20:0 Incompatible variable type [9]: j5 is declared to have type `aliases_recursive.Json (resolves to Union[None, Dict[str, Json], List[Json], float, int, str])` but is used as type `List[complex]`. -aliases_recursive.py:30:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[str, typing.Any]`. +aliases_recursive.py:30:29 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. aliases_recursive.py:33:4 Undefined or invalid type [11]: Annotation `RecursiveTuple` is not defined as a type. aliases_recursive.py:42:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT_co](covariant)]]` but got `Tuple[Type[str], str]`. aliases_recursive.py:44:4 Undefined or invalid type [11]: Annotation `RecursiveMapping` is not defined as a type. -aliases_recursive.py:58:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `_SpecialForm`. +aliases_recursive.py:58:20 Undefined attribute [16]: `list` has no attribute `__getitem__`. aliases_recursive.py:61:4 Undefined or invalid type [11]: Annotation `SpecializedTypeAlias1` is not defined as a type. aliases_recursive.py:62:4 Undefined or invalid type [11]: Annotation `GenericTypeAlias1` is not defined as a type. -aliases_recursive.py:65:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `_SpecialForm`. aliases_recursive.py:67:4 Undefined or invalid type [11]: Annotation `GenericTypeAlias2` is not defined as a type. aliases_recursive.py:72:0 Incompatible variable type [9]: RecursiveUnion is declared to have type `TypeAlias` but is used as type `Type[typing.Any]`. aliases_recursive.py:75:0 Incompatible variable type [9]: MutualReference1 is declared to have type `TypeAlias` but is used as type `Type[typing.Any]`. @@ -28,13 +27,12 @@ Line 51: Expected 1 errors Line 52: Expected 1 errors Line 63: Expected 1 errors Line 69: Expected 1 errors -Line 30: Unexpected errors ['aliases_recursive.py:30:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[str, typing.Any]`.'] +Line 30: Unexpected errors ['aliases_recursive.py:30:29 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] Line 33: Unexpected errors ['aliases_recursive.py:33:4 Undefined or invalid type [11]: Annotation `RecursiveTuple` is not defined as a type.'] Line 42: Unexpected errors ['aliases_recursive.py:42:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT_co](covariant)]]` but got `Tuple[Type[str], str]`.'] Line 44: Unexpected errors ['aliases_recursive.py:44:4 Undefined or invalid type [11]: Annotation `RecursiveMapping` is not defined as a type.'] -Line 58: Unexpected errors ['aliases_recursive.py:58:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `_SpecialForm`.'] +Line 58: Unexpected errors ['aliases_recursive.py:58:20 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] Line 61: Unexpected errors ['aliases_recursive.py:61:4 Undefined or invalid type [11]: Annotation `SpecializedTypeAlias1` is not defined as a type.'] Line 62: Unexpected errors ['aliases_recursive.py:62:4 Undefined or invalid type [11]: Annotation `GenericTypeAlias1` is not defined as a type.'] -Line 65: Unexpected errors ['aliases_recursive.py:65:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `_SpecialForm`.'] Line 67: Unexpected errors ['aliases_recursive.py:67:4 Undefined or invalid type [11]: Annotation `GenericTypeAlias2` is not defined as a type.'] """ diff --git a/conformance/results/pyre/aliases_typealiastype.toml b/conformance/results/pyre/aliases_typealiastype.toml index cdafd65cb..1e88186be 100644 --- a/conformance/results/pyre/aliases_typealiastype.toml +++ b/conformance/results/pyre/aliases_typealiastype.toml @@ -3,59 +3,42 @@ notes = """ Support for TypeAliasType is not implemented. """ output = """ -aliases_typealiastype.py:5:0 Undefined import [21]: Could not find a name `TypeAliasType` defined in module `typing`. -aliases_typealiastype.py:16:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:17:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:17:46 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. -aliases_typealiastype.py:18:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:18:46 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. -aliases_typealiastype.py:18:56 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. -aliases_typealiastype.py:19:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:20:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. +aliases_typealiastype.py:17:41 Undefined attribute [16]: `list` has no attribute `__getitem__`. aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`. -aliases_typealiastype.py:22:29 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. -aliases_typealiastype.py:22:71 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[typing.Any, ...]`. -aliases_typealiastype.py:27:17 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:27:50 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. +aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. +aliases_typealiastype.py:27:45 Undefined attribute [16]: `list` has no attribute `__getitem__`. +aliases_typealiastype.py:32:6 Undefined attribute [16]: `TypeAliasType` has no attribute `other_attrib`. aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type. +aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `...` is not defined as a type. aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type. aliases_typealiastype.py:39:4 Invalid type [31]: Expression `$local_aliases_typealiastype$GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type. -aliases_typealiastype.py:43:12 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:43:44 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. -aliases_typealiastype.py:44:12 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:44:44 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. -aliases_typealiastype.py:45:12 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:46:12 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:47:12 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:48:12 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:49:12 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:52:12 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:53:12 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:54:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:55:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:56:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:57:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:58:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:59:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:60:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:61:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:62:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:63:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. -aliases_typealiastype.py:64:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`. """ conformance_automated = "Fail" errors_diff = """ -Line 32: Expected 1 errors Line 40: Expected 1 errors -Line 5: Unexpected errors ['aliases_typealiastype.py:5:0 Undefined import [21]: Could not find a name `TypeAliasType` defined in module `typing`.'] -Line 16: Unexpected errors ['aliases_typealiastype.py:16:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`.'] -Line 17: Unexpected errors ['aliases_typealiastype.py:17:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`.', 'aliases_typealiastype.py:17:46 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`.'] -Line 18: Unexpected errors ['aliases_typealiastype.py:18:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`.', 'aliases_typealiastype.py:18:46 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`.', 'aliases_typealiastype.py:18:56 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`.'] -Line 19: Unexpected errors ['aliases_typealiastype.py:19:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`.'] -Line 20: Unexpected errors ['aliases_typealiastype.py:20:13 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`.'] -Line 22: Unexpected errors ['aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`.', 'aliases_typealiastype.py:22:29 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`.', 'aliases_typealiastype.py:22:71 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[typing.Any, ...]`.'] -Line 27: Unexpected errors ['aliases_typealiastype.py:27:17 Undefined attribute [16]: Module `typing` has no attribute `TypeAliasType`.', 'aliases_typealiastype.py:27:50 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`.'] +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 +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 ['aliases_typealiastype.py:17:41 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] +Line 22: Unexpected errors ['aliases_typealiastype.py:22:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, TypeVar]`.', 'aliases_typealiastype.py:22:65 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] +Line 27: Unexpected errors ['aliases_typealiastype.py:27:45 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] Line 35: Unexpected errors ['aliases_typealiastype.py:35:4 Undefined or invalid type [11]: Annotation `GoodAlias4` is not defined as a type.'] -Line 37: Unexpected errors ['aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.'] +Line 37: Unexpected errors ['aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `...` is not defined as a type.', 'aliases_typealiastype.py:37:4 Undefined or invalid type [11]: Annotation `GoodAlias5` is not defined as a type.'] Line 39: Unexpected errors ['aliases_typealiastype.py:39:4 Invalid type [31]: Expression `$local_aliases_typealiastype$GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/annotations_coroutines.toml b/conformance/results/pyre/annotations_coroutines.toml index cf8bc0f9c..5e485e856 100644 --- a/conformance/results/pyre/annotations_coroutines.toml +++ b/conformance/results/pyre/annotations_coroutines.toml @@ -1,11 +1,6 @@ -conformant = "Partial" -notes = """ -Does not evaluate correct type for async function. -""" +conformant = "Pass" output = """ -annotations_coroutines.py:19:45 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_T_co](covariant)], Type[Variable[_T_contra](contravariant)], Type[Variable[_V_co](covariant)]]` but got `Tuple[object, object, Type[str]]`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 19: Unexpected errors ['annotations_coroutines.py:19:45 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_T_co](covariant)], Type[Variable[_T_contra](contravariant)], Type[Variable[_V_co](covariant)]]` but got `Tuple[object, object, Type[str]]`.'] """ diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 00885232d..9c41a7acc 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -8,7 +8,6 @@ Does not generate error for unquoted type defined in class scope. Does not treat triple-quoted forward reference annotation as implicitly parenthesized. """ output = """ -annotations_forward_refs.py:19:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `UnionType`. annotations_forward_refs.py:41:8 Undefined or invalid type [11]: Annotation `eval(.join(map(chr, [105, 110, 116])))` is not defined as a type. annotations_forward_refs.py:42:8 Invalid type [31]: Expression `"[int, str]"` is not a valid type. annotations_forward_refs.py:43:8 Invalid type [31]: Expression `"(int, str)"` is not a valid type. @@ -37,7 +36,6 @@ Line 25: Expected 1 errors Line 54: Expected 1 errors Line 66: Expected 1 errors Line 89: Expected 1 errors -Line 19: Unexpected errors ['annotations_forward_refs.py:19:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `UnionType`.'] Line 77: Unexpected errors ['annotations_forward_refs.py:77:0 Uninitialized attribute [13]: Attribute `ClassC` is declared in class `ClassD` to have type `ClassC` but is never initialized.'] Line 87: Unexpected errors ['annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type.'] Line 100: Unexpected errors ['annotations_forward_refs.py:100:7 Undefined or invalid type [11]: Annotation `'] diff --git a/conformance/results/pyre/annotations_generators.toml b/conformance/results/pyre/annotations_generators.toml index 4d5caf812..4f05a0844 100644 --- a/conformance/results/pyre/annotations_generators.toml +++ b/conformance/results/pyre/annotations_generators.toml @@ -15,17 +15,12 @@ annotations_generators.py:92:4 Incompatible return type [7]: Expected `int` but annotations_generators.py:118:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[A, None, typing.Any]`. annotations_generators.py:119:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[int, None, typing.Any]`. annotations_generators.py:135:4 Incompatible return type [7]: Expected `Generator[None, str, None]` but got `Generator[None, int, typing.Any]`. -annotations_generators.py:167:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_T_co](covariant)], Type[Variable[_T_contra](contravariant)]]` but got `Tuple[Type[str], None]`. -annotations_generators.py:174:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_T_co](covariant)], Type[Variable[_T_contra](contravariant)]]` but got `Tuple[Type[str], None]`. -annotations_generators.py:182:48 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_T_co](covariant)], Type[Variable[_T_contra](contravariant)], Type[Variable[_V_co](covariant)]]` but got `Tuple[object, object, typing.Any]`. -annotations_generators.py:182:58 Undefined attribute [16]: `AsyncIterator` has no attribute `__getitem__`. +annotations_generators.py:182:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but got `typing.Callable(generator29)[[], AsyncIterator[int]]`. """ conformance_automated = "Fail" errors_diff = """ Line 51: Expected 1 errors Line 86: Expected 1 errors Line 88: Unexpected errors ['annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`.'] -Line 167: Unexpected errors ['annotations_generators.py:167:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_T_co](covariant)], Type[Variable[_T_contra](contravariant)]]` but got `Tuple[Type[str], None]`.'] -Line 174: Unexpected errors ['annotations_generators.py:174:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_T_co](covariant)], Type[Variable[_T_contra](contravariant)]]` but got `Tuple[Type[str], None]`.'] -Line 182: Unexpected errors ['annotations_generators.py:182:48 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_T_co](covariant)], Type[Variable[_T_contra](contravariant)], Type[Variable[_V_co](covariant)]]` but got `Tuple[object, object, typing.Any]`.', 'annotations_generators.py:182:58 Undefined attribute [16]: `AsyncIterator` has no attribute `__getitem__`.'] +Line 182: Unexpected errors ['annotations_generators.py:182:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but got `typing.Callable(generator29)[[], AsyncIterator[int]]`.'] """ diff --git a/conformance/results/pyre/annotations_methods.toml b/conformance/results/pyre/annotations_methods.toml index 4d4581610..c6be1388e 100644 --- a/conformance/results/pyre/annotations_methods.toml +++ b/conformance/results/pyre/annotations_methods.toml @@ -3,6 +3,7 @@ notes = """ Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. """ output = """ +annotations_methods.py:42:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `A` but got `B`. """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyre/annotations_typeexpr.toml b/conformance/results/pyre/annotations_typeexpr.toml index af34154ba..f3a6f06cd 100644 --- a/conformance/results/pyre/annotations_typeexpr.toml +++ b/conformance/results/pyre/annotations_typeexpr.toml @@ -1,10 +1,5 @@ -conformant = "Partial" -notes = """ -Rejects some generics -""" +conformant = "Pass" output = """ -annotations_typeexpr.py:75:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `object`. -annotations_typeexpr.py:77:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[object, typing.Any]`. annotations_typeexpr.py:88:8 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type. annotations_typeexpr.py:89:8 Invalid type [31]: Expression `[int, str]` is not a valid type. annotations_typeexpr.py:90:8 Invalid type [31]: Expression `(int, str)` is not a valid type. @@ -21,8 +16,6 @@ annotations_typeexpr.py:100:9 Invalid type [31]: Expression `int or str` is not annotations_typeexpr.py:101:9 Invalid type [31]: Expression `"int"` is not a valid type. annotations_typeexpr.py:102:9 Undefined or invalid type [11]: Annotation `types` is not defined as a type. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 75: Unexpected errors ['annotations_typeexpr.py:75:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `object`.'] -Line 77: Unexpected errors ['annotations_typeexpr.py:77:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[object, typing.Any]`.'] """ diff --git a/conformance/results/pyre/callables_annotation.toml b/conformance/results/pyre/callables_annotation.toml index 66a9363d4..900125346 100644 --- a/conformance/results/pyre/callables_annotation.toml +++ b/conformance/results/pyre/callables_annotation.toml @@ -11,15 +11,14 @@ callables_annotation.py:26:10 Incompatible parameter type [6]: In anonymous call callables_annotation.py:27:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. callables_annotation.py:29:4 Unexpected keyword [28]: Unexpected keyword argument `a` to anonymous call. callables_annotation.py:35:4 Too many arguments [19]: PositionalOnly call expects 0 positional arguments, 1 was provided. -callables_annotation.py:51:28 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`. callables_annotation.py:55:4 Invalid type [31]: Expression `typing.Callable[int]` is not a valid type. callables_annotation.py:56:4 Invalid type [31]: Expression `typing.Callable[(int, int)]` is not a valid type. callables_annotation.py:57:4 Invalid type [31]: Expression `typing.Callable[([], [int])]` is not a valid type. callables_annotation.py:58:4 Invalid type [31]: Expression `typing.Callable[(int, int, int)]` is not a valid type. +callables_annotation.py:59:4 Undefined or invalid type [11]: Annotation `...` is not defined as a type. callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type. callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type. callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type. -callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`. callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`. callables_annotation.py:159:4 Incompatible variable type [9]: err1 is declared to have type `Proto5[typing.Any]` but is used as type `Proto8`. callables_annotation.py:166:0 Incompatible variable type [9]: Callback1 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. @@ -35,14 +34,11 @@ callables_annotation.py:189:8 Undefined or invalid type [11]: Annotation `Callba """ conformance_automated = "Fail" errors_diff = """ -Line 59: Expected 1 errors Line 91: Expected 1 errors Line 93: Expected 1 errors -Line 51: Unexpected errors ['callables_annotation.py:51:28 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`.'] Line 89: Unexpected errors ['callables_annotation.py:89:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type.'] Line 145: Unexpected errors ['callables_annotation.py:145:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.'] Line 151: Unexpected errors ['callables_annotation.py:151:9 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], None)]` is not a valid type.'] -Line 156: Unexpected errors ['callables_annotation.py:156:4 Incompatible variable type [9]: ok10 is declared to have type `Proto3` but is used as type `Proto4[[...]]`.'] Line 157: Unexpected errors ['callables_annotation.py:157:4 Incompatible variable type [9]: ok11 is declared to have type `Proto6` but is used as type `Proto7`.'] Line 166: Unexpected errors ['callables_annotation.py:166:0 Incompatible variable type [9]: Callback1 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] Line 167: Unexpected errors ['callables_annotation.py:167:0 Incompatible variable type [9]: Callback2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] diff --git a/conformance/results/pyre/callables_kwargs.toml b/conformance/results/pyre/callables_kwargs.toml index 0c22bec18..596abc4d4 100644 --- a/conformance/results/pyre/callables_kwargs.toml +++ b/conformance/results/pyre/callables_kwargs.toml @@ -4,6 +4,9 @@ Does not understand Unpack in the context of **kwargs annotation. """ output = """ callables_kwargs.py:22:20 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type. +callables_kwargs.py:24:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +callables_kwargs.py:32:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. +callables_kwargs.py:35:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. callables_kwargs.py:52:4 Too many arguments [19]: Call `func1` expects 1 positional argument, 4 were provided. callables_kwargs.py:62:12 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `str` but got `object`. callables_kwargs.py:64:10 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `str` but got `int`. @@ -21,5 +24,8 @@ Line 102: Expected 1 errors Line 103: Expected 1 errors Line 111: Expected 1 errors Line 22: Unexpected errors ['callables_kwargs.py:22:20 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type.'] +Line 24: Unexpected errors ['callables_kwargs.py:24:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] +Line 32: Unexpected errors ['callables_kwargs.py:32:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] +Line 35: Unexpected errors ['callables_kwargs.py:35:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] Line 62: Unexpected errors ['callables_kwargs.py:62:12 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `str` but got `object`.'] """ diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index 80e8d551d..91d038f07 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -8,6 +8,7 @@ Does not reject use of ClassVar in local variable annotation. Does not reject use of ClassVar in instance variable annotation. Does not reject use of ClassVar in return type annotation. Does not reject use of ClassVar in type alias definition. +Does not infer type from initialization for bare ClassVar. """ output = """ classes_classvar.py:33:0 Uninitialized attribute [13]: Attribute `bad1` is declared in class `ClassA` to have type `typing.Any` but is never initialized. @@ -21,6 +22,7 @@ classes_classvar.py:50:4 Incompatible attribute type [8]: Attribute `bad8` decla classes_classvar.py:52:10 Unbound name [10]: Name `Final` is used but not defined in the current scope. classes_classvar.py:63:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. classes_classvar.py:66:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. +classes_classvar.py:76:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`. classes_classvar.py:79:0 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized. classes_classvar.py:100:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? classes_classvar.py:129:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. @@ -38,5 +40,6 @@ Line 69: Expected 1 errors Line 70: Expected 1 errors Line 33: Unexpected errors ['classes_classvar.py:33:0 Uninitialized attribute [13]: Attribute `bad1` is declared in class `ClassA` to have type `typing.Any` but is never initialized.', 'classes_classvar.py:33:0 Uninitialized attribute [13]: Attribute `bad4` is declared in class `ClassA` to have type `Variable[T]` but is never initialized.', 'classes_classvar.py:33:0 Uninitialized attribute [13]: Attribute `bad5` is declared in class `ClassA` to have type `typing.List[Variable[T]]` but is never initialized.', 'classes_classvar.py:33:0 Uninitialized attribute [13]: Attribute `bad6` is declared in class `ClassA` to have type `typing.Callable[classes_classvar.P, typing.Any]` but is never initialized.'] Line 66: Unexpected errors ['classes_classvar.py:66:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] +Line 76: Unexpected errors ['classes_classvar.py:76:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.'] Line 79: Unexpected errors ['classes_classvar.py:79:0 Uninitialized attribute [13]: Attribute `damage` is declared in class `BasicStarship` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/classes_override.toml b/conformance/results/pyre/classes_override.toml index 484f0bdac..ac73d049b 100644 --- a/conformance/results/pyre/classes_override.toml +++ b/conformance/results/pyre/classes_override.toml @@ -1,35 +1,19 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not yet support the @override decorator. +Does not allow Any as a base class, leading to false positives. """ output = """ -classes_override.py:7:0 Undefined import [21]: Could not find a name `override` defined in module `typing`. -classes_override.py:37:5 Undefined attribute [16]: Module `typing` has no attribute `override`. -classes_override.py:52:5 Undefined attribute [16]: Module `typing` has no attribute `override`. classes_override.py:53:4 Invalid override [40]: `classes_override.ChildA.method3` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -classes_override.py:64:5 Undefined attribute [16]: Module `typing` has no attribute `override`. classes_override.py:65:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). classes_override.py:65:4 Invalid override [40]: `classes_override.ChildA.method4` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -classes_override.py:78:5 Undefined attribute [16]: Module `typing` has no attribute `override`. classes_override.py:79:4 Invalid override [40]: `classes_override.ChildA.static_method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -classes_override.py:83:5 Undefined attribute [16]: Module `typing` has no attribute `override`. classes_override.py:84:4 Invalid override [40]: `classes_override.ChildA.class_method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. -classes_override.py:88:5 Undefined attribute [16]: Module `typing` has no attribute `override`. classes_override.py:89:4 Invalid override [40]: `classes_override.ChildA.property1` is decorated with @override, but no method of the same name exists in superclasses of `ChildA`. classes_override.py:95:14 Invalid inheritance [39]: `typing.Any` is not a valid parent class. -classes_override.py:100:5 Undefined attribute [16]: Module `typing` has no attribute `override`. classes_override.py:101:4 Invalid override [40]: `classes_override.ChildB.method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildB`. """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['classes_override.py:7:0 Undefined import [21]: Could not find a name `override` defined in module `typing`.'] -Line 37: Unexpected errors ['classes_override.py:37:5 Undefined attribute [16]: Module `typing` has no attribute `override`.'] -Line 52: Unexpected errors ['classes_override.py:52:5 Undefined attribute [16]: Module `typing` has no attribute `override`.'] -Line 64: Unexpected errors ['classes_override.py:64:5 Undefined attribute [16]: Module `typing` has no attribute `override`.'] -Line 78: Unexpected errors ['classes_override.py:78:5 Undefined attribute [16]: Module `typing` has no attribute `override`.'] -Line 83: Unexpected errors ['classes_override.py:83:5 Undefined attribute [16]: Module `typing` has no attribute `override`.'] -Line 88: Unexpected errors ['classes_override.py:88:5 Undefined attribute [16]: Module `typing` has no attribute `override`.'] Line 95: Unexpected errors ['classes_override.py:95:14 Invalid inheritance [39]: `typing.Any` is not a valid parent class.'] -Line 100: Unexpected errors ['classes_override.py:100:5 Undefined attribute [16]: Module `typing` has no attribute `override`.'] Line 101: Unexpected errors ['classes_override.py:101:4 Invalid override [40]: `classes_override.ChildB.method1` is decorated with @override, but no method of the same name exists in superclasses of `ChildB`.'] """ diff --git a/conformance/results/pyre/constructors_call_init.toml b/conformance/results/pyre/constructors_call_init.toml index a249a7d19..9358ef095 100644 --- a/conformance/results/pyre/constructors_call_init.toml +++ b/conformance/results/pyre/constructors_call_init.toml @@ -9,12 +9,18 @@ errors_diff = """ Line 42: Expected 1 errors Line 56: Expected 1 errors Line 107: Expected 1 errors +Line 24: Unexpected errors ['constructors_call_init.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] Line 61: Unexpected errors ['constructors_call_init.py:61:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `61`.'] Line 63: Unexpected errors ['constructors_call_init.py:63:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `63`.'] +Line 91: Unexpected errors ["constructors_call_init.py:91:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`."] +Line 99: Unexpected errors ["constructors_call_init.py:99:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[str, int]` but got `Class7[typing_extensions.Literal[''], typing_extensions.Literal[0]]`."] """ output = """ constructors_call_init.py:21:12 Incompatible parameter type [6]: In call `Class1.__init__`, for 1st positional argument, expected `int` but got `float`. +constructors_call_init.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`. constructors_call_init.py:61:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `61`. constructors_call_init.py:63:4 Incompatible overload [43]: The implementation of `Class5.__init__` does not accept all possible arguments of overload defined on line `63`. +constructors_call_init.py:91:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`. +constructors_call_init.py:99:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[str, int]` but got `Class7[typing_extensions.Literal[''], typing_extensions.Literal[0]]`. constructors_call_init.py:130:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. """ diff --git a/conformance/results/pyre/constructors_call_new.toml b/conformance/results/pyre/constructors_call_new.toml index bf3c61744..3974f524a 100644 --- a/conformance/results/pyre/constructors_call_new.toml +++ b/conformance/results/pyre/constructors_call_new.toml @@ -6,15 +6,25 @@ Does not report errors during binding to cls parameter of __new__ method. conformance_automated = "Fail" errors_diff = """ Line 145: Expected 1 errors -Line 49: Unexpected errors ['constructors_call_new.py:49:12 Missing argument [20]: Call `Class3.__init__` expects argument `x`.'] -Line 64: Unexpected errors ['constructors_call_new.py:64:12 Missing argument [20]: Call `Class4.__init__` expects argument `x`.'] -Line 76: Unexpected errors ['constructors_call_new.py:76:16 Missing argument [20]: Call `Class5.__init__` expects argument `x`.'] -Line 89: Unexpected errors ['constructors_call_new.py:89:12 Missing argument [20]: Call `Class6.__init__` expects argument `x`.'] +Line 23: Unexpected errors ['constructors_call_new.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] +Line 35: Unexpected errors ['constructors_call_new.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`.'] +Line 36: Unexpected errors ["constructors_call_new.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`."] +Line 49: Unexpected errors ['constructors_call_new.py:49:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class3`.', 'constructors_call_new.py:49:12 Missing argument [20]: Call `Class3.__init__` expects argument `x`.'] +Line 64: Unexpected errors ['constructors_call_new.py:64:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Any` but got `Class4`.', 'constructors_call_new.py:64:12 Missing argument [20]: Call `Class4.__init__` expects argument `x`.'] +Line 76: Unexpected errors ['constructors_call_new.py:76:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `NoReturn` but got `Class5`.', 'constructors_call_new.py:76:16 Missing argument [20]: Call `Class5.__init__` expects argument `x`.'] +Line 89: Unexpected errors ['constructors_call_new.py:89:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[Class6, int]` but got `Class6`.', 'constructors_call_new.py:89:12 Missing argument [20]: Call `Class6.__init__` expects argument `x`.'] """ output = """ constructors_call_new.py:21:12 Incompatible parameter type [6]: In call `Class1.__new__`, for 1st positional argument, expected `int` but got `float`. +constructors_call_new.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`. +constructors_call_new.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`. +constructors_call_new.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`. +constructors_call_new.py:49:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class3`. constructors_call_new.py:49:12 Missing argument [20]: Call `Class3.__init__` expects argument `x`. +constructors_call_new.py:64:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Any` but got `Class4`. constructors_call_new.py:64:12 Missing argument [20]: Call `Class4.__init__` expects argument `x`. +constructors_call_new.py:76:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `NoReturn` but got `Class5`. constructors_call_new.py:76:16 Missing argument [20]: Call `Class5.__init__` expects argument `x`. +constructors_call_new.py:89:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[Class6, int]` but got `Class6`. constructors_call_new.py:89:12 Missing argument [20]: Call `Class6.__init__` expects argument `x`. """ diff --git a/conformance/results/pyre/constructors_callable.toml b/conformance/results/pyre/constructors_callable.toml index a331160db..bc7ec6948 100644 --- a/conformance/results/pyre/constructors_callable.toml +++ b/conformance/results/pyre/constructors_callable.toml @@ -11,30 +11,61 @@ Line 127: Expected 1 errors Line 144: Expected 1 errors Line 184: Expected 1 errors Line 195: Expected 1 errors +Line 36: Unexpected errors ['constructors_callable.py:36:0 Revealed type [-1]: Revealed type for `r1` is `typing.Callable[[Named(x, int)], Class1]`.'] +Line 49: Unexpected errors ['constructors_callable.py:49:0 Revealed type [-1]: Revealed type for `r2` is `typing.Callable[[], Class2]`.'] +Line 63: Unexpected errors ['constructors_callable.py:63:0 Revealed type [-1]: Revealed type for `r3` is `typing.Callable[[Named(x, int)], Class3]`.'] +Line 77: Unexpected errors ['constructors_callable.py:77:0 Revealed type [-1]: Revealed type for `r4` is `typing.Callable[[Named(x, int)], Class4]`.'] +Line 78: Unexpected errors ['constructors_callable.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class4`.'] +Line 97: Unexpected errors ['constructors_callable.py:97:0 Revealed type [-1]: Revealed type for `r5` is `typing.Callable[[Variable(typing.Any), Keywords(typing.Any)], NoReturn]`.'] Line 117: Unexpected errors ['constructors_callable.py:117:8 Incompatible return type [7]: Expected `Class6Proxy` but got `Class6`.'] -Line 126: Unexpected errors ['constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] -Line 143: Unexpected errors ['constructors_callable.py:143:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] +Line 125: Unexpected errors ['constructors_callable.py:125:0 Revealed type [-1]: Revealed type for `r6` is `typing.Callable[[Named(x, int)], Class6]`.'] +Line 126: Unexpected errors ['constructors_callable.py:126:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6Proxy` but got `Class6`.', 'constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] +Line 142: Unexpected errors ['constructors_callable.py:142:0 Revealed type [-1]: Revealed type for `r6_any` is `typing.Callable[[Named(x, int)], Class6Any]`.'] +Line 143: Unexpected errors ['constructors_callable.py:143:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Any` but got `Class6Any`.', 'constructors_callable.py:143:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] Line 153: Unexpected errors ['constructors_callable.py:153:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `153`.'] Line 155: Unexpected errors ['constructors_callable.py:155:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `155`.'] -Line 165: Unexpected errors ['constructors_callable.py:165:15 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`.'] +Line 161: Unexpected errors ['constructors_callable.py:161:0 Revealed type [-1]: Revealed type for `r7` is `typing.Callable[[Named(x, int)], Class7[typing.Any]]`.'] +Line 164: Unexpected errors ['constructors_callable.py:164:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[int]` but got `Class7[typing.Any]`.'] +Line 165: Unexpected errors ['constructors_callable.py:165:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[str]` but got `Class7[typing.Any]`.', 'constructors_callable.py:165:15 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`.'] Line 181: Unexpected errors ['constructors_callable.py:181:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class8]`.'] +Line 182: Unexpected errors ['constructors_callable.py:182:0 Revealed type [-1]: Revealed type for `r8` is `typing.Callable[..., typing.Any]`.'] +Line 183: Unexpected errors ['constructors_callable.py:183:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class8[str]` but got `typing.Any`.'] Line 192: Unexpected errors ['constructors_callable.py:192:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class9]`.'] +Line 193: Unexpected errors ['constructors_callable.py:193:0 Revealed type [-1]: Revealed type for `r9` is `typing.Callable[..., typing.Any]`.'] +Line 194: Unexpected errors ['constructors_callable.py:194:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class9` but got `typing.Any`.'] """ output = """ +constructors_callable.py:36:0 Revealed type [-1]: Revealed type for `r1` is `typing.Callable[[Named(x, int)], Class1]`. constructors_callable.py:38:0 Missing argument [20]: PositionalOnly call expects argument `x`. constructors_callable.py:39:0 Unexpected keyword [28]: Unexpected keyword argument `y` to anonymous call. +constructors_callable.py:49:0 Revealed type [-1]: Revealed type for `r2` is `typing.Callable[[], Class2]`. constructors_callable.py:51:0 Too many arguments [19]: PositionalOnly call expects 0 positional arguments, 1 was provided. +constructors_callable.py:63:0 Revealed type [-1]: Revealed type for `r3` is `typing.Callable[[Named(x, int)], Class3]`. constructors_callable.py:65:0 Missing argument [20]: PositionalOnly call expects argument `x`. constructors_callable.py:66:0 Unexpected keyword [28]: Unexpected keyword argument `y` to anonymous call. constructors_callable.py:67:0 Too many arguments [19]: PositionalOnly call expects 1 positional argument, 2 were provided. +constructors_callable.py:77:0 Revealed type [-1]: Revealed type for `r4` is `typing.Callable[[Named(x, int)], Class4]`. +constructors_callable.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Class4`. constructors_callable.py:79:0 Missing argument [20]: PositionalOnly call expects argument `x`. constructors_callable.py:80:0 Unexpected keyword [28]: Unexpected keyword argument `y` to anonymous call. +constructors_callable.py:97:0 Revealed type [-1]: Revealed type for `r5` is `typing.Callable[[Variable(typing.Any), Keywords(typing.Any)], NoReturn]`. constructors_callable.py:117:8 Incompatible return type [7]: Expected `Class6Proxy` but got `Class6`. +constructors_callable.py:125:0 Revealed type [-1]: Revealed type for `r6` is `typing.Callable[[Named(x, int)], Class6]`. +constructors_callable.py:126:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class6Proxy` but got `Class6`. constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`. +constructors_callable.py:142:0 Revealed type [-1]: Revealed type for `r6_any` is `typing.Callable[[Named(x, int)], Class6Any]`. +constructors_callable.py:143:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Any` but got `Class6Any`. constructors_callable.py:143:12 Missing argument [20]: PositionalOnly call expects argument `x`. constructors_callable.py:153:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `153`. constructors_callable.py:155:4 Incompatible overload [43]: The implementation of `Class7.__init__` does not accept all possible arguments of overload defined on line `155`. +constructors_callable.py:161:0 Revealed type [-1]: Revealed type for `r7` is `typing.Callable[[Named(x, int)], Class7[typing.Any]]`. +constructors_callable.py:164:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[int]` but got `Class7[typing.Any]`. +constructors_callable.py:165:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class7[str]` but got `Class7[typing.Any]`. constructors_callable.py:165:15 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`. constructors_callable.py:181:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class8]`. +constructors_callable.py:182:0 Revealed type [-1]: Revealed type for `r8` is `typing.Callable[..., typing.Any]`. +constructors_callable.py:183:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class8[str]` but got `typing.Any`. constructors_callable.py:192:22 Incompatible parameter type [6]: In call `accepts_callable`, for 1st positional argument, expected `typing.Callable[constructors_callable.P, Variable[R]]` but got `Type[Class9]`. +constructors_callable.py:193:0 Revealed type [-1]: Revealed type for `r9` is `typing.Callable[..., typing.Any]`. +constructors_callable.py:194:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class9` but got `typing.Any`. """ diff --git a/conformance/results/pyre/dataclasses_descriptors.toml b/conformance/results/pyre/dataclasses_descriptors.toml index 929ca9616..0f99b5978 100644 --- a/conformance/results/pyre/dataclasses_descriptors.toml +++ b/conformance/results/pyre/dataclasses_descriptors.toml @@ -4,8 +4,16 @@ Incorrectly generates error when calling constructor of dataclass with descripto """ output = """ dataclasses_descriptors.py:35:10 Incompatible parameter type [6]: In call `DC1.__init__`, for 1st positional argument, expected `Desc1` but got `int`. +dataclasses_descriptors.py:61:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `Desc2[int]`. +dataclasses_descriptors.py:62:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[str]` but got `Desc2[str]`. +dataclasses_descriptors.py:66:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Desc2[int]`. +dataclasses_descriptors.py:67:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Desc2[str]`. """ conformance_automated = "Fail" errors_diff = """ Line 35: Unexpected errors ['dataclasses_descriptors.py:35:10 Incompatible parameter type [6]: In call `DC1.__init__`, for 1st positional argument, expected `Desc1` but got `int`.'] +Line 61: Unexpected errors ['dataclasses_descriptors.py:61:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `Desc2[int]`.'] +Line 62: Unexpected errors ['dataclasses_descriptors.py:62:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[str]` but got `Desc2[str]`.'] +Line 66: Unexpected errors ['dataclasses_descriptors.py:66:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Desc2[int]`.'] +Line 67: Unexpected errors ['dataclasses_descriptors.py:67:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Desc2[str]`.'] """ diff --git a/conformance/results/pyre/dataclasses_order.toml b/conformance/results/pyre/dataclasses_order.toml index 48d3afa18..0452db28b 100644 --- a/conformance/results/pyre/dataclasses_order.toml +++ b/conformance/results/pyre/dataclasses_order.toml @@ -1,10 +1,7 @@ -conformant = "Partial" -notes = """ -Does not report type incompatibility with comparison operator. -""" +conformant = "Pass" output = """ +dataclasses_order.py:50:3 Unsupported operand [58]: `<` is not supported for operand types `DC1` and `DC2`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 50: Expected 1 errors """ diff --git a/conformance/results/pyre/dataclasses_postinit.toml b/conformance/results/pyre/dataclasses_postinit.toml index 6e870e508..311994866 100644 --- a/conformance/results/pyre/dataclasses_postinit.toml +++ b/conformance/results/pyre/dataclasses_postinit.toml @@ -1,16 +1,28 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ Does not perform validation of `__post_init__` method. -Does not reject access of `InitVar` from object. +Incorrectly complains on the assignment of `InitVar` in class bodies. """ output = """ +dataclasses_postinit.py:15:4 Undefined attribute [16]: `typing.Type` has no attribute `x`. +dataclasses_postinit.py:17:4 Undefined attribute [16]: `typing.Type` has no attribute `y`. +dataclasses_postinit.py:28:6 Undefined attribute [16]: `DC1` has no attribute `x`. +dataclasses_postinit.py:29:6 Undefined attribute [16]: `DC1` has no attribute `y`. +dataclasses_postinit.py:33:4 Undefined attribute [16]: `typing.Type` has no attribute `x`. +dataclasses_postinit.py:34:4 Undefined attribute [16]: `typing.Type` has no attribute `y`. +dataclasses_postinit.py:42:4 Undefined attribute [16]: `typing.Type` has no attribute `_name`. +dataclasses_postinit.py:51:4 Undefined attribute [16]: `typing.Type` has no attribute `_age`. dataclasses_postinit.py:54:4 Inconsistent override [14]: `dataclasses_postinit.DC4.__post_init__` overrides method defined in `DC3` inconsistently. Could not find parameter `_age` in overridden signature. """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors -Line 28: Expected 1 errors -Line 29: Expected 1 errors Line 36: Expected 1 errors +Line 15: Unexpected errors ['dataclasses_postinit.py:15:4 Undefined attribute [16]: `typing.Type` has no attribute `x`.'] +Line 17: Unexpected errors ['dataclasses_postinit.py:17:4 Undefined attribute [16]: `typing.Type` has no attribute `y`.'] +Line 33: Unexpected errors ['dataclasses_postinit.py:33:4 Undefined attribute [16]: `typing.Type` has no attribute `x`.'] +Line 34: Unexpected errors ['dataclasses_postinit.py:34:4 Undefined attribute [16]: `typing.Type` has no attribute `y`.'] +Line 42: Unexpected errors ['dataclasses_postinit.py:42:4 Undefined attribute [16]: `typing.Type` has no attribute `_name`.'] +Line 51: Unexpected errors ['dataclasses_postinit.py:51:4 Undefined attribute [16]: `typing.Type` has no attribute `_age`.'] Line 54: Unexpected errors ['dataclasses_postinit.py:54:4 Inconsistent override [14]: `dataclasses_postinit.DC4.__post_init__` overrides method defined in `DC3` inconsistently. Could not find parameter `_age` in overridden signature.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_class.toml b/conformance/results/pyre/dataclasses_transform_class.toml index 89bb4257c..e340ff43a 100644 --- a/conformance/results/pyre/dataclasses_transform_class.toml +++ b/conformance/results/pyre/dataclasses_transform_class.toml @@ -1,40 +1,24 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not understand @dataclass_transform. +Does not validate when a non-frozen model derives from a frozen one. +Does not support field specifiers. """ output = """ dataclasses_transform_class.py:27:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized. -dataclasses_transform_class.py:52:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. -dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_class.py:63:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:65:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. +dataclasses_transform_class.py:60:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. +dataclasses_transform_class.py:63:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. dataclasses_transform_class.py:69:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_class.py:71:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_class.py:73:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_class.py:75:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. -dataclasses_transform_class.py:79:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_class.py:79:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. dataclasses_transform_class.py:86:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. -dataclasses_transform_class.py:103:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. dataclasses_transform_class.py:107:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. -dataclasses_transform_class.py:111:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer3` to have type `int` but is never initialized. -dataclasses_transform_class.py:111:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer3` to have type `str` but is never initialized. -dataclasses_transform_class.py:116:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_class.py:119:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ Line 48: Expected 1 errors -Line 60: Expected 1 errors -Line 119: Expected 1 errors Line 27: Unexpected errors ['dataclasses_transform_class.py:27:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBase` to have type `str` but is never initialized.'] -Line 52: Unexpected errors ['dataclasses_transform_class.py:52:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.'] -Line 57: Unexpected errors ['dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 65: Unexpected errors ['dataclasses_transform_class.py:65:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 71: Unexpected errors ['dataclasses_transform_class.py:71:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 73: Unexpected errors ['dataclasses_transform_class.py:73:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 75: Unexpected errors ['dataclasses_transform_class.py:75:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] +Line 57: Unexpected errors ['dataclasses_transform_class.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] Line 86: Unexpected errors ['dataclasses_transform_class.py:86:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] -Line 103: Unexpected errors ['dataclasses_transform_class.py:103:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] Line 107: Unexpected errors ['dataclasses_transform_class.py:107:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] -Line 111: Unexpected errors ['dataclasses_transform_class.py:111:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer3` to have type `int` but is never initialized.', 'dataclasses_transform_class.py:111:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer3` to have type `str` but is never initialized.'] -Line 116: Unexpected errors ['dataclasses_transform_class.py:116:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_field.toml b/conformance/results/pyre/dataclasses_transform_field.toml index 592b60c31..b17502676 100644 --- a/conformance/results/pyre/dataclasses_transform_field.toml +++ b/conformance/results/pyre/dataclasses_transform_field.toml @@ -1,17 +1,19 @@ conformant = "Unsupported" notes = """ -Does not understand @dataclass_transform. +Does not understand dataclass transform field specifiers. """ output = """ dataclasses_transform_field.py:49:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -dataclasses_transform_field.py:60:0 Unexpected keyword [28]: Unexpected keyword argument `name` to call `object.__init__`. -dataclasses_transform_field.py:64:0 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_field.py:75:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -dataclasses_transform_field.py:77:0 Unexpected keyword [28]: Unexpected keyword argument `name` to call `object.__init__`. +dataclasses_transform_field.py:59:0 Missing argument [20]: Call `CustomerModel1.__init__` expects argument `id`. +dataclasses_transform_field.py:60:0 Missing argument [20]: Call `CustomerModel1.__init__` expects argument `id`. +dataclasses_transform_field.py:75:0 Too many arguments [19]: Call `CustomerModel2.__init__` expects 0 positional arguments, 1 was provided. +dataclasses_transform_field.py:77:0 Missing argument [20]: Call `CustomerModel2.__init__` expects argument `id`. """ conformance_automated = "Fail" errors_diff = """ +Line 64: Expected 1 errors Line 49: Unexpected errors ["dataclasses_transform_field.py:49:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 60: Unexpected errors ['dataclasses_transform_field.py:60:0 Unexpected keyword [28]: Unexpected keyword argument `name` to call `object.__init__`.'] -Line 77: Unexpected errors ['dataclasses_transform_field.py:77:0 Unexpected keyword [28]: Unexpected keyword argument `name` to call `object.__init__`.'] +Line 59: Unexpected errors ['dataclasses_transform_field.py:59:0 Missing argument [20]: Call `CustomerModel1.__init__` expects argument `id`.'] +Line 60: Unexpected errors ['dataclasses_transform_field.py:60:0 Missing argument [20]: Call `CustomerModel1.__init__` expects argument `id`.'] +Line 77: Unexpected errors ['dataclasses_transform_field.py:77:0 Missing argument [20]: Call `CustomerModel2.__init__` expects argument `id`.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_func.toml b/conformance/results/pyre/dataclasses_transform_func.toml index c7d47f6f5..461f76dc0 100644 --- a/conformance/results/pyre/dataclasses_transform_func.toml +++ b/conformance/results/pyre/dataclasses_transform_func.toml @@ -1,6 +1,8 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not understand @dataclass_transform. +Does not understand @dataclass_transform when it is +applied only to overloads of a decorator but not the +definition. """ output = """ dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`. @@ -19,14 +21,11 @@ dataclasses_transform_func.py:65:7 Unexpected keyword [28]: Unexpected keyword a dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. dataclasses_transform_func.py:71:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. -dataclasses_transform_func.py:82:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer3` to have type `int` but is never initialized. -dataclasses_transform_func.py:82:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer3` to have type `str` but is never initialized. dataclasses_transform_func.py:90:0 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized. -dataclasses_transform_func.py:94:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_func.py:97:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 97: Expected 1 errors Line 20: Unexpected errors ['dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`.'] Line 25: Unexpected errors ["dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] Line 29: Unexpected errors ['dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] @@ -37,6 +36,4 @@ Line 50: Unexpected errors ['dataclasses_transform_func.py:50:7 Unexpected keywo Line 53: Unexpected errors ['dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.'] Line 67: Unexpected errors ['dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] Line 73: Unexpected errors ['dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] -Line 82: Unexpected errors ['dataclasses_transform_func.py:82:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer3` to have type `int` but is never initialized.', 'dataclasses_transform_func.py:82:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer3` to have type `str` but is never initialized.'] -Line 94: Unexpected errors ['dataclasses_transform_func.py:94:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_meta.toml b/conformance/results/pyre/dataclasses_transform_meta.toml index 2045bb6d4..b773b53e4 100644 --- a/conformance/results/pyre/dataclasses_transform_meta.toml +++ b/conformance/results/pyre/dataclasses_transform_meta.toml @@ -1,34 +1,19 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not understand @dataclass_transform. +Does not understand custom field specifiers. """ output = """ dataclasses_transform_meta.py:25:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized. -dataclasses_transform_meta.py:52:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. -dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_meta.py:63:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:66:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. +dataclasses_transform_meta.py:60:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. +dataclasses_transform_meta.py:63:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. dataclasses_transform_meta.py:70:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_meta.py:72:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_meta.py:74:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_meta.py:76:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. -dataclasses_transform_meta.py:80:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:92:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer3` to have type `int` but is never initialized. -dataclasses_transform_meta.py:92:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer3` to have type `str` but is never initialized. -dataclasses_transform_meta.py:97:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_meta.py:80:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_meta.py:100:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ Line 48: Expected 1 errors -Line 60: Expected 1 errors -Line 100: Expected 1 errors Line 25: Unexpected errors ['dataclasses_transform_meta.py:25:0 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelMeta` to have type `str` but is never initialized.'] -Line 52: Unexpected errors ['dataclasses_transform_meta.py:52:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.'] -Line 57: Unexpected errors ['dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 66: Unexpected errors ['dataclasses_transform_meta.py:66:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 72: Unexpected errors ['dataclasses_transform_meta.py:72:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 74: Unexpected errors ['dataclasses_transform_meta.py:74:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 76: Unexpected errors ['dataclasses_transform_meta.py:76:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] -Line 92: Unexpected errors ['dataclasses_transform_meta.py:92:0 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer3` to have type `int` but is never initialized.', 'dataclasses_transform_meta.py:92:0 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer3` to have type `str` but is never initialized.'] -Line 97: Unexpected errors ['dataclasses_transform_meta.py:97:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] +Line 57: Unexpected errors ['dataclasses_transform_meta.py:57:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] """ diff --git a/conformance/results/pyre/dataclasses_usage.toml b/conformance/results/pyre/dataclasses_usage.toml index 88ef2af99..c3feb171e 100644 --- a/conformance/results/pyre/dataclasses_usage.toml +++ b/conformance/results/pyre/dataclasses_usage.toml @@ -2,14 +2,18 @@ conformant = "Partial" notes = """ Does not report error when field with no default follows field with default. Incorrectly reports error with InitVar that has default value. +Complains on `assert_type` when used for bound methods vs `Callable`. +Does not understand `__dataclass_fields__`. """ output = """ dataclasses_usage.py:50:5 Missing argument [20]: Call `InventoryItem.__init__` expects argument `unit_price`. dataclasses_usage.py:51:27 Incompatible parameter type [6]: In call `InventoryItem.__init__`, for 2nd positional argument, expected `float` but got `str`. dataclasses_usage.py:52:5 Too many arguments [19]: Call `InventoryItem.__init__` expects 3 positional arguments, 4 were provided. dataclasses_usage.py:72:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC3` has type `InitVar[int]` but is used as type `int`. +dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. dataclasses_usage.py:83:5 Too many arguments [19]: Call `DC4.__init__` expects 1 positional argument, 2 were provided. dataclasses_usage.py:88:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC5` has type `int` but is used as type `str`. +dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`. dataclasses_usage.py:115:0 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized. dataclasses_usage.py:126:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. dataclasses_usage.py:129:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. @@ -17,14 +21,17 @@ dataclasses_usage.py:171:0 Uninitialized attribute [13]: Attribute `x` is declar dataclasses_usage.py:171:0 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. dataclasses_usage.py:178:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. dataclasses_usage.py:204:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. +dataclasses_usage.py:212:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. """ conformance_automated = "Fail" errors_diff = """ Lines 58, 61: Expected error (tag 'DC1') Lines 64, 67: Expected error (tag 'DC2') Lines 70, 73: Expected error (tag 'DC3') -Line 72: Unexpected errors ['dataclasses_usage.py:72:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC3` has type `InitVar[int]` but is used as type `int`.'] +Line 72: Unexpected errors ['dataclasses_usage.py:72:4 Incompatible attribute type [8]: Attribute `a` declared in class `DC3` has type `InitVar[int]` but is used as type `int`.', 'dataclasses_usage.py:72:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] +Line 106: Unexpected errors ['dataclasses_usage.py:106:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing.Callable[[str], int]` but got `BoundMethod[typing.Callable[[str], int], DC6]`.'] Line 115: Unexpected errors ['dataclasses_usage.py:115:0 Uninitialized attribute [13]: Attribute `y` is declared in class `DC8` to have type `int` but is never initialized.'] Line 171: Unexpected errors ['dataclasses_usage.py:171:0 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.', 'dataclasses_usage.py:171:0 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] Line 204: Unexpected errors ['dataclasses_usage.py:204:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] +Line 212: Unexpected errors ['dataclasses_usage.py:212:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`.'] """ diff --git a/conformance/results/pyre/directives_assert_type.toml b/conformance/results/pyre/directives_assert_type.toml index b16852d99..2afa3ee8f 100644 --- a/conformance/results/pyre/directives_assert_type.toml +++ b/conformance/results/pyre/directives_assert_type.toml @@ -1,15 +1,15 @@ -conformant = "Unsupported" +conformant = "Pass" notes = """ -Does not understand "assert_type". +Does not weaken literal types in `assert_type`, which some (other) tests rely on. """ output = """ +directives_assert_type.py:27:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Union[int, str]`. +directives_assert_type.py:28:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +directives_assert_type.py:29:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[4]`. directives_assert_type.py:31:4 Missing argument [20]: Call `assert_type` expects argument in position 0. +directives_assert_type.py:32:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `str`. directives_assert_type.py:33:4 Too many arguments [19]: Call `assert_type` expects 2 positional arguments, 3 were provided. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 27: Expected 1 errors -Line 28: Expected 1 errors -Line 29: Expected 1 errors -Line 32: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_reveal_type.toml b/conformance/results/pyre/directives_reveal_type.toml index 5a0f84eb9..92a179946 100644 --- a/conformance/results/pyre/directives_reveal_type.toml +++ b/conformance/results/pyre/directives_reveal_type.toml @@ -1,11 +1,19 @@ -conformant = "Unsupported" -notes = """ -Does not understand reveal_type call. +conformant = "Partial" +notes = """" +Produces errors rather than warnings on `reveal_type`. """ output = """ +directives_reveal_type.py:14:4 Revealed type [-1]: Revealed type for `a` is `typing.Union[int, str]`. +directives_reveal_type.py:15:4 Revealed type [-1]: Revealed type for `b` is `typing.List[int]`. +directives_reveal_type.py:16:4 Revealed type [-1]: Revealed type for `c` is `typing.Any`. +directives_reveal_type.py:17:4 Revealed type [-1]: Revealed type for `d` is `ForwardReference`. directives_reveal_type.py:19:4 Missing argument [20]: Call `reveal_type` expects argument in position 0. -directives_reveal_type.py:20:4 Too many arguments [19]: Call `reveal_type` expects 1 positional argument, 2 were provided. +directives_reveal_type.py:20:4 Revealed type [-1]: Revealed type for `a` is `typing.Union[int, str]`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 14: Unexpected errors ['directives_reveal_type.py:14:4 Revealed type [-1]: Revealed type for `a` is `typing.Union[int, str]`.'] +Line 15: Unexpected errors ['directives_reveal_type.py:15:4 Revealed type [-1]: Revealed type for `b` is `typing.List[int]`.'] +Line 16: Unexpected errors ['directives_reveal_type.py:16:4 Revealed type [-1]: Revealed type for `c` is `typing.Any`.'] +Line 17: Unexpected errors ['directives_reveal_type.py:17:4 Revealed type [-1]: Revealed type for `d` is `ForwardReference`.'] """ diff --git a/conformance/results/pyre/exceptions_context_managers.toml b/conformance/results/pyre/exceptions_context_managers.toml index be211bd5b..9dff9945b 100644 --- a/conformance/results/pyre/exceptions_context_managers.toml +++ b/conformance/results/pyre/exceptions_context_managers.toml @@ -1,6 +1,13 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Unsupported" +notes = """ +Does not understand context manager exception rules. +""" +conformance_automated = "Fail" errors_diff = """ +Line 50: Unexpected errors ['exceptions_context_managers.py:50:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[int, str]` but got `str`.'] +Line 57: Unexpected errors ['exceptions_context_managers.py:57:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[int, str]` but got `str`.'] """ output = """ +exceptions_context_managers.py:50:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[int, str]` but got `str`. +exceptions_context_managers.py:57:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[int, str]` but got `str`. """ diff --git a/conformance/results/pyre/generics_base_class.toml b/conformance/results/pyre/generics_base_class.toml index 7bb398784..0e50c8f7e 100644 --- a/conformance/results/pyre/generics_base_class.toml +++ b/conformance/results/pyre/generics_base_class.toml @@ -5,7 +5,6 @@ Does not allow using generic in assert_type expression. """ output = """ generics_base_class.py:26:25 Incompatible parameter type [6]: In call `takes_dict_incorrect`, for 1st positional argument, expected `Dict[str, List[object]]` but got `SymbolTable`. -generics_base_class.py:45:25 Undefined attribute [16]: `typing.Iterator` has no attribute `__getitem__`. generics_base_class.py:49:21 Invalid type parameters [24]: Generic type `LinkedList` expects 1 type parameter, received 2. generics_base_class.py:61:17 Invalid type parameters [24]: Generic type `MyDict` expects 1 type parameter, received 2. generics_base_class.py:68:0 Duplicate type variables [59]: Duplicate type variable `T` in Generic[...]. @@ -14,5 +13,4 @@ conformance_automated = "Fail" errors_diff = """ Line 29: Expected 1 errors Line 30: Expected 1 errors -Line 45: Unexpected errors ['generics_base_class.py:45:25 Undefined attribute [16]: `typing.Iterator` has no attribute `__getitem__`.'] """ diff --git a/conformance/results/pyre/generics_basic.toml b/conformance/results/pyre/generics_basic.toml index 186066834..b7e8d00b0 100644 --- a/conformance/results/pyre/generics_basic.toml +++ b/conformance/results/pyre/generics_basic.toml @@ -7,21 +7,19 @@ False positive using `iter`. False negative for generic metaclass. """ output = """ -generics_basic.py:34:4 Incompatible return type [7]: Expected `Variable[AnyStr <: [str, bytes]]` but got `bytes`. -generics_basic.py:34:15 Incompatible parameter type [6]: In call `bytes.__add__`, for 1st positional argument, expected `Union[array[typing.Any], bytearray, bytes, _CData, memoryview, mmap, PickleBuffer]` but got `Variable[AnyStr <: [str, bytes]]`. +generics_basic.py:34:4 Incompatible return type [7]: Expected `Variable[AnyStr <: [str, bytes]]` but got `str`. +generics_basic.py:34:15 Incompatible parameter type [6]: In call `str.__add__`, for 1st positional argument, expected `str` but got `Variable[AnyStr <: [str, bytes]]`. generics_basic.py:40:14 Incompatible parameter type [6]: In call `concat`, for 2nd positional argument, expected `Variable[AnyStr <: [str, bytes]]` but got `bytes`. generics_basic.py:41:14 Incompatible parameter type [6]: In call `concat`, for 2nd positional argument, expected `Variable[AnyStr <: [str, bytes]]` but got `str`. generics_basic.py:49:0 Invalid type [31]: TypeVar can't have a single explicit constraint. Did you mean `bound=str`? -generics_basic.py:55:57 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. +generics_basic.py:55:52 Undefined attribute [16]: `list` has no attribute `__getitem__`. generics_basic.py:69:14 Incompatible parameter type [6]: In call `concat`, for 2nd positional argument, expected `Variable[AnyStr <: [str, bytes]]` but got `bytes`. generics_basic.py:121:0 Duplicate type variables [59]: Duplicate type variable `T` in Generic[...]. -generics_basic.py:182:25 Undefined attribute [16]: `typing.Iterator` has no attribute `__getitem__`. """ conformance_automated = "Fail" errors_diff = """ Line 157: Expected 1 errors Line 158: Expected 1 errors Line 191: Expected 1 errors -Line 34: Unexpected errors ['generics_basic.py:34:4 Incompatible return type [7]: Expected `Variable[AnyStr <: [str, bytes]]` but got `bytes`.', 'generics_basic.py:34:15 Incompatible parameter type [6]: In call `bytes.__add__`, for 1st positional argument, expected `Union[array[typing.Any], bytearray, bytes, _CData, memoryview, mmap, PickleBuffer]` but got `Variable[AnyStr <: [str, bytes]]`.'] -Line 182: Unexpected errors ['generics_basic.py:182:25 Undefined attribute [16]: `typing.Iterator` has no attribute `__getitem__`.'] +Line 34: Unexpected errors ['generics_basic.py:34:4 Incompatible return type [7]: Expected `Variable[AnyStr <: [str, bytes]]` but got `str`.', 'generics_basic.py:34:15 Incompatible parameter type [6]: In call `str.__add__`, for 1st positional argument, expected `str` but got `Variable[AnyStr <: [str, bytes]]`.'] """ diff --git a/conformance/results/pyre/generics_defaults.toml b/conformance/results/pyre/generics_defaults.toml index 9b715405f..2d4d4749a 100644 --- a/conformance/results/pyre/generics_defaults.toml +++ b/conformance/results/pyre/generics_defaults.toml @@ -1,32 +1,69 @@ conformant = "Unsupported" +notes = """ +Does not support generic defaults. +""" output = """ generics_defaults.py:24:31 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type. generics_defaults.py:24:31 Undefined or invalid type [11]: Annotation `T` is not defined as a type. generics_defaults.py:27:20 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type. -generics_defaults.py:30:32 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`. +generics_defaults.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`. +generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. +generics_defaults.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, 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. +generics_defaults.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[NoNonDefaults[]]` but got `typing.Any`. +generics_defaults.py:32:37 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. generics_defaults.py:35:17 Undefined or invalid type [11]: Annotation `DefaultBoolT` is not defined as a type. +generics_defaults.py:38:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[OneDefault[]]` but got `typing.Any`. generics_defaults.py:38:12 Undefined attribute [16]: `OneDefault` has no attribute `__getitem__`. +generics_defaults.py:38:31 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters. +generics_defaults.py:39:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `OneDefault[]` but got `typing.Any`. +generics_defaults.py:39:33 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters. generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T1` is not defined as a type. generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T2` is not defined as a type. -generics_defaults.py:45:33 Undefined attribute [16]: `AllTheDefaults` has no attribute `__getitem__`. +generics_defaults.py:45:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `Type[AllTheDefaults]`. +generics_defaults.py:45:28 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. +generics_defaults.py:46:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:47:4 Undefined attribute [16]: `AllTheDefaults` has no attribute `__getitem__`. +generics_defaults.py:47:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. +generics_defaults.py:52:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:53:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. +generics_defaults.py:55:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:57:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. +generics_defaults.py:59:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:61:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. +generics_defaults.py:63:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`. +generics_defaults.py:65:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters. generics_defaults.py:73:33 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[Union[int, str]]]`. generics_defaults.py:76:22 Undefined or invalid type [11]: Annotation `DefaultP` is not defined as a type. -generics_defaults.py:79:34 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`. -generics_defaults.py:88:59 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[int]]`. +generics_defaults.py:79:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_ParamSpec[]]` but got `Type[Class_ParamSpec]`. +generics_defaults.py:79:29 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. +generics_defaults.py:80:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `Class_ParamSpec`. +generics_defaults.py:80:31 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. +generics_defaults.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `typing.Any`. +generics_defaults.py:81:12 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`. +generics_defaults.py:81:45 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters. +generics_defaults.py:88:53 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. generics_defaults.py:91:25 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$DefaultTs)]` is not a valid type. -generics_defaults.py:94:56 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_defaults.py:94:63 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[int]]`. -generics_defaults.py:95:53 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[str], Type[int]]`. Expected has length 0, but actual has length 2. +generics_defaults.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`. +generics_defaults.py:94:32 Invalid type [31]: Expression `type[generics_defaults.Class_TypeVarTuple[(*tuple[(str, int)])]]` is not a valid type. +generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. +generics_defaults.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`. +generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. generics_defaults.py:96:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2. -generics_defaults.py:96:64 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2. generics_defaults.py:124:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type. generics_defaults.py:138:11 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$Ts, $local_generics_defaults$T5)]` is not a valid type. generics_defaults.py:138:11 Undefined or invalid type [11]: Annotation `T5` is not defined as a type. generics_defaults.py:145:19 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[float]]`. generics_defaults.py:148:11 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$Ts, $local_generics_defaults$P)]` is not a valid type. generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type. +generics_defaults.py:151:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`. generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`. -generics_defaults.py:166:33 Undefined attribute [16]: `Foo7` has no attribute `__getitem__`. +generics_defaults.py:151:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:152:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`. +generics_defaults.py:152:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters. +generics_defaults.py:166:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, 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:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. """ conformance_automated = "Fail" errors_diff = """ @@ -34,22 +71,38 @@ Line 50: Expected 1 errors Line 104: Expected 1 errors Line 111: Expected 1 errors 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:32 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`.'] +Line 30: Unexpected errors ['generics_defaults.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, 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 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, 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.'] +Line 32: Unexpected errors ['generics_defaults.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:32:37 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] Line 35: Unexpected errors ['generics_defaults.py:35:17 Undefined or invalid type [11]: Annotation `DefaultBoolT` is not defined as a type.'] -Line 38: Unexpected errors ['generics_defaults.py:38:12 Undefined attribute [16]: `OneDefault` has no attribute `__getitem__`.'] +Line 38: Unexpected errors ['generics_defaults.py:38:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[OneDefault[]]` but got `typing.Any`.', 'generics_defaults.py:38:12 Undefined attribute [16]: `OneDefault` has no attribute `__getitem__`.', 'generics_defaults.py:38:31 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters.'] +Line 39: Unexpected errors ['generics_defaults.py:39:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `OneDefault[]` but got `typing.Any`.', 'generics_defaults.py:39:33 Invalid type parameters [24]: Non-generic type `OneDefault` cannot take parameters.'] Line 42: Unexpected errors ['generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T1` is not defined as a type.', 'generics_defaults.py:42:21 Undefined or invalid type [11]: Annotation `T2` is not defined as a type.'] -Line 45: Unexpected errors ['generics_defaults.py:45:33 Undefined attribute [16]: `AllTheDefaults` has no attribute `__getitem__`.'] +Line 45: Unexpected errors ['generics_defaults.py:45:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `Type[AllTheDefaults]`.', 'generics_defaults.py:45:28 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] +Line 46: Unexpected errors ['generics_defaults.py:46:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 47: Unexpected errors ['generics_defaults.py:47:4 Undefined attribute [16]: `AllTheDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:47:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] +Line 52: Unexpected errors ['generics_defaults.py:52:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 53: Unexpected errors ['generics_defaults.py:53:34 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] +Line 55: Unexpected errors ['generics_defaults.py:55:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 57: Unexpected errors ['generics_defaults.py:57:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] +Line 59: Unexpected errors ['generics_defaults.py:59:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 61: Unexpected errors ['generics_defaults.py:61:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] +Line 63: Unexpected errors ['generics_defaults.py:63:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[AllTheDefaults[]]` but got `typing.Any`.'] +Line 65: Unexpected errors ['generics_defaults.py:65:4 Invalid type parameters [24]: Non-generic type `AllTheDefaults` cannot take parameters.'] Line 73: Unexpected errors ['generics_defaults.py:73:33 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[Union[int, str]]]`.'] Line 76: Unexpected errors ['generics_defaults.py:76:22 Undefined or invalid type [11]: Annotation `DefaultP` is not defined as a type.'] -Line 79: Unexpected errors ['generics_defaults.py:79:34 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`.'] -Line 88: Unexpected errors ['generics_defaults.py:88:59 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[int]]`.'] +Line 79: Unexpected errors ['generics_defaults.py:79:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_ParamSpec[]]` but got `Type[Class_ParamSpec]`.', 'generics_defaults.py:79:29 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] +Line 80: Unexpected errors ['generics_defaults.py:80:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `Class_ParamSpec`.', 'generics_defaults.py:80:31 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] +Line 81: Unexpected errors ['generics_defaults.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_ParamSpec[]` but got `typing.Any`.', 'generics_defaults.py:81:12 Undefined attribute [16]: `Class_ParamSpec` has no attribute `__getitem__`.', 'generics_defaults.py:81:45 Invalid type parameters [24]: Non-generic type `Class_ParamSpec` cannot take parameters.'] +Line 88: Unexpected errors ['generics_defaults.py:88:53 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] Line 91: Unexpected errors ['generics_defaults.py:91:25 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$DefaultTs)]` is not a valid type.'] -Line 94: Unexpected errors ['generics_defaults.py:94:56 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'generics_defaults.py:94:63 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[int]]`.'] -Line 95: Unexpected errors ['generics_defaults.py:95:53 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[str], Type[int]]`. Expected has length 0, but actual has length 2.'] -Line 96: Unexpected errors ['generics_defaults.py:96:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2.', 'generics_defaults.py:96:64 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2.'] +Line 94: Unexpected errors ['generics_defaults.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`.', 'generics_defaults.py:94:32 Invalid type [31]: Expression `type[generics_defaults.Class_TypeVarTuple[(*tuple[(str, int)])]]` is not a valid type.', 'generics_defaults.py:94:32 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] +Line 95: Unexpected errors ['generics_defaults.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`.', 'generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] +Line 96: Unexpected errors ['generics_defaults.py:96:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2.'] Line 124: Unexpected errors ['generics_defaults.py:124:13 Undefined or invalid type [11]: Annotation `T4` is not defined as a type.'] Line 145: Unexpected errors ['generics_defaults.py:145:19 Incompatible parameter type [6]: In call `ParamSpec.__init__`, for argument `default`, expected `Union[None, Type[typing.Any], str]` but got `List[Type[float]]`.'] Line 148: Unexpected errors ['generics_defaults.py:148:11 Invalid type [31]: Expression `typing.Generic[(*$local_generics_defaults$Ts, $local_generics_defaults$P)]` is not a valid type.', 'generics_defaults.py:148:11 Undefined or invalid type [11]: Annotation `P` is not defined as a type.'] -Line 151: Unexpected errors ['generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.'] -Line 166: Unexpected errors ['generics_defaults.py:166:33 Undefined attribute [16]: `Foo7` has no attribute `__getitem__`.'] +Line 151: Unexpected errors ['generics_defaults.py:151:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:151:12 Undefined attribute [16]: `Foo6` has no attribute `__getitem__`.', 'generics_defaults.py:151:28 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 152: Unexpected errors ['generics_defaults.py:152:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Foo6[]]` but got `typing.Any`.', 'generics_defaults.py:152:37 Invalid type parameters [24]: Non-generic type `Foo6` cannot take parameters.'] +Line 166: Unexpected errors ['generics_defaults.py:166:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, 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:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_defaults_referential.toml b/conformance/results/pyre/generics_defaults_referential.toml index e47f1a9ac..3da14a215 100644 --- a/conformance/results/pyre/generics_defaults_referential.toml +++ b/conformance/results/pyre/generics_defaults_referential.toml @@ -3,34 +3,59 @@ output = """ generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StartT` is not defined as a type. generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StepT` is not defined as a type. generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StopT` is not defined as a type. -generics_defaults_referential.py:23:24 Undefined attribute [16]: `slice` has no attribute `__getitem__`. +generics_defaults_referential.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[slice[]]` but got `Type[slice]`. +generics_defaults_referential.py:23:19 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. +generics_defaults_referential.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `slice`. +generics_defaults_referential.py:24:21 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. +generics_defaults_referential.py:25:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `typing.Any`. +generics_defaults_referential.py:25:12 Undefined attribute [16]: `slice` has no attribute `__getitem__`. +generics_defaults_referential.py:25:26 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. +generics_defaults_referential.py:26:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `typing.Any`. +generics_defaults_referential.py:26:41 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters. generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type. generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `T2` is not defined as a type. -generics_defaults_referential.py:35:24 Undefined attribute [16]: `Foo` has no attribute `__getitem__`. +generics_defaults_referential.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Foo[]` but got `Foo`. +generics_defaults_referential.py:35:24 Invalid type parameters [24]: Non-generic type `Foo` cannot take parameters. +generics_defaults_referential.py:36:0 Undefined attribute [16]: `Foo` has no attribute `__getitem__`. generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S1` is not defined as a type. generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S2` is not defined as a type. generics_defaults_referential.py:53:13 Undefined or invalid type [11]: Annotation `Start2T` is not defined as a type. generics_defaults_referential.py:53:13 Undefined or invalid type [11]: Annotation `Stop2T` is not defined as a type. -generics_defaults_referential.py:87:52 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. +generics_defaults_referential.py:87:47 Undefined attribute [16]: `list` has no attribute `__getitem__`. generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `ListDefaultT` is not defined as a type. generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `Z1` is not defined as a type. -generics_defaults_referential.py:94:22 Undefined attribute [16]: `Bar` has no attribute `__getitem__`. -generics_defaults_referential.py:94:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `object`. +generics_defaults_referential.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `Type[Bar]`. +generics_defaults_referential.py:94:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. +generics_defaults_referential.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `typing.Any`. +generics_defaults_referential.py:95:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`. +generics_defaults_referential.py:95:22 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. +generics_defaults_referential.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`. +generics_defaults_referential.py:96:29 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. +generics_defaults_referential.py:97:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`. +generics_defaults_referential.py:97:40 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. +generics_defaults_referential.py:98:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`. +generics_defaults_referential.py:98:34 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. """ conformance_automated = "Fail" errors_diff = """ -Line 36: Expected 1 errors Line 37: Expected 1 errors Line 60: Expected 1 errors Line 68: Expected 1 errors Line 74: Expected 1 errors Line 78: Expected 1 errors Line 20: Unexpected errors ['generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StartT` is not defined as a type.', 'generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StepT` is not defined as a type.', 'generics_defaults_referential.py:20:12 Undefined or invalid type [11]: Annotation `StopT` is not defined as a type.'] -Line 23: Unexpected errors ['generics_defaults_referential.py:23:24 Undefined attribute [16]: `slice` has no attribute `__getitem__`.'] +Line 23: Unexpected errors ['generics_defaults_referential.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[slice[]]` but got `Type[slice]`.', 'generics_defaults_referential.py:23:19 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] +Line 24: Unexpected errors ['generics_defaults_referential.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `slice`.', 'generics_defaults_referential.py:24:21 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] +Line 25: Unexpected errors ['generics_defaults_referential.py:25:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `typing.Any`.', 'generics_defaults_referential.py:25:12 Undefined attribute [16]: `slice` has no attribute `__getitem__`.', 'generics_defaults_referential.py:25:26 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] +Line 26: Unexpected errors ['generics_defaults_referential.py:26:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `slice[]` but got `typing.Any`.', 'generics_defaults_referential.py:26:41 Invalid type parameters [24]: Non-generic type `slice` cannot take parameters.'] Line 31: Unexpected errors ['generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type.', 'generics_defaults_referential.py:31:10 Undefined or invalid type [11]: Annotation `T2` is not defined as a type.'] -Line 35: Unexpected errors ['generics_defaults_referential.py:35:24 Undefined attribute [16]: `Foo` has no attribute `__getitem__`.'] +Line 35: Unexpected errors ['generics_defaults_referential.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Foo[]` but got `Foo`.', 'generics_defaults_referential.py:35:24 Invalid type parameters [24]: Non-generic type `Foo` cannot take parameters.'] Line 46: Unexpected errors ['generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S1` is not defined as a type.', 'generics_defaults_referential.py:46:11 Undefined or invalid type [11]: Annotation `S2` is not defined as a type.'] -Line 87: Unexpected errors ['generics_defaults_referential.py:87:52 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`.'] +Line 87: Unexpected errors ['generics_defaults_referential.py:87:47 Undefined attribute [16]: `list` has no attribute `__getitem__`.'] Line 90: Unexpected errors ['generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `ListDefaultT` is not defined as a type.', 'generics_defaults_referential.py:90:10 Undefined or invalid type [11]: Annotation `Z1` is not defined as a type.'] -Line 94: Unexpected errors ['generics_defaults_referential.py:94:22 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.', 'generics_defaults_referential.py:94:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `object`.'] +Line 94: Unexpected errors ['generics_defaults_referential.py:94:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `Type[Bar]`.', 'generics_defaults_referential.py:94:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 95: Unexpected errors ['generics_defaults_referential.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `typing.Any`.', 'generics_defaults_referential.py:95:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.', 'generics_defaults_referential.py:95:22 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 96: Unexpected errors ['generics_defaults_referential.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:96:29 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 97: Unexpected errors ['generics_defaults_referential.py:97:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:97:40 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 98: Unexpected errors ['generics_defaults_referential.py:98:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`.', 'generics_defaults_referential.py:98:34 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_defaults_specialization.toml b/conformance/results/pyre/generics_defaults_specialization.toml index c7b89486c..7de25df9c 100644 --- a/conformance/results/pyre/generics_defaults_specialization.toml +++ b/conformance/results/pyre/generics_defaults_specialization.toml @@ -1,13 +1,23 @@ conformant = "Unsupported" +notes = """ +Does not support generic defaults. +""" output = """ generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T1` is not defined as a type. generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T2` is not defined as a type. generics_defaults_specialization.py:22:21 Undefined attribute [16]: `SomethingWithNoDefaults` has no attribute `__getitem__`. generics_defaults_specialization.py:25:14 Undefined or invalid type [11]: Annotation `MyAlias` is not defined as a type. -generics_defaults_specialization.py:26:20 Undefined attribute [16]: `SomethingWithNoDefaults` has no attribute `__getitem__`. +generics_defaults_specialization.py:26:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters. +generics_defaults_specialization.py:27:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters. generics_defaults_specialization.py:30:0 Undefined attribute [16]: `TypeAlias` has no attribute `__getitem__`. generics_defaults_specialization.py:38:17 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type. -generics_defaults_specialization.py:45:22 Undefined attribute [16]: `Bar` has no attribute `__getitem__`. +generics_defaults_specialization.py:45:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `Type[Bar]`. +generics_defaults_specialization.py:45:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. +generics_defaults_specialization.py:46:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `Bar`. +generics_defaults_specialization.py:46:19 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. +generics_defaults_specialization.py:47:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`. +generics_defaults_specialization.py:47:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`. +generics_defaults_specialization.py:47:25 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters. generics_defaults_specialization.py:50:10 Invalid type parameters [24]: Non-generic type `SubclassMe` cannot take parameters. generics_defaults_specialization.py:55:0 Undefined attribute [16]: `Foo` has no attribute `__getitem__`. generics_defaults_specialization.py:58:10 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type. @@ -19,9 +29,12 @@ errors_diff = """ Line 19: Unexpected errors ['generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T1` is not defined as a type.', 'generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annotation `T2` is not defined as a type.'] Line 22: Unexpected errors ['generics_defaults_specialization.py:22:21 Undefined attribute [16]: `SomethingWithNoDefaults` has no attribute `__getitem__`.'] Line 25: Unexpected errors ['generics_defaults_specialization.py:25:14 Undefined or invalid type [11]: Annotation `MyAlias` is not defined as a type.'] -Line 26: Unexpected errors ['generics_defaults_specialization.py:26:20 Undefined attribute [16]: `SomethingWithNoDefaults` has no attribute `__getitem__`.'] +Line 26: Unexpected errors ['generics_defaults_specialization.py:26:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters.'] +Line 27: Unexpected errors ['generics_defaults_specialization.py:27:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters.'] Line 38: Unexpected errors ['generics_defaults_specialization.py:38:17 Undefined or invalid type [11]: Annotation `DefaultStrT` is not defined as a type.'] -Line 45: Unexpected errors ['generics_defaults_specialization.py:45:22 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.'] +Line 45: Unexpected errors ['generics_defaults_specialization.py:45:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Type[Bar[]]` but got `Type[Bar]`.', 'generics_defaults_specialization.py:45:17 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 46: Unexpected errors ['generics_defaults_specialization.py:46:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `Bar`.', 'generics_defaults_specialization.py:46:19 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] +Line 47: Unexpected errors ['generics_defaults_specialization.py:47:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Bar[]` but got `typing.Any`.', 'generics_defaults_specialization.py:47:12 Undefined attribute [16]: `Bar` has no attribute `__getitem__`.', 'generics_defaults_specialization.py:47:25 Invalid type parameters [24]: Non-generic type `Bar` cannot take parameters.'] Line 50: Unexpected errors ['generics_defaults_specialization.py:50:10 Invalid type parameters [24]: Non-generic type `SubclassMe` cannot take parameters.'] Line 58: Unexpected errors ['generics_defaults_specialization.py:58:10 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type.'] Line 65: Unexpected errors ['generics_defaults_specialization.py:65:0 Incompatible variable type [9]: v1 is declared to have type `Baz[]` but is used as type `Spam`.', 'generics_defaults_specialization.py:65:4 Invalid type parameters [24]: Non-generic type `Baz` cannot take parameters.'] diff --git a/conformance/results/pyre/generics_paramspec_components.toml b/conformance/results/pyre/generics_paramspec_components.toml index c914064f4..daf77e2f1 100644 --- a/conformance/results/pyre/generics_paramspec_components.toml +++ b/conformance/results/pyre/generics_paramspec_components.toml @@ -11,11 +11,8 @@ output = """ generics_paramspec_components.py:17:24 Undefined or invalid type [11]: Annotation `P.kwargs` is not defined as a type. generics_paramspec_components.py:17:44 Undefined or invalid type [11]: Annotation `P.args` is not defined as a type. generics_paramspec_components.py:49:8 Call error [29]: `typing.Callable[generics_paramspec_components.P, int]` cannot be safely called because the types and kinds of its parameters depend on a type variable. -generics_paramspec_components.py:56:32 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(str, $local_generics_paramspec_components$P)], None)]` is not a valid type. -generics_paramspec_components.py:66:14 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_components$P)], int)]` is not a valid type. -generics_paramspec_components.py:66:14 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_components$P)], int)]` is not a valid type. -generics_paramspec_components.py:66:53 Invalid type variable [34]: The type variable `P` isn't present in the function's parameters. -generics_paramspec_components.py:74:4 Incompatible return type [7]: Expected `typing.Callable[generics_paramspec_components.P, None]` but got `typing.Callable($local_generics_paramspec_components?remove$foo)[generics_paramspec_components.P, None]`. +generics_paramspec_components.py:70:8 Call error [29]: `typing.Callable[typing.Concatenate[int, generics_paramspec_components.P], int]` cannot be safely called because the types and kinds of its parameters depend on a type variable. +generics_paramspec_components.py:72:8 Missing argument [20]: PositionalOnly call expects argument in position 0. generics_paramspec_components.py:83:8 Unexpected keyword [28]: Unexpected keyword argument `x` to call `foo`. generics_paramspec_components.py:98:19 Incompatible parameter type [6]: In call `twice`, for 2nd positional argument, expected `int` but got `str`. generics_paramspec_components.py:98:24 Incompatible parameter type [6]: In call `twice`, for 3rd positional argument, expected `str` but got `int`. @@ -32,9 +29,4 @@ Line 38: Expected 1 errors Line 41: Expected 1 errors Line 51: Expected 1 errors Line 60: Expected 1 errors -Line 70: Expected 1 errors -Line 72: Expected 1 errors -Line 56: Unexpected errors ['generics_paramspec_components.py:56:32 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(str, $local_generics_paramspec_components$P)], None)]` is not a valid type.'] -Line 66: Unexpected errors ['generics_paramspec_components.py:66:14 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_components$P)], int)]` is not a valid type.', 'generics_paramspec_components.py:66:14 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_components$P)], int)]` is not a valid type.', "generics_paramspec_components.py:66:53 Invalid type variable [34]: The type variable `P` isn't present in the function's parameters."] -Line 74: Unexpected errors ['generics_paramspec_components.py:74:4 Incompatible return type [7]: Expected `typing.Callable[generics_paramspec_components.P, None]` but got `typing.Callable($local_generics_paramspec_components?remove$foo)[generics_paramspec_components.P, None]`.'] """ diff --git a/conformance/results/pyre/generics_paramspec_semantics.toml b/conformance/results/pyre/generics_paramspec_semantics.toml index cae301395..df19bc773 100644 --- a/conformance/results/pyre/generics_paramspec_semantics.toml +++ b/conformance/results/pyre/generics_paramspec_semantics.toml @@ -1,32 +1,18 @@ -conformant = "Partial" -notes = """ -Constraint solver doesn't find common type for two signatures captured by a single ParamSpec (allowed). -Reports error for legitimate Callable type annotation that uses Concatenate. -Does not evaluate the correct type for call of Callable defined with Concatenate. -""" +conformant = "Pass" output = """ generics_paramspec_semantics.py:26:0 Unexpected keyword [28]: Unexpected keyword argument `a` to anonymous call. generics_paramspec_semantics.py:27:8 Incompatible parameter type [6]: In anonymous call, for 2nd positional argument, expected `bool` but got `str`. generics_paramspec_semantics.py:46:16 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `typing.Callable[generics_paramspec_semantics.P, int]` but got `typing.Callable(y_x)[[Named(y, int), Named(x, str)], int]`. generics_paramspec_semantics.py:61:22 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `typing.Callable[generics_paramspec_semantics.P, int]` but got `typing.Callable(keyword_only_y)[[KeywordOnly(y, int)], int]`. -generics_paramspec_semantics.py:90:32 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(str, $local_generics_paramspec_semantics$P)], bool)]` is not a valid type. -generics_paramspec_semantics.py:100:14 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_semantics$P)], int)]` is not a valid type. -generics_paramspec_semantics.py:100:53 Invalid type variable [34]: The type variable `P` isn't present in the function's parameters. -generics_paramspec_semantics.py:111:7 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_semantics$P)], int)]` is not a valid type. -generics_paramspec_semantics.py:112:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(str, $local_generics_paramspec_semantics$P)], bool)]` is not a valid type. -generics_paramspec_semantics.py:122:25 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_semantics$P)], int)]` is not a valid type. +generics_paramspec_semantics.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Y[int, [int]]` but got `Y[typing_extensions.Literal[1], [int]]`. +generics_paramspec_semantics.py:97:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. +generics_paramspec_semantics.py:107:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `bool` but got `int`. +generics_paramspec_semantics.py:119:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. +generics_paramspec_semantics.py:126:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. +generics_paramspec_semantics.py:131:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. +generics_paramspec_semantics.py:136:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions Please add # pyre-ignore[56] to `generics_paramspec_semantics.expects_int_first`. """ conformance_automated = "Fail" errors_diff = """ -Line 97: Expected 1 errors -Line 107: Expected 1 errors -Line 119: Expected 1 errors -Line 126: Expected 1 errors -Line 131: Expected 1 errors -Line 136: Expected 1 errors -Line 90: Unexpected errors ['generics_paramspec_semantics.py:90:32 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(str, $local_generics_paramspec_semantics$P)], bool)]` is not a valid type.'] -Line 100: Unexpected errors ['generics_paramspec_semantics.py:100:14 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_semantics$P)], int)]` is not a valid type.', "generics_paramspec_semantics.py:100:53 Invalid type variable [34]: The type variable `P` isn't present in the function's parameters."] -Line 111: Unexpected errors ['generics_paramspec_semantics.py:111:7 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_semantics$P)], int)]` is not a valid type.'] -Line 112: Unexpected errors ['generics_paramspec_semantics.py:112:5 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(str, $local_generics_paramspec_semantics$P)], bool)]` is not a valid type.'] -Line 122: Unexpected errors ['generics_paramspec_semantics.py:122:25 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, $local_generics_paramspec_semantics$P)], int)]` is not a valid type.'] +Line 81: Unexpected errors ['generics_paramspec_semantics.py:81:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Y[int, [int]]` but got `Y[typing_extensions.Literal[1], [int]]`.'] """ diff --git a/conformance/results/pyre/generics_paramspec_specialization.toml b/conformance/results/pyre/generics_paramspec_specialization.toml index 152779ccb..b152cb021 100644 --- a/conformance/results/pyre/generics_paramspec_specialization.toml +++ b/conformance/results/pyre/generics_paramspec_specialization.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ -Reports error for legitimate use of ParamSpec and Concatenate in function signature. -Reports error for legitimate specialization of generic class parameterized with ParamSpec. +Reports error for legitimate use of `...` to specialize ParamSpec """ output = """ generics_paramspec_specialization.py:14:0 Uninitialized attribute [13]: Attribute `f` is declared in class `ClassA` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized. @@ -9,10 +8,7 @@ generics_paramspec_specialization.py:14:0 Uninitialized attribute [13]: Attribut generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `f1` is declared in class `ClassB` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized. generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `f2` is declared in class `ClassB` to have type `typing.Callable[generics_paramspec_specialization.P2, int]` but is never initialized. generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassB` to have type `Variable[T]` but is never initialized. -generics_paramspec_specialization.py:29:14 Invalid type variable [34]: The type variable `P2` isn't present in the function's parameters. -generics_paramspec_specialization.py:29:14 Undefined or invalid type [11]: Annotation `Concatenate` is not defined as a type. -generics_paramspec_specialization.py:33:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB. -generics_paramspec_specialization.py:37:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA. +generics_paramspec_specialization.py:33:14 Undefined or invalid type [11]: Annotation `...` is not defined as a type. generics_paramspec_specialization.py:45:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `int` was given for generic type ClassA. generics_paramspec_specialization.py:49:0 Uninitialized attribute [13]: Attribute `f` is declared in class `ClassC` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized. generics_paramspec_specialization.py:55:8 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `int` but got `str`. @@ -24,8 +20,6 @@ conformance_automated = "Fail" errors_diff = """ Line 14: Unexpected errors ['generics_paramspec_specialization.py:14:0 Uninitialized attribute [13]: Attribute `f` is declared in class `ClassA` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized.', 'generics_paramspec_specialization.py:14:0 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassA` to have type `Variable[T]` but is never initialized.'] Line 19: Unexpected errors ['generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `f1` is declared in class `ClassB` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized.', 'generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `f2` is declared in class `ClassB` to have type `typing.Callable[generics_paramspec_specialization.P2, int]` but is never initialized.', 'generics_paramspec_specialization.py:19:0 Uninitialized attribute [13]: Attribute `x` is declared in class `ClassB` to have type `Variable[T]` but is never initialized.'] -Line 29: Unexpected errors ["generics_paramspec_specialization.py:29:14 Invalid type variable [34]: The type variable `P2` isn't present in the function's parameters.", 'generics_paramspec_specialization.py:29:14 Undefined or invalid type [11]: Annotation `Concatenate` is not defined as a type.'] -Line 33: Unexpected errors ['generics_paramspec_specialization.py:33:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB.'] -Line 37: Unexpected errors ['generics_paramspec_specialization.py:37:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA.'] +Line 33: Unexpected errors ['generics_paramspec_specialization.py:33:14 Undefined or invalid type [11]: Annotation `...` is not defined as a type.'] Line 49: Unexpected errors ['generics_paramspec_specialization.py:49:0 Uninitialized attribute [13]: Attribute `f` is declared in class `ClassC` to have type `typing.Callable[generics_paramspec_specialization.P1, int]` but is never initialized.'] """ diff --git a/conformance/results/pyre/generics_scoping.toml b/conformance/results/pyre/generics_scoping.toml index 395797e83..c29afaebc 100644 --- a/conformance/results/pyre/generics_scoping.toml +++ b/conformance/results/pyre/generics_scoping.toml @@ -4,21 +4,28 @@ False negative on generic class nested within generic function with same type va False negative on generic class nested within generic class with same type variable. """ output = """ +generics_scoping.py:14:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[1]`. +generics_scoping.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['a']`. generics_scoping.py:29:9 Incompatible parameter type [6]: In call `MyClass.meth_2`, for 1st positional argument, expected `int` but got `str`. +generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['abc']`. +generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`. generics_scoping.py:50:7 Invalid type variable [34]: The type variable `Variable[S]` isn't present in the function's parameters. generics_scoping.py:54:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[S]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[S]`. generics_scoping.py:74:0 Uninitialized attribute [13]: Attribute `attr` is declared in class `Outer` to have type `Outer.Inner[Variable[T]]` but is never initialized. generics_scoping.py:77:4 Uninitialized attribute [13]: Attribute `x` is declared in class `Outer.AlsoBad` to have type `typing.List[Variable[T]]` but is never initialized. generics_scoping.py:78:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. -generics_scoping.py:84:4 Incompatible attribute type [8]: Attribute `alias` declared in class `Outer` has type `TypeAlias` but is used as type `Type[List[Variable[_T]]]`. -generics_scoping.py:84:28 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. +generics_scoping.py:84:23 Undefined attribute [16]: `list` has no attribute `__getitem__`. generics_scoping.py:88:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. generics_scoping.py:89:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. -generics_scoping.py:90:5 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. +generics_scoping.py:90:0 Undefined attribute [16]: `list` has no attribute `__getitem__`. """ conformance_automated = "Fail" errors_diff = """ Line 65: Expected 1 errors Line 75: Expected 1 errors +Line 14: Unexpected errors ['generics_scoping.py:14:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[1]`.'] +Line 15: Unexpected errors ["generics_scoping.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['a']`."] +Line 42: Unexpected errors ["generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['abc']`."] +Line 43: Unexpected errors ["generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`."] """ ignore_errors = ["Uninitialized attribute [13]"] diff --git a/conformance/results/pyre/generics_self_advanced.toml b/conformance/results/pyre/generics_self_advanced.toml index 0a9334274..e7ef9d28d 100644 --- a/conformance/results/pyre/generics_self_advanced.toml +++ b/conformance/results/pyre/generics_self_advanced.toml @@ -1,27 +1,23 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not understand `Self` type. +Does not handle use of `Self` within class body correctly. """ output = """ generics_self_advanced.py:25:7 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. -generics_self_advanced.py:35:26 Undefined attribute [16]: Module `typing` has no attribute `Self`. -generics_self_advanced.py:36:33 Undefined attribute [16]: Module `typing` has no attribute `Self`. -generics_self_advanced.py:37:31 Undefined attribute [16]: Module `typing` has no attribute `Self`. -generics_self_advanced.py:38:36 Undefined attribute [16]: Module `typing` has no attribute `Self`. -generics_self_advanced.py:42:30 Undefined attribute [16]: Module `typing` has no attribute `Self`. -generics_self_advanced.py:43:32 Undefined attribute [16]: Module `typing` has no attribute `Self`. -generics_self_advanced.py:44:30 Undefined attribute [16]: Module `typing` has no attribute `Self`. -generics_self_advanced.py:45:35 Undefined attribute [16]: Module `typing` has no attribute `Self`. +generics_self_advanced.py:35:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`. +generics_self_advanced.py:37:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `typing.Any`. +generics_self_advanced.py:38:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`. +generics_self_advanced.py:42:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[ChildB]`. +generics_self_advanced.py:44:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `typing.Any`. +generics_self_advanced.py:45:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`. """ conformance_automated = "Fail" errors_diff = """ Line 25: Unexpected errors ['generics_self_advanced.py:25:7 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] -Line 35: Unexpected errors ['generics_self_advanced.py:35:26 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] -Line 36: Unexpected errors ['generics_self_advanced.py:36:33 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] -Line 37: Unexpected errors ['generics_self_advanced.py:37:31 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] -Line 38: Unexpected errors ['generics_self_advanced.py:38:36 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] -Line 42: Unexpected errors ['generics_self_advanced.py:42:30 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] -Line 43: Unexpected errors ['generics_self_advanced.py:43:32 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] -Line 44: Unexpected errors ['generics_self_advanced.py:44:30 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] -Line 45: Unexpected errors ['generics_self_advanced.py:45:35 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] +Line 35: Unexpected errors ['generics_self_advanced.py:35:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`.'] +Line 37: Unexpected errors ['generics_self_advanced.py:37:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `typing.Any`.'] +Line 38: Unexpected errors ['generics_self_advanced.py:38:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`.'] +Line 42: Unexpected errors ['generics_self_advanced.py:42:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[ChildB]`.'] +Line 44: Unexpected errors ['generics_self_advanced.py:44:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `typing.Any`.'] +Line 45: Unexpected errors ['generics_self_advanced.py:45:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `ChildB`.'] """ diff --git a/conformance/results/pyre/generics_self_basic.toml b/conformance/results/pyre/generics_self_basic.toml index c937a575e..a2f0dfbe7 100644 --- a/conformance/results/pyre/generics_self_basic.toml +++ b/conformance/results/pyre/generics_self_basic.toml @@ -1,22 +1,21 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not understand `Self` type. +Does not handle use of `Self` as a generic type. """ output = """ -generics_self_basic.py:14:26 Undefined attribute [16]: Module `typing` has no attribute `Self`. +generics_self_basic.py:14:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. +generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. generics_self_basic.py:20:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. -generics_self_basic.py:27:30 Undefined attribute [16]: Module `typing` has no attribute `Self`. +generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`. generics_self_basic.py:33:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. -generics_self_basic.py:40:27 Undefined attribute [16]: Module `typing` has no attribute `Self`. +generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. generics_self_basic.py:58:0 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized. -generics_self_basic.py:64:25 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. -generics_self_basic.py:80:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `TypeVar`. """ conformance_automated = "Fail" errors_diff = """ -Line 14: Unexpected errors ['generics_self_basic.py:14:26 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] -Line 27: Unexpected errors ['generics_self_basic.py:27:30 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] -Line 40: Unexpected errors ['generics_self_basic.py:40:27 Undefined attribute [16]: Module `typing` has no attribute `Self`.'] +Line 64: Expected 1 errors +Line 14: Unexpected errors ['generics_self_basic.py:14:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.', 'generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] +Line 27: Unexpected errors ['generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] +Line 40: Unexpected errors ['generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] Line 58: Unexpected errors ['generics_self_basic.py:58:0 Uninitialized attribute [13]: Attribute `value` is declared in class `Container` to have type `Variable[T]` but is never initialized.'] -Line 80: Unexpected errors ['generics_self_basic.py:80:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `TypeVar`.'] """ diff --git a/conformance/results/pyre/generics_self_usage.toml b/conformance/results/pyre/generics_self_usage.toml index f4581fa8a..8907b5e76 100644 --- a/conformance/results/pyre/generics_self_usage.toml +++ b/conformance/results/pyre/generics_self_usage.toml @@ -1,11 +1,16 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not understand `Self` type. +Complains in some cases when `self: Self` is used explicitly. +Does not complain when `Self` is used on a function outside any class definition. +Does not complain when `self` is annotated explicitly (without `Self`) and `Self` is returned. +Does not complain on inheritance involving `Self`. +Does not complain on use of `Self` in static methods. +Does not complain on use of `Self` in metaclasses. """ output = """ generics_self_usage.py:20:34 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. generics_self_usage.py:86:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_usage_Foo3__ (bound to Foo3)]` but got `Foo3`. -generics_self_usage.py:106:0 Incompatible variable type [9]: TupleSelf is declared to have type `TypeAlias` but is used as type `Type[tuple[Variable[_T_co](covariant)]]`. +generics_self_usage.py:106:23 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. generics_self_usage.py:106:29 Undefined attribute [16]: Module `typing` has no attribute `Self`. """ conformance_automated = "Fail" diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index 47d40bcf6..a4669c746 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -1,13 +1,18 @@ conformant = "Partial" notes = """ -Doesn't allow using Node[Any] in assert_type expression. +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. """ output = """ generics_type_erasure.py:11:0 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized. -generics_type_erasure.py:17:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `object`. +generics_type_erasure.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. +generics_type_erasure.py:16:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. +generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`. +generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`. generics_type_erasure.py:36:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. +generics_type_erasure.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ @@ -17,5 +22,9 @@ Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors Line 11: Unexpected errors ['generics_type_erasure.py:11:0 Uninitialized attribute [13]: Attribute `label` is declared in class `Node` to have type `Variable[T]` but is never initialized.'] -Line 17: Unexpected errors ['generics_type_erasure.py:17:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `object`.'] +Line 15: Unexpected errors ["generics_type_erasure.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] +Line 16: Unexpected errors ['generics_type_erasure.py:16:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] +Line 17: Unexpected errors ['generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] +Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`.'] +Line 54: Unexpected errors ['generics_type_erasure.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_args.toml b/conformance/results/pyre/generics_typevartuple_args.toml index ff006cc20..c42d5409b 100644 --- a/conformance/results/pyre/generics_typevartuple_args.toml +++ b/conformance/results/pyre/generics_typevartuple_args.toml @@ -1,15 +1,12 @@ conformant = "Unsupported" notes = """ -Does not support TypeVarTuple. +Does not support star expressions for `Unpack`. """ output = """ generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*$local_generics_typevartuple_args$Ts` is not a valid type. generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type. -generics_typevartuple_args.py:20:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[str]]`. generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*$local_generics_typevartuple_args$Ts, generics_typevartuple_args.Env)]` is not a valid type. generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type. -generics_typevartuple_args.py:31:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[]`. -generics_typevartuple_args.py:32:45 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[str]]`. generics_typevartuple_args.py:42:17 Invalid type [31]: Expression `*tuple[(int, ...)]` is not a valid type. generics_typevartuple_args.py:51:17 Invalid type [31]: Expression `*tuple[(int, *tuple[(str, ...)], str)]` is not a valid type. generics_typevartuple_args.py:62:17 Invalid type [31]: Expression `*tuple[(int, str)]` is not a valid type. @@ -27,10 +24,7 @@ Line 59: Expected 1 errors Line 67: Expected 1 errors Line 76: Expected 1 errors Line 16: Unexpected errors ['generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*$local_generics_typevartuple_args$Ts` is not a valid type.', 'generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type.'] -Line 20: Unexpected errors ['generics_typevartuple_args.py:20:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[str]]`.'] Line 27: Unexpected errors ['generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*$local_generics_typevartuple_args$Ts, generics_typevartuple_args.Env)]` is not a valid type.', 'generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_args$Ts)]` is not a valid type.'] -Line 31: Unexpected errors ['generics_typevartuple_args.py:31:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[]`.'] -Line 32: Unexpected errors ['generics_typevartuple_args.py:32:45 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[str]]`.'] Line 42: Unexpected errors ['generics_typevartuple_args.py:42:17 Invalid type [31]: Expression `*tuple[(int, ...)]` is not a valid type.'] Line 51: Unexpected errors ['generics_typevartuple_args.py:51:17 Invalid type [31]: Expression `*tuple[(int, *tuple[(str, ...)], str)]` is not a valid type.'] Line 62: Unexpected errors ['generics_typevartuple_args.py:62:17 Invalid type [31]: Expression `*tuple[(int, str)]` is not a valid type.'] diff --git a/conformance/results/pyre/generics_typevartuple_callable.toml b/conformance/results/pyre/generics_typevartuple_callable.toml index 96eea18ee..edff454cb 100644 --- a/conformance/results/pyre/generics_typevartuple_callable.toml +++ b/conformance/results/pyre/generics_typevartuple_callable.toml @@ -12,20 +12,17 @@ generics_typevartuple_callable.py:26:22 Incompatible parameter type [6]: In call generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T], tuple[($local_generics_typevartuple_callable$T, *$local_generics_typevartuple_callable$Ts)])]` is not a valid type. generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T)]` is not a valid type. generics_typevartuple_callable.py:41:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback1)[[Named(a, int), Named(b, str), Named(c, int), Named(d, complex)], Tuple[complex, str, int]]`. -generics_typevartuple_callable.py:41:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[int], Type[complex]]`. generics_typevartuple_callable.py:42:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback2)[[Named(a, int), Named(d, str)], Tuple[str]]`. generics_typevartuple_callable.py:45:17 Invalid type [31]: Expression `*tuple[(int, *$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T)]` is not a valid type. generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_callable$T, *$local_generics_typevartuple_callable$Ts)]` is not a valid type. generics_typevartuple_callable.py:45:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -generics_typevartuple_callable.py:49:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[float], Type[str], Type[complex]]`. """ conformance_automated = "Fail" errors_diff = """ Line 17: Unexpected errors ['generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*$local_generics_typevartuple_callable$Ts], None)]` is not a valid type.', 'generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_callable$Ts)]` is not a valid type.'] Line 25: Unexpected errors ['generics_typevartuple_callable.py:25:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[unknown], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`.', 'generics_typevartuple_callable.py:25:22 Incompatible parameter type [6]: In call `Process.__init__`, for argument `args`, expected `Tuple[]` but got `Tuple[int, str]`. Expected has length 1, but actual has length 2.'] Line 29: Unexpected errors ['generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T], tuple[($local_generics_typevartuple_callable$T, *$local_generics_typevartuple_callable$Ts)])]` is not a valid type.', 'generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T)]` is not a valid type.'] -Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback1)[[Named(a, int), Named(b, str), Named(c, int), Named(d, complex)], Tuple[complex, str, int]]`.', 'generics_typevartuple_callable.py:41:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[int], Type[complex]]`.'] +Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback1)[[Named(a, int), Named(b, str), Named(c, int), Named(d, complex)], Tuple[complex, str, int]]`.'] Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:18 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `typing.Callable[[int, unknown, Variable[T]], Tuple[Variable[T], unknown]]` but got `typing.Callable(callback2)[[Named(a, int), Named(d, str)], Tuple[str]]`.'] Line 45: Unexpected errors ['generics_typevartuple_callable.py:45:17 Invalid type [31]: Expression `*tuple[(int, *$local_generics_typevartuple_callable$Ts, $local_generics_typevartuple_callable$T)]` is not a valid type.', 'generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_callable$T, *$local_generics_typevartuple_callable$Ts)]` is not a valid type.', "generics_typevartuple_callable.py:45:42 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[float], Type[str], Type[complex]]`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_concat.toml b/conformance/results/pyre/generics_typevartuple_concat.toml index f45e34847..751ee441c 100644 --- a/conformance/results/pyre/generics_typevartuple_concat.toml +++ b/conformance/results/pyre/generics_typevartuple_concat.toml @@ -17,13 +17,9 @@ generics_typevartuple_concat.py:34:26 Invalid type parameters [24]: Non-generic generics_typevartuple_concat.py:34:44 Invalid type [31]: Expression `Array[(generics_typevartuple_concat.Batch, *$local_generics_typevartuple_concat$Shape, generics_typevartuple_concat.Channels)]` is not a valid type. generics_typevartuple_concat.py:34:44 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_concat.py:38:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:40:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[Batch], Type[Height], Type[Width]]`. Expected has length 0, but actual has length 3. -generics_typevartuple_concat.py:42:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[Height], Type[Width]]`. Expected has length 0, but actual has length 2. -generics_typevartuple_concat.py:44:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[Batch], Type[Height], Type[Width], Type[Channels]]`. Expected has length 0, but actual has length 4. generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_concat$Ts)]` is not a valid type. generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_concat$T, *$local_generics_typevartuple_concat$Ts)]` is not a valid type. generics_typevartuple_concat.py:51:22 Incompatible parameter type [6]: In call `prefix_tuple`, for argument `y`, expected `Tuple[]` but got `Tuple[bool, str]`. Expected has length 1, but actual has length 2. -generics_typevartuple_concat.py:52:21 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[bool], Type[str]]`. generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_concat$T, *$local_generics_typevartuple_concat$Ts)]` is not a valid type. generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_concat$Ts, $local_generics_typevartuple_concat$T)]` is not a valid type. generics_typevartuple_concat.py:56:11 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `Variable[generics_typevartuple_concat.T]`. @@ -36,12 +32,8 @@ Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:22 Invalid type Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `Array[(generics_typevartuple_concat.Batch, *$local_generics_typevartuple_concat$Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:30:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:30:47 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_concat$Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:30:47 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 34: Unexpected errors ['generics_typevartuple_concat.py:34:26 Invalid type [31]: Expression `Array[(*$local_generics_typevartuple_concat$Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:34:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:34:44 Invalid type [31]: Expression `Array[(generics_typevartuple_concat.Batch, *$local_generics_typevartuple_concat$Shape, generics_typevartuple_concat.Channels)]` is not a valid type.', 'generics_typevartuple_concat.py:34:44 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 38: Unexpected errors ['generics_typevartuple_concat.py:38:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 40: Unexpected errors ['generics_typevartuple_concat.py:40:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[Batch], Type[Height], Type[Width]]`. Expected has length 0, but actual has length 3.'] -Line 42: Unexpected errors ['generics_typevartuple_concat.py:42:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[Height], Type[Width]]`. Expected has length 0, but actual has length 2.'] -Line 44: Unexpected errors ['generics_typevartuple_concat.py:44:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[Batch], Type[Height], Type[Width], Type[Channels]]`. Expected has length 0, but actual has length 4.'] Line 47: Unexpected errors ['generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_concat$Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_concat$T, *$local_generics_typevartuple_concat$Ts)]` is not a valid type.'] Line 51: Unexpected errors ['generics_typevartuple_concat.py:51:22 Incompatible parameter type [6]: In call `prefix_tuple`, for argument `y`, expected `Tuple[]` but got `Tuple[bool, str]`. Expected has length 1, but actual has length 2.'] -Line 52: Unexpected errors ['generics_typevartuple_concat.py:52:21 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[bool], Type[str]]`.'] Line 55: Unexpected errors ['generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[($local_generics_typevartuple_concat$T, *$local_generics_typevartuple_concat$Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*$local_generics_typevartuple_concat$Ts, $local_generics_typevartuple_concat$T)]` is not a valid type.'] Line 56: Unexpected errors ['generics_typevartuple_concat.py:56:11 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `Variable[generics_typevartuple_concat.T]`.', 'generics_typevartuple_concat.py:56:17 Incompatible parameter type [6]: In call `tuple.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal[0]` but got `slice`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_overloads.toml b/conformance/results/pyre/generics_typevartuple_overloads.toml index a87f03199..05291c62f 100644 --- a/conformance/results/pyre/generics_typevartuple_overloads.toml +++ b/conformance/results/pyre/generics_typevartuple_overloads.toml @@ -1,6 +1,6 @@ conformant = "Unsupported" notes = """ -Does not support TypeVarTuple. +Does not support star expressions for `Unpack`. """ output = """ generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_overloads$Shape)]` is not a valid type. @@ -10,8 +10,6 @@ generics_typevartuple_overloads.py:22:24 Invalid type parameters [24]: Non-gener generics_typevartuple_overloads.py:22:57 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_overloads.py:29:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_overloads.py:29:37 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_overloads.py:30:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[TypeVar, TypeVar]`. Expected has length 0, but actual has length 2. -generics_typevartuple_overloads.py:31:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[TypeVar, TypeVar, TypeVar]`. Expected has length 0, but actual has length 3. """ conformance_automated = "Fail" errors_diff = """ @@ -19,6 +17,4 @@ Line 16: Unexpected errors ['generics_typevartuple_overloads.py:16:12 Invalid ty Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_overloads.py:18:50 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:24 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_overloads.py:22:57 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 29: Unexpected errors ['generics_typevartuple_overloads.py:29:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_overloads.py:29:37 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 30: Unexpected errors ['generics_typevartuple_overloads.py:30:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[TypeVar, TypeVar]`. Expected has length 0, but actual has length 2.'] -Line 31: Unexpected errors ['generics_typevartuple_overloads.py:31:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[TypeVar, TypeVar, TypeVar]`. Expected has length 0, but actual has length 3.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_specialization.toml b/conformance/results/pyre/generics_typevartuple_specialization.toml index 0c2a16ede..b78a5b15f 100644 --- a/conformance/results/pyre/generics_typevartuple_specialization.toml +++ b/conformance/results/pyre/generics_typevartuple_specialization.toml @@ -1,6 +1,6 @@ conformant = "Unsupported" notes = """ -Does not support TypeVarTuple. +Does not support star expressions for `Unpack`. """ output = """ generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_specialization$Ts)]` is not a valid type. @@ -8,46 +8,24 @@ generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `Arr generics_typevartuple_specialization.py:24:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_specialization.py:28:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_specialization.py:33:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_specialization.py:41:17 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[Type[int], *Tuple[typing.Any, ...]]`. -generics_typevartuple_specialization.py:42:0 Incompatible variable type [9]: NamedArray is declared to have type `Type[Tuple[str, Array[]]]` but is used as type `Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:42:19 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[Array[]]]`. +generics_typevartuple_specialization.py:41:11 Undefined attribute [16]: `tuple` has no attribute `__getitem__`. generics_typevartuple_specialization.py:45:13 Undefined or invalid type [11]: Annotation `IntTuple` is not defined as a type. generics_typevartuple_specialization.py:45:39 Undefined or invalid type [11]: Annotation `NamedArray` is not defined as a type. -generics_typevartuple_specialization.py:46:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[float], Type[bool]]`. -generics_typevartuple_specialization.py:47:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[Array[]]]`. -generics_typevartuple_specialization.py:47:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Type[Height]`. -generics_typevartuple_specialization.py:52:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[Array[]]]`. +generics_typevartuple_specialization.py:47:19 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. generics_typevartuple_specialization.py:59:13 Invalid type [31]: Expression `typing.Generic[($local_generics_typevartuple_specialization$DType, *$local_generics_typevartuple_specialization$Shape)]` is not a valid type. generics_typevartuple_specialization.py:59:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[DType]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[DType]`. generics_typevartuple_specialization.py:63:20 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `typing.Tuple[Type[float], *Tuple[typing.Any, ...]]`. generics_typevartuple_specialization.py:64:0 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters. -generics_typevartuple_specialization.py:68:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[object, object]`. Expected has length 0, but actual has length 2. -generics_typevartuple_specialization.py:69:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], object]`. Expected has length 0, but actual has length 2. +generics_typevartuple_specialization.py:68:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Array2[]` but got `Array2`. +generics_typevartuple_specialization.py:68:19 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters. +generics_typevartuple_specialization.py:69:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Array2[]` but got `Array2`. +generics_typevartuple_specialization.py:69:19 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters. generics_typevartuple_specialization.py:72:38 Undefined or invalid type [11]: Annotation `FloatArray` is not defined as a type. -generics_typevartuple_specialization.py:89:22 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, *Tuple[typing.Any, ...]]`. generics_typevartuple_specialization.py:92:13 Undefined or invalid type [11]: Annotation `VariadicTuple` is not defined as a type. -generics_typevartuple_specialization.py:93:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[int]]`. -generics_typevartuple_specialization.py:95:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[object, *Tuple[typing.Any, ...]]`. -generics_typevartuple_specialization.py:95:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:95:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[object, typing.Any]`. -generics_typevartuple_specialization.py:101:20 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[Type[int], *Tuple[typing.Any, ...]]`. -generics_typevartuple_specialization.py:103:32 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:103:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[float], typing.Any]`. -generics_typevartuple_specialization.py:110:16 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:110:23 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[float], typing.Any]`. -generics_typevartuple_specialization.py:117:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], TypeVar, TypeVar]`. -generics_typevartuple_specialization.py:118:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, TypeVar, *Tuple[typing.Any, ...]]`. -generics_typevartuple_specialization.py:119:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, *Tuple[typing.Any, ...], TypeVar, TypeVar]`. -generics_typevartuple_specialization.py:120:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, TypeVar, *Tuple[typing.Any, ...]]`. -generics_typevartuple_specialization.py:120:12 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:120:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`. -generics_typevartuple_specialization.py:121:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[typing.Any, ...]`. +generics_typevartuple_specialization.py:95:19 Invalid type [31]: Expression `tuple[(typing.Any, *tuple[(typing.Any, ...)])]` is not a valid type. +generics_typevartuple_specialization.py:108:0 Undefined attribute [16]: `typing.Tuple` has no attribute `__getitem__`. generics_typevartuple_specialization.py:121:12 Unable to concatenate tuple [60]: Concatenation not yet support for multiple variadic tuples: `*Ts, *Ts`. -generics_typevartuple_specialization.py:122:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[typing.Any, ...]`. generics_typevartuple_specialization.py:122:12 Unable to concatenate tuple [60]: Concatenation not yet support for multiple variadic tuples: `*Ts, *tuple[(int, ...)]`. -generics_typevartuple_specialization.py:122:12 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:122:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`. -generics_typevartuple_specialization.py:125:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], TypeVar, TypeVar]`. generics_typevartuple_specialization.py:127:4 Undefined or invalid type [11]: Annotation `TA7` is not defined as a type. generics_typevartuple_specialization.py:130:13 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA7[(*$local_generics_typevartuple_specialization$Ts, $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2)]` is not a valid type. generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. @@ -55,12 +33,6 @@ generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The t generics_typevartuple_specialization.py:130:34 Invalid type [31]: Expression `tuple[(tuple[(*$local_generics_typevartuple_specialization$Ts)], $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2)]` is not a valid type. generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:135:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[Variable[_T_co](covariant)]], Type[str], Type[bool]]`. -generics_typevartuple_specialization.py:135:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[]`. -generics_typevartuple_specialization.py:136:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[str]], Type[bool], Type[float]]`. -generics_typevartuple_specialization.py:137:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[Variable[_T_co](covariant)]], Type[float], Type[int]]`. -generics_typevartuple_specialization.py:137:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[bool]]`. -generics_typevartuple_specialization.py:140:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, *Tuple[typing.Any, ...], TypeVar, TypeVar]`. generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA8[($local_generics_typevartuple_specialization$T1, *$local_generics_typevartuple_specialization$Ts, $local_generics_typevartuple_specialization$T2, $local_generics_typevartuple_specialization$T3)]` is not a valid type. generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. @@ -70,71 +42,39 @@ generics_typevartuple_specialization.py:143:38 Invalid type [31]: Expression `tu generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters. generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters. generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters. -generics_typevartuple_specialization.py:148:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[Variable[_T_co](covariant)]], Type[str], Type[bool], Type[float]]`. -generics_typevartuple_specialization.py:148:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[]`. -generics_typevartuple_specialization.py:149:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[bool]], Type[str], Type[float], Type[int]]`. -generics_typevartuple_specialization.py:152:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], TypeVar]`. -generics_typevartuple_specialization.py:153:11 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:153:18 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`. generics_typevartuple_specialization.py:156:14 Undefined or invalid type [11]: Annotation `TA10` is not defined as a type. generics_typevartuple_specialization.py:156:23 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA9[(*tuple[(int, ...)], str)]` is not a valid type. generics_typevartuple_specialization.py:156:23 Undefined or invalid type [11]: Annotation `TA9` is not defined as a type. generics_typevartuple_specialization.py:156:54 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA9[(*tuple[(int, ...)], str)]` is not a valid type. -generics_typevartuple_specialization.py:157:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], Type[int]]`. -generics_typevartuple_specialization.py:157:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:157:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`. -generics_typevartuple_specialization.py:158:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], Type[str]]`. -generics_typevartuple_specialization.py:158:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:158:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`. -generics_typevartuple_specialization.py:159:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], Type[str]]`. -generics_typevartuple_specialization.py:159:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -generics_typevartuple_specialization.py:159:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`. -generics_typevartuple_specialization.py:162:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, *Tuple[typing.Any, ...]]`. +generics_typevartuple_specialization.py:157:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], int)]` is not a valid type. +generics_typevartuple_specialization.py:158:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type. +generics_typevartuple_specialization.py:159:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ Line 109: Expected 1 errors +Line 110: Expected 1 errors Line 163: Expected 1 errors Line 16: Unexpected errors ['generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_specialization$Ts)]` is not a valid type.'] Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `Array[(*tuple[(typing.Any, ...)])]` is not a valid type.', 'generics_typevartuple_specialization.py:24:26 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 28: Unexpected errors ['generics_typevartuple_specialization.py:28:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 33: Unexpected errors ['generics_typevartuple_specialization.py:33:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 41: Unexpected errors ['generics_typevartuple_specialization.py:41:17 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[Type[int], *Tuple[typing.Any, ...]]`.'] -Line 42: Unexpected errors ['generics_typevartuple_specialization.py:42:0 Incompatible variable type [9]: NamedArray is declared to have type `Type[Tuple[str, Array[]]]` but is used as type `Type[tuple[Variable[_T_co](covariant)]]`.', 'generics_typevartuple_specialization.py:42:19 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[Array[]]]`.'] +Line 41: Unexpected errors ['generics_typevartuple_specialization.py:41:11 Undefined attribute [16]: `tuple` has no attribute `__getitem__`.'] Line 45: Unexpected errors ['generics_typevartuple_specialization.py:45:13 Undefined or invalid type [11]: Annotation `IntTuple` is not defined as a type.', 'generics_typevartuple_specialization.py:45:39 Undefined or invalid type [11]: Annotation `NamedArray` is not defined as a type.'] -Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[float], Type[bool]]`.'] -Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[Array[]]]`.', 'generics_typevartuple_specialization.py:47:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Type[Height]`.'] -Line 52: Unexpected errors ['generics_typevartuple_specialization.py:52:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[Array[]]]`.'] +Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:19 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] Line 59: Unexpected errors ['generics_typevartuple_specialization.py:59:13 Invalid type [31]: Expression `typing.Generic[($local_generics_typevartuple_specialization$DType, *$local_generics_typevartuple_specialization$Shape)]` is not a valid type.', "generics_typevartuple_specialization.py:59:13 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[DType]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[DType]`."] Line 63: Unexpected errors ['generics_typevartuple_specialization.py:63:20 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `typing.Tuple[Type[float], *Tuple[typing.Any, ...]]`.'] Line 64: Unexpected errors ['generics_typevartuple_specialization.py:64:0 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters.'] -Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[object, object]`. Expected has length 0, but actual has length 2.'] -Line 69: Unexpected errors ['generics_typevartuple_specialization.py:69:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], object]`. Expected has length 0, but actual has length 2.'] +Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Array2[]` but got `Array2`.', 'generics_typevartuple_specialization.py:68:19 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters.'] +Line 69: Unexpected errors ['generics_typevartuple_specialization.py:69:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Array2[]` but got `Array2`.', 'generics_typevartuple_specialization.py:69:19 Invalid type parameters [24]: Non-generic type `Array2` cannot take parameters.'] Line 72: Unexpected errors ['generics_typevartuple_specialization.py:72:38 Undefined or invalid type [11]: Annotation `FloatArray` is not defined as a type.'] -Line 89: Unexpected errors ['generics_typevartuple_specialization.py:89:22 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, *Tuple[typing.Any, ...]]`.'] Line 92: Unexpected errors ['generics_typevartuple_specialization.py:92:13 Undefined or invalid type [11]: Annotation `VariadicTuple` is not defined as a type.'] -Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[int]]`.'] -Line 95: Unexpected errors ['generics_typevartuple_specialization.py:95:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[object, *Tuple[typing.Any, ...]]`.', 'generics_typevartuple_specialization.py:95:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'generics_typevartuple_specialization.py:95:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[object, typing.Any]`.'] -Line 101: Unexpected errors ['generics_typevartuple_specialization.py:101:20 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[Type[int], *Tuple[typing.Any, ...]]`.'] -Line 103: Unexpected errors ['generics_typevartuple_specialization.py:103:32 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'generics_typevartuple_specialization.py:103:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[float], typing.Any]`.'] -Line 117: Unexpected errors ['generics_typevartuple_specialization.py:117:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], TypeVar, TypeVar]`.'] -Line 118: Unexpected errors ['generics_typevartuple_specialization.py:118:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, TypeVar, *Tuple[typing.Any, ...]]`.'] -Line 119: Unexpected errors ['generics_typevartuple_specialization.py:119:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, *Tuple[typing.Any, ...], TypeVar, TypeVar]`.'] -Line 120: Unexpected errors ['generics_typevartuple_specialization.py:120:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, TypeVar, *Tuple[typing.Any, ...]]`.', 'generics_typevartuple_specialization.py:120:12 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'generics_typevartuple_specialization.py:120:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`.'] -Line 125: Unexpected errors ['generics_typevartuple_specialization.py:125:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], TypeVar, TypeVar]`.'] +Line 95: Unexpected errors ['generics_typevartuple_specialization.py:95:19 Invalid type [31]: Expression `tuple[(typing.Any, *tuple[(typing.Any, ...)])]` is not a valid type.'] +Line 108: Unexpected errors ['generics_typevartuple_specialization.py:108:0 Undefined attribute [16]: `typing.Tuple` has no attribute `__getitem__`.'] Line 130: Unexpected errors ['generics_typevartuple_specialization.py:130:13 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA7[(*$local_generics_typevartuple_specialization$Ts, $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2)]` is not a valid type.', "generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:130:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", 'generics_typevartuple_specialization.py:130:34 Invalid type [31]: Expression `tuple[(tuple[(*$local_generics_typevartuple_specialization$Ts)], $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2)]` is not a valid type.', "generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:130:34 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters."] -Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[Variable[_T_co](covariant)]], Type[str], Type[bool]]`.', 'generics_typevartuple_specialization.py:135:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[]`.'] -Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[str]], Type[bool], Type[float]]`.'] -Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[Variable[_T_co](covariant)]], Type[float], Type[int]]`.', 'generics_typevartuple_specialization.py:137:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[bool]]`.'] -Line 140: Unexpected errors ['generics_typevartuple_specialization.py:140:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, *Tuple[typing.Any, ...], TypeVar, TypeVar]`.'] Line 143: Unexpected errors ['generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA8[($local_generics_typevartuple_specialization$T1, *$local_generics_typevartuple_specialization$Ts, $local_generics_typevartuple_specialization$T2, $local_generics_typevartuple_specialization$T3)]` is not a valid type.', "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:13 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters.", 'generics_typevartuple_specialization.py:143:13 Undefined or invalid type [11]: Annotation `TA8` is not defined as a type.', 'generics_typevartuple_specialization.py:143:38 Invalid type [31]: Expression `tuple[(tuple[(*$local_generics_typevartuple_specialization$Ts)], $local_generics_typevartuple_specialization$T1, $local_generics_typevartuple_specialization$T2, $local_generics_typevartuple_specialization$T3)]` is not a valid type.', "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T1]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T2]` isn't present in the function's parameters.", "generics_typevartuple_specialization.py:143:38 Invalid type variable [34]: The type variable `Variable[T3]` isn't present in the function's parameters."] -Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[Variable[_T_co](covariant)]], Type[str], Type[bool], Type[float]]`.', 'generics_typevartuple_specialization.py:148:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[]`.'] -Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[tuple[bool]], Type[str], Type[float], Type[int]]`.'] -Line 152: Unexpected errors ['generics_typevartuple_specialization.py:152:12 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], TypeVar]`.'] -Line 153: Unexpected errors ['generics_typevartuple_specialization.py:153:11 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'generics_typevartuple_specialization.py:153:18 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`.'] Line 156: Unexpected errors ['generics_typevartuple_specialization.py:156:14 Undefined or invalid type [11]: Annotation `TA10` is not defined as a type.', 'generics_typevartuple_specialization.py:156:23 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA9[(*tuple[(int, ...)], str)]` is not a valid type.', 'generics_typevartuple_specialization.py:156:23 Undefined or invalid type [11]: Annotation `TA9` is not defined as a type.', 'generics_typevartuple_specialization.py:156:54 Invalid type [31]: Expression `$local_generics_typevartuple_specialization$TA9[(*tuple[(int, ...)], str)]` is not a valid type.'] -Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], Type[int]]`.', 'generics_typevartuple_specialization.py:157:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'generics_typevartuple_specialization.py:157:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`.'] -Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], Type[str]]`.', 'generics_typevartuple_specialization.py:158:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'generics_typevartuple_specialization.py:158:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`.'] -Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], Type[str]]`.', 'generics_typevartuple_specialization.py:159:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'generics_typevartuple_specialization.py:159:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], typing.Any]`.'] -Line 162: Unexpected errors ['generics_typevartuple_specialization.py:162:13 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[TypeVar, *Tuple[typing.Any, ...]]`.'] +Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], int)]` is not a valid type.'] +Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type.'] +Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:19 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], str)]` is not a valid type.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_unpack.toml b/conformance/results/pyre/generics_typevartuple_unpack.toml index ec0432b6a..8b9f13eb2 100644 --- a/conformance/results/pyre/generics_typevartuple_unpack.toml +++ b/conformance/results/pyre/generics_typevartuple_unpack.toml @@ -1,6 +1,6 @@ conformant = "Unsupported" notes = """ -Does not support TypeVarTuple. +Does not support star expressions for `Unpack`. """ output = """ generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*$local_generics_typevartuple_unpack$Ts)]` is not a valid type. diff --git a/conformance/results/pyre/generics_upper_bound.toml b/conformance/results/pyre/generics_upper_bound.toml index 19ae4ce0b..b54303c54 100644 --- a/conformance/results/pyre/generics_upper_bound.toml +++ b/conformance/results/pyre/generics_upper_bound.toml @@ -1,9 +1,10 @@ conformant = "Partial" notes = """ -Does not reject use of upper bound with constrained TypeVar. +False positives on valid type expression (`list[T]`) in `bound`. +Does not complain when bound is used alongside type constraints. """ output = """ -generics_upper_bound.py:24:42 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `TypeVar`. +generics_upper_bound.py:24:37 Undefined attribute [16]: `list` has no attribute `__getitem__`. generics_upper_bound.py:51:7 Incompatible parameter type [6]: In call `longer`, for 1st positional argument, expected `Variable[ST (bound to Sized)]` but got `int`. generics_upper_bound.py:51:10 Incompatible parameter type [6]: In call `longer`, for 2nd positional argument, expected `Variable[ST (bound to Sized)]` but got `int`. """ diff --git a/conformance/results/pyre/historical_positional.toml b/conformance/results/pyre/historical_positional.toml index 140f9820d..9e1a52b20 100644 --- a/conformance/results/pyre/historical_positional.toml +++ b/conformance/results/pyre/historical_positional.toml @@ -1,8 +1,8 @@ conformant = "Partial" notes = """ Does not reject positional-only parameter after non-positional-only parameter. -Treats keyword-only parameter as positional-only. -Applies legacy positional-only rules when PEP 570 syntax is used. +Incorrectly applies legacy positional-only rules when explicit *args are used. +Incorrectly applies legacy positional-only rules when PEP 570 syntax is used. """ output = """ historical_positional.py:18:0 Unexpected keyword [28]: Unexpected keyword argument `__x` to call `f1`. diff --git a/conformance/results/pyre/literals_interactions.toml b/conformance/results/pyre/literals_interactions.toml index 6cdd9525b..fd34d1f4e 100644 --- a/conformance/results/pyre/literals_interactions.toml +++ b/conformance/results/pyre/literals_interactions.toml @@ -1,11 +1,12 @@ conformant = "Partial" notes = """ Does not detect out-of-bound tuple literal index. +Does not perform exhaustiveness checks on enums. Does not narrow type of `x` with `x in Literal` type guard pattern. Does not narrow type of `x` with `x == Literal` type guard pattern. """ output = """ -literals_interactions.py:51:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[AnyStr <: [str, bytes]]]` but got `object`. +literals_interactions.py:93:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Union[Status, str]`. literals_interactions.py:106:34 Incompatible parameter type [6]: In call `expects_bad_status`, for 1st positional argument, expected `Union[typing_extensions.Literal['ABORTED'], typing_extensions.Literal['MALFORMED']]` but got `str`. literals_interactions.py:109:31 Non-literal string [62]: In call `expects_pending_status`, for 1st positional argument, expected `LiteralString` but got `str`. Ensure only a string literal or a `LiteralString` is used. """ @@ -15,7 +16,7 @@ Line 15: Expected 1 errors Line 16: Expected 1 errors Line 17: Expected 1 errors Line 18: Expected 1 errors -Line 51: Unexpected errors ['literals_interactions.py:51:38 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[AnyStr <: [str, bytes]]]` but got `object`.'] +Line 93: Unexpected errors ['literals_interactions.py:93:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Union[Status, str]`.'] Line 106: Unexpected errors ["literals_interactions.py:106:34 Incompatible parameter type [6]: In call `expects_bad_status`, for 1st positional argument, expected `Union[typing_extensions.Literal['ABORTED'], typing_extensions.Literal['MALFORMED']]` but got `str`."] Line 109: Unexpected errors ['literals_interactions.py:109:31 Non-literal string [62]: In call `expects_pending_status`, for 1st positional argument, expected `LiteralString` but got `str`. Ensure only a string literal or a `LiteralString` is used.'] """ diff --git a/conformance/results/pyre/literals_literalstring.toml b/conformance/results/pyre/literals_literalstring.toml index c735a90ca..d92481187 100644 --- a/conformance/results/pyre/literals_literalstring.toml +++ b/conformance/results/pyre/literals_literalstring.toml @@ -1,9 +1,13 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly infers `str` rather than `LiteralString` when literal string `join` is used. +""" output = """ literals_literalstring.py:36:11 Invalid type [31]: Expression `LiteralString` is not a literal value. literals_literalstring.py:36:11 Undefined or invalid type [11]: Annotation `typing` is not defined as a type. literals_literalstring.py:37:13 Invalid type [31]: Expression `LiteralString` is not a literal value. literals_literalstring.py:43:4 Incompatible variable type [9]: x2 is declared to have type `typing_extensions.Literal['']` but is used as type `typing_extensions.Literal['two']`. +literals_literalstring.py:52:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.LiteralString` but got `str`. literals_literalstring.py:66:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.LiteralString` but is used as type `str`. literals_literalstring.py:74:4 Incompatible variable type [9]: x3 is declared to have type `typing_extensions.LiteralString` but is used as type `typing_extensions.Literal[3]`. literals_literalstring.py:75:4 Incompatible variable type [9]: x4 is declared to have type `typing_extensions.LiteralString` but is used as type `typing_extensions.Literal[b'test']`. @@ -11,6 +15,7 @@ literals_literalstring.py:120:21 Incompatible parameter type [6]: In call `liter literals_literalstring.py:134:50 Incompatible parameter type [6]: In call `Container.__init__`, for 1st positional argument, expected `Variable[T (bound to typing_extensions.LiteralString)]` but got `str`. literals_literalstring.py:171:4 Incompatible variable type [9]: x1 is declared to have type `List[str]` but is used as type `List[typing_extensions.LiteralString]`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 52: Unexpected errors ['literals_literalstring.py:52:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.LiteralString` but got `str`.'] """ diff --git a/conformance/results/pyre/literals_parameterizations.toml b/conformance/results/pyre/literals_parameterizations.toml index 861c8e3bf..c856e8bc8 100644 --- a/conformance/results/pyre/literals_parameterizations.toml +++ b/conformance/results/pyre/literals_parameterizations.toml @@ -2,7 +2,6 @@ conformant = "Partial" notes = """ Does not support type aliases in Literal type expression. Does not support nested Literal type expression. -Does not reject unary + operator in Literal type expression. Does not reject tuple in Literal type expression. Does not reject "bare" Literal in type expression. """ diff --git a/conformance/results/pyre/namedtuples_define_class.toml b/conformance/results/pyre/namedtuples_define_class.toml index 0f6fe7903..49225bc7d 100644 --- a/conformance/results/pyre/namedtuples_define_class.toml +++ b/conformance/results/pyre/namedtuples_define_class.toml @@ -1,5 +1,6 @@ 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. @@ -7,8 +8,14 @@ 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:29:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int]]`. -namedtuples_define_class.py:30:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int], Type[str]]`. +namedtuples_define_class.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +namedtuples_define_class.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +namedtuples_define_class.py:25:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. +namedtuples_define_class.py:26:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. +namedtuples_define_class.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +namedtuples_define_class.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +namedtuples_define_class.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, int]` but got `typing.Tuple[typing.Any, ...]`. +namedtuples_define_class.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, int, str]` but got `typing.Tuple[typing.Any, ...]`. namedtuples_define_class.py:44:5 Missing argument [20]: Call `Point.__init__` expects argument `y`. namedtuples_define_class.py:45:5 Missing argument [20]: Call `Point.__init__` expects argument `y`. namedtuples_define_class.py:46:14 Incompatible parameter type [6]: In call `Point.__init__`, for 2nd positional argument, expected `int` but got `str`. @@ -17,6 +24,7 @@ namedtuples_define_class.py:48:5 Too many arguments [19]: Call `Point.__init__` namedtuples_define_class.py:49:6 Unexpected keyword [28]: Unexpected keyword argument `other` to call `Point.__init__`. namedtuples_define_class.py:73:0 Incompatible variable type [9]: Unable to unpack `PointWithName`, expected a tuple. namedtuples_define_class.py:79:4 Invalid assignment [41]: Cannot reassign final attribute `x`. +namedtuples_define_class.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`. namedtuples_define_class.py:98:18 Incompatible parameter type [6]: In call `Property.__init__`, for 2nd positional argument, expected `str` but got `float`. """ conformance_automated = "Fail" @@ -25,7 +33,14 @@ Line 32: Expected 1 errors Line 33: Expected 1 errors Line 59: Expected 1 errors Line 105: Expected 1 errors -Line 29: Unexpected errors ['namedtuples_define_class.py:29:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int]]`.'] -Line 30: Unexpected errors ['namedtuples_define_class.py:30:26 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int], Type[str]]`.'] +Line 23: Unexpected errors ['namedtuples_define_class.py:23:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] +Line 24: Unexpected errors ['namedtuples_define_class.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] +Line 25: Unexpected errors ['namedtuples_define_class.py:25:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] +Line 26: Unexpected errors ['namedtuples_define_class.py:26:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] +Line 27: Unexpected errors ['namedtuples_define_class.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] +Line 28: Unexpected errors ['namedtuples_define_class.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] +Line 29: Unexpected errors ['namedtuples_define_class.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, int]` but got `typing.Tuple[typing.Any, ...]`.'] +Line 30: Unexpected errors ['namedtuples_define_class.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, int, str]` but got `typing.Tuple[typing.Any, ...]`.'] Line 73: Unexpected errors ['namedtuples_define_class.py:73:0 Incompatible variable type [9]: Unable to unpack `PointWithName`, expected a tuple.'] +Line 95: Unexpected errors ['namedtuples_define_class.py:95:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/namedtuples_define_functional.toml b/conformance/results/pyre/namedtuples_define_functional.toml index b9efa74f6..8bf701ba9 100644 --- a/conformance/results/pyre/namedtuples_define_functional.toml +++ b/conformance/results/pyre/namedtuples_define_functional.toml @@ -1,7 +1,8 @@ -conformant = "Pass" +conformant = "Partial" notes = """ Does not reject duplicate field names in functional form. Does not handle illegal named tuple names the same as runtime. +Does not handle defined fields correctly when extra flags like `rename` or `default` are used. Does not support defaults in functional form. """ output = """ diff --git a/conformance/results/pyre/namedtuples_type_compat.toml b/conformance/results/pyre/namedtuples_type_compat.toml index 9d724f14c..76f3303cb 100644 --- a/conformance/results/pyre/namedtuples_type_compat.toml +++ b/conformance/results/pyre/namedtuples_type_compat.toml @@ -1,4 +1,4 @@ -conformant = "Partial" +conformant = "Unsupported" notes = """ Rejects valid type compatibility between named tuple and tuple. """ diff --git a/conformance/results/pyre/namedtuples_usage.toml b/conformance/results/pyre/namedtuples_usage.toml index 8426a79c2..a9956c367 100644 --- a/conformance/results/pyre/namedtuples_usage.toml +++ b/conformance/results/pyre/namedtuples_usage.toml @@ -4,8 +4,15 @@ Does not report out-of-range index access with named tuple instance. Does not reject attempt to delete named tuple field by name. Does not reject attempt to delete named tuple field by index. Incorrectly handles subclasses of named tuples that add more attributes. +Does not handle unpacking of named tuples. """ output = """ +namedtuples_usage.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +namedtuples_usage.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +namedtuples_usage.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. +namedtuples_usage.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. +namedtuples_usage.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +namedtuples_usage.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. namedtuples_usage.py:40:0 Invalid assignment [41]: Cannot reassign final attribute `p.x`. namedtuples_usage.py:41:0 Undefined attribute [16]: `Point` has no attribute `__setitem__`. namedtuples_usage.py:52:0 Unable to unpack [23]: Unable to unpack 3 values, 2 were expected. @@ -18,5 +25,11 @@ Line 34: Expected 1 errors Line 35: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors +Line 27: Unexpected errors ['namedtuples_usage.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] +Line 28: Unexpected errors ['namedtuples_usage.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] +Line 29: Unexpected errors ['namedtuples_usage.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] +Line 30: Unexpected errors ['namedtuples_usage.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] +Line 31: Unexpected errors ['namedtuples_usage.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] +Line 32: Unexpected errors ['namedtuples_usage.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] Line 61: Unexpected errors ['namedtuples_usage.py:61:0 Unable to unpack [23]: Unable to unpack 0 values, 3 were expected.'] """ diff --git a/conformance/results/pyre/narrowing_typeguard.toml b/conformance/results/pyre/narrowing_typeguard.toml index a4fca0a77..7bf7ead7b 100644 --- a/conformance/results/pyre/narrowing_typeguard.toml +++ b/conformance/results/pyre/narrowing_typeguard.toml @@ -1,12 +1,8 @@ conformant = "Partial" notes = """ -Does not support `tuple` in `assert_type` call. Does not reject TypeGuard method with too few parameters. -Does not allow covariant use of TypeGuard. """ output = """ -narrowing_typeguard.py:17:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[str]]`. -narrowing_typeguard.py:19:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], typing.Any]`. narrowing_typeguard.py:128:19 Incompatible parameter type [6]: In call `takes_callable_str`, for 1st positional argument, expected `typing.Callable[[object], str]` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeGuard[int]]`. narrowing_typeguard.py:148:25 Incompatible parameter type [6]: In call `takes_callable_str_proto`, for 1st positional argument, expected `CallableStrProto` but got `typing.Callable(simple_typeguard)[[Named(val, object)], TypeGuard[int]]`. narrowing_typeguard.py:167:20 Incompatible parameter type [6]: In call `takes_int_typeguard`, for 1st positional argument, expected `typing.Callable[[object], TypeGuard[int]]` but got `typing.Callable(bool_typeguard)[[Named(val, object)], TypeGuard[bool]]`. @@ -15,7 +11,5 @@ conformance_automated = "Fail" errors_diff = """ Line 102: Expected 1 errors Line 107: Expected 1 errors -Line 17: Unexpected errors ['narrowing_typeguard.py:17:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[str]]`.'] -Line 19: Unexpected errors ['narrowing_typeguard.py:19:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], typing.Any]`.'] Line 167: Unexpected errors ['narrowing_typeguard.py:167:20 Incompatible parameter type [6]: In call `takes_int_typeguard`, for 1st positional argument, expected `typing.Callable[[object], TypeGuard[int]]` but got `typing.Callable(bool_typeguard)[[Named(val, object)], TypeGuard[bool]]`.'] """ diff --git a/conformance/results/pyre/narrowing_typeis.toml b/conformance/results/pyre/narrowing_typeis.toml index d36cf2e82..2746dc5f7 100644 --- a/conformance/results/pyre/narrowing_typeis.toml +++ b/conformance/results/pyre/narrowing_typeis.toml @@ -2,9 +2,16 @@ conformant = "Unsupported" output = """ narrowing_typeis.py:9:0 Undefined import [21]: Could not find a name `TypeIs` defined in module `typing_extensions`. narrowing_typeis.py:14:48 Undefined or invalid type [11]: Annotation `TypeIs` is not defined as a type. -narrowing_typeis.py:19:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[str]]`. -narrowing_typeis.py:21:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], typing.Any]`. +narrowing_typeis.py:19:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[str, str]` but got `typing.Tuple[str, ...]`. narrowing_typeis.py:35:17 Incompatible awaitable type [12]: Expected an awaitable but got `typing.Union[typing.Awaitable[int], int]`. +narrowing_typeis.py:38:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Union[Awaitable[int], int]`. +narrowing_typeis.py:72:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. +narrowing_typeis.py:76:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. +narrowing_typeis.py:80:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. +narrowing_typeis.py:84:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. +narrowing_typeis.py:88:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`. +narrowing_typeis.py:92:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `B` but got `object`. +narrowing_typeis.py:96:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `B` but got `object`. """ conformance_automated = "Fail" errors_diff = """ @@ -19,7 +26,14 @@ Line 195: Expected 1 errors Line 199: Expected 1 errors Line 9: Unexpected errors ['narrowing_typeis.py:9:0 Undefined import [21]: Could not find a name `TypeIs` defined in module `typing_extensions`.'] Line 14: Unexpected errors ['narrowing_typeis.py:14:48 Undefined or invalid type [11]: Annotation `TypeIs` is not defined as a type.'] -Line 19: Unexpected errors ['narrowing_typeis.py:19:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[str]]`.'] -Line 21: Unexpected errors ['narrowing_typeis.py:21:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], typing.Any]`.'] +Line 19: Unexpected errors ['narrowing_typeis.py:19:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[str, str]` but got `typing.Tuple[str, ...]`.'] Line 35: Unexpected errors ['narrowing_typeis.py:35:17 Incompatible awaitable type [12]: Expected an awaitable but got `typing.Union[typing.Awaitable[int], int]`.'] +Line 38: Unexpected errors ['narrowing_typeis.py:38:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Union[Awaitable[int], int]`.'] +Line 72: Unexpected errors ['narrowing_typeis.py:72:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] +Line 76: Unexpected errors ['narrowing_typeis.py:76:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] +Line 80: Unexpected errors ['narrowing_typeis.py:80:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] +Line 84: Unexpected errors ['narrowing_typeis.py:84:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] +Line 88: Unexpected errors ['narrowing_typeis.py:88:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `object`.'] +Line 92: Unexpected errors ['narrowing_typeis.py:92:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `B` but got `object`.'] +Line 96: Unexpected errors ['narrowing_typeis.py:96:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `B` but got `object`.'] """ diff --git a/conformance/results/pyre/qualifiers_annotated.toml b/conformance/results/pyre/qualifiers_annotated.toml index a12bea661..f15d74fc5 100644 --- a/conformance/results/pyre/qualifiers_annotated.toml +++ b/conformance/results/pyre/qualifiers_annotated.toml @@ -22,9 +22,13 @@ qualifiers_annotated.py:84:16 Incompatible parameter type [6]: In call `typing.G qualifiers_annotated.py:85:6 Incompatible parameter type [6]: In call `func4`, for 1st positional argument, expected `Type[Variable[T]]` but got `TypeAlias`. qualifiers_annotated.py:92:10 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], str]`. Expected has length 0, but actual has length 2. qualifiers_annotated.py:93:0 Call error [29]: `TypeAlias` is not a function. +qualifiers_annotated.py:105:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. +qualifiers_annotated.py:106:4 Undefined attribute [16]: `typing.Type` has no attribute `b`. """ conformance_automated = "Fail" errors_diff = """ Line 64: Expected 1 errors Line 91: Expected 1 errors +Line 105: Unexpected errors ['qualifiers_annotated.py:105:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] +Line 106: Unexpected errors ['qualifiers_annotated.py:106:4 Undefined attribute [16]: `typing.Type` has no attribute `b`.'] """ diff --git a/conformance/results/pyre/specialtypes_any.toml b/conformance/results/pyre/specialtypes_any.toml index 2603766cc..b3b83ddee 100644 --- a/conformance/results/pyre/specialtypes_any.toml +++ b/conformance/results/pyre/specialtypes_any.toml @@ -1,23 +1,14 @@ conformant = "Partial" notes = """ -Does not treat missing type argument as Any in generic type. Does not support Any as a base class. """ output = """ -specialtypes_any.py:48:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `object`. -specialtypes_any.py:49:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT]]]` but got `Tuple[object, object]`. -specialtypes_any.py:62:28 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[object, typing.Any]`. -specialtypes_any.py:72:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[typing.Any, object]`. specialtypes_any.py:81:13 Invalid inheritance [39]: `typing.Any` is not a valid parent class. specialtypes_any.py:87:12 Undefined attribute [16]: `ClassA` has no attribute `method2`. specialtypes_any.py:88:12 Undefined attribute [16]: `ClassA` has no attribute `method3`. """ conformance_automated = "Fail" errors_diff = """ -Line 48: Unexpected errors ['specialtypes_any.py:48:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T]]` but got `object`.'] -Line 49: Unexpected errors ['specialtypes_any.py:49:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT]]]` but got `Tuple[object, object]`.'] -Line 62: Unexpected errors ['specialtypes_any.py:62:28 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[object, typing.Any]`.'] -Line 72: Unexpected errors ['specialtypes_any.py:72:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[typing.Any, object]`.'] Line 81: Unexpected errors ['specialtypes_any.py:81:13 Invalid inheritance [39]: `typing.Any` is not a valid parent class.'] Line 87: Unexpected errors ['specialtypes_any.py:87:12 Undefined attribute [16]: `ClassA` has no attribute `method2`.'] Line 88: Unexpected errors ['specialtypes_any.py:88:12 Undefined attribute [16]: `ClassA` has no attribute `method3`.'] diff --git a/conformance/results/pyre/specialtypes_none.toml b/conformance/results/pyre/specialtypes_none.toml index 3b48d0a30..a9c3b0913 100644 --- a/conformance/results/pyre/specialtypes_none.toml +++ b/conformance/results/pyre/specialtypes_none.toml @@ -1,14 +1,9 @@ -conformant = "Partial" -notes = """ -Does not correctly handle type annotation type[None]. -""" +conformant = "Pass" output = """ specialtypes_none.py:21:6 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `None` but got `Type[None]`. specialtypes_none.py:27:0 Incompatible variable type [9]: none2 is declared to have type `Iterable[typing.Any]` but is used as type `None`. -specialtypes_none.py:36:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `None`. specialtypes_none.py:41:6 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `Type[None]` but got `None`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 36: Unexpected errors ['specialtypes_none.py:36:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `None`.'] """ diff --git a/conformance/results/pyre/specialtypes_type.toml b/conformance/results/pyre/specialtypes_type.toml index 183af325e..78343fa29 100644 --- a/conformance/results/pyre/specialtypes_type.toml +++ b/conformance/results/pyre/specialtypes_type.toml @@ -9,16 +9,7 @@ Reports type incompatibility between `type` and `Callable[..., Any]`. output = """ specialtypes_type.py:56:6 Incompatible parameter type [6]: In call `func4`, for 1st positional argument, expected `Type[Union[BasicUser, ProUser]]` but got `Type[TeamUser]`. specialtypes_type.py:76:11 Invalid type parameters [24]: Generic type `type` expects 1 type parameter, received 2, use `typing.Type[]` to avoid runtime subscripting errors. -specialtypes_type.py:84:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`. -specialtypes_type.py:98:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[type], typing.Any]`. -specialtypes_type.py:102:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[type], typing.Any]`. -specialtypes_type.py:106:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[type], typing.Any]`. -specialtypes_type.py:110:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[type], typing.Any]`. specialtypes_type.py:117:4 Undefined attribute [16]: `object` has no attribute `unknown`. -specialtypes_type.py:137:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`. -specialtypes_type.py:138:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`. -specialtypes_type.py:139:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`. -specialtypes_type.py:140:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`. specialtypes_type.py:143:0 Undefined attribute [16]: `TypeAlias` has no attribute `unknown`. specialtypes_type.py:165:4 Incompatible variable type [9]: x1 is declared to have type `typing.Callable[..., typing.Any]` but is used as type `Type[typing.Any]`. specialtypes_type.py:166:4 Incompatible variable type [9]: x2 is declared to have type `typing.Callable[[int, int], int]` but is used as type `Type[typing.Any]`. @@ -30,15 +21,6 @@ Line 120: Expected 1 errors Line 144: Expected 1 errors Line 145: Expected 1 errors Line 146: Expected 1 errors -Line 84: Unexpected errors ['specialtypes_type.py:84:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`.'] -Line 98: Unexpected errors ['specialtypes_type.py:98:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[type], typing.Any]`.'] -Line 102: Unexpected errors ['specialtypes_type.py:102:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[type], typing.Any]`.'] -Line 106: Unexpected errors ['specialtypes_type.py:106:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[type], typing.Any]`.'] -Line 110: Unexpected errors ['specialtypes_type.py:110:33 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[type], typing.Any]`.'] -Line 137: Unexpected errors ['specialtypes_type.py:137:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`.'] -Line 138: Unexpected errors ['specialtypes_type.py:138:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`.'] -Line 139: Unexpected errors ['specialtypes_type.py:139:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`.'] -Line 140: Unexpected errors ['specialtypes_type.py:140:24 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_meta](covariant)]` but got `object`.'] Line 165: Unexpected errors ['specialtypes_type.py:165:4 Incompatible variable type [9]: x1 is declared to have type `typing.Callable[..., typing.Any]` but is used as type `Type[typing.Any]`.'] Line 166: Unexpected errors ['specialtypes_type.py:166:4 Incompatible variable type [9]: x2 is declared to have type `typing.Callable[[int, int], int]` but is used as type `Type[typing.Any]`.'] """ diff --git a/conformance/results/pyre/tuples_type_compat.toml b/conformance/results/pyre/tuples_type_compat.toml index 6f1c6109a..3d3a35787 100644 --- a/conformance/results/pyre/tuples_type_compat.toml +++ b/conformance/results/pyre/tuples_type_compat.toml @@ -12,18 +12,15 @@ tuples_type_compat.py:27:8 Invalid type [31]: Expression `tuple[(int, *tuple[(in tuples_type_compat.py:47:8 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type. tuples_type_compat.py:55:21 Undefined or invalid type [11]: Annotation `SomeType` is not defined as a type. tuples_type_compat.py:71:15 Invalid type [31]: Expression `typing.Union[(tuple[int], tuple[(str, str)], tuple[(int, *tuple[(str, ...)], int)])]` is not a valid type. -tuples_type_compat.py:78:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[str]]`. -tuples_type_compat.py:78:49 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int]]`. -tuples_type_compat.py:82:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[str], Type[int]]`. tuples_type_compat.py:91:15 Invalid type [31]: Expression `typing.Union[(tuple[int], tuple[(str, str)], tuple[(int, *tuple[(str, ...)], int)])]` is not a valid type. -tuples_type_compat.py:99:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[str]]`. -tuples_type_compat.py:99:53 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int]]`. -tuples_type_compat.py:103:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[str], Type[int]]`. -tuples_type_compat.py:115:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[UnionType, Type[str]]`. -tuples_type_compat.py:117:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[UnionType, Type[int]]`. +tuples_type_compat.py:95:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str]]`. +tuples_type_compat.py:99:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str]]`. +tuples_type_compat.py:103:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str]]`. +tuples_type_compat.py:115:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`. +tuples_type_compat.py:117:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`. tuples_type_compat.py:134:39 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type. -tuples_type_compat.py:137:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `UnionType`. -tuples_type_compat.py:139:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `UnionType`. +tuples_type_compat.py:139:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Sequence[Union[int, str]]` but got `Sequence[Variable[T]]`. +tuples_type_compat.py:140:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Sequence[Never]` but got `Sequence[Variable[T]]`. tuples_type_compat.py:143:4 Invalid type [31]: Expression `tuple[(int, *tuple[str])]` is not a valid type. tuples_type_compat.py:144:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['']]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal['']]`. tuples_type_compat.py:146:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, unknown]` but is used as type `Tuple[int]`. @@ -72,16 +69,15 @@ Line 27: Unexpected errors ['tuples_type_compat.py:27:8 Invalid type [31]: Expre Line 47: Unexpected errors ['tuples_type_compat.py:47:8 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type.'] Line 55: Unexpected errors ['tuples_type_compat.py:55:21 Undefined or invalid type [11]: Annotation `SomeType` is not defined as a type.'] Line 71: Unexpected errors ['tuples_type_compat.py:71:15 Invalid type [31]: Expression `typing.Union[(tuple[int], tuple[(str, str)], tuple[(int, *tuple[(str, ...)], int)])]` is not a valid type.'] -Line 78: Unexpected errors ['tuples_type_compat.py:78:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[str]]`.', 'tuples_type_compat.py:78:49 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int]]`.'] -Line 82: Unexpected errors ['tuples_type_compat.py:82:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[str], Type[int]]`.'] Line 91: Unexpected errors ['tuples_type_compat.py:91:15 Invalid type [31]: Expression `typing.Union[(tuple[int], tuple[(str, str)], tuple[(int, *tuple[(str, ...)], int)])]` is not a valid type.'] -Line 99: Unexpected errors ['tuples_type_compat.py:99:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[str], Type[str]]`.', 'tuples_type_compat.py:99:53 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int]]`.'] -Line 103: Unexpected errors ['tuples_type_compat.py:103:35 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[str], Type[int]]`.'] -Line 115: Unexpected errors ['tuples_type_compat.py:115:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[UnionType, Type[str]]`.'] -Line 117: Unexpected errors ['tuples_type_compat.py:117:36 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[UnionType, Type[int]]`.'] +Line 95: Unexpected errors ['tuples_type_compat.py:95:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str]]`.'] +Line 99: Unexpected errors ['tuples_type_compat.py:99:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str]]`.'] +Line 103: Unexpected errors ['tuples_type_compat.py:103:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str]]`.'] +Line 115: Unexpected errors ['tuples_type_compat.py:115:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`.'] +Line 117: Unexpected errors ['tuples_type_compat.py:117:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`.'] Line 134: Unexpected errors ['tuples_type_compat.py:134:39 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type.'] -Line 137: Unexpected errors ['tuples_type_compat.py:137:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `UnionType`.'] -Line 139: Unexpected errors ['tuples_type_compat.py:139:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `UnionType`.'] +Line 139: Unexpected errors ['tuples_type_compat.py:139:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Sequence[Union[int, str]]` but got `Sequence[Variable[T]]`.'] +Line 140: Unexpected errors ['tuples_type_compat.py:140:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Sequence[Never]` but got `Sequence[Variable[T]]`.'] Line 143: Unexpected errors ['tuples_type_compat.py:143:4 Invalid type [31]: Expression `tuple[(int, *tuple[str])]` is not a valid type.'] Line 146: Unexpected errors ['tuples_type_compat.py:146:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, unknown]` but is used as type `Tuple[int]`.', 'tuples_type_compat.py:146:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type.'] Line 147: Unexpected errors ["tuples_type_compat.py:147:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['']]`."] diff --git a/conformance/results/pyre/tuples_type_form.toml b/conformance/results/pyre/tuples_type_form.toml index 494ed84f7..18b7d89ad 100644 --- a/conformance/results/pyre/tuples_type_form.toml +++ b/conformance/results/pyre/tuples_type_form.toml @@ -8,12 +8,12 @@ tuples_type_form.py:14:0 Incompatible variable type [9]: t2 is declared to have tuples_type_form.py:15:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[int, str]`. tuples_type_form.py:25:0 Incompatible variable type [9]: t10 is declared to have type `Tuple[]` but is used as type `Tuple[int]`. tuples_type_form.py:36:0 Incompatible variable type [9]: t20 is declared to have type `typing.Tuple[int, ...]` but is used as type `Tuple[int, int, int, str]`. +tuples_type_form.py:40:5 Undefined or invalid type [11]: Annotation `...` is not defined as a type. tuples_type_form.py:44:5 Invalid type [31]: Expression `tuple[(*tuple[str], ...)]` is not a valid type. tuples_type_form.py:45:5 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], ...)]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors Line 41: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors diff --git a/conformance/results/pyre/tuples_unpacked.toml b/conformance/results/pyre/tuples_unpacked.toml index 52ce6edc5..521b8b9a7 100644 --- a/conformance/results/pyre/tuples_unpacked.toml +++ b/conformance/results/pyre/tuples_unpacked.toml @@ -1,23 +1,13 @@ conformant = "Partial" notes = """ -Rejects some legal tuple type forms involving unpack. -Does not reject some illegal tuple type forms involving unpack. +Does not understand star syntax for `Unpack`. """ output = """ tuples_unpacked.py:16:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, bool)], str)]` is not a valid type. -tuples_unpacked.py:17:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[bool], Type[bool], Type[str]]`. -tuples_unpacked.py:18:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], Type[bool], Type[str]]`. -tuples_unpacked.py:18:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -tuples_unpacked.py:18:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[bool]]`. -tuples_unpacked.py:19:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[Type[int], Type[bool], *Tuple[typing.Any, ...]]`. -tuples_unpacked.py:19:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -tuples_unpacked.py:19:43 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[bool], Type[str]]`. +tuples_unpacked.py:18:19 Invalid type [31]: Expression `tuple[(*tuple[(int, bool)], bool, str)]` is not a valid type. +tuples_unpacked.py:19:19 Invalid type [31]: Expression `tuple[(int, bool, *tuple[(bool, str)])]` is not a valid type. tuples_unpacked.py:25:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, ...)], str)]` is not a valid type. -tuples_unpacked.py:26:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[Type[int], *Tuple[typing.Any, ...], Type[str]]`. -tuples_unpacked.py:26:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`. -tuples_unpacked.py:26:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[bool], typing.Any]`. tuples_unpacked.py:31:4 Invalid type [31]: Expression `tuple[(*tuple[int], *tuple[int])]` is not a valid type. -tuples_unpacked.py:32:22 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int]]`. tuples_unpacked.py:33:4 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], *tuple[int])]` is not a valid type. tuples_unpacked.py:38:4 Invalid type [31]: Expression `tuple[(*tuple[str], *tuple[str])]` is not a valid type. tuples_unpacked.py:39:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])])]` is not a valid type. @@ -26,24 +16,21 @@ tuples_unpacked.py:41:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tupl tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*$local_tuples_unpacked$Ts)]` is not a valid type. tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *$local_tuples_unpacked$Ts)]` is not a valid type. tuples_unpacked.py:51:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *$local_tuples_unpacked$Ts)]` is not a valid type. -tuples_unpacked.py:57:5 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type. +tuples_unpacked.py:59:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, ...)]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type. +tuples_unpacked.py:60:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, typing.Unpack[tuple[(str, ...)]])]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ -Line 59: Expected 1 errors Line 61: Expected 1 errors Line 16: Unexpected errors ['tuples_unpacked.py:16:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, bool)], str)]` is not a valid type.'] -Line 17: Unexpected errors ['tuples_unpacked.py:17:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[bool], Type[bool], Type[str]]`.'] -Line 18: Unexpected errors ['tuples_unpacked.py:18:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[*Tuple[typing.Any, ...], Type[bool], Type[str]]`.', 'tuples_unpacked.py:18:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'tuples_unpacked.py:18:32 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[bool]]`.'] -Line 19: Unexpected errors ['tuples_unpacked.py:19:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[Type[int], Type[bool], *Tuple[typing.Any, ...]]`.', 'tuples_unpacked.py:19:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'tuples_unpacked.py:19:43 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[bool], Type[str]]`.'] +Line 18: Unexpected errors ['tuples_unpacked.py:18:19 Invalid type [31]: Expression `tuple[(*tuple[(int, bool)], bool, str)]` is not a valid type.'] +Line 19: Unexpected errors ['tuples_unpacked.py:19:19 Invalid type [31]: Expression `tuple[(int, bool, *tuple[(bool, str)])]` is not a valid type.'] Line 25: Unexpected errors ['tuples_unpacked.py:25:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, ...)], str)]` is not a valid type.'] -Line 26: Unexpected errors ['tuples_unpacked.py:26:25 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `typing.Tuple[Type[int], *Tuple[typing.Any, ...], Type[str]]`.', 'tuples_unpacked.py:26:25 Unable to concatenate tuple [60]: Expected to unpack an iterable, but got `typing.Type[tuple[Variable[_T_co](covariant)]]`.', 'tuples_unpacked.py:26:37 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[bool], typing.Any]`.'] Line 31: Unexpected errors ['tuples_unpacked.py:31:4 Invalid type [31]: Expression `tuple[(*tuple[int], *tuple[int])]` is not a valid type.'] -Line 32: Unexpected errors ['tuples_unpacked.py:32:22 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[_T_co](covariant)]` but got `Tuple[Type[int], Type[int]]`.'] Line 33: Unexpected errors ['tuples_unpacked.py:33:4 Invalid type [31]: Expression `tuple[(*tuple[(int, ...)], *tuple[int])]` is not a valid type.'] Line 38: Unexpected errors ['tuples_unpacked.py:38:4 Invalid type [31]: Expression `tuple[(*tuple[str], *tuple[str])]` is not a valid type.'] Line 39: Unexpected errors ['tuples_unpacked.py:39:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])])]` is not a valid type.'] Line 49: Unexpected errors ['tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*$local_tuples_unpacked$Ts)]` is not a valid type.'] Line 50: Unexpected errors ['tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *$local_tuples_unpacked$Ts)]` is not a valid type.'] -Line 57: Unexpected errors ['tuples_unpacked.py:57:5 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type.'] +Line 60: Unexpected errors ['tuples_unpacked.py:60:5 Invalid type [31]: Expression `tuple[(typing.Unpack[tuple[(str, typing.Unpack[tuple[(str, ...)]])]], typing.Unpack[tuple[(int, ...)]])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly.toml b/conformance/results/pyre/typeddicts_readonly.toml index e9b04f3b1..70380b51f 100644 --- a/conformance/results/pyre/typeddicts_readonly.toml +++ b/conformance/results/pyre/typeddicts_readonly.toml @@ -1,6 +1,5 @@ conformant = "Unsupported" output = """ -typeddicts_readonly.py:8:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`. typeddicts_readonly.py:18:13 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. """ conformance_automated = "Fail" @@ -11,6 +10,5 @@ Line 50: Expected 1 errors Line 51: Expected 1 errors Line 60: Expected 1 errors Line 61: Expected 1 errors -Line 8: Unexpected errors ['typeddicts_readonly.py:8:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`.'] Line 18: Unexpected errors ['typeddicts_readonly.py:18:13 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_consistency.toml b/conformance/results/pyre/typeddicts_readonly_consistency.toml index 4ce868b8e..a13a44a5c 100644 --- a/conformance/results/pyre/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyre/typeddicts_readonly_consistency.toml @@ -1,6 +1,5 @@ conformant = "Unsupported" output = """ -typeddicts_readonly_consistency.py:8:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`. typeddicts_readonly_consistency.py:30:7 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. typeddicts_readonly_consistency.py:37:4 Incompatible variable type [9]: v3 is declared to have type `B1` but is used as type `A1`. typeddicts_readonly_consistency.py:38:4 Incompatible variable type [9]: v4 is declared to have type `B1` but is used as type `C1`. @@ -15,7 +14,6 @@ typeddicts_readonly_consistency.py:85:4 Incompatible variable type [9]: v6 is de """ conformance_automated = "Fail" errors_diff = """ -Line 8: Unexpected errors ['typeddicts_readonly_consistency.py:8:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`.'] Line 30: Unexpected errors ['typeddicts_readonly_consistency.py:30:7 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] Line 41: Unexpected errors ['typeddicts_readonly_consistency.py:41:4 Incompatible variable type [9]: v6 is declared to have type `C1` but is used as type `B1`.'] Line 78: Unexpected errors ['typeddicts_readonly_consistency.py:78:4 Incompatible variable type [9]: v1 is declared to have type `A2` but is used as type `B2`.'] diff --git a/conformance/results/pyre/typeddicts_readonly_inheritance.toml b/conformance/results/pyre/typeddicts_readonly_inheritance.toml index a5ef30b14..8bcacffd1 100644 --- a/conformance/results/pyre/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyre/typeddicts_readonly_inheritance.toml @@ -1,6 +1,5 @@ conformant = "Unsupported" output = """ -typeddicts_readonly_inheritance.py:8:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`. typeddicts_readonly_inheritance.py:15:10 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. typeddicts_readonly_inheritance.py:18:0 Inconsistent override [15]: `name` overrides attribute defined in `NamedDict` inconsistently. Type `str` is not a subtype of the overridden attribute `unknown`. typeddicts_readonly_inheritance.py:65:18 TypedDict initialization error [55]: Missing required field `name` for TypedDict `RequiredName`. @@ -20,7 +19,6 @@ Line 94: Expected 1 errors Line 98: Expected 1 errors Line 106: Expected 1 errors Line 132: Expected 1 errors -Line 8: Unexpected errors ['typeddicts_readonly_inheritance.py:8:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`.'] Line 15: Unexpected errors ['typeddicts_readonly_inheritance.py:15:10 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] Line 18: Unexpected errors ['typeddicts_readonly_inheritance.py:18:0 Inconsistent override [15]: `name` overrides attribute defined in `NamedDict` inconsistently. Type `str` is not a subtype of the overridden attribute `unknown`.'] Line 75: Unexpected errors ['typeddicts_readonly_inheritance.py:75:0 Inconsistent override [15]: `ident` overrides attribute defined in `OptionalIdent` inconsistently. Type `str` is not a subtype of the overridden attribute `unknown`.'] diff --git a/conformance/results/pyre/typeddicts_readonly_kwargs.toml b/conformance/results/pyre/typeddicts_readonly_kwargs.toml index a8c0fcbd4..911a969a2 100644 --- a/conformance/results/pyre/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyre/typeddicts_readonly_kwargs.toml @@ -1,13 +1,11 @@ conformant = "Unsupported" output = """ -typeddicts_readonly_kwargs.py:9:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`. typeddicts_readonly_kwargs.py:24:10 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. typeddicts_readonly_kwargs.py:29:33 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ Line 33: Expected 1 errors -Line 9: Unexpected errors ['typeddicts_readonly_kwargs.py:9:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`.'] Line 24: Unexpected errors ['typeddicts_readonly_kwargs.py:24:10 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] Line 29: Unexpected errors ['typeddicts_readonly_kwargs.py:29:33 Undefined or invalid type [11]: Annotation `Unpack` is not defined as a type.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_update.toml b/conformance/results/pyre/typeddicts_readonly_update.toml index 1fab03b57..6f271f647 100644 --- a/conformance/results/pyre/typeddicts_readonly_update.toml +++ b/conformance/results/pyre/typeddicts_readonly_update.toml @@ -1,13 +1,11 @@ conformant = "Unsupported" output = """ -typeddicts_readonly_update.py:9:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`. typeddicts_readonly_update.py:17:7 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. typeddicts_readonly_update.py:34:13 Incompatible parameter type [6]: In call `TypedDictionary.update`, for 1st positional argument, expected `A` but got `B`. """ conformance_automated = "Fail" errors_diff = """ Line 23: Expected 1 errors -Line 9: Unexpected errors ['typeddicts_readonly_update.py:9:0 Undefined import [21]: Could not find a name `ReadOnly` defined in module `typing_extensions`.'] Line 17: Unexpected errors ['typeddicts_readonly_update.py:17:7 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type.'] Line 34: Unexpected errors ['typeddicts_readonly_update.py:34:13 Incompatible parameter type [6]: In call `TypedDictionary.update`, for 1st positional argument, expected `A` but got `B`.'] """ diff --git a/conformance/results/pyre/typeddicts_required.toml b/conformance/results/pyre/typeddicts_required.toml index faa297eb8..f8d3d4cc8 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -3,6 +3,7 @@ notes = """ Does not reject use of `Required` in function parameter annotation. Does not reject nested use of `Required` in type annotation. Does not support recursive TypedDict definitions. +Incorrectly complains about uninitialized attributes on TypedDict definitions. """ output = """ typeddicts_required.py:11:0 Uninitialized attribute [13]: Attribute `x` is declared in class `NotTypedDict` to have type `Required[int]` but is never initialized. diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index e4f3bd0c9..737b7ea3a 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ -version = "pyre 0.9.19" -test_duration = 2.8 +version = "pyre 0.9.21" +test_duration = 4.1