From 1a9429e44875b400670a0f846c889469d0624462 Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 16:01:08 +0000 Subject: [PATCH 01/12] Add conformance tests for PEP 702's `@deprecated` --- .../_directives_deprecated_pep702_example.py | 44 +++++++++++++++++++ .../directives_deprecated_pep702_example.py | 44 +++++++++++++++++++ .../tests/directives_deprecated_protocol.py | 34 ++++++++++++++ .../directives_deprecated_same_module.py | 20 +++++++++ 4 files changed, 142 insertions(+) create mode 100644 conformance/tests/_directives_deprecated_pep702_example.py create mode 100644 conformance/tests/directives_deprecated_pep702_example.py create mode 100644 conformance/tests/directives_deprecated_protocol.py create mode 100644 conformance/tests/directives_deprecated_same_module.py diff --git a/conformance/tests/_directives_deprecated_pep702_example.py b/conformance/tests/_directives_deprecated_pep702_example.py new file mode 100644 index 00000000..7e2db077 --- /dev/null +++ b/conformance/tests/_directives_deprecated_pep702_example.py @@ -0,0 +1,44 @@ +""" +Support module for directive_deprecated_pep702_example. +""" + +from typing import overload + +from typing_extensions import deprecated + + +@deprecated("Use Spam instead") +class Ham: ... + + +@deprecated("It is pining for the fiords") +def norwegian_blue(x: int) -> int: ... + + +@overload +@deprecated("Only str will be allowed") +def foo(x: int) -> str: ... + + +@overload +def foo(x: str) -> str: ... + + +def foo(x: int | str) -> str: ... + + +class Spam: + + @deprecated("There is enough spam in the world") + def __add__(self, other: object) -> object: ... + + @property + @deprecated("All spam will be equally greasy") + def greasy(self) -> float: ... + + @property + def shape(self) -> str: ... + + @shape.setter + @deprecated("Shapes are becoming immutable") + def shape(self, value: str) -> None: ... diff --git a/conformance/tests/directives_deprecated_pep702_example.py b/conformance/tests/directives_deprecated_pep702_example.py new file mode 100644 index 00000000..ee9b3b92 --- /dev/null +++ b/conformance/tests/directives_deprecated_pep702_example.py @@ -0,0 +1,44 @@ +""" +Tests the warnings.deprecated function. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/directives.html#deprecated +# See also https://peps.python.org/pep-0702/ + +# > Type checkers should produce a diagnostic whenever they encounter a usage of an object +# > marked as deprecated. [...] For deprecated classes and functions, this includes: + +# > * `from` imports + +from _directives_deprecated_pep702_example import Ham # E: Use of deprecated class Ham + +import _directives_deprecated_pep702_example as library + + +# > * References through module, class, or instance attributes + +library.norwegian_blue(1) # E: Use of deprecated function norwegian_blue +map(library.norwegian_blue, [1, 2, 3]) # E: Use of deprecated function norwegian_blue + + +# > For deprecated overloads, this includes all calls that resolve to the deprecated overload. + +library.foo(1) # E: Use of deprecated overload for foo +library.foo("x") # no error + + +ham = Ham() # no error (already reported above) + + +# > Any syntax that indirectly triggers a call to the function. + +spam = library.Spam() + +spam + 1 # E: Use of deprecated method Spam.__add__ +spam += 1 # E: Use of deprecated method Spam.__add__ + +spam.greasy # E: Use of deprecated property Spam.greasy +spam.shape # no error + +spam.shape = "cube" # E: Use of deprecated property setter Spam.shape +spam.shape += "cube" # E: Use of deprecated property setter Spam.shape diff --git a/conformance/tests/directives_deprecated_protocol.py b/conformance/tests/directives_deprecated_protocol.py new file mode 100644 index 00000000..23efaad3 --- /dev/null +++ b/conformance/tests/directives_deprecated_protocol.py @@ -0,0 +1,34 @@ +""" +Tests the warnings.deprecated function when it is used in a Protocol. +""" + +# > There are additional scenarios where deprecations could come into play. +# > For example, an object may implement a `typing.Protocol`, +# > but one of the methods required for protocol compliance is deprecated. +# > As scenarios such as this one appear complex and relatively unlikely to come up in practice, +# > this PEP does not mandate that type checkers detect them. + +from typing import Protocol + +from typing_extensions import deprecated + + +class Fooable(Protocol): + + @deprecated("Deprecated") + def foo(self) -> None: ... + + def bar(self) -> None: ... + + +class Fooer(Fooable): + + def foo(self) -> None: # E?: Implementation of deprecated method foo + ... + + def bar(self) -> None: ... + + +def foo_it(fooable: Fooable) -> None: + fooable.foo() # E: Use of deprecated method foo + fooable.bar() diff --git a/conformance/tests/directives_deprecated_same_module.py b/conformance/tests/directives_deprecated_same_module.py new file mode 100644 index 00000000..6f05f0a4 --- /dev/null +++ b/conformance/tests/directives_deprecated_same_module.py @@ -0,0 +1,20 @@ +""" +Tests the warnings.deprecated function when a deprecated symbol is used in the same module. +""" + +# Specification: https://typing.readthedocs.io/en/latest/spec/directives.html#deprecated +# See also https://peps.python.org/pep-0702/ + +# > Type checkers should produce a diagnostic whenever they encounter a usage of an object +# > marked as deprecated. [...] For deprecated classes and functions, this includes: +# > +# > * Any usage of deprecated objects in their defining module + +from typing_extensions import deprecated + + +@deprecated("Deprecated") +def lorem() -> None: ... + + +ipsum = lorem() # E: Use of deprecated function lorem From 8c7f06b6d41f5639e769f44e889d9c4a183c4847 Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 17:23:46 +0000 Subject: [PATCH 02/12] Reorder testcases to avoid irrelevant errors by Pyright --- conformance/tests/directives_deprecated_pep702_example.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conformance/tests/directives_deprecated_pep702_example.py b/conformance/tests/directives_deprecated_pep702_example.py index ee9b3b92..494060a9 100644 --- a/conformance/tests/directives_deprecated_pep702_example.py +++ b/conformance/tests/directives_deprecated_pep702_example.py @@ -34,11 +34,11 @@ spam = library.Spam() -spam + 1 # E: Use of deprecated method Spam.__add__ -spam += 1 # E: Use of deprecated method Spam.__add__ - spam.greasy # E: Use of deprecated property Spam.greasy spam.shape # no error spam.shape = "cube" # E: Use of deprecated property setter Spam.shape spam.shape += "cube" # E: Use of deprecated property setter Spam.shape + +spam + 1 # E: Use of deprecated method Spam.__add__ +spam += 1 # E: Use of deprecated method Spam.__add__ From 902f681465f7916a0edc41dcf4493f3a611605f4 Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 17:32:02 +0000 Subject: [PATCH 03/12] Address PR reviews --- ...02_example.py => directives_deprecated.py} | 65 ++++++++++++++++++- .../tests/directives_deprecated_protocol.py | 34 ---------- .../directives_deprecated_same_module.py | 20 ------ 3 files changed, 64 insertions(+), 55 deletions(-) rename conformance/tests/{directives_deprecated_pep702_example.py => directives_deprecated.py} (50%) delete mode 100644 conformance/tests/directives_deprecated_protocol.py delete mode 100644 conformance/tests/directives_deprecated_same_module.py diff --git a/conformance/tests/directives_deprecated_pep702_example.py b/conformance/tests/directives_deprecated.py similarity index 50% rename from conformance/tests/directives_deprecated_pep702_example.py rename to conformance/tests/directives_deprecated.py index 494060a9..35bed2c2 100644 --- a/conformance/tests/directives_deprecated_pep702_example.py +++ b/conformance/tests/directives_deprecated.py @@ -11,9 +11,10 @@ # > * `from` imports from _directives_deprecated_pep702_example import Ham # E: Use of deprecated class Ham - import _directives_deprecated_pep702_example as library +from typing_extensions import deprecated + # > * References through module, class, or instance attributes @@ -42,3 +43,65 @@ spam + 1 # E: Use of deprecated method Spam.__add__ spam += 1 # E: Use of deprecated method Spam.__add__ + + +# > * Any usage of deprecated objects in their defining module + + +@deprecated("Deprecated") +def lorem() -> None: ... + + +ipsum = lorem() # E: Use of deprecated function lorem + + +# > There are additional scenarios where deprecations could come into play. +# > For example, an object may implement a `typing.Protocol`, +# > but one of the methods required for protocol compliance is deprecated. +# > As scenarios such as this one appear complex and relatively unlikely to come up in practice, +# > this PEP does not mandate that type checkers detect them. + +from typing import Protocol, override + + +class Fooable(Protocol): + + @deprecated("Deprecated") + def foo(self) -> None: ... + + def bar(self) -> None: ... + + +class Fooer(Fooable): + + @override + def foo(self) -> None: # E?: Implementation of deprecated method foo + ... + + def bar(self) -> None: ... + + +def foo_it(fooable: Fooable) -> None: + fooable.foo() # E: Use of deprecated method foo + fooable.bar() + + +# https://github.com/python/typing/pull/1822#discussion_r1693991644 + + +class Fooable2(Protocol): + + def foo(self) -> None: ... + + +class Concrete: + + @deprecated("Deprecated") + def foo(self) -> None: ... + + +def take_fooable(f: Fooable2) -> None: ... + + +def caller(c: Concrete) -> None: + take_fooable(c) # E?: Concrete is a Fooable2, but only because of a deprecated method diff --git a/conformance/tests/directives_deprecated_protocol.py b/conformance/tests/directives_deprecated_protocol.py deleted file mode 100644 index 23efaad3..00000000 --- a/conformance/tests/directives_deprecated_protocol.py +++ /dev/null @@ -1,34 +0,0 @@ -""" -Tests the warnings.deprecated function when it is used in a Protocol. -""" - -# > There are additional scenarios where deprecations could come into play. -# > For example, an object may implement a `typing.Protocol`, -# > but one of the methods required for protocol compliance is deprecated. -# > As scenarios such as this one appear complex and relatively unlikely to come up in practice, -# > this PEP does not mandate that type checkers detect them. - -from typing import Protocol - -from typing_extensions import deprecated - - -class Fooable(Protocol): - - @deprecated("Deprecated") - def foo(self) -> None: ... - - def bar(self) -> None: ... - - -class Fooer(Fooable): - - def foo(self) -> None: # E?: Implementation of deprecated method foo - ... - - def bar(self) -> None: ... - - -def foo_it(fooable: Fooable) -> None: - fooable.foo() # E: Use of deprecated method foo - fooable.bar() diff --git a/conformance/tests/directives_deprecated_same_module.py b/conformance/tests/directives_deprecated_same_module.py deleted file mode 100644 index 6f05f0a4..00000000 --- a/conformance/tests/directives_deprecated_same_module.py +++ /dev/null @@ -1,20 +0,0 @@ -""" -Tests the warnings.deprecated function when a deprecated symbol is used in the same module. -""" - -# Specification: https://typing.readthedocs.io/en/latest/spec/directives.html#deprecated -# See also https://peps.python.org/pep-0702/ - -# > Type checkers should produce a diagnostic whenever they encounter a usage of an object -# > marked as deprecated. [...] For deprecated classes and functions, this includes: -# > -# > * Any usage of deprecated objects in their defining module - -from typing_extensions import deprecated - - -@deprecated("Deprecated") -def lorem() -> None: ... - - -ipsum = lorem() # E: Use of deprecated function lorem From 903bbd05b7913aa694cd163b8d5b8e74252deef3 Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 17:45:56 +0000 Subject: [PATCH 04/12] Avoid irrelevant errors --- conformance/tests/_directives_deprecated_pep702_example.py | 4 ++-- conformance/tests/directives_deprecated.py | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/conformance/tests/_directives_deprecated_pep702_example.py b/conformance/tests/_directives_deprecated_pep702_example.py index 7e2db077..f9abd9e7 100644 --- a/conformance/tests/_directives_deprecated_pep702_example.py +++ b/conformance/tests/_directives_deprecated_pep702_example.py @@ -2,7 +2,7 @@ Support module for directive_deprecated_pep702_example. """ -from typing import overload +from typing import Self, overload from typing_extensions import deprecated @@ -30,7 +30,7 @@ def foo(x: int | str) -> str: ... class Spam: @deprecated("There is enough spam in the world") - def __add__(self, other: object) -> object: ... + def __add__(self, other: object) -> Self: ... @property @deprecated("All spam will be equally greasy") diff --git a/conformance/tests/directives_deprecated.py b/conformance/tests/directives_deprecated.py index 35bed2c2..e5c24125 100644 --- a/conformance/tests/directives_deprecated.py +++ b/conformance/tests/directives_deprecated.py @@ -35,15 +35,15 @@ spam = library.Spam() +_ = spam + 1 # E: Use of deprecated method Spam.__add__ +spam += 1 # E: Use of deprecated method Spam.__add__ + spam.greasy # E: Use of deprecated property Spam.greasy spam.shape # no error spam.shape = "cube" # E: Use of deprecated property setter Spam.shape spam.shape += "cube" # E: Use of deprecated property setter Spam.shape -spam + 1 # E: Use of deprecated method Spam.__add__ -spam += 1 # E: Use of deprecated method Spam.__add__ - # > * Any usage of deprecated objects in their defining module @@ -88,7 +88,6 @@ def foo_it(fooable: Fooable) -> None: # https://github.com/python/typing/pull/1822#discussion_r1693991644 - class Fooable2(Protocol): def foo(self) -> None: ... From 168caf27926700a28593e7353eb9621f458525a3 Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 17:59:02 +0000 Subject: [PATCH 05/12] Also rename "library" file --- ..._pep702_example.py => _directives_deprecated_library.py} | 0 conformance/tests/directives_deprecated.py | 6 ++++-- 2 files changed, 4 insertions(+), 2 deletions(-) rename conformance/tests/{_directives_deprecated_pep702_example.py => _directives_deprecated_library.py} (100%) diff --git a/conformance/tests/_directives_deprecated_pep702_example.py b/conformance/tests/_directives_deprecated_library.py similarity index 100% rename from conformance/tests/_directives_deprecated_pep702_example.py rename to conformance/tests/_directives_deprecated_library.py diff --git a/conformance/tests/directives_deprecated.py b/conformance/tests/directives_deprecated.py index e5c24125..bd46f6d6 100644 --- a/conformance/tests/directives_deprecated.py +++ b/conformance/tests/directives_deprecated.py @@ -2,6 +2,8 @@ Tests the warnings.deprecated function. """ +# pyright: reportDeprecated=true + # Specification: https://typing.readthedocs.io/en/latest/spec/directives.html#deprecated # See also https://peps.python.org/pep-0702/ @@ -10,8 +12,8 @@ # > * `from` imports -from _directives_deprecated_pep702_example import Ham # E: Use of deprecated class Ham -import _directives_deprecated_pep702_example as library +from _directives_deprecated_library import Ham # E: Use of deprecated class Ham +import _directives_deprecated_library as library from typing_extensions import deprecated From c3347604761802dcb4ec57760bfea9bb28f321ee Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 18:07:06 +0000 Subject: [PATCH 06/12] Add manual test results --- .../results/mypy/directives_deprecated.toml | 20 ++++ conformance/results/mypy/version.toml | 2 +- .../results/pyre/aliases_explicit.toml | 38 +++---- .../results/pyre/aliases_implicit.toml | 38 +++---- conformance/results/pyre/aliases_newtype.toml | 14 +-- .../results/pyre/aliases_recursive.toml | 25 +---- .../results/pyre/aliases_type_statement.toml | 2 - .../results/pyre/aliases_typealiastype.toml | 15 +-- .../results/pyre/aliases_variance.toml | 10 +- .../pyre/annotations_forward_refs.toml | 34 +++---- .../results/pyre/annotations_generators.toml | 24 ++--- .../results/pyre/annotations_methods.toml | 1 - .../results/pyre/annotations_typeexpr.toml | 32 +++--- .../results/pyre/callables_annotation.toml | 52 +++------- .../results/pyre/callables_kwargs.toml | 18 +--- .../results/pyre/callables_protocol.toml | 32 +++--- .../results/pyre/callables_subtyping.toml | 79 ++++++--------- .../results/pyre/classes_classvar.toml | 18 ++-- .../results/pyre/classes_override.toml | 15 +-- .../results/pyre/constructors_call_init.toml | 14 +-- .../results/pyre/constructors_call_new.toml | 20 +--- .../results/pyre/constructors_call_type.toml | 18 ++-- .../results/pyre/constructors_callable.toml | 61 ++---------- .../results/pyre/dataclasses_descriptors.toml | 12 +-- .../results/pyre/dataclasses_final.toml | 12 +-- .../results/pyre/dataclasses_frozen.toml | 10 +- .../results/pyre/dataclasses_kwonly.toml | 8 +- .../results/pyre/dataclasses_order.toml | 4 +- .../results/pyre/dataclasses_postinit.toml | 18 +--- .../results/pyre/dataclasses_slots.toml | 2 +- .../pyre/dataclasses_transform_class.toml | 18 ++-- .../pyre/dataclasses_transform_converter.toml | 46 ++------- .../pyre/dataclasses_transform_field.toml | 10 +- .../pyre/dataclasses_transform_func.toml | 36 +------ .../pyre/dataclasses_transform_meta.toml | 16 ++- .../results/pyre/dataclasses_usage.toml | 28 ++---- .../results/pyre/directives_assert_type.toml | 14 +-- conformance/results/pyre/directives_cast.toml | 8 +- .../results/pyre/directives_deprecated.toml | 20 ++++ .../pyre/directives_no_type_check.toml | 9 +- .../results/pyre/directives_reveal_type.toml | 15 +-- .../pyre/directives_type_ignore_file1.toml | 4 +- .../pyre/directives_type_ignore_file2.toml | 4 +- .../pyre/directives_version_platform.toml | 8 +- .../results/pyre/enums_definition.toml | 11 +-- conformance/results/pyre/enums_expansion.toml | 6 +- .../results/pyre/enums_member_names.toml | 4 - .../results/pyre/enums_member_values.toml | 9 -- conformance/results/pyre/enums_members.toml | 22 +---- .../pyre/exceptions_context_managers.toml | 6 +- .../results/pyre/generics_base_class.toml | 8 +- conformance/results/pyre/generics_basic.toml | 15 ++- .../results/pyre/generics_defaults.toml | 98 +------------------ .../pyre/generics_defaults_referential.toml | 52 +--------- .../generics_defaults_specialization.toml | 34 +------ .../pyre/generics_paramspec_basic.toml | 13 +-- .../pyre/generics_paramspec_components.toml | 14 ++- .../pyre/generics_paramspec_semantics.toml | 21 ++-- .../generics_paramspec_specialization.toml | 18 +--- .../results/pyre/generics_scoping.toml | 24 ++--- .../results/pyre/generics_self_advanced.toml | 16 +-- .../pyre/generics_self_attributes.toml | 8 +- .../results/pyre/generics_self_basic.toml | 11 +-- .../results/pyre/generics_self_protocols.toml | 2 +- .../results/pyre/generics_self_usage.toml | 7 +- .../pyre/generics_syntax_compatibility.toml | 2 +- .../pyre/generics_syntax_declarations.toml | 2 - .../pyre/generics_syntax_infer_variance.toml | 2 - .../results/pyre/generics_syntax_scoping.toml | 2 +- .../results/pyre/generics_type_erasure.toml | 14 +-- .../pyre/generics_typevartuple_args.toml | 16 +-- .../pyre/generics_typevartuple_basic.toml | 67 ++----------- .../pyre/generics_typevartuple_callable.toml | 20 +--- .../pyre/generics_typevartuple_concat.toml | 32 +----- .../pyre/generics_typevartuple_overloads.toml | 13 +-- .../generics_typevartuple_specialization.toml | 71 +------------- .../pyre/generics_typevartuple_unpack.toml | 17 ---- .../results/pyre/generics_upper_bound.toml | 5 +- .../results/pyre/generics_variance.toml | 12 +-- .../pyre/generics_variance_inference.toml | 2 - .../results/pyre/historical_positional.toml | 8 +- .../results/pyre/literals_interactions.toml | 6 -- .../results/pyre/literals_literalstring.toml | 21 ++-- .../pyre/literals_parameterizations.toml | 38 +++---- .../results/pyre/literals_semantics.toml | 10 +- .../pyre/namedtuples_define_class.toml | 36 ++----- .../pyre/namedtuples_define_functional.toml | 35 ++----- .../results/pyre/namedtuples_type_compat.toml | 10 +- .../results/pyre/namedtuples_usage.toml | 22 +---- .../results/pyre/narrowing_typeguard.toml | 6 +- .../results/pyre/narrowing_typeis.toml | 24 ----- conformance/results/pyre/overloads_basic.toml | 4 +- .../results/pyre/protocols_class_objects.toml | 4 +- .../results/pyre/protocols_definition.toml | 26 ++--- .../results/pyre/protocols_explicit.toml | 4 +- .../results/pyre/protocols_generic.toml | 12 +-- .../results/pyre/protocols_merging.toml | 10 +- .../results/pyre/protocols_subtyping.toml | 16 +-- .../results/pyre/protocols_variance.toml | 2 - .../results/pyre/qualifiers_annotated.toml | 40 ++++---- .../pyre/qualifiers_final_annotation.toml | 44 ++++----- .../pyre/qualifiers_final_decorator.toml | 19 ++-- .../results/pyre/specialtypes_any.toml | 8 +- .../results/pyre/specialtypes_never.toml | 16 +-- .../results/pyre/specialtypes_none.toml | 8 +- .../results/pyre/specialtypes_type.toml | 12 +-- .../results/pyre/tuples_type_compat.toml | 91 +++-------------- .../results/pyre/tuples_type_form.toml | 24 ++--- conformance/results/pyre/tuples_unpacked.toml | 30 +----- .../results/pyre/typeddicts_alt_syntax.toml | 5 +- .../results/pyre/typeddicts_class_syntax.toml | 2 - .../results/pyre/typeddicts_final.toml | 4 +- .../results/pyre/typeddicts_inheritance.toml | 4 +- .../results/pyre/typeddicts_operations.toml | 21 ++-- .../results/pyre/typeddicts_readonly.toml | 2 - .../pyre/typeddicts_readonly_consistency.toml | 22 ++--- .../pyre/typeddicts_readonly_inheritance.toml | 20 +--- .../pyre/typeddicts_readonly_kwargs.toml | 4 - .../pyre/typeddicts_readonly_update.toml | 4 - .../results/pyre/typeddicts_required.toml | 6 -- .../pyre/typeddicts_type_consistency.toml | 20 ++-- .../results/pyre/typeddicts_usage.toml | 6 +- conformance/results/pyre/version.toml | 2 +- .../pyright/directives_deprecated.toml | 32 ++++++ conformance/results/pyright/version.toml | 2 +- .../results/pytype/directives_deprecated.toml | 26 +++++ conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 14 ++- 128 files changed, 673 insertions(+), 1671 deletions(-) create mode 100644 conformance/results/mypy/directives_deprecated.toml create mode 100644 conformance/results/pyre/directives_deprecated.toml create mode 100644 conformance/results/pyright/directives_deprecated.toml create mode 100644 conformance/results/pytype/directives_deprecated.toml diff --git a/conformance/results/mypy/directives_deprecated.toml b/conformance/results/mypy/directives_deprecated.toml new file mode 100644 index 00000000..1cd9d997 --- /dev/null +++ b/conformance/results/mypy/directives_deprecated.toml @@ -0,0 +1,20 @@ +conformant = "Unsupported" +notes = """ +Does not support @deprecated +""" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 29: Expected 1 errors +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 43: Expected 1 errors +Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 57: Expected 1 errors +Line 87: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 8f919ed4..dcb5ffc5 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.11.0" -test_duration = 1.0 +test_duration = 2.9 diff --git a/conformance/results/pyre/aliases_explicit.toml b/conformance/results/pyre/aliases_explicit.toml index 473b04ee..e96d1f0f 100644 --- a/conformance/results/pyre/aliases_explicit.toml +++ b/conformance/results/pyre/aliases_explicit.toml @@ -9,26 +9,6 @@ Incorrectly rejects import alias of `TypeAlias` when used to define type alias. Does not report invalid specialization of already-specialized generic type alias. """ output = """ -aliases_explicit.py:23:0 Incompatible variable type [9]: GoodTypeAlias9 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. -aliases_explicit.py:23: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[object, TypeVar]`. -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]`. -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: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]]`. -aliases_explicit.py:83:0 Incompatible variable type [9]: BadTypeAlias5 is declared to have type `TA` but is used as type `Dict[str, str]`. -aliases_explicit.py:84:0 Incompatible variable type [9]: BadTypeAlias6 is declared to have type `TA` but is used as type `Type[int]`. -aliases_explicit.py:85:0 Incompatible variable type [9]: BadTypeAlias7 is declared to have type `TA` but is used as type `Type[int]`. -aliases_explicit.py:86:0 Incompatible variable type [9]: BadTypeAlias8 is declared to have type `TA` but is used as type `Type[Union[int, str]]`. -aliases_explicit.py:87:0 Incompatible variable type [9]: BadTypeAlias9 is declared to have type `TA` but is used as type `int`. -aliases_explicit.py:88:0 Incompatible variable type [9]: BadTypeAlias10 is declared to have type `TA` but is used as type `bool`. -aliases_explicit.py:89:0 Incompatible variable type [9]: BadTypeAlias11 is declared to have type `TA` but is used as type `int`. -aliases_explicit.py:90:0 Incompatible variable type [9]: BadTypeAlias12 is declared to have type `TA` but is used as type `Type[Union[list, set]]`. -aliases_explicit.py:91:0 Incompatible variable type [9]: BadTypeAlias13 is declared to have type `TA` but is used as type `str`. -aliases_explicit.py:97:16 Call error [29]: `TA` is not a function. -aliases_explicit.py:101:5 Call error [29]: `TA` is not a function. """ conformance_automated = "Fail" errors_diff = """ @@ -38,11 +18,19 @@ Line 69: Expected 1 errors Line 70: Expected 1 errors Line 71: Expected 1 errors Line 79: Expected 1 errors +Line 80: Expected 1 errors +Line 81: Expected 1 errors +Line 82: Expected 1 errors +Line 83: Expected 1 errors +Line 84: Expected 1 errors +Line 85: Expected 1 errors +Line 86: Expected 1 errors +Line 87: Expected 1 errors +Line 88: Expected 1 errors +Line 89: Expected 1 errors +Line 90: Expected 1 errors +Line 91: Expected 1 errors Line 100: Expected 1 errors +Line 101: Expected 1 errors Line 102: Expected 1 errors -Line 23: Unexpected errors ['aliases_explicit.py:23:0 Incompatible variable type [9]: GoodTypeAlias9 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'aliases_explicit.py:23: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[object, TypeVar]`.'] -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 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 1d00603e..88e7565d 100644 --- a/conformance/results/pyre/aliases_implicit.toml +++ b/conformance/results/pyre/aliases_implicit.toml @@ -8,25 +8,6 @@ Does not report error for attempt to instantiate union type alias. Does not report invalid specialization of already-specialized generic type alias. """ output = """ -aliases_implicit.py:38:26 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[object, TypeVar]`. -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: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. -aliases_implicit.py:109:8 Undefined or invalid type [11]: Annotation `BadTypeAlias4` is not defined as a type. -aliases_implicit.py:110:8 Undefined or invalid type [11]: Annotation `BadTypeAlias5` is not defined as a type. -aliases_implicit.py:111:8 Undefined or invalid type [11]: Annotation `BadTypeAlias6` is not defined as a type. -aliases_implicit.py:112:8 Undefined or invalid type [11]: Annotation `BadTypeAlias7` is not defined as a type. -aliases_implicit.py:113:8 Undefined or invalid type [11]: Annotation `BadTypeAlias8` is not defined as a type. -aliases_implicit.py:114:8 Undefined or invalid type [11]: Annotation `BadTypeAlias9` is not defined as a type. -aliases_implicit.py:115:9 Undefined or invalid type [11]: Annotation `BadTypeAlias10` is not defined as a type. -aliases_implicit.py:116:9 Undefined or invalid type [11]: Annotation `BadTypeAlias11` is not defined as a type. -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 = """ @@ -36,11 +17,20 @@ Line 78: Expected 1 errors Line 79: Expected 1 errors Line 80: Expected 1 errors Line 81: Expected 1 errors +Line 106: Expected 1 errors +Line 107: Expected 1 errors +Line 108: Expected 1 errors +Line 109: Expected 1 errors +Line 110: Expected 1 errors +Line 111: Expected 1 errors +Line 112: Expected 1 errors +Line 113: Expected 1 errors +Line 114: Expected 1 errors +Line 115: Expected 1 errors +Line 116: Expected 1 errors +Line 117: Expected 1 errors +Line 118: Expected 1 errors +Line 119: Expected 1 errors Line 133: Expected 1 errors Line 135: Expected 1 errors -Line 38: Unexpected errors ['aliases_implicit.py:38:26 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[object, TypeVar]`.'] -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 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_newtype.toml b/conformance/results/pyre/aliases_newtype.toml index e9de5014..d4ba459e 100644 --- a/conformance/results/pyre/aliases_newtype.toml +++ b/conformance/results/pyre/aliases_newtype.toml @@ -9,20 +9,20 @@ Does not reject use of NewType with TypedDict class. Does not reject use of NewType with Any. """ output = """ -aliases_newtype.py:11:7 Incompatible parameter type [6]: In call `UserId.__init__`, for 1st positional argument, expected `int` but got `str`. -aliases_newtype.py:12:0 Incompatible variable type [9]: u1 is declared to have type `UserId` but is used as type `int`. -aliases_newtype.py:38:5 Invalid type parameters [24]: Non-generic type `GoodNewType1` cannot take parameters. -aliases_newtype.py:44:37 Invalid inheritance [39]: `typing.Union[int, str]` is not a valid parent class. -aliases_newtype.py:51:37 Invalid inheritance [39]: `typing_extensions.Literal[7]` is not a valid parent class. -aliases_newtype.py:60:14 Too many arguments [19]: Call `NewType.__init__` expects 2 positional arguments, 3 were provided. -aliases_newtype.py:62:37 Invalid inheritance [39]: `typing.Any` is not a valid parent class. """ conformance_automated = "Fail" errors_diff = """ +Line 11: Expected 1 errors +Line 12: Expected 1 errors Line 20: Expected 1 errors Line 23: Expected 1 errors Line 32: Expected 1 errors +Line 38: Expected 1 errors +Line 44: Expected 1 errors Line 47: Expected 1 errors Line 49: Expected 1 errors +Line 51: Expected 1 errors Line 58: Expected 1 errors +Line 60: Expected 1 errors +Line 62: Expected 1 errors """ diff --git a/conformance/results/pyre/aliases_recursive.toml b/conformance/results/pyre/aliases_recursive.toml index a87f4cf4..4c448b22 100644 --- a/conformance/results/pyre/aliases_recursive.toml +++ b/conformance/results/pyre/aliases_recursive.toml @@ -4,22 +4,11 @@ Does not properly handle some recursive type aliases. 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: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: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: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]`. -aliases_recursive.py:75:62 Incompatible variable type [9]: MutualReference2 is declared to have type `TypeAlias` but is used as type `Type[typing.Any]`. """ conformance_automated = "Fail" errors_diff = """ +Line 19: Expected 1 errors +Line 20: Expected 1 errors Line 38: Expected 1 errors Line 39: Expected 1 errors Line 50: Expected 1 errors @@ -27,12 +16,6 @@ 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: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: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 67: Unexpected errors ['aliases_recursive.py:67:4 Undefined or invalid type [11]: Annotation `GenericTypeAlias2` is not defined as a type.'] +Line 72: Expected 1 errors +Line 75: Expected 1 errors """ diff --git a/conformance/results/pyre/aliases_type_statement.toml b/conformance/results/pyre/aliases_type_statement.toml index 02d923e1..0858da06 100644 --- a/conformance/results/pyre/aliases_type_statement.toml +++ b/conformance/results/pyre/aliases_type_statement.toml @@ -3,7 +3,6 @@ notes = """ Does not support `type` statement. """ output = """ -aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -34,5 +33,4 @@ Line 81: Expected 1 errors Line 84: Expected 1 errors Line 86: Expected 1 errors Line 90: Expected 1 errors -Line 8: Unexpected errors ['aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/aliases_typealiastype.toml b/conformance/results/pyre/aliases_typealiastype.toml index 152a87de..46513dbd 100644 --- a/conformance/results/pyre/aliases_typealiastype.toml +++ b/conformance/results/pyre/aliases_typealiastype.toml @@ -3,17 +3,10 @@ notes = """ Support for TypeAliasType is not implemented. """ output = """ -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: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 `GoodAlias5` is not defined as a type. -aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ +Line 32: Expected 1 errors Line 40: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors @@ -34,10 +27,4 @@ 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 39: Unexpected errors ['aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/aliases_variance.toml b/conformance/results/pyre/aliases_variance.toml index 76fec94c..d0243da4 100644 --- a/conformance/results/pyre/aliases_variance.toml +++ b/conformance/results/pyre/aliases_variance.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ -aliases_variance.py:24:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. -aliases_variance.py:28:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. -aliases_variance.py:32:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. -aliases_variance.py:44:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 24: Expected 1 errors +Line 28: Expected 1 errors +Line 32: Expected 1 errors +Line 44: Expected 1 errors """ diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 1e4ecf73..c82dcc33 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -8,23 +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: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. -annotations_forward_refs.py:44:8 Undefined or invalid type [11]: Annotation `comprehension(int for generators(generator($target$i in range(1) if )))` is not defined as a type. -annotations_forward_refs.py:45:8 Invalid type [31]: Expression `"{ }"` is not a valid type. -annotations_forward_refs.py:46:8 Undefined or invalid type [11]: Annotation `lambda () (int)()` is not defined as a type. -annotations_forward_refs.py:47:8 Invalid type [31]: Expression `[int][0]` is not a valid type. -annotations_forward_refs.py:48:8 Invalid type [31]: Expression `"int if 1 < 3 else str"` is not a valid type. -annotations_forward_refs.py:49:8 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. -annotations_forward_refs.py:50:9 Invalid type [31]: Expression `"True"` is not a valid type. -annotations_forward_refs.py:51:9 Invalid type [31]: Expression `"1"` is not a valid type. -annotations_forward_refs.py:52:9 Invalid type [31]: Expression `"-1"` is not a valid type. -annotations_forward_refs.py:53:9 Invalid type [31]: Expression `"int or str"` is not a valid type. -annotations_forward_refs.py:55:9 Undefined or invalid type [11]: Annotation `types` is not defined as a type. -annotations_forward_refs.py:80:12 Undefined or invalid type [11]: Annotation `ClassF` is not defined as a type. -annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type. -annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation ` """ conformance_automated = "Fail" errors_diff = """ @@ -32,9 +15,22 @@ Line 22: Expected 1 errors Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 44: Expected 1 errors +Line 45: Expected 1 errors +Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Line 49: Expected 1 errors +Line 50: Expected 1 errors +Line 51: Expected 1 errors +Line 52: Expected 1 errors +Line 53: Expected 1 errors Line 54: Expected 1 errors +Line 55: Expected 1 errors Line 66: Expected 1 errors +Line 80: Expected 1 errors Line 89: Expected 1 errors -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 103: Unexpected errors ['annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation `'] """ diff --git a/conformance/results/pyre/annotations_generators.toml b/conformance/results/pyre/annotations_generators.toml index 4f05a084..1fbec79d 100644 --- a/conformance/results/pyre/annotations_generators.toml +++ b/conformance/results/pyre/annotations_generators.toml @@ -4,23 +4,19 @@ Does not report invalid return type for generator when function implicitly retur Incorrectly evaluates type of call to async generator. """ output = """ -annotations_generators.py:54:8 Incompatible return type [7]: Expected `Generator[A, B, C]` but got `Generator[typing.Any, typing.Any, bool]`. -annotations_generators.py:57:8 Incompatible return type [7]: Expected `Generator[A, B, C]` but got `Generator[int, typing.Any, typing.Any]`. -annotations_generators.py:66:8 Incompatible return type [7]: Expected `Generator[A, int, typing.Any]` but got `Generator[int, typing.Any, typing.Any]`. -annotations_generators.py:75:4 Incompatible return type [7]: Expected `Iterator[A]` but got `Generator[B, typing.Any, typing.Any]`. -annotations_generators.py:87:4 Incompatible return type [7]: Expected `int` but got `Generator[None, typing.Any, typing.Any]`. -annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`. -annotations_generators.py:91:0 Incompatible async generator return type [57]: Expected return annotation to be AsyncGenerator or a superclass but got `int`. -annotations_generators.py:92:4 Incompatible return type [7]: Expected `int` but got `AsyncGenerator[None, typing.Any]`. -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: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 54: Expected 1 errors +Line 57: Expected 1 errors +Line 66: Expected 1 errors +Line 75: 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 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]]`.'] +Line 87: Expected 1 errors +Line 91: Expected 1 errors +Line 92: Expected 1 errors +Line 118: Expected 1 errors +Line 119: Expected 1 errors +Line 135: Expected 1 errors """ diff --git a/conformance/results/pyre/annotations_methods.toml b/conformance/results/pyre/annotations_methods.toml index c6be1388..4d458161 100644 --- a/conformance/results/pyre/annotations_methods.toml +++ b/conformance/results/pyre/annotations_methods.toml @@ -3,7 +3,6 @@ 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 457e5a3d..1298ee2e 100644 --- a/conformance/results/pyre/annotations_typeexpr.toml +++ b/conformance/results/pyre/annotations_typeexpr.toml @@ -1,21 +1,21 @@ conformant = "Pass" output = """ -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. -annotations_typeexpr.py:91:8 Invalid type [31]: Expression `comprehension(int for generators(generator(i in range(1) if )))` is not a valid type. -annotations_typeexpr.py:92:8 Invalid type [31]: Expression `{ }` is not a valid type. -annotations_typeexpr.py:93:8 Invalid type [31]: Expression `lambda () (int)()` is not a valid type. -annotations_typeexpr.py:94:8 Invalid type [31]: Expression `[int][0]` is not a valid type. -annotations_typeexpr.py:95:8 Invalid type [31]: Expression `int if 1 < 3 else str` is not a valid type. -annotations_typeexpr.py:96:8 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. -annotations_typeexpr.py:97:9 Invalid type [31]: Expression `True` is not a valid type. -annotations_typeexpr.py:98:9 Invalid type [31]: Expression `1` is not a valid type. -annotations_typeexpr.py:99:9 Invalid type [31]: Expression `-1` is not a valid type. -annotations_typeexpr.py:100:9 Invalid type [31]: Expression `int or str` is not a valid type. -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 = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 88: Expected 1 errors +Line 89: Expected 1 errors +Line 90: Expected 1 errors +Line 91: Expected 1 errors +Line 92: Expected 1 errors +Line 93: Expected 1 errors +Line 94: Expected 1 errors +Line 95: Expected 1 errors +Line 96: Expected 1 errors +Line 97: Expected 1 errors +Line 98: Expected 1 errors +Line 99: Expected 1 errors +Line 100: Expected 1 errors +Line 101: Expected 1 errors +Line 102: Expected 1 errors """ diff --git a/conformance/results/pyre/callables_annotation.toml b/conformance/results/pyre/callables_annotation.toml index 384310ba..d7e33bdd 100644 --- a/conformance/results/pyre/callables_annotation.toml +++ b/conformance/results/pyre/callables_annotation.toml @@ -5,47 +5,23 @@ Does not correctly implement type compatibility rules for "...". Does not treat "*args: Any, **kwargs: Any" as "...". """ output = """ -callables_annotation.py:25:4 Missing argument [20]: PositionalOnly call expects argument in position 1. -callables_annotation.py:26:10 Incompatible parameter type [6]: In anonymous call, for 2nd positional argument, expected `str` but got `int`. -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: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 Invalid type [31]: Expression `typing.Callable[([...], int)]` is not a valid 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]]`. -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]]`. -callables_annotation.py:171:8 Undefined or invalid type [11]: Annotation `Callback1` is not defined as a type. -callables_annotation.py:172:8 Undefined or invalid type [11]: Annotation `Callback2` is not defined as a type. -callables_annotation.py:181:0 Incompatible variable type [9]: CallbackWithInt is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. -callables_annotation.py:182:0 Incompatible variable type [9]: CallbackWithStr is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. -callables_annotation.py:186:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type. -callables_annotation.py:187:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(str, ...)], str)]` is not a valid type. -callables_annotation.py:188:8 Undefined or invalid type [11]: Annotation `CallbackWithInt` is not defined as a type. -callables_annotation.py:189:8 Undefined or invalid type [11]: Annotation `CallbackWithStr` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ +Line 25: Expected 1 errors +Line 26: Expected 1 errors +Line 27: Expected 1 errors +Line 29: Expected 1 errors +Line 35: 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 91: Expected 1 errors Line 93: Expected 1 errors -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]]`.'] -Line 171: Unexpected errors ['callables_annotation.py:171:8 Undefined or invalid type [11]: Annotation `Callback1` is not defined as a type.'] -Line 181: Unexpected errors ['callables_annotation.py:181:0 Incompatible variable type [9]: CallbackWithInt is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] -Line 182: Unexpected errors ['callables_annotation.py:182:0 Incompatible variable type [9]: CallbackWithStr is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] -Line 186: Unexpected errors ['callables_annotation.py:186:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type.'] -Line 188: Unexpected errors ['callables_annotation.py:188:8 Undefined or invalid type [11]: Annotation `CallbackWithInt` is not defined as a type.'] +Line 159: Expected 1 errors +Line 172: Expected 1 errors +Line 187: Expected 1 errors +Line 189: Expected 1 errors """ diff --git a/conformance/results/pyre/callables_kwargs.toml b/conformance/results/pyre/callables_kwargs.toml index 596abc4d..e0cbf231 100644 --- a/conformance/results/pyre/callables_kwargs.toml +++ b/conformance/results/pyre/callables_kwargs.toml @@ -3,29 +3,19 @@ notes = """ 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`. -callables_kwargs.py:65:18 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `str` but got `object`. -callables_kwargs.py:122:20 Invalid type variable [34]: The type variable `Variable[T (bound to callables_kwargs.TD2)]` isn't present in the function's parameters. """ conformance_automated = "Fail" errors_diff = """ Line 46: Expected 1 errors Line 51: Expected 1 errors +Line 52: Expected 1 errors Line 58: Expected 1 errors Line 63: Expected 1 errors +Line 64: Expected 1 errors +Line 65: Expected 1 errors Line 101: Expected 1 errors 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`.'] +Line 122: Expected 1 errors """ diff --git a/conformance/results/pyre/callables_protocol.toml b/conformance/results/pyre/callables_protocol.toml index c4630b5e..2034abcc 100644 --- a/conformance/results/pyre/callables_protocol.toml +++ b/conformance/results/pyre/callables_protocol.toml @@ -7,28 +7,24 @@ Does not report type incompatibility for callback missing a default argument for Does not report type incompatibility for callback missing a default argument for keyword parameter. """ output = """ -callables_protocol.py:35:0 Incompatible variable type [9]: cb1 is declared to have type `Proto1` but is used as type `typing.Callable(cb1_bad1)[[Variable(bytes), KeywordOnly(max_items, Optional[int])], List[bytes]]`. -callables_protocol.py:36:0 Incompatible variable type [9]: cb1 is declared to have type `Proto1` but is used as type `typing.Callable(cb1_bad2)[[Variable(bytes)], List[bytes]]`. -callables_protocol.py:37:0 Incompatible variable type [9]: cb1 is declared to have type `Proto1` but is used as type `typing.Callable(cb1_bad3)[[Variable(bytes), KeywordOnly(max_len, Optional[str])], List[bytes]]`. -callables_protocol.py:67:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad1)[[Variable(bytes)], typing.Any]`. -callables_protocol.py:68:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad2)[[Variable(str), Keywords(str)], typing.Any]`. -callables_protocol.py:69:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad3)[[Variable(bytes), Keywords(bytes)], typing.Any]`. -callables_protocol.py:70:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad4)[[Keywords(str)], typing.Any]`. -callables_protocol.py:97:0 Incompatible variable type [9]: var4 is declared to have type `Proto4` but is used as type `typing.Callable(cb4_bad1)[[Named(x, int)], None]`. -callables_protocol.py:121:0 Incompatible variable type [9]: cb6 is declared to have type `NotProto6` but is used as type `typing.Callable(cb6_bad1)[[Variable(bytes), KeywordOnly(max_len, Optional[int], default)], List[bytes]]`. -callables_protocol.py:169:0 Incompatible variable type [9]: cb8 is declared to have type `Proto8` but is used as type `typing.Callable(cb8_bad1)[[Named(x, int)], typing.Any]`. -callables_protocol.py:186:4 Incompatible attribute type [8]: Attribute `other_attribute` declared in class `Proto9` has type `int` but is used as type `str`. -callables_protocol.py:187:4 Undefined attribute [16]: `Proto9` has no attribute `xxx`. -callables_protocol.py:197:6 Undefined attribute [16]: `Proto9` has no attribute `other_attribute2`. -callables_protocol.py:216:0 Incompatible variable type [9]: cb10 is declared to have type `Proto10` but is used as type `typing.Callable(cb10_good)[[], None]`. -callables_protocol.py:259:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_good2)[[Variable(typing.Any), Keywords(typing.Any)], None]`. -callables_protocol.py:260:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_bad1)[[Variable(typing.Any), KeywordOnly(kwarg0, typing.Any)], None]`. """ conformance_automated = "Fail" errors_diff = """ +Line 35: Expected 1 errors +Line 36: Expected 1 errors +Line 37: Expected 1 errors +Line 67: Expected 1 errors +Line 68: Expected 1 errors +Line 69: Expected 1 errors +Line 70: Expected 1 errors +Line 97: Expected 1 errors +Line 121: Expected 1 errors +Line 169: Expected 1 errors +Line 186: Expected 1 errors +Line 187: Expected 1 errors +Line 197: Expected 1 errors Line 238: Expected 1 errors +Line 260: Expected 1 errors Line 284: Expected 1 errors Line 311: Expected 1 errors -Line 216: Unexpected errors ['callables_protocol.py:216:0 Incompatible variable type [9]: cb10 is declared to have type `Proto10` but is used as type `typing.Callable(cb10_good)[[], None]`.'] -Line 259: Unexpected errors ['callables_protocol.py:259:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_good2)[[Variable(typing.Any), Keywords(typing.Any)], None]`.'] """ diff --git a/conformance/results/pyre/callables_subtyping.toml b/conformance/results/pyre/callables_subtyping.toml index 4c686d89..5a07468e 100644 --- a/conformance/results/pyre/callables_subtyping.toml +++ b/conformance/results/pyre/callables_subtyping.toml @@ -4,56 +4,39 @@ Rejects standard parameter as incompatible with keyword-only parameter. Rejects use of Callable with ParamSpec in TypeAlias definition. """ errors_diff = """ +Line 26: Expected 1 errors +Line 29: Expected 1 errors +Line 51: Expected 1 errors +Line 52: Expected 1 errors +Line 55: Expected 1 errors +Line 58: Expected 1 errors +Line 82: Expected 1 errors +Line 85: Expected 1 errors +Line 86: Expected 1 errors +Line 116: Expected 1 errors +Line 119: Expected 1 errors +Line 120: Expected 1 errors +Line 122: Expected 1 errors +Line 124: Expected 1 errors +Line 125: Expected 1 errors +Line 126: Expected 1 errors +Line 151: Expected 1 errors +Line 154: Expected 1 errors +Line 155: Expected 1 errors +Line 187: Expected 1 errors +Line 190: Expected 1 errors +Line 191: Expected 1 errors +Line 193: Expected 1 errors +Line 195: Expected 1 errors +Line 196: Expected 1 errors +Line 197: Expected 1 errors Line 236: Expected 1 errors -Line 57: Unexpected errors ['callables_subtyping.py:57:4 Incompatible variable type [9]: f5 is declared to have type `KwOnly2` but is used as type `Standard2`.'] -Line 188: Unexpected errors ['callables_subtyping.py:188:4 Incompatible variable type [9]: f2 is declared to have type `KwOnly6` but is used as type `IntStrKwargs6`.'] -Line 189: Unexpected errors ['callables_subtyping.py:189:4 Incompatible variable type [9]: f3 is declared to have type `KwOnly6` but is used as type `StrKwargs6`.'] -Line 192: Unexpected errors ['callables_subtyping.py:192:4 Incompatible variable type [9]: f6 is declared to have type `StrKwargs6` but is used as type `IntStrKwargs6`.'] -Line 208: Unexpected errors ['callables_subtyping.py:208:0 Incompatible variable type [9]: TypeAliasWithP is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'callables_subtyping.py:208:37 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 211: Unexpected errors ['callables_subtyping.py:211:39 Undefined or invalid type [11]: Annotation `TypeAliasWithP` is not defined as a type.'] -Line 253: Unexpected errors ['callables_subtyping.py:253:4 Missing overload implementation [42]: Overloaded function `Overloaded9.__call__` must have an implementation.'] -Line 282: Unexpected errors ['callables_subtyping.py:282:4 Missing overload implementation [42]: Overloaded function `Overloaded10.__call__` must have an implementation.'] +Line 237: Expected 1 errors +Line 240: Expected 1 errors +Line 243: Expected 1 errors +Line 273: Expected 1 errors +Line 297: Expected 1 errors """ output = """ -callables_subtyping.py:26:4 Incompatible variable type [9]: f6 is declared to have type `typing.Callable[[float], float]` but is used as type `typing.Callable[[int], int]`. -callables_subtyping.py:29:4 Incompatible variable type [9]: f8 is declared to have type `typing.Callable[[int], int]` but is used as type `typing.Callable[[float], float]`. -callables_subtyping.py:51:4 Incompatible variable type [9]: f1 is declared to have type `Standard2` but is used as type `PosOnly2`. -callables_subtyping.py:52:4 Incompatible variable type [9]: f2 is declared to have type `Standard2` but is used as type `KwOnly2`. -callables_subtyping.py:55:4 Incompatible variable type [9]: f4 is declared to have type `PosOnly2` but is used as type `KwOnly2`. -callables_subtyping.py:57:4 Incompatible variable type [9]: f5 is declared to have type `KwOnly2` but is used as type `Standard2`. -callables_subtyping.py:58:4 Incompatible variable type [9]: f6 is declared to have type `KwOnly2` but is used as type `PosOnly2`. -callables_subtyping.py:82:4 Incompatible variable type [9]: f3 is declared to have type `IntArgs3` but is used as type `NoArgs3`. -callables_subtyping.py:85:4 Incompatible variable type [9]: f5 is declared to have type `FloatArgs3` but is used as type `NoArgs3`. -callables_subtyping.py:86:4 Incompatible variable type [9]: f6 is declared to have type `FloatArgs3` but is used as type `IntArgs3`. -callables_subtyping.py:116:4 Incompatible variable type [9]: f1 is declared to have type `PosOnly4` but is used as type `IntArgs4`. -callables_subtyping.py:119:4 Incompatible variable type [9]: f4 is declared to have type `IntStrArgs4` but is used as type `StrArgs4`. -callables_subtyping.py:120:4 Incompatible variable type [9]: f5 is declared to have type `IntStrArgs4` but is used as type `IntArgs4`. -callables_subtyping.py:122:4 Incompatible variable type [9]: f7 is declared to have type `StrArgs4` but is used as type `IntArgs4`. -callables_subtyping.py:124:4 Incompatible variable type [9]: f9 is declared to have type `IntArgs4` but is used as type `StrArgs4`. -callables_subtyping.py:125:4 Incompatible variable type [9]: f10 is declared to have type `Standard4` but is used as type `IntStrArgs4`. -callables_subtyping.py:126:4 Incompatible variable type [9]: f11 is declared to have type `Standard4` but is used as type `StrArgs4`. -callables_subtyping.py:151:4 Incompatible variable type [9]: f3 is declared to have type `IntKwargs5` but is used as type `NoKwargs5`. -callables_subtyping.py:154:4 Incompatible variable type [9]: f5 is declared to have type `FloatKwargs5` but is used as type `NoKwargs5`. -callables_subtyping.py:155:4 Incompatible variable type [9]: f6 is declared to have type `FloatKwargs5` but is used as type `IntKwargs5`. -callables_subtyping.py:187:4 Incompatible variable type [9]: f1 is declared to have type `KwOnly6` but is used as type `IntKwargs6`. -callables_subtyping.py:188:4 Incompatible variable type [9]: f2 is declared to have type `KwOnly6` but is used as type `IntStrKwargs6`. -callables_subtyping.py:189:4 Incompatible variable type [9]: f3 is declared to have type `KwOnly6` but is used as type `StrKwargs6`. -callables_subtyping.py:190:4 Incompatible variable type [9]: f4 is declared to have type `IntStrKwargs6` but is used as type `StrKwargs6`. -callables_subtyping.py:191:4 Incompatible variable type [9]: f5 is declared to have type `IntStrKwargs6` but is used as type `IntKwargs6`. -callables_subtyping.py:192:4 Incompatible variable type [9]: f6 is declared to have type `StrKwargs6` but is used as type `IntStrKwargs6`. -callables_subtyping.py:193:4 Incompatible variable type [9]: f7 is declared to have type `StrKwargs6` but is used as type `IntKwargs6`. -callables_subtyping.py:195:4 Incompatible variable type [9]: f9 is declared to have type `IntKwargs6` but is used as type `StrKwargs6`. -callables_subtyping.py:196:4 Incompatible variable type [9]: f10 is declared to have type `Standard6` but is used as type `IntStrKwargs6`. -callables_subtyping.py:197:4 Incompatible variable type [9]: f11 is declared to have type `Standard6` but is used as type `StrKwargs6`. -callables_subtyping.py:208:0 Incompatible variable type [9]: TypeAliasWithP is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. -callables_subtyping.py:208:37 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]`. -callables_subtyping.py:211:39 Undefined or invalid type [11]: Annotation `TypeAliasWithP` is not defined as a type. -callables_subtyping.py:237:4 Incompatible variable type [9]: f2 is declared to have type `DefaultArg8` but is used as type `NoX8`. -callables_subtyping.py:240:4 Incompatible variable type [9]: f4 is declared to have type `NoDefaultArg8` but is used as type `NoX8`. -callables_subtyping.py:243:4 Incompatible variable type [9]: f6 is declared to have type `NoX8` but is used as type `NoDefaultArg8`. -callables_subtyping.py:253:4 Missing overload implementation [42]: Overloaded function `Overloaded9.__call__` must have an implementation. -callables_subtyping.py:273:4 Incompatible variable type [9]: f3 is declared to have type `FloatArg9` but is used as type `Overloaded9`. -callables_subtyping.py:282:4 Missing overload implementation [42]: Overloaded function `Overloaded10.__call__` must have an implementation. -callables_subtyping.py:297:4 Incompatible variable type [9]: f2 is declared to have type `Overloaded10` but is used as type `StrArg10`. """ conformance_automated = "Fail" diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index 52902aed..a559ad76 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -11,28 +11,24 @@ Does not reject use of ClassVar in type alias definition. Does not infer type from initialization for bare ClassVar. """ output = """ -classes_classvar.py:38:10 Invalid type parameters [24]: Generic type `CV` expects 1 type parameter, received 2. -classes_classvar.py:39:10 Invalid type [31]: Expression `typing.ClassVar[3]` is not a valid type. -classes_classvar.py:40:13 Unbound name [10]: Name `var` is used but not defined in the current scope. -classes_classvar.py:52:4 Incompatible attribute type [8]: Attribute `bad8` declared in class `ClassA` has type `List[str]` but is used as type `Dict[Variable[_KT], Variable[_VT]]`. -classes_classvar.py:65:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. -classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. -classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`. -classes_classvar.py:105:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? -classes_classvar.py:134:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. """ conformance_automated = "Fail" errors_diff = """ +Line 38: Expected 1 errors +Line 39: Expected 1 errors +Line 40: Expected 1 errors Line 45: Expected 1 errors Line 46: Expected 1 errors Line 47: Expected 1 errors +Line 52: Expected 1 errors Line 54: Expected 1 errors Line 55: Expected 1 errors Line 63: Expected 1 errors Line 64: Expected 1 errors +Line 65: Expected 1 errors Line 67: Expected 1 errors Line 71: Expected 1 errors Line 72: Expected 1 errors -Line 68: Unexpected errors ['classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] -Line 78: Unexpected errors ['classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.'] +Line 105: Expected 1 errors +Line 134: Expected 1 errors """ diff --git a/conformance/results/pyre/classes_override.toml b/conformance/results/pyre/classes_override.toml index ac73d049..9a7a711e 100644 --- a/conformance/results/pyre/classes_override.toml +++ b/conformance/results/pyre/classes_override.toml @@ -3,17 +3,12 @@ notes = """ Does not allow Any as a base class, leading to false positives. """ output = """ -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: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: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: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: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: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 95: Unexpected errors ['classes_override.py:95:14 Invalid inheritance [39]: `typing.Any` is not a valid parent class.'] -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`.'] +Line 53: Expected 1 errors +Line 79: Expected 1 errors +Line 84: Expected 1 errors +Line 89: Expected 1 errors +Lines 56, 65: Expected error (tag 'method4') """ diff --git a/conformance/results/pyre/constructors_call_init.toml b/conformance/results/pyre/constructors_call_init.toml index 9358ef09..d881a6ff 100644 --- a/conformance/results/pyre/constructors_call_init.toml +++ b/conformance/results/pyre/constructors_call_init.toml @@ -6,21 +6,11 @@ Does not reject use of class-scoped type variables in annotation of self paramet """ conformance_automated = "Fail" errors_diff = """ +Line 21: Expected 1 errors 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]]`."] +Line 130: Expected 1 errors """ 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 3974f524..6b4b14dc 100644 --- a/conformance/results/pyre/constructors_call_new.toml +++ b/conformance/results/pyre/constructors_call_new.toml @@ -5,26 +5,8 @@ Does not report errors during binding to cls parameter of __new__ method. """ conformance_automated = "Fail" errors_diff = """ +Line 21: Expected 1 errors Line 145: Expected 1 errors -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_call_type.toml b/conformance/results/pyre/constructors_call_type.toml index b78a1daf..3a2f99ea 100644 --- a/conformance/results/pyre/constructors_call_type.toml +++ b/conformance/results/pyre/constructors_call_type.toml @@ -1,14 +1,14 @@ conformant = "Pass" errors_diff = """ +Line 30: Expected 1 errors +Line 40: Expected 1 errors +Line 50: Expected 1 errors +Line 59: Expected 1 errors +Line 64: Expected 1 errors +Line 72: Expected 1 errors +Line 81: Expected 1 errors +Line 82: Expected 1 errors """ output = """ -constructors_call_type.py:30:4 Missing argument [20]: Call `Meta1.__call__` expects argument `x`. -constructors_call_type.py:40:4 Missing argument [20]: Call `Class2.__new__` expects argument `x`. -constructors_call_type.py:50:4 Missing argument [20]: Call `Class3.__init__` expects argument `x`. -constructors_call_type.py:59:4 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -constructors_call_type.py:64:4 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -constructors_call_type.py:72:4 Missing argument [20]: Call `Meta1.__call__` expects argument `x`. -constructors_call_type.py:81:4 Missing argument [20]: Call `Class2.__new__` expects argument `y`. -constructors_call_type.py:82:11 Incompatible parameter type [6]: In call `Class2.__new__`, for 2nd positional argument, expected `str` but got `int`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" diff --git a/conformance/results/pyre/constructors_callable.toml b/conformance/results/pyre/constructors_callable.toml index 6ab0dffa..50483f3a 100644 --- a/conformance/results/pyre/constructors_callable.toml +++ b/conformance/results/pyre/constructors_callable.toml @@ -7,63 +7,18 @@ Does not use annotated type of self in __init__ method to generate return type o """ conformance_automated = "Fail" errors_diff = """ +Line 38: Expected 1 errors +Line 39: Expected 1 errors +Line 51: Expected 1 errors +Line 65: Expected 1 errors +Line 66: Expected 1 errors +Line 67: Expected 1 errors +Line 79: Expected 1 errors +Line 80: Expected 1 errors 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 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 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: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 0f99b597..8fb83ff8 100644 --- a/conformance/results/pyre/dataclasses_descriptors.toml +++ b/conformance/results/pyre/dataclasses_descriptors.toml @@ -3,17 +3,7 @@ notes = """ Incorrectly generates error when calling constructor of dataclass with descriptor. """ 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" +conformance_automated = "Pass" 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_final.toml b/conformance/results/pyre/dataclasses_final.toml index c579f132..2a6b20d0 100644 --- a/conformance/results/pyre/dataclasses_final.toml +++ b/conformance/results/pyre/dataclasses_final.toml @@ -1,11 +1,11 @@ conformant = "Pass" -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 27: Expected 1 errors +Line 35: Expected 1 errors +Line 36: Expected 1 errors +Line 37: Expected 1 errors +Line 38: Expected 1 errors """ output = """ -dataclasses_final.py:27:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_classvar`. -dataclasses_final.py:35:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_no_default`. -dataclasses_final.py:36:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_with_default`. -dataclasses_final.py:37:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_no_default`. -dataclasses_final.py:38:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_with_default`. """ diff --git a/conformance/results/pyre/dataclasses_frozen.toml b/conformance/results/pyre/dataclasses_frozen.toml index 410c163f..10323d7e 100644 --- a/conformance/results/pyre/dataclasses_frozen.toml +++ b/conformance/results/pyre/dataclasses_frozen.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ -dataclasses_frozen.py:16:0 Invalid assignment [41]: Cannot reassign final attribute `dc1.a`. -dataclasses_frozen.py:17:0 Invalid assignment [41]: Cannot reassign final attribute `dc1.b`. -dataclasses_frozen.py:23:0 Invalid inheritance [39]: Non-frozen dataclass `DC2` cannot inherit from frozen dataclass `DC1`. -dataclasses_frozen.py:33:0 Invalid inheritance [39]: Frozen dataclass `DC4` cannot inherit from non-frozen dataclass `DC3`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 16: Expected 1 errors +Line 17: Expected 1 errors +Lines 22, 23: Expected error (tag 'DC2') +Lines 32, 33: Expected error (tag 'DC4') """ diff --git a/conformance/results/pyre/dataclasses_kwonly.toml b/conformance/results/pyre/dataclasses_kwonly.toml index 9e66c08f..2cfa94bf 100644 --- a/conformance/results/pyre/dataclasses_kwonly.toml +++ b/conformance/results/pyre/dataclasses_kwonly.toml @@ -3,12 +3,10 @@ notes = """ Rejects legitimate use of dataclass field with `kw_only=True`. """ output = """ -dataclasses_kwonly.py:23:0 Too many arguments [19]: Call `DC1.__init__` expects 1 positional argument, 2 were provided. -dataclasses_kwonly.py:38:0 Too many arguments [19]: Call `DC2.__init__` expects 1 positional argument, 2 were provided. -dataclasses_kwonly.py:53:0 Too many arguments [19]: Call `DC3.__init__` expects 1 positional argument, 2 were provided. -dataclasses_kwonly.py:61:0 Unexpected keyword [28]: Unexpected keyword argument `b` to call `DC4.__init__`. """ conformance_automated = "Fail" errors_diff = """ -Line 61: Unexpected errors ['dataclasses_kwonly.py:61:0 Unexpected keyword [28]: Unexpected keyword argument `b` to call `DC4.__init__`.'] +Line 23: Expected 1 errors +Line 38: Expected 1 errors +Line 53: Expected 1 errors """ diff --git a/conformance/results/pyre/dataclasses_order.toml b/conformance/results/pyre/dataclasses_order.toml index 0452db28..d8eda5a7 100644 --- a/conformance/results/pyre/dataclasses_order.toml +++ b/conformance/results/pyre/dataclasses_order.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ -dataclasses_order.py:50:3 Unsupported operand [58]: `<` is not supported for operand types `DC1` and `DC2`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 50: Expected 1 errors """ diff --git a/conformance/results/pyre/dataclasses_postinit.toml b/conformance/results/pyre/dataclasses_postinit.toml index 31199486..922e559a 100644 --- a/conformance/results/pyre/dataclasses_postinit.toml +++ b/conformance/results/pyre/dataclasses_postinit.toml @@ -4,25 +4,11 @@ Does not perform validation of `__post_init__` method. 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_slots.toml b/conformance/results/pyre/dataclasses_slots.toml index ca83a885..e8108e48 100644 --- a/conformance/results/pyre/dataclasses_slots.toml +++ b/conformance/results/pyre/dataclasses_slots.toml @@ -5,12 +5,12 @@ Does not reject write to instance variable that is not defined in __slots__. Does not reject access to `__slots__` from dataclass instance when `slots=False`. """ output = """ -dataclasses_slots.py:66:0 Undefined attribute [16]: `DC6` has no attribute `__slots__`. """ conformance_automated = "Fail" errors_diff = """ Line 25: Expected 1 errors Line 38: Expected 1 errors +Line 66: Expected 1 errors Line 69: Expected 1 errors Lines 10, 11: Expected error (tag 'DC1') """ diff --git a/conformance/results/pyre/dataclasses_transform_class.toml b/conformance/results/pyre/dataclasses_transform_class.toml index bdb113d3..a0596517 100644 --- a/conformance/results/pyre/dataclasses_transform_class.toml +++ b/conformance/results/pyre/dataclasses_transform_class.toml @@ -4,19 +4,13 @@ Does not support field specifiers. Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_class.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. -dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. -dataclasses_transform_class.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. -dataclasses_transform_class.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_class.py:82:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. -dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. -dataclasses_transform_class.py:122:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 60: Unexpected errors ['dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] -Line 90: Unexpected errors ['dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] -Line 111: Unexpected errors ['dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] +Line 51: Expected 1 errors +Line 63: Expected 1 errors +Line 66: Expected 1 errors +Line 72: Expected 1 errors +Line 82: Expected 1 errors +Line 122: Expected 1 errors """ diff --git a/conformance/results/pyre/dataclasses_transform_converter.toml b/conformance/results/pyre/dataclasses_transform_converter.toml index 810debae..ab8e064b 100644 --- a/conformance/results/pyre/dataclasses_transform_converter.toml +++ b/conformance/results/pyre/dataclasses_transform_converter.toml @@ -4,45 +4,15 @@ Converter parameter not yet supported. """ conformance_automated = "Fail" errors_diff = """ +Line 48: Expected 1 errors +Line 49: Expected 1 errors +Line 107: Expected 1 errors +Line 108: Expected 1 errors +Line 109: Expected 1 errors Line 118: Expected 1 errors -Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`.', 'dataclasses_transform_converter.py:112:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`.'] -Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`.'] -Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`.'] -Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`.'] -Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`.', 'dataclasses_transform_converter.py:121:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`.'] +Line 119: Expected 1 errors +Line 130: Expected 1 errors +Line 133: Expected 1 errors """ output = """ -dataclasses_transform_converter.py:48:30 Incompatible parameter type [6]: In call `model_field`, for argument `converter`, expected `typing.Callable[[Variable[S]], Variable[T]]` but got `typing.Callable(bad_converter1)[[], int]`. -dataclasses_transform_converter.py:49:30 Incompatible parameter type [6]: In call `model_field`, for argument `converter`, expected `typing.Callable[[Variable[S]], Variable[T]]` but got `typing.Callable(bad_converter2)[[KeywordOnly(x, int)], int]`. -dataclasses_transform_converter.py:107:7 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:107:13 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:107:19 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. -dataclasses_transform_converter.py:107:26 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. -dataclasses_transform_converter.py:108:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:108:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:108:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:108:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `int`. -dataclasses_transform_converter.py:108:25 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. -dataclasses_transform_converter.py:109:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:109:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:109:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:109:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. -dataclasses_transform_converter.py:109:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `complex`. -dataclasses_transform_converter.py:112:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:112:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:112:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:112:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. -dataclasses_transform_converter.py:112:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. -dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`. -dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`. -dataclasses_transform_converter.py:116:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`. -dataclasses_transform_converter.py:119:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `int`. -dataclasses_transform_converter.py:121:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:121:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:121:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:121:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. -dataclasses_transform_converter.py:121:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`. -dataclasses_transform_converter.py:121:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`. -dataclasses_transform_converter.py:130:58 Incompatible parameter type [6]: In call `model_field`, for argument `default`, expected `Optional[Variable[S]]` but got `int`. -dataclasses_transform_converter.py:133:58 Incompatible parameter type [6]: In call `model_field`, for argument `default_factory`, expected `Optional[typing.Callable[[], Variable[S]]]` but got `Type[int]`. """ diff --git a/conformance/results/pyre/dataclasses_transform_field.toml b/conformance/results/pyre/dataclasses_transform_field.toml index b1750267..d038ffe0 100644 --- a/conformance/results/pyre/dataclasses_transform_field.toml +++ b/conformance/results/pyre/dataclasses_transform_field.toml @@ -3,17 +3,9 @@ notes = """ 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: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 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`.'] +Line 75: Expected 1 errors """ diff --git a/conformance/results/pyre/dataclasses_transform_func.toml b/conformance/results/pyre/dataclasses_transform_func.toml index 2f69091f..7569e15d 100644 --- a/conformance/results/pyre/dataclasses_transform_func.toml +++ b/conformance/results/pyre/dataclasses_transform_func.toml @@ -5,39 +5,13 @@ Does not detect non-frozen class inheriting from frozen class. Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`. -dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. -dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized. -dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized. -dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. -dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized. -dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized. -dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_func.py:57:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`. -dataclasses_transform_func.py:61:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_func.py:65:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. -dataclasses_transform_func.py:71:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. -dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized. -dataclasses_transform_func.py:97:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ +Line 57: Expected 1 errors +Line 61: Expected 1 errors +Line 65: Expected 1 errors +Line 71: Expected 1 errors +Line 97: Expected 1 errors Lines 89, 90: Expected error (tag 'Customer3Subclass') -Line 20: Unexpected errors ['dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`.'] -Line 25: Unexpected errors ["dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] -Line 29: Unexpected errors ['dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] -Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.'] -Line 36: Unexpected errors ['dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.'] -Line 41: Unexpected errors ['dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.'] -Line 42: Unexpected errors ['dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.'] -Line 47: Unexpected errors ['dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.'] -Line 50: Unexpected errors ['dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 53: Unexpected errors ['dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.'] -Line 67: Unexpected errors ['dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] -Line 73: Unexpected errors ['dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] -Line 91: Unexpected errors ['dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_meta.toml b/conformance/results/pyre/dataclasses_transform_meta.toml index ffcce3b4..bf3fccbd 100644 --- a/conformance/results/pyre/dataclasses_transform_meta.toml +++ b/conformance/results/pyre/dataclasses_transform_meta.toml @@ -5,17 +5,13 @@ Incorrectly rejects frozen dataclass that inherits from non-frozen. Emits "attribute not initialized" error for dataclass field. """ output = """ -dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`. -dataclasses_transform_meta.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. -dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. -dataclasses_transform_meta.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. -dataclasses_transform_meta.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. -dataclasses_transform_meta.py:83:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. -dataclasses_transform_meta.py:103:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 43: Unexpected errors ['dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`.'] -Line 60: Unexpected errors ['dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] +Line 51: Expected 1 errors +Line 63: Expected 1 errors +Line 66: Expected 1 errors +Line 73: Expected 1 errors +Line 83: Expected 1 errors +Line 103: Expected 1 errors """ diff --git a/conformance/results/pyre/dataclasses_usage.toml b/conformance/results/pyre/dataclasses_usage.toml index 4620f9ec..23ec8794 100644 --- a/conformance/results/pyre/dataclasses_usage.toml +++ b/conformance/results/pyre/dataclasses_usage.toml @@ -5,30 +5,18 @@ 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 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:127:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. -dataclasses_usage.py:130:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. -dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized. -dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. -dataclasses_usage.py:179:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. -dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. -dataclasses_usage.py:213: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 = """ +Line 50: Expected 1 errors +Line 51: Expected 1 errors +Line 52: Expected 1 errors +Line 83: Expected 1 errors +Line 88: Expected 1 errors +Line 127: Expected 1 errors +Line 130: Expected 1 errors +Line 179: Expected 1 errors 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 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 173: Unexpected errors ['dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.'] -Line 174: Unexpected errors ['dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] -Line 205: Unexpected errors ['dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] -Line 213: Unexpected errors ['dataclasses_usage.py:213: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 2afa3ee8..03ed5501 100644 --- a/conformance/results/pyre/directives_assert_type.toml +++ b/conformance/results/pyre/directives_assert_type.toml @@ -3,13 +3,13 @@ notes = """ 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 = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 27: Expected 1 errors +Line 28: Expected 1 errors +Line 29: Expected 1 errors +Line 31: Expected 1 errors +Line 32: Expected 1 errors +Line 33: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_cast.toml b/conformance/results/pyre/directives_cast.toml index 8046276e..a7edd8c2 100644 --- a/conformance/results/pyre/directives_cast.toml +++ b/conformance/results/pyre/directives_cast.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ -directives_cast.py:15:7 Missing argument [20]: Call `cast` expects argument `typ`. -directives_cast.py:16:12 Invalid type [31]: Expression `1` is not a valid type. -directives_cast.py:17:7 Too many arguments [19]: Call `cast` expects 2 positional arguments, 3 were provided. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 15: Expected 1 errors +Line 16: Expected 1 errors +Line 17: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_deprecated.toml b/conformance/results/pyre/directives_deprecated.toml new file mode 100644 index 00000000..1cd9d997 --- /dev/null +++ b/conformance/results/pyre/directives_deprecated.toml @@ -0,0 +1,20 @@ +conformant = "Unsupported" +notes = """ +Does not support @deprecated +""" +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 29: Expected 1 errors +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 43: Expected 1 errors +Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 57: Expected 1 errors +Line 87: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/pyre/directives_no_type_check.toml b/conformance/results/pyre/directives_no_type_check.toml index f08913ea..87b037ac 100644 --- a/conformance/results/pyre/directives_no_type_check.toml +++ b/conformance/results/pyre/directives_no_type_check.toml @@ -3,13 +3,8 @@ notes = """ Does not honor @no_type_check decorator. """ output = """ -directives_no_type_check.py:15:4 Incompatible attribute type [8]: Attribute `x` declared in class `ClassA` has type `int` but is used as type `str`. -directives_no_type_check.py:25:12 Unsupported operand [58]: `+` is not supported for operand types `int` and `str`. -directives_no_type_check.py:26:4 Incompatible return type [7]: Expected `None` but got `int`. -directives_no_type_check.py:29:6 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `int` but got `bytes`. -directives_no_type_check.py:29:18 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `str` but got `bytes`. -directives_no_type_check.py:32:0 Missing argument [20]: Call `func1` expects argument `a`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 32: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_reveal_type.toml b/conformance/results/pyre/directives_reveal_type.toml index 92a17994..9bd8ee44 100644 --- a/conformance/results/pyre/directives_reveal_type.toml +++ b/conformance/results/pyre/directives_reveal_type.toml @@ -1,19 +1,12 @@ conformant = "Partial" -notes = """" +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 Revealed type [-1]: Revealed type for `a` is `typing.Union[int, str]`. """ 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`.'] +Line 19: Expected 1 errors +Line 20: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_type_ignore_file1.toml b/conformance/results/pyre/directives_type_ignore_file1.toml index 3efc56a3..52bc0972 100644 --- a/conformance/results/pyre/directives_type_ignore_file1.toml +++ b/conformance/results/pyre/directives_type_ignore_file1.toml @@ -3,9 +3,7 @@ notes = """ Does not support file-level `#type: ignore` comment. """ output = """ -directives_type_ignore_file1.py:16:0 Incompatible variable type [9]: x is declared to have type `int` but is used as type `str`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 16: Unexpected errors ['directives_type_ignore_file1.py:16:0 Incompatible variable type [9]: x is declared to have type `int` but is used as type `str`.'] """ diff --git a/conformance/results/pyre/directives_type_ignore_file2.toml b/conformance/results/pyre/directives_type_ignore_file2.toml index 7e43e7dc..86845706 100644 --- a/conformance/results/pyre/directives_type_ignore_file2.toml +++ b/conformance/results/pyre/directives_type_ignore_file2.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ -directives_type_ignore_file2.py:14:0 Incompatible variable type [9]: x is declared to have type `int` but is used as type `str`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 14: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_version_platform.toml b/conformance/results/pyre/directives_version_platform.toml index 24d9f1ea..81d30e36 100644 --- a/conformance/results/pyre/directives_version_platform.toml +++ b/conformance/results/pyre/directives_version_platform.toml @@ -4,13 +4,7 @@ Does not support sys.platform checks. Does not support os.name checks. """ output = """ -directives_version_platform.py:31:4 Incompatible variable type [9]: val5 is declared to have type `int` but is used as type `str`. -directives_version_platform.py:36:4 Incompatible variable type [9]: val6 is declared to have type `int` but is used as type `str`. -directives_version_platform.py:40:4 Incompatible variable type [9]: val7 is declared to have type `int` but is used as type `str`. -directives_version_platform.py:45:4 Incompatible variable type [9]: val8 is declared to have type `int` but is used as type `str`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 31: Unexpected errors ['directives_version_platform.py:31:4 Incompatible variable type [9]: val5 is declared to have type `int` but is used as type `str`.'] -Line 36: Unexpected errors ['directives_version_platform.py:36:4 Incompatible variable type [9]: val6 is declared to have type `int` but is used as type `str`.'] """ diff --git a/conformance/results/pyre/enums_definition.toml b/conformance/results/pyre/enums_definition.toml index 832a9d48..717426e9 100644 --- a/conformance/results/pyre/enums_definition.toml +++ b/conformance/results/pyre/enums_definition.toml @@ -3,17 +3,8 @@ notes = """ Does not support custom Enum classes based on EnumType metaclass. Does not support some functional forms for Enum class definitions (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 75: Unexpected errors ['enums_definition.py:75:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color11.RED]` but got `int`.'] """ output = """ -enums_definition.py:24:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 4 were provided. -enums_definition.py:27:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. -enums_definition.py:28:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. -enums_definition.py:31:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. -enums_definition.py:33:12 Undefined attribute [16]: `Enum` has no attribute `RED`. -enums_definition.py:38:12 Undefined attribute [16]: `Color7` has no attribute `RED`. -enums_definition.py:39:12 Undefined attribute [16]: `Color8` has no attribute `RED`. -enums_definition.py:75:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color11.RED]` but got `int`. """ diff --git a/conformance/results/pyre/enums_expansion.toml b/conformance/results/pyre/enums_expansion.toml index 8b75a929..cf383d41 100644 --- a/conformance/results/pyre/enums_expansion.toml +++ b/conformance/results/pyre/enums_expansion.toml @@ -2,11 +2,9 @@ conformant = "Pass" notes = """ Does not perform type narrowing based on enum literal expansion (optional). """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 53: Expected 1 errors """ output = """ -enums_expansion.py:25:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color.GREEN]` but got `Color`. -enums_expansion.py:35:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Never` but got `Color`. -enums_expansion.py:53:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[CustomFlags.FLAG3]` but got `CustomFlags`. """ diff --git a/conformance/results/pyre/enums_member_names.toml b/conformance/results/pyre/enums_member_names.toml index 109185b5..993bbd88 100644 --- a/conformance/results/pyre/enums_member_names.toml +++ b/conformance/results/pyre/enums_member_names.toml @@ -6,8 +6,4 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_member_names.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal['RED']` but got `str`. -enums_member_names.py:22:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal['RED']` but got `typing.Any`. -enums_member_names.py:26:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['RED']]` but got `typing.Any`. -enums_member_names.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['GREEN'], typing_extensions.Literal['RED']]` but got `typing.Any`. """ diff --git a/conformance/results/pyre/enums_member_values.toml b/conformance/results/pyre/enums_member_values.toml index 84241741..69d8b861 100644 --- a/conformance/results/pyre/enums_member_values.toml +++ b/conformance/results/pyre/enums_member_values.toml @@ -9,15 +9,6 @@ conformance_automated = "Fail" errors_diff = """ Line 78: Expected 1 errors Line 85: Expected 1 errors -Line 76: Unexpected errors ['enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized.'] """ output = """ -enums_member_values.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:22:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:26:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[3]]` but got `typing.Any`. -enums_member_values.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[2], typing_extensions.Literal[3]]` but got `typing.Any`. -enums_member_values.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:68:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. -enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized. -enums_member_values.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. """ diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml index 914ecb99..50e938a1 100644 --- a/conformance/results/pyre/enums_members.toml +++ b/conformance/results/pyre/enums_members.toml @@ -14,28 +14,10 @@ errors_diff = """ Line 50: Expected 1 errors Line 82: Expected 1 errors Line 83: Expected 1 errors +Line 84: Expected 1 errors +Line 85: Expected 1 errors Line 116: Expected 1 errors Line 129: Expected 1 errors -Line 27: Unexpected errors ['enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] -Line 28: Unexpected errors ['enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] -Line 35: Unexpected errors ['enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] -Line 36: Unexpected errors ['enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] -Line 100: Unexpected errors ['enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] -Line 117: Unexpected errors ['enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`.'] -Line 128: Unexpected errors ['enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final).'] -Line 139: Unexpected errors ['enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] """ output = """ -enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. -enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. -enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. -enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. -enums_members.py:84:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.species]` but got `str`. -enums_members.py:85:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. -enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. -enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`. -enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final). -enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`. -enums_members.py:146:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. -enums_members.py:147:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. """ diff --git a/conformance/results/pyre/exceptions_context_managers.toml b/conformance/results/pyre/exceptions_context_managers.toml index 9dff9945..54fcb612 100644 --- a/conformance/results/pyre/exceptions_context_managers.toml +++ b/conformance/results/pyre/exceptions_context_managers.toml @@ -2,12 +2,8 @@ conformant = "Unsupported" notes = """ Does not understand context manager exception rules. """ -conformance_automated = "Fail" +conformance_automated = "Pass" 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 0e50c8f7..64fa72b3 100644 --- a/conformance/results/pyre/generics_base_class.toml +++ b/conformance/results/pyre/generics_base_class.toml @@ -4,13 +4,13 @@ Does not reject illegal use of Generic. 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: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[...]. """ conformance_automated = "Fail" errors_diff = """ +Line 26: Expected 1 errors Line 29: Expected 1 errors Line 30: Expected 1 errors +Line 49: Expected 1 errors +Line 61: Expected 1 errors +Line 68: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_basic.toml b/conformance/results/pyre/generics_basic.toml index b7e8d00b..e5a3c7cd 100644 --- a/conformance/results/pyre/generics_basic.toml +++ b/conformance/results/pyre/generics_basic.toml @@ -7,19 +7,16 @@ 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 `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: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[...]. """ conformance_automated = "Fail" errors_diff = """ +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 49: Expected 1 errors +Line 55: Expected 1 errors +Line 69: Expected 1 errors +Line 121: Expected 1 errors 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 `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 5e641c5b..e98d1812 100644 --- a/conformance/results/pyre/generics_defaults.toml +++ b/conformance/results/pyre/generics_defaults.toml @@ -3,106 +3,12 @@ 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: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: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: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[(*DefaultTs)]` is not a valid type. -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: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[(*Ts, 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[(*Ts, 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: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 = """ +Line 24: Expected 1 errors 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: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: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: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: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[(*DefaultTs)]` is not a valid type.'] -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[(*Ts, 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: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.'] +Line 138: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_defaults_referential.toml b/conformance/results/pyre/generics_defaults_referential.toml index 3da14a21..64c0a213 100644 --- a/conformance/results/pyre/generics_defaults_referential.toml +++ b/conformance/results/pyre/generics_defaults_referential.toml @@ -1,61 +1,13 @@ conformant = "Unsupported" 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: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: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: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: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 53: 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: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: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: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: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 7de25df9..a196a8ad 100644 --- a/conformance/results/pyre/generics_defaults_specialization.toml +++ b/conformance/results/pyre/generics_defaults_specialization.toml @@ -3,39 +3,9 @@ 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 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: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. -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. """ conformance_automated = "Fail" 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 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: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.'] +Line 30: Expected 1 errors +Line 55: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_paramspec_basic.toml b/conformance/results/pyre/generics_paramspec_basic.toml index 74f97773..ad1538f5 100644 --- a/conformance/results/pyre/generics_paramspec_basic.toml +++ b/conformance/results/pyre/generics_paramspec_basic.toml @@ -5,21 +5,14 @@ Incorrectly reports error for legitimate use of ParamSpec in generic type alias. Does not reject ParamSpec when used in various invalid locations. """ output = """ -generics_paramspec_basic.py:15:0 Undefined or invalid type [11]: Annotation `P` is not defined as a type. -generics_paramspec_basic.py:17:0 Incompatible variable type [9]: TA2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. -generics_paramspec_basic.py:17:26 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]`. -generics_paramspec_basic.py:18:0 Incompatible variable type [9]: TA3 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. -generics_paramspec_basic.py:18:26 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[object, None]`. -generics_paramspec_basic.py:27:13 Invalid type variable [34]: The type variable `P` isn't present in the function's parameters. -generics_paramspec_basic.py:27:13 Undefined or invalid type [11]: Annotation `Concatenate` is not defined as a type. -generics_paramspec_basic.py:31:13 Invalid type parameters [24]: Single type parameter `Variable[_T]` expected, but a callable parameters `generics_paramspec_basic.P` was given for generic type list. """ conformance_automated = "Fail" errors_diff = """ Line 10: Expected 1 errors +Line 15: Expected 1 errors Line 23: Expected 1 errors +Line 27: Expected 1 errors +Line 31: Expected 1 errors Line 35: Expected 1 errors Line 39: Expected 1 errors -Line 17: Unexpected errors ['generics_paramspec_basic.py:17:0 Incompatible variable type [9]: TA2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'generics_paramspec_basic.py:17:26 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 18: Unexpected errors ['generics_paramspec_basic.py:18:0 Incompatible variable type [9]: TA3 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'generics_paramspec_basic.py:18:26 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[object, None]`.'] """ diff --git a/conformance/results/pyre/generics_paramspec_components.toml b/conformance/results/pyre/generics_paramspec_components.toml index daf77e2f..093958aa 100644 --- a/conformance/results/pyre/generics_paramspec_components.toml +++ b/conformance/results/pyre/generics_paramspec_components.toml @@ -8,17 +8,10 @@ Does not report error when keyword argument is specified between P.args and P.kw Does not report error when calling callable and argument is missing for concatenated parameters. """ 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: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`. """ conformance_automated = "Fail" errors_diff = """ +Line 17: Expected 1 errors Line 20: Expected 1 errors Line 23: Expected 1 errors Line 26: Expected 1 errors @@ -27,6 +20,11 @@ Line 35: Expected 1 errors Line 36: Expected 1 errors Line 38: Expected 1 errors Line 41: Expected 1 errors +Line 49: Expected 1 errors Line 51: Expected 1 errors Line 60: Expected 1 errors +Line 70: Expected 1 errors +Line 72: Expected 1 errors +Line 83: Expected 1 errors +Line 98: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_paramspec_semantics.toml b/conformance/results/pyre/generics_paramspec_semantics.toml index a3a645b6..b33334e4 100644 --- a/conformance/results/pyre/generics_paramspec_semantics.toml +++ b/conformance/results/pyre/generics_paramspec_semantics.toml @@ -1,16 +1,15 @@ 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:98:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. -generics_paramspec_semantics.py:108:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `bool` but got `int`. -generics_paramspec_semantics.py:120:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. -generics_paramspec_semantics.py:127: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:132: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:137: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 = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 26: Expected 1 errors +Line 27: Expected 1 errors +Line 61: Expected 1 errors +Line 98: Expected 1 errors +Line 108: Expected 1 errors +Line 120: Expected 1 errors +Line 127: Expected 1 errors +Line 132: Expected 1 errors +Line 137: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_paramspec_specialization.toml b/conformance/results/pyre/generics_paramspec_specialization.toml index 34a215ee..dba669c0 100644 --- a/conformance/results/pyre/generics_paramspec_specialization.toml +++ b/conformance/results/pyre/generics_paramspec_specialization.toml @@ -3,20 +3,12 @@ notes = """ Reports error for legitimate use of `...` to specialize ParamSpec """ output = """ -generics_paramspec_specialization.py:32: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:36: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:44: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:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:54:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:55:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:60:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. -generics_paramspec_specialization.py:61:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. """ conformance_automated = "Fail" errors_diff = """ -Line 32: Unexpected errors ['generics_paramspec_specialization.py:32:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB.'] -Line 36: Unexpected errors ['generics_paramspec_specialization.py:36:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA.'] -Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] -Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] +Line 44: Expected 1 errors +Line 54: Expected 1 errors +Line 55: Expected 1 errors +Line 60: Expected 1 errors +Line 61: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_scoping.toml b/conformance/results/pyre/generics_scoping.toml index ae6cd48c..4f86bd70 100644 --- a/conformance/results/pyre/generics_scoping.toml +++ b/conformance/results/pyre/generics_scoping.toml @@ -4,25 +4,17 @@ 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: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:87:23 Undefined attribute [16]: `list` has no attribute `__getitem__`. -generics_scoping.py:94:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. -generics_scoping.py:95:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. -generics_scoping.py:96:0 Undefined attribute [16]: `list` has no attribute `__getitem__`. """ conformance_automated = "Fail" errors_diff = """ +Line 29: Expected 1 errors +Line 50: Expected 1 errors +Line 54: Expected 1 errors 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']`."] +Line 78: Expected 1 errors +Line 87: Expected 1 errors +Line 94: Expected 1 errors +Line 95: Expected 1 errors +Line 96: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_self_advanced.toml b/conformance/results/pyre/generics_self_advanced.toml index e7ef9d28..4796db85 100644 --- a/conformance/results/pyre/generics_self_advanced.toml +++ b/conformance/results/pyre/generics_self_advanced.toml @@ -3,21 +3,7 @@ notes = """ 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: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" +conformance_automated = "Pass" 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: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_attributes.toml b/conformance/results/pyre/generics_self_attributes.toml index 557fadbf..7bc2b5e3 100644 --- a/conformance/results/pyre/generics_self_attributes.toml +++ b/conformance/results/pyre/generics_self_attributes.toml @@ -3,13 +3,9 @@ notes = """ Does not understand `Self` type. """ output = """ -generics_self_attributes.py:16:10 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. -generics_self_attributes.py:26:5 Unexpected keyword [28]: Unexpected keyword argument `next` to call `OrdinalLinkedList.__init__`. -generics_self_attributes.py:29:14 Unexpected keyword [28]: Unexpected keyword argument `next` to call `OrdinalLinkedList.__init__`. -generics_self_attributes.py:32:14 Unexpected keyword [28]: Unexpected keyword argument `next` to call `LinkedList.__init__`. """ conformance_automated = "Fail" errors_diff = """ -Line 16: Unexpected errors ['generics_self_attributes.py:16:10 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] -Line 29: Unexpected errors ['generics_self_attributes.py:29:14 Unexpected keyword [28]: Unexpected keyword argument `next` to call `OrdinalLinkedList.__init__`.'] +Line 26: Expected 1 errors +Line 32: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_self_basic.toml b/conformance/results/pyre/generics_self_basic.toml index 8b64f812..02a58a1c 100644 --- a/conformance/results/pyre/generics_self_basic.toml +++ b/conformance/results/pyre/generics_self_basic.toml @@ -3,17 +3,10 @@ notes = """ Does not handle use of `Self` as a generic type. """ output = """ -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:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`. -generics_self_basic.py:33:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. -generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. """ conformance_automated = "Fail" errors_diff = """ +Line 20: Expected 1 errors +Line 33: Expected 1 errors Line 67: Expected 1 errors -Line 14: Unexpected errors ['generics_self_basic.py:14:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.', 'generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] -Line 27: Unexpected errors ['generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] -Line 40: Unexpected errors ['generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] """ diff --git a/conformance/results/pyre/generics_self_protocols.toml b/conformance/results/pyre/generics_self_protocols.toml index 309def8b..0d95e9a9 100644 --- a/conformance/results/pyre/generics_self_protocols.toml +++ b/conformance/results/pyre/generics_self_protocols.toml @@ -3,9 +3,9 @@ notes = """ Does not reject protocol compatibility due to method `Self` return type. """ output = """ -generics_self_protocols.py:61:18 Incompatible parameter type [6]: In call `accepts_shape`, for 1st positional argument, expected `ShapeProtocol` but got `BadReturnType`. """ conformance_automated = "Fail" errors_diff = """ +Line 61: Expected 1 errors Line 64: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_self_usage.toml b/conformance/results/pyre/generics_self_usage.toml index 8907b5e7..69cd993a 100644 --- a/conformance/results/pyre/generics_self_usage.toml +++ b/conformance/results/pyre/generics_self_usage.toml @@ -8,21 +8,18 @@ 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: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" errors_diff = """ Line 73: Expected 1 errors Line 76: Expected 1 errors Line 82: Expected 1 errors +Line 86: Expected 1 errors Line 101: Expected 1 errors Line 103: Expected 1 errors +Line 106: Expected 1 errors Line 111: Expected 1 errors Line 116: Expected 1 errors Line 121: Expected 1 errors Line 125: Expected 1 errors -Line 20: Unexpected errors ['generics_self_usage.py:20:34 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] """ diff --git a/conformance/results/pyre/generics_syntax_compatibility.toml b/conformance/results/pyre/generics_syntax_compatibility.toml index 46268f56..4c39980d 100644 --- a/conformance/results/pyre/generics_syntax_compatibility.toml +++ b/conformance/results/pyre/generics_syntax_compatibility.toml @@ -3,9 +3,9 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_compatibility.py:14:13 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ +Line 14: Expected 1 errors Line 26: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_syntax_declarations.toml b/conformance/results/pyre/generics_syntax_declarations.toml index 59b938d5..fed137d7 100644 --- a/conformance/results/pyre/generics_syntax_declarations.toml +++ b/conformance/results/pyre/generics_syntax_declarations.toml @@ -3,7 +3,6 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -17,5 +16,4 @@ Line 66: Expected 1 errors Line 73: Expected 1 errors Line 77: Expected 1 errors Line 81: Expected 1 errors -Line 13: Unexpected errors ['generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index 2a2c10d6..be4fcbbd 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -3,7 +3,6 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_infer_variance.py:125:25 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -26,5 +25,4 @@ Line 121: Expected 1 errors Line 129: Expected 1 errors Line 137: Expected 1 errors Line 148: Expected 1 errors -Line 125: Unexpected errors ['generics_syntax_infer_variance.py:125:25 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/generics_syntax_scoping.toml b/conformance/results/pyre/generics_syntax_scoping.toml index db9a56f1..5424b352 100644 --- a/conformance/results/pyre/generics_syntax_scoping.toml +++ b/conformance/results/pyre/generics_syntax_scoping.toml @@ -3,10 +3,10 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_scoping.py:14:13 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ +Line 14: Expected 1 errors Line 18: Expected 1 errors Line 35: Expected 1 errors Line 44: Expected 1 errors diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index f2bc6919..6b193b5a 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -5,24 +5,14 @@ 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:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. -generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. -generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`. -generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`. -generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. -generics_type_erasure.py:40:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. -generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ +Line 38: Expected 1 errors +Line 40: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors Line 45: Expected 1 errors Line 46: Expected 1 errors -Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] -Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] -Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] -Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`.'] -Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_args.toml b/conformance/results/pyre/generics_typevartuple_args.toml index eaca737d..12b55605 100644 --- a/conformance/results/pyre/generics_typevartuple_args.toml +++ b/conformance/results/pyre/generics_typevartuple_args.toml @@ -3,15 +3,6 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*Ts` is not a valid type. -generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*Ts, generics_typevartuple_args.Env)]` is not a valid type. -generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -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. -generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_args.py:75:12 Incompatible parameter type [6]: In call `func4`, for 2nd positional argument, expected `Tuple[]` but got `Tuple[int, int]`. Expected has length 1, but actual has length 2. """ conformance_automated = "Fail" errors_diff = """ @@ -22,11 +13,6 @@ Line 57: Expected 1 errors Line 58: Expected 1 errors Line 59: Expected 1 errors Line 67: Expected 1 errors +Line 75: Expected 1 errors Line 76: Expected 1 errors -Line 16: Unexpected errors ['generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*Ts` is not a valid type.', 'generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -Line 27: Unexpected errors ['generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*Ts, generics_typevartuple_args.Env)]` is not a valid type.', 'generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -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.'] -Line 70: Unexpected errors ['generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_basic.toml b/conformance/results/pyre/generics_typevartuple_basic.toml index 8964996a..053768fd 100644 --- a/conformance/results/pyre/generics_typevartuple_basic.toml +++ b/conformance/results/pyre/generics_typevartuple_basic.toml @@ -3,71 +3,22 @@ notes = """ Does not support TypeVarTuple. """ output = """ -generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*Ts` is not a valid type. -generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:36:0 Incompatible variable type [9]: v1 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:36:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:36:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Height, Width]`. Expected has length 1, but actual has length 2. -generics_typevartuple_basic.py:37:0 Incompatible variable type [9]: v2 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:37:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:37:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Height, Width]`. Expected has length 1, but actual has length 3. -generics_typevartuple_basic.py:38:0 Incompatible variable type [9]: v3 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:38:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:39:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Height, Width]`. Expected has length 1, but actual has length 4. -generics_typevartuple_basic.py:42:0 Incompatible variable type [9]: v4 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:42:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:42:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Height`. -generics_typevartuple_basic.py:43:0 Incompatible variable type [9]: v5 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:43:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:43:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Width]`. Expected has length 1, but actual has length 2. -generics_typevartuple_basic.py:44:0 Incompatible variable type [9]: v6 is declared to have type `Array[]` but is used as type `Array`. -generics_typevartuple_basic.py:44:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:45:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Width, Height]`. Expected has length 1, but actual has length 4. -generics_typevartuple_basic.py:52:13 Undefined or invalid type [11]: Annotation `Shape` is not defined as a type. -generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:65:6 Unexpected keyword [28]: Unexpected keyword argument `covariant` to call `TypeVarTuple.__init__`. -generics_typevartuple_basic.py:66:6 Too many arguments [19]: Call `TypeVarTuple.__init__` expects 1 positional argument, 3 were provided. -generics_typevartuple_basic.py:67:6 Unexpected keyword [28]: Unexpected keyword argument `bound` to call `TypeVarTuple.__init__`. -generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_basic.py:90:6 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `Tuple[]` but got `Tuple[int, int]`. Expected has length 1, but actual has length 2. -generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. -generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:97:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:97:31 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:97:48 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_basic.py:106:13 Invalid type [31]: Expression `typing.Generic[(*Ts1, *Ts2)]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 52: Expected 1 errors Line 53: Expected 1 errors Line 56: Expected 1 errors Line 59: Expected 1 errors +Line 65: Expected 1 errors +Line 66: Expected 1 errors +Line 67: Expected 1 errors Line 89: Expected 1 errors +Line 90: Expected 1 errors Line 99: Expected 1 errors Line 100: Expected 1 errors -Line 12: Unexpected errors ['generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] -Line 16: Unexpected errors ['generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*Ts` is not a valid type.', 'generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -Line 23: Unexpected errors ['generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type.'] -Line 24: Unexpected errors ['generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] -Line 25: Unexpected errors ['generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] -Line 27: Unexpected errors ['generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] -Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:0 Incompatible variable type [9]: v1 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:36:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:36:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Height, Width]`. Expected has length 1, but actual has length 2.'] -Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:0 Incompatible variable type [9]: v2 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:37:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:37:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Height, Width]`. Expected has length 1, but actual has length 3.'] -Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:0 Incompatible variable type [9]: v3 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:38:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 39: Unexpected errors ['generics_typevartuple_basic.py:39:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Height, Width]`. Expected has length 1, but actual has length 4.'] -Line 54: Unexpected errors ['generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] -Line 75: Unexpected errors ['generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] -Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:97:31 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:97:48 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 106: Expected 1 errors +Lines 44, 45: Expected error (tag 'v6') """ diff --git a/conformance/results/pyre/generics_typevartuple_callable.toml b/conformance/results/pyre/generics_typevartuple_callable.toml index e3c989ea..3d6c9c44 100644 --- a/conformance/results/pyre/generics_typevartuple_callable.toml +++ b/conformance/results/pyre/generics_typevartuple_callable.toml @@ -3,26 +3,8 @@ notes = """ Does not support TypeVarTuple. """ output = """ -generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*Ts], None)]` is not a valid type. -generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -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. -generics_typevartuple_callable.py:26: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:26:22 Incompatible parameter type [6]: In call `Process.__init__`, for argument `args`, expected `Tuple[]` but got `Tuple[str, int]`. Expected has length 1, but actual has length 2. -generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *Ts, T], tuple[(T, *Ts)])]` is not a valid type. -generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*Ts, 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: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, *Ts, T)]` is not a valid type. -generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[(T, *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. """ conformance_automated = "Fail" errors_diff = """ -Line 17: Unexpected errors ['generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*Ts], None)]` is not a valid type.', 'generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*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, *Ts, T], tuple[(T, *Ts)])]` is not a valid type.', 'generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*Ts, 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]]`.'] -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, *Ts, T)]` is not a valid type.', 'generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[(T, *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 26: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_typevartuple_concat.toml b/conformance/results/pyre/generics_typevartuple_concat.toml index e3a1bf0f..fc713546 100644 --- a/conformance/results/pyre/generics_typevartuple_concat.toml +++ b/conformance/results/pyre/generics_typevartuple_concat.toml @@ -3,37 +3,7 @@ notes = """ Does not support TypeVarTuple. """ output = """ -generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. -generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. -generics_typevartuple_concat.py:26:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type. -generics_typevartuple_concat.py:26:40 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *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 `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. -generics_typevartuple_concat.py:30:47 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_concat.py:34:26 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*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 `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *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:47:26 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[(T, *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:55:36 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type. -generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*Ts, 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]`. -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`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 22: Unexpected errors ['generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] -Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:40 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *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 `generics_typevartuple_concat.Array[(*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 `generics_typevartuple_concat.Array[(*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 `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *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 47: Unexpected errors ['generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[(T, *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 55: Unexpected errors ['generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*Ts, 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 9696e56a..2f19de53 100644 --- a/conformance/results/pyre/generics_typevartuple_overloads.toml +++ b/conformance/results/pyre/generics_typevartuple_overloads.toml @@ -3,18 +3,7 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type. -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. -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. -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. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 16: Unexpected errors ['generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type.'] -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.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_specialization.toml b/conformance/results/pyre/generics_typevartuple_specialization.toml index d6cf07fe..7f281215 100644 --- a/conformance/results/pyre/generics_typevartuple_specialization.toml +++ b/conformance/results/pyre/generics_typevartuple_specialization.toml @@ -3,78 +3,13 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. -generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `generics_typevartuple_specialization.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. -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: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: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[(DType, *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: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:92:13 Undefined or invalid type [11]: Annotation `VariadicTuple` is not defined as a type. -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 Unable to concatenate tuple [60]: Concatenation not yet support for multiple variadic tuples: `*Ts, *tuple[(int, ...)]`. -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 `TA7[(*Ts, T1, 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[(*Ts)], T1, 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:143:13 Invalid type [31]: Expression `TA8[(T1, *Ts, T2, 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[(*Ts)], T1, T2, 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. -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 `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 `TA9[(*tuple[(int, ...)], str)]` is not a valid type. -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 121: Expected 1 errors +Line 122: Expected 1 errors +Line 127: Expected 1 errors Line 163: Expected 1 errors -Line 16: Unexpected errors ['generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] -Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `generics_typevartuple_specialization.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: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 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[(DType, *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: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 92: Unexpected errors ['generics_typevartuple_specialization.py:92:13 Undefined or invalid type [11]: Annotation `VariadicTuple` is not defined as a type.'] -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 `TA7[(*Ts, T1, 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[(*Ts)], T1, 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 143: Unexpected errors ['generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `TA8[(T1, *Ts, T2, 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[(*Ts)], T1, T2, 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 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 `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 `TA9[(*tuple[(int, ...)], str)]` is not a valid type.'] -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 7e2f93c9..278fe056 100644 --- a/conformance/results/pyre/generics_typevartuple_unpack.toml +++ b/conformance/results/pyre/generics_typevartuple_unpack.toml @@ -3,25 +3,8 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ -generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. -generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type. -generics_typevartuple_unpack.py:21:30 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:26:7 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:26:49 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:26:76 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *Shape)]` is not a valid type. -generics_typevartuple_unpack.py:36:29 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:40:28 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. -generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(*tuple[(typing.Any, ...)])]` is not a valid type. -generics_typevartuple_unpack.py:44:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. """ conformance_automated = "Fail" errors_diff = """ Line 30: Expected 1 errors -Line 17: Unexpected errors ['generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] -Line 21: Unexpected errors ['generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type.', 'generics_typevartuple_unpack.py:21:30 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 26: Unexpected errors ['generics_typevartuple_unpack.py:26:7 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_unpack.py:26:49 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_unpack.py:26:76 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 36: Unexpected errors ['generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_unpack.py:36:29 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 40: Unexpected errors ['generics_typevartuple_unpack.py:40:28 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] -Line 44: Unexpected errors ['generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(*tuple[(typing.Any, ...)])]` is not a valid type.', 'generics_typevartuple_unpack.py:44:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_upper_bound.toml b/conformance/results/pyre/generics_upper_bound.toml index b54303c5..2d884827 100644 --- a/conformance/results/pyre/generics_upper_bound.toml +++ b/conformance/results/pyre/generics_upper_bound.toml @@ -4,11 +4,10 @@ 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: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`. """ conformance_automated = "Fail" errors_diff = """ +Line 24: Expected 1 errors +Line 51: Expected 1 errors Line 56: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_variance.toml b/conformance/results/pyre/generics_variance.toml index 3054f35e..4f5db55c 100644 --- a/conformance/results/pyre/generics_variance.toml +++ b/conformance/results/pyre/generics_variance.toml @@ -4,20 +4,20 @@ Does not reject a TypeVar that is defined as both covariant and contravariant. Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible. """ output = """ -generics_variance.py:77:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:81:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:93:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T_co](covariant)` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:105:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T_contra](contravariant)` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:125:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T_contra](contravariant)` because subclasses cannot use more permissive type variables than their superclasses. -generics_variance.py:131:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T_co](covariant)` because subclasses cannot use more permissive type variables than their superclasses. """ conformance_automated = "Fail" errors_diff = """ Line 14: Expected 1 errors +Line 77: Expected 1 errors +Line 81: Expected 1 errors +Line 93: Expected 1 errors +Line 105: Expected 1 errors Line 113: Expected 1 errors Line 163: Expected 1 errors Line 167: Expected 1 errors Line 191: Expected 1 errors +Lines 125, 126: Expected error (tag 'CoContra_Child2') +Lines 131, 132: Expected error (tag 'CoContra_Child3') Lines 141, 142: Expected error (tag 'CoContra_Child5') Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') """ diff --git a/conformance/results/pyre/generics_variance_inference.toml b/conformance/results/pyre/generics_variance_inference.toml index a0efdd76..6282d44d 100644 --- a/conformance/results/pyre/generics_variance_inference.toml +++ b/conformance/results/pyre/generics_variance_inference.toml @@ -3,7 +3,6 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_variance_inference.py:15:13 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -30,5 +29,4 @@ Line 169: Expected 1 errors Line 170: Expected 1 errors Line 181: Expected 1 errors Line 194: Expected 1 errors -Line 15: Unexpected errors ['generics_variance_inference.py:15:13 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/historical_positional.toml b/conformance/results/pyre/historical_positional.toml index 9e1a52b2..97c3b23a 100644 --- a/conformance/results/pyre/historical_positional.toml +++ b/conformance/results/pyre/historical_positional.toml @@ -5,15 +5,11 @@ 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`. -historical_positional.py:32:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f3`. -historical_positional.py:43:0 Unexpected keyword [28]: Unexpected keyword argument `__x` to call `A.m1`. -historical_positional.py:53:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f4`. """ conformance_automated = "Fail" errors_diff = """ +Line 18: Expected 1 errors Line 26: Expected 1 errors Line 38: Expected 1 errors -Line 32: Unexpected errors ['historical_positional.py:32:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f3`.'] -Line 53: Unexpected errors ['historical_positional.py:53:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f4`.'] +Line 43: Expected 1 errors """ diff --git a/conformance/results/pyre/literals_interactions.toml b/conformance/results/pyre/literals_interactions.toml index fd34d1f4..eabf31e3 100644 --- a/conformance/results/pyre/literals_interactions.toml +++ b/conformance/results/pyre/literals_interactions.toml @@ -6,9 +6,6 @@ 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: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. """ conformance_automated = "Fail" errors_diff = """ @@ -16,7 +13,4 @@ Line 15: Expected 1 errors Line 16: Expected 1 errors Line 17: Expected 1 errors Line 18: Expected 1 errors -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 d9248118..27cfa146 100644 --- a/conformance/results/pyre/literals_literalstring.toml +++ b/conformance/results/pyre/literals_literalstring.toml @@ -3,19 +3,16 @@ 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']`. -literals_literalstring.py:120:21 Incompatible parameter type [6]: In call `literal_identity`, for 1st positional argument, expected `Variable[TLiteral (bound to typing_extensions.LiteralString)]` but got `str`. -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 = "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`.'] +Line 36: Expected 1 errors +Line 37: Expected 1 errors +Line 43: Expected 1 errors +Line 66: Expected 1 errors +Line 74: Expected 1 errors +Line 75: Expected 1 errors +Line 120: Expected 1 errors +Line 134: Expected 1 errors +Line 171: Expected 1 errors """ diff --git a/conformance/results/pyre/literals_parameterizations.toml b/conformance/results/pyre/literals_parameterizations.toml index 6dc0a522..3e6bd453 100644 --- a/conformance/results/pyre/literals_parameterizations.toml +++ b/conformance/results/pyre/literals_parameterizations.toml @@ -6,32 +6,24 @@ Does not reject tuple in Literal type expression. Does not reject "bare" Literal in type expression. """ output = """ -literals_parameterizations.py:33:0 Invalid type [31]: Expression `AppendMode` is not a literal value. -literals_parameterizations.py:33:0 Invalid type [31]: Expression `ReadOnlyMode` is not a literal value. -literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteAndTruncateMode` is not a literal value. -literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteNoTruncateMode` is not a literal value. -literals_parameterizations.py:33:0 Undefined or invalid type [11]: Annotation `` is not defined as a type. -literals_parameterizations.py:35:8 Invalid type [31]: Expression `typing.Literal[(typing.Literal[(typing.Literal[(1, 2, 3)], "foo")], 5, None)]` is not a valid type. -literals_parameterizations.py:41:6 Invalid type [31]: Expression `typing.Literal[3 + 4]` is not a valid type. -literals_parameterizations.py:42:6 Invalid type [31]: Expression `typing.Literal["foo".replace("o", "b")]` is not a valid type. -literals_parameterizations.py:43:6 Invalid type [31]: Expression `typing.Literal[4 + 3.000000j]` is not a valid type. -literals_parameterizations.py:44:6 Invalid type [31]: Expression `typing.Literal[~ 5]` is not a valid type. -literals_parameterizations.py:45:6 Invalid type [31]: Expression `typing.Literal[not False]` is not a valid type. -literals_parameterizations.py:47:6 Invalid type [31]: Expression `typing.Literal[{ "a":"b","c":"d" }]` is not a valid type. -literals_parameterizations.py:48:6 Invalid type [31]: Expression `typing.Literal[int]` is not a valid type. -literals_parameterizations.py:49:6 Invalid type [31]: Expression `variable` is not a literal value. -literals_parameterizations.py:50:7 Invalid type [31]: Expression `T` is not a literal value. -literals_parameterizations.py:51:7 Invalid type [31]: Expression `typing.Literal[3.140000]` is not a valid type. -literals_parameterizations.py:52:7 Invalid type [31]: Expression `Any` is not a literal value. -literals_parameterizations.py:53:7 Invalid type [31]: Expression `typing.Literal[...]` is not a valid type. -literals_parameterizations.py:56:19 Invalid type [31]: Expression `typing.Literal[1 + 2]` is not a valid type. -literals_parameterizations.py:61:3 Invalid type [31]: Expression `my_function` is not a literal value. -literals_parameterizations.py:65:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.Literal['Color.RED']` but is used as type `typing_extensions.Literal[Color.RED]`. """ conformance_automated = "Fail" errors_diff = """ +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 44: Expected 1 errors +Line 45: Expected 1 errors Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 48: Expected 1 errors +Line 49: Expected 1 errors +Line 50: Expected 1 errors +Line 51: Expected 1 errors +Line 52: Expected 1 errors +Line 53: Expected 1 errors +Line 56: Expected 1 errors Line 60: Expected 1 errors -Line 33: Unexpected errors ['literals_parameterizations.py:33:0 Invalid type [31]: Expression `AppendMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `ReadOnlyMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteAndTruncateMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteNoTruncateMode` is not a literal value.', 'literals_parameterizations.py:33:0 Undefined or invalid type [11]: Annotation `` is not defined as a type.'] -Line 35: Unexpected errors ['literals_parameterizations.py:35:8 Invalid type [31]: Expression `typing.Literal[(typing.Literal[(typing.Literal[(1, 2, 3)], "foo")], 5, None)]` is not a valid type.'] +Line 61: Expected 1 errors +Line 65: Expected 1 errors """ diff --git a/conformance/results/pyre/literals_semantics.toml b/conformance/results/pyre/literals_semantics.toml index b2d2d151..1e7ee183 100644 --- a/conformance/results/pyre/literals_semantics.toml +++ b/conformance/results/pyre/literals_semantics.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ -literals_semantics.py:10:0 Incompatible variable type [9]: v2 is declared to have type `typing_extensions.Literal[3]` but is used as type `typing_extensions.Literal[4]`. -literals_semantics.py:24:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.Literal[False]` but is used as type `typing_extensions.Literal[0]`. -literals_semantics.py:25:4 Incompatible variable type [9]: x2 is declared to have type `typing_extensions.Literal[0]` but is used as type `typing_extensions.Literal[False]`. -literals_semantics.py:33:4 Incompatible variable type [9]: a is declared to have type `Union[typing_extensions.Literal[3], typing_extensions.Literal[4], typing_extensions.Literal[5]]` but is used as type `int`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 10: Expected 1 errors +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 33: Expected 1 errors """ diff --git a/conformance/results/pyre/namedtuples_define_class.toml b/conformance/results/pyre/namedtuples_define_class.toml index 49225bc7..9169ea7b 100644 --- a/conformance/results/pyre/namedtuples_define_class.toml +++ b/conformance/results/pyre/namedtuples_define_class.toml @@ -8,39 +8,19 @@ 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: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`. -namedtuples_define_class.py:47:17 Incompatible parameter type [6]: In call `Point.__init__`, for argument `units`, expected `str` but got `int`. -namedtuples_define_class.py:48:5 Too many arguments [19]: Call `Point.__init__` expects 3 positional arguments, 4 were provided. -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" errors_diff = """ Line 32: Expected 1 errors Line 33: 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 49: Expected 1 errors Line 59: Expected 1 errors +Line 79: Expected 1 errors +Line 98: Expected 1 errors Line 105: Expected 1 errors -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 ac10f8e5..a40236c5 100644 --- a/conformance/results/pyre/namedtuples_define_functional.toml +++ b/conformance/results/pyre/namedtuples_define_functional.toml @@ -5,33 +5,16 @@ Does not handle defined fields correctly when extra flags like `rename` or `defa Does not support defaults in functional form. """ output = """ -namedtuples_define_functional.py:16:7 Missing argument [20]: Call `Point1.__init__` expects argument `y`. -namedtuples_define_functional.py:21:7 Missing argument [20]: Call `Point2.__init__` expects argument `x`. -namedtuples_define_functional.py:26:7 Too many arguments [19]: Call `Point3.__init__` expects 2 positional arguments, 3 were provided. -namedtuples_define_functional.py:31:7 Unexpected keyword [28]: Unexpected keyword argument `z` to call `Point4.__init__`. -namedtuples_define_functional.py:36:17 Incompatible parameter type [6]: In call `Point5.__init__`, for 2nd positional argument, expected `int` but got `str`. -namedtuples_define_functional.py:37:7 Too many arguments [19]: Call `Point5.__init__` expects 2 positional arguments, 3 were provided. -namedtuples_define_functional.py:42:17 Incompatible parameter type [6]: In call `Point6.__init__`, for 2nd positional argument, expected `int` but got `str`. -namedtuples_define_functional.py:43:14 Incompatible parameter type [6]: In call `Point6.__init__`, for argument `x`, expected `int` but got `float`. -namedtuples_define_functional.py:52:0 Duplicate parameter [65]: Duplicate parameter name `a`. -namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `False` is not a valid type. -namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `False` is not a valid type. -namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `typing.Final[False]` is not a valid type. -namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type. -namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type. -namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `typing.Final[True]` is not a valid type. -namedtuples_define_functional.py:57:0 Unexpected keyword [28]: Unexpected keyword argument `abc` to call `NT4.__init__`. -namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type. -namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type. -namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type. -namedtuples_define_functional.py:63:42 Invalid type parameters [24]: Generic type `typing.Final` expects 1 type parameter, received 2. -namedtuples_define_functional.py:65:0 Too many arguments [19]: Call `NT5.__init__` expects 1 positional argument, 3 were provided. -namedtuples_define_functional.py:66:0 Missing argument [20]: Call `NT5.__init__` expects argument `defaults`. """ conformance_automated = "Fail" errors_diff = """ -Line 56: Unexpected errors ['namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type.', 'namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type.', 'namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `typing.Final[True]` is not a valid type.'] -Line 57: Unexpected errors ['namedtuples_define_functional.py:57:0 Unexpected keyword [28]: Unexpected keyword argument `abc` to call `NT4.__init__`.'] -Line 63: Unexpected errors ['namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type parameters [24]: Generic type `typing.Final` expects 1 type parameter, received 2.'] -Line 65: Unexpected errors ['namedtuples_define_functional.py:65:0 Too many arguments [19]: Call `NT5.__init__` expects 1 positional argument, 3 were provided.'] +Line 16: Expected 1 errors +Line 21: Expected 1 errors +Line 26: Expected 1 errors +Line 31: Expected 1 errors +Line 36: Expected 1 errors +Line 37: Expected 1 errors +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 66: Expected 1 errors """ diff --git a/conformance/results/pyre/namedtuples_type_compat.toml b/conformance/results/pyre/namedtuples_type_compat.toml index 76f3303c..b1f8fe73 100644 --- a/conformance/results/pyre/namedtuples_type_compat.toml +++ b/conformance/results/pyre/namedtuples_type_compat.toml @@ -3,15 +3,9 @@ notes = """ Rejects valid type compatibility between named tuple and tuple. """ output = """ -namedtuples_type_compat.py:20:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. -namedtuples_type_compat.py:21:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. -namedtuples_type_compat.py:22:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. -namedtuples_type_compat.py:23:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. -namedtuples_type_compat.py:27:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. """ conformance_automated = "Fail" errors_diff = """ -Line 20: Unexpected errors ['namedtuples_type_compat.py:20:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple.'] -Line 21: Unexpected errors ['namedtuples_type_compat.py:21:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple.'] -Line 27: Unexpected errors ['namedtuples_type_compat.py:27:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple.'] +Line 22: Expected 1 errors +Line 23: Expected 1 errors """ diff --git a/conformance/results/pyre/namedtuples_usage.toml b/conformance/results/pyre/namedtuples_usage.toml index a9956c36..bd0e145a 100644 --- a/conformance/results/pyre/namedtuples_usage.toml +++ b/conformance/results/pyre/namedtuples_usage.toml @@ -7,29 +7,15 @@ 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. -namedtuples_usage.py:53:0 Unable to unpack [23]: Unable to unpack 3 values, 4 were expected. -namedtuples_usage.py:61:0 Unable to unpack [23]: Unable to unpack 0 values, 3 were expected. """ conformance_automated = "Fail" errors_diff = """ Line 34: Expected 1 errors Line 35: Expected 1 errors +Line 40: Expected 1 errors +Line 41: 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.'] +Line 52: Expected 1 errors +Line 53: Expected 1 errors """ diff --git a/conformance/results/pyre/narrowing_typeguard.toml b/conformance/results/pyre/narrowing_typeguard.toml index 7bf7ead7..a0640951 100644 --- a/conformance/results/pyre/narrowing_typeguard.toml +++ b/conformance/results/pyre/narrowing_typeguard.toml @@ -3,13 +3,11 @@ notes = """ Does not reject TypeGuard method with too few parameters. """ output = """ -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]]`. """ conformance_automated = "Fail" errors_diff = """ Line 102: Expected 1 errors Line 107: Expected 1 errors -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]]`.'] +Line 128: Expected 1 errors +Line 148: Expected 1 errors """ diff --git a/conformance/results/pyre/narrowing_typeis.toml b/conformance/results/pyre/narrowing_typeis.toml index 2746dc5f..a2ba4fe8 100644 --- a/conformance/results/pyre/narrowing_typeis.toml +++ b/conformance/results/pyre/narrowing_typeis.toml @@ -1,17 +1,5 @@ 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: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 = """ @@ -24,16 +12,4 @@ Line 170: Expected 1 errors Line 191: Expected 1 errors 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: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/overloads_basic.toml b/conformance/results/pyre/overloads_basic.toml index 7de070af..9eb8ad76 100644 --- a/conformance/results/pyre/overloads_basic.toml +++ b/conformance/results/pyre/overloads_basic.toml @@ -3,10 +3,10 @@ notes = """ Does not reject a function with a single @overload signature. """ output = """ -overloads_basic.py:37:2 Incompatible parameter type [6]: In call `Bytes.__getitem__`, for 1st positional argument, expected `int` but got `str`. -overloads_basic.py:75:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation. """ conformance_automated = "Fail" errors_diff = """ +Line 37: Expected 1 errors Lines 62, 63: Expected error (tag 'func1') +Lines 74, 75: Expected error (tag 'func2') """ diff --git a/conformance/results/pyre/protocols_class_objects.toml b/conformance/results/pyre/protocols_class_objects.toml index 9a640450..500a6f9f 100644 --- a/conformance/results/pyre/protocols_class_objects.toml +++ b/conformance/results/pyre/protocols_class_objects.toml @@ -5,17 +5,15 @@ Incorrectly reports some class objects as incompatible with a protocol. Fails to report some class objects as incompatible with a protocol. """ output = """ -protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`. -protocols_class_objects.py:58:0 Incompatible variable type [9]: pa1 is declared to have type `ProtoA1` but is used as type `Type[ConcreteA]`. """ conformance_automated = "Fail" errors_diff = """ Line 29: Expected 1 errors Line 34: Expected 1 errors +Line 58: Expected 1 errors Line 74: Expected 1 errors Line 104: Expected 1 errors Line 106: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 26: Unexpected errors ['protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`.'] """ diff --git a/conformance/results/pyre/protocols_definition.toml b/conformance/results/pyre/protocols_definition.toml index 10231997..659f73de 100644 --- a/conformance/results/pyre/protocols_definition.toml +++ b/conformance/results/pyre/protocols_definition.toml @@ -8,27 +8,27 @@ Does not reject immutable named tuple attribute in concrete class when protocol Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable. """ output = """ -protocols_definition.py:30:10 Incompatible parameter type [6]: In call `close_all`, for 1st positional argument, expected `Iterable[SupportsClose]` but got `Iterable[int]`. -protocols_definition.py:67:8 Undefined attribute [16]: `Template` has no attribute `temp`. -protocols_definition.py:114:0 Incompatible variable type [9]: v2_bad1 is declared to have type `Template2` but is used as type `Concrete2_Bad1`. -protocols_definition.py:115:0 Incompatible variable type [9]: v2_bad2 is declared to have type `Template2` but is used as type `Concrete2_Bad2`. -protocols_definition.py:156:0 Incompatible variable type [9]: v3_bad1 is declared to have type `Template3` but is used as type `Concrete3_Bad1`. -protocols_definition.py:159:0 Incompatible variable type [9]: v3_bad4 is declared to have type `Template3` but is used as type `Concrete3_Bad4`. -protocols_definition.py:218:0 Incompatible variable type [9]: v4_bad1 is declared to have type `Template4` but is used as type `Concrete4_Bad1`. -protocols_definition.py:219:0 Incompatible variable type [9]: v4_bad2 is declared to have type `Template4` but is used as type `Concrete4_Bad2`. -protocols_definition.py:285:0 Incompatible variable type [9]: v5_bad1 is declared to have type `Template5` but is used as type `Concrete5_Bad1`. -protocols_definition.py:286:0 Incompatible variable type [9]: v5_bad2 is declared to have type `Template5` but is used as type `Concrete5_Bad2`. -protocols_definition.py:287:0 Incompatible variable type [9]: v5_bad3 is declared to have type `Template5` but is used as type `Concrete5_Bad3`. -protocols_definition.py:288:0 Incompatible variable type [9]: v5_bad4 is declared to have type `Template5` but is used as type `Concrete5_Bad4`. -protocols_definition.py:289:0 Incompatible variable type [9]: v5_bad5 is declared to have type `Template5` but is used as type `Concrete5_Bad5`. """ conformance_automated = "Fail" errors_diff = """ +Line 30: Expected 1 errors +Line 67: Expected 1 errors +Line 114: Expected 1 errors +Line 115: Expected 1 errors Line 116: Expected 1 errors Line 117: Expected 1 errors +Line 156: Expected 1 errors Line 157: Expected 1 errors Line 158: Expected 1 errors +Line 159: Expected 1 errors Line 160: Expected 1 errors +Line 218: Expected 1 errors +Line 219: Expected 1 errors +Line 285: Expected 1 errors +Line 286: Expected 1 errors +Line 287: Expected 1 errors +Line 288: Expected 1 errors +Line 289: Expected 1 errors Line 339: Expected 1 errors Line 340: Expected 1 errors Line 341: Expected 1 errors diff --git a/conformance/results/pyre/protocols_explicit.toml b/conformance/results/pyre/protocols_explicit.toml index 0e7d70ef..54ad5894 100644 --- a/conformance/results/pyre/protocols_explicit.toml +++ b/conformance/results/pyre/protocols_explicit.toml @@ -4,14 +4,14 @@ Does not report error when calling unimplemented protocol method from derived cl Does not report error when method is not implemented in derived class. """ output = """ -protocols_explicit.py:60:4 Invalid class instantiation [45]: Cannot instantiate abstract class `Point` with abstract method `intensity`. -protocols_explicit.py:165:6 Invalid class instantiation [45]: Cannot instantiate abstract class `Concrete7A` with abstract method `method1`. """ conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors Line 56: Expected 1 errors +Line 60: Expected 1 errors Line 90: Expected 1 errors Line 110: Expected 1 errors Line 135: Expected 1 errors +Line 165: Expected 1 errors """ diff --git a/conformance/results/pyre/protocols_generic.toml b/conformance/results/pyre/protocols_generic.toml index f1370fa7..19c75eb7 100644 --- a/conformance/results/pyre/protocols_generic.toml +++ b/conformance/results/pyre/protocols_generic.toml @@ -4,15 +4,15 @@ Does not reject the use of Protocol and Generic together as base classes. Does not detect protocol mismatch when method-scoped TypeVar is used in protocol. """ output = """ -protocols_generic.py:40:0 Incompatible variable type [9]: p2 is declared to have type `Proto1[int, str]` but is used as type `Concrete1`. -protocols_generic.py:56:4 Incompatible variable type [9]: v2 is declared to have type `Box[int]` but is used as type `Box[float]`. -protocols_generic.py:66:4 Incompatible variable type [9]: v2 is declared to have type `Sender[float]` but is used as type `Sender[int]`. -protocols_generic.py:74:4 Incompatible variable type [9]: v1 is declared to have type `AttrProto[float]` but is used as type `AttrProto[int]`. -protocols_generic.py:75:4 Incompatible variable type [9]: v2 is declared to have type `AttrProto[int]` but is used as type `AttrProto[float]`. -protocols_generic.py:146:0 Incompatible variable type [9]: hp3 is declared to have type `HasPropertyProto` but is used as type `ConcreteHasProperty3`. """ conformance_automated = "Fail" errors_diff = """ +Line 40: Expected 1 errors Line 44: Expected 1 errors +Line 56: Expected 1 errors +Line 66: Expected 1 errors +Line 74: Expected 1 errors +Line 75: Expected 1 errors +Line 146: Expected 1 errors Line 147: Expected 1 errors """ diff --git a/conformance/results/pyre/protocols_merging.toml b/conformance/results/pyre/protocols_merging.toml index c471755f..8bcbb9c4 100644 --- a/conformance/results/pyre/protocols_merging.toml +++ b/conformance/results/pyre/protocols_merging.toml @@ -3,13 +3,13 @@ notes = """ Does not reject a protocol class that derives from a non-protocol class. """ output = """ -protocols_merging.py:52:0 Incompatible variable type [9]: s6 is declared to have type `SizedAndClosable1` but is used as type `SCConcrete2`. -protocols_merging.py:53:0 Incompatible variable type [9]: s7 is declared to have type `SizedAndClosable2` but is used as type `SCConcrete2`. -protocols_merging.py:54:0 Incompatible variable type [9]: s8 is declared to have type `SizedAndClosable3` but is used as type `SCConcrete2`. -protocols_merging.py:82:4 Invalid class instantiation [45]: Cannot instantiate abstract class `SizedAndClosable4` with abstract method `close`. -protocols_merging.py:83:0 Incompatible variable type [9]: y is declared to have type `SizedAndClosable4` but is used as type `SCConcrete1`. """ conformance_automated = "Fail" errors_diff = """ +Line 52: Expected 1 errors +Line 53: Expected 1 errors +Line 54: Expected 1 errors Line 67: Expected 1 errors +Line 82: Expected 1 errors +Line 83: Expected 1 errors """ diff --git a/conformance/results/pyre/protocols_subtyping.toml b/conformance/results/pyre/protocols_subtyping.toml index 1c8c18fc..8abfa6ee 100644 --- a/conformance/results/pyre/protocols_subtyping.toml +++ b/conformance/results/pyre/protocols_subtyping.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ -protocols_subtyping.py:16:5 Invalid class instantiation [45]: Cannot instantiate protocol `Proto1`. -protocols_subtyping.py:38:4 Incompatible variable type [9]: v2 is declared to have type `Concrete2` but is used as type `Proto2`. -protocols_subtyping.py:55:4 Incompatible variable type [9]: v2 is declared to have type `Proto3` but is used as type `Proto2`. -protocols_subtyping.py:79:4 Incompatible variable type [9]: v3 is declared to have type `Proto4[int, float]` but is used as type `Proto5[int]`. -protocols_subtyping.py:80:4 Incompatible variable type [9]: v4 is declared to have type `Proto5[float]` but is used as type `Proto4[int, int]`. -protocols_subtyping.py:102:4 Incompatible variable type [9]: v4 is declared to have type `Proto7[int, float]` but is used as type `Proto6[float, float]`. -protocols_subtyping.py:103:4 Incompatible variable type [9]: v5 is declared to have type `Proto7[float, object]` but is used as type `Proto6[float, float]`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 16: Expected 1 errors +Line 38: Expected 1 errors +Line 55: Expected 1 errors +Line 79: Expected 1 errors +Line 80: Expected 1 errors +Line 102: Expected 1 errors +Line 103: Expected 1 errors """ diff --git a/conformance/results/pyre/protocols_variance.toml b/conformance/results/pyre/protocols_variance.toml index 5577f252..0417da5b 100644 --- a/conformance/results/pyre/protocols_variance.toml +++ b/conformance/results/pyre/protocols_variance.toml @@ -3,8 +3,6 @@ notes = """ Does not detect incorrect TypeVar variance within generic protocols. """ output = """ -protocols_variance.py:62:17 Invalid type variance [46]: The type variable `Variable[T1_co](covariant)` is covariant and cannot be a parameter type. -protocols_variance.py:72:4 Invalid type variance [46]: The type variable `Variable[T1_contra](contravariant)` is contravariant and cannot be a return type. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pyre/qualifiers_annotated.toml b/conformance/results/pyre/qualifiers_annotated.toml index 2c9bc289..c571c185 100644 --- a/conformance/results/pyre/qualifiers_annotated.toml +++ b/conformance/results/pyre/qualifiers_annotated.toml @@ -4,31 +4,27 @@ Does not reject Annotated with a single parameter. Does not reject call of Annotated with no type arguments. """ output = """ -qualifiers_annotated.py:43:6 Undefined or invalid type [11]: Annotation `` is not defined as a type. -qualifiers_annotated.py:44:6 Invalid type [31]: Expression `typing.Annotated[(((int, str)), "")]` is not a valid type. -qualifiers_annotated.py:45:6 Invalid type [31]: Expression `typing.Annotated[(comprehension(int for generators(generator(i in range(1) if ))), "")]` is not a valid type. -qualifiers_annotated.py:46:6 Invalid type [31]: Expression `typing.Annotated[({ "a":"b" }, "")]` is not a valid type. -qualifiers_annotated.py:47:6 Invalid type [31]: Expression `typing.Annotated[(lambda () (int)(), "")]` is not a valid type. -qualifiers_annotated.py:48:6 Invalid type [31]: Expression `typing.Annotated[([int][0], "")]` is not a valid type. -qualifiers_annotated.py:49:6 Invalid type [31]: Expression `typing.Annotated[(int if 1 < 3 else str, "")]` is not a valid type. -qualifiers_annotated.py:50:16 Unbound name [10]: Name `var1` is used but not defined in the current scope. -qualifiers_annotated.py:51:6 Invalid type [31]: Expression `typing.Annotated[(True, "")]` is not a valid type. -qualifiers_annotated.py:52:7 Invalid type [31]: Expression `typing.Annotated[(1, "")]` is not a valid type. -qualifiers_annotated.py:53:7 Invalid type [31]: Expression `typing.Annotated[(list or set, "")]` is not a valid type. -qualifiers_annotated.py:54:7 Invalid type [31]: Expression `typing.Annotated[(f"{"int"}", "")]` is not a valid type. -qualifiers_annotated.py:76:33 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:77:0 Incompatible variable type [9]: not_type2 is declared to have type `Type[typing.Any]` but is used as type `TypeAlias`. -qualifiers_annotated.py:84:16 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[str], str]`. Expected has length 0, but actual has length 2. -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 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 49: Expected 1 errors +Line 50: Expected 1 errors +Line 51: Expected 1 errors +Line 52: Expected 1 errors +Line 53: Expected 1 errors +Line 54: Expected 1 errors Line 64: Expected 1 errors +Line 76: Expected 1 errors +Line 77: Expected 1 errors +Line 84: Expected 1 errors +Line 85: 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`.'] +Line 92: Expected 1 errors +Line 93: Expected 1 errors """ diff --git a/conformance/results/pyre/qualifiers_final_annotation.toml b/conformance/results/pyre/qualifiers_final_annotation.toml index 1e7cb4c6..f5482dd1 100644 --- a/conformance/results/pyre/qualifiers_final_annotation.toml +++ b/conformance/results/pyre/qualifiers_final_annotation.toml @@ -5,33 +5,31 @@ Does not report error for invalid nesting of Final and ClassVar. Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition. """ output = """ -qualifiers_final_annotation.py:18:6 Invalid type parameters [24]: Generic type `Final` expects 1 type parameter, received 2. -qualifiers_final_annotation.py:34:4 Invalid assignment [41]: Cannot reassign final attribute `ClassA.ID2`. -qualifiers_final_annotation.py:38:4 Uninitialized attribute [13]: Attribute `ID3` is declared in class `ClassA` to have type `int` but is never initialized. -qualifiers_final_annotation.py:54:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID5`. -qualifiers_final_annotation.py:62:8 Undefined attribute [16]: `ClassA` has no attribute `id3`. -qualifiers_final_annotation.py:63:8 Undefined attribute [16]: `ClassA` has no attribute `id4`. -qualifiers_final_annotation.py:65:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID7`. -qualifiers_final_annotation.py:67:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID7`. -qualifiers_final_annotation.py:71:0 Invalid assignment [41]: Cannot reassign final attribute `RATE`. -qualifiers_final_annotation.py:81:0 Invalid assignment [41]: Cannot reassign final attribute `ClassB.DEFAULT_ID`. -qualifiers_final_annotation.py:94:4 Invalid assignment [41]: Cannot reassign final attribute `BORDER_WIDTH`. -qualifiers_final_annotation.py:118:0 Invalid type [31]: Expression `typing.List[Final[int]]` is not a valid type. Final cannot be nested. -qualifiers_final_annotation.py:121:10 Invalid type [31]: Parameter `x` cannot be annotated with Final. -qualifiers_final_annotation.py:133:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`. -qualifiers_final_annotation.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `a` to call `N.__init__`. -qualifiers_final_annotation.py:135:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`. -qualifiers_final_annotation.py:141:4 Invalid assignment [41]: Cannot reassign final attribute `ID1`. -qualifiers_final_annotation.py:145:4 Invalid assignment [41]: Cannot reassign final attribute `x`. -qualifiers_final_annotation.py:147:9 Invalid assignment [41]: Cannot reassign final attribute `x`. -qualifiers_final_annotation.py:149:8 Invalid assignment [41]: Cannot reassign final attribute `x`. -qualifiers_final_annotation.py:152:29 Invalid assignment [41]: Cannot reassign final attribute `x`. -qualifiers_final_annotation.py:155:8 Invalid assignment [41]: Cannot reassign final attribute `x`. """ conformance_automated = "Fail" errors_diff = """ Line 16: Expected 1 errors +Line 18: Expected 1 errors +Line 34: Expected 1 errors +Line 38: Expected 1 errors +Line 54: Expected 1 errors +Line 62: Expected 1 errors +Line 63: Expected 1 errors +Line 65: Expected 1 errors +Line 67: Expected 1 errors +Line 71: Expected 1 errors +Line 81: Expected 1 errors +Line 94: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 133: Unexpected errors ['qualifiers_final_annotation.py:133:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`.'] +Line 118: Expected 1 errors +Line 121: Expected 1 errors +Line 134: Expected 1 errors +Line 135: Expected 1 errors +Line 141: Expected 1 errors +Line 145: Expected 1 errors +Line 147: Expected 1 errors +Line 149: Expected 1 errors +Line 152: Expected 1 errors +Line 155: Expected 1 errors """ diff --git a/conformance/results/pyre/qualifiers_final_decorator.toml b/conformance/results/pyre/qualifiers_final_decorator.toml index ef5be734..9613895b 100644 --- a/conformance/results/pyre/qualifiers_final_decorator.toml +++ b/conformance/results/pyre/qualifiers_final_decorator.toml @@ -5,20 +5,17 @@ Does not report error for overloaded @final method defined in stub file. Reports misleading error when overload is marked @final but implementation is not. """ output = """ -qualifiers_final_decorator.py:21:0 Invalid inheritance [39]: Cannot inherit from final class `Base1`. -qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -qualifiers_final_decorator.py:56:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method1` cannot override final method defined in `Base2`. -qualifiers_final_decorator.py:60:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method2` cannot override final method defined in `Base2`. -qualifiers_final_decorator.py:64:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method3` cannot override final method defined in `Base2`. -qualifiers_final_decorator.py:75:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method4` cannot override final method defined in `Base2`. -qualifiers_final_decorator.py:86:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). -qualifiers_final_decorator.py:118:4 Inconsistent override [14]: `qualifiers_final_decorator.Derived5.method` overrides method defined in `Base5_2` inconsistently. Could not find parameter `v` in overriding signature. -qualifiers_final_decorator.py:118:4 Invalid override [40]: `qualifiers_final_decorator.Derived5.method` cannot override final method defined in `Base5_2`. -qualifiers_final_decorator.py:126:0 Invalid inheritance [39]: `final` cannot be used with non-method functions. """ conformance_automated = "Fail" errors_diff = """ +Line 21: Expected 1 errors +Line 56: Expected 1 errors +Line 118: Expected 1 errors +Lines 59, 60: Expected error (tag 'method2') +Lines 63, 64: Expected error (tag 'method3') +Lines 67, 75: Expected error (tag 'method4') Lines 80, 89: Expected error (tag 'Derived3') +Lines 84, 85, 86: Expected error (tag 'Derived3-2') Lines 94, 102: Expected error (tag 'Derived4') -Line 51: Unexpected errors ['qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Lines 125, 126: Expected error (tag 'func') """ diff --git a/conformance/results/pyre/specialtypes_any.toml b/conformance/results/pyre/specialtypes_any.toml index b3b83dde..427d91c6 100644 --- a/conformance/results/pyre/specialtypes_any.toml +++ b/conformance/results/pyre/specialtypes_any.toml @@ -3,13 +3,7 @@ notes = """ Does not support Any as a base class. """ output = """ -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" +conformance_automated = "Pass" errors_diff = """ -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_never.toml b/conformance/results/pyre/specialtypes_never.toml index d65de23e..0c1a6a09 100644 --- a/conformance/results/pyre/specialtypes_never.toml +++ b/conformance/results/pyre/specialtypes_never.toml @@ -3,22 +3,10 @@ notes = """ Does not treat Never as compatible with all other types. """ output = """ -specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`. -specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`. -specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`. -specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`. -specialtypes_never.py:86:4 Incompatible variable type [9]: v3 is declared to have type `List[int]` but is used as type `List[Never]`. -specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`. -specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`. -specialtypes_never.py:105:4 Incompatible return type [7]: Expected `ClassC[Variable[U]]` but got `ClassC[Never]`. """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors -Line 21: Unexpected errors ['specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`.'] -Line 68: Unexpected errors ['specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`.'] -Line 69: Unexpected errors ['specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`.'] -Line 70: Unexpected errors ['specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`.'] -Line 87: Unexpected errors ['specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`.'] -Line 96: Unexpected errors ['specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`.'] +Line 86: Expected 1 errors +Line 105: Expected 1 errors """ diff --git a/conformance/results/pyre/specialtypes_none.toml b/conformance/results/pyre/specialtypes_none.toml index a9c3b091..2dc7005d 100644 --- a/conformance/results/pyre/specialtypes_none.toml +++ b/conformance/results/pyre/specialtypes_none.toml @@ -1,9 +1,9 @@ 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:41:6 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `Type[None]` but got `None`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 21: Expected 1 errors +Line 27: Expected 1 errors +Line 41: Expected 1 errors """ diff --git a/conformance/results/pyre/specialtypes_type.toml b/conformance/results/pyre/specialtypes_type.toml index 78343fa2..d85d614a 100644 --- a/conformance/results/pyre/specialtypes_type.toml +++ b/conformance/results/pyre/specialtypes_type.toml @@ -7,20 +7,16 @@ Does not reject access to unknown attributes from object of type `Type[object]`. 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:117:4 Undefined attribute [16]: `object` has no attribute `unknown`. -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]`. """ conformance_automated = "Fail" errors_diff = """ +Line 56: Expected 1 errors Line 70: Expected 1 errors +Line 76: Expected 1 errors +Line 117: Expected 1 errors Line 120: Expected 1 errors +Line 143: Expected 1 errors Line 144: Expected 1 errors Line 145: Expected 1 errors Line 146: Expected 1 errors -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 3d3a3578..ac928139 100644 --- a/conformance/results/pyre/tuples_type_compat.toml +++ b/conformance/results/pyre/tuples_type_compat.toml @@ -6,92 +6,23 @@ Does not support tuple narrowing based on `len()` type guard (optional). Does not correctly evaluate `Sequence[Never]` for `tuple[()]`. """ output = """ -tuples_type_compat.py:15:4 Incompatible variable type [9]: v2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[float, complex]`. -tuples_type_compat.py:22:30 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type. -tuples_type_compat.py:27:8 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type. -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: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: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: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]`. -tuples_type_compat.py:146:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type. -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['']]`. -tuples_type_compat.py:148: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[''], typing_extensions.Literal['']]`. -tuples_type_compat.py:149: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[1], typing_extensions.Literal['']]`. -tuples_type_compat.py:150: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[''], typing_extensions.Literal[1]]`. -tuples_type_compat.py:153:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[int, unknown, int]` but is used as type `Tuple[int, int]`. -tuples_type_compat.py:153:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)], int)]` is not a valid type. -tuples_type_compat.py:154:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[2]]`. -tuples_type_compat.py:155:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[2]]`. -tuples_type_compat.py:156:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal['']]`. -tuples_type_compat.py:157:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[''], float]`. -tuples_type_compat.py:159:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[unknown, int]` but is used as type `Tuple[int]`. -tuples_type_compat.py:159:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], int)]` is not a valid type. -tuples_type_compat.py:160:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[1]]`. -tuples_type_compat.py:161:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[1]]`. -tuples_type_compat.py:162:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[1]]`. -tuples_type_compat.py:163:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[''], float]`. -tuples_type_compat.py:167:4 Incompatible variable type [9]: t1 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:167:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(int, ...)])]` is not a valid type. -tuples_type_compat.py:168:4 Incompatible variable type [9]: t2 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:168:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[int])]` is not a valid type. -tuples_type_compat.py:169:8 Invalid type [31]: Expression `tuple[(str, *tuple[(str, ...)])]` is not a valid type. -tuples_type_compat.py:170:4 Incompatible variable type [9]: t4 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:170:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(str, ...)])]` is not a valid type. -tuples_type_compat.py:171:4 Incompatible variable type [9]: t5 is declared to have type `Tuple[str, str, str, unknown]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:171:8 Invalid type [31]: Expression `tuple[(str, str, str, *tuple[(str, ...)])]` is not a valid type. -tuples_type_compat.py:172:4 Incompatible variable type [9]: t6 is declared to have type `Tuple[str, unknown, str]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:172:8 Invalid type [31]: Expression `tuple[(str, *tuple[(int, ...)], str)]` is not a valid type. -tuples_type_compat.py:173:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type. -tuples_type_compat.py:174:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type. -tuples_type_compat.py:175:4 Incompatible variable type [9]: t9 is declared to have type `Tuple[unknown, str, str, str]` but is used as type `Tuple[str, str]`. -tuples_type_compat.py:175:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str, str, str)]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ +Line 15: Expected 1 errors Line 29: Expected 1 errors Line 32: Expected 1 errors Line 33: Expected 1 errors Line 43: Expected 1 errors Line 62: Expected 1 errors -Line 22: Unexpected errors ['tuples_type_compat.py:22:30 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type.'] -Line 27: Unexpected errors ['tuples_type_compat.py:27:8 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type.'] -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 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 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 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['']]`."] -Line 148: Unexpected errors ["tuples_type_compat.py:148: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[''], typing_extensions.Literal['']]`."] -Line 153: Unexpected errors ['tuples_type_compat.py:153:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[int, unknown, int]` but is used as type `Tuple[int, int]`.', 'tuples_type_compat.py:153:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)], int)]` is not a valid type.'] -Line 154: Unexpected errors ["tuples_type_compat.py:154:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[2]]`."] -Line 155: Unexpected errors ["tuples_type_compat.py:155:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[2]]`."] -Line 159: Unexpected errors ['tuples_type_compat.py:159:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[unknown, int]` but is used as type `Tuple[int]`.', 'tuples_type_compat.py:159:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], int)]` is not a valid type.'] -Line 160: Unexpected errors ["tuples_type_compat.py:160:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[1]]`."] -Line 161: Unexpected errors ["tuples_type_compat.py:161:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[1]]`."] -Line 167: Unexpected errors ['tuples_type_compat.py:167:4 Incompatible variable type [9]: t1 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`.', 'tuples_type_compat.py:167:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(int, ...)])]` is not a valid type.'] -Line 169: Unexpected errors ['tuples_type_compat.py:169:8 Invalid type [31]: Expression `tuple[(str, *tuple[(str, ...)])]` is not a valid type.'] -Line 170: Unexpected errors ['tuples_type_compat.py:170:4 Incompatible variable type [9]: t4 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`.', 'tuples_type_compat.py:170:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(str, ...)])]` is not a valid type.'] -Line 172: Unexpected errors ['tuples_type_compat.py:172:4 Incompatible variable type [9]: t6 is declared to have type `Tuple[str, unknown, str]` but is used as type `Tuple[str, str]`.', 'tuples_type_compat.py:172:8 Invalid type [31]: Expression `tuple[(str, *tuple[(int, ...)], str)]` is not a valid type.'] -Line 173: Unexpected errors ['tuples_type_compat.py:173:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type.'] -Line 174: Unexpected errors ['tuples_type_compat.py:174:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type.'] +Line 144: Expected 1 errors +Line 149: Expected 1 errors +Line 150: Expected 1 errors +Line 156: Expected 1 errors +Line 157: Expected 1 errors +Line 162: Expected 1 errors +Line 163: Expected 1 errors +Line 168: Expected 1 errors +Line 171: Expected 1 errors +Line 175: Expected 1 errors """ diff --git a/conformance/results/pyre/tuples_type_form.toml b/conformance/results/pyre/tuples_type_form.toml index 750fc795..168ecc90 100644 --- a/conformance/results/pyre/tuples_type_form.toml +++ b/conformance/results/pyre/tuples_type_form.toml @@ -1,17 +1,17 @@ conformant = "Pass" output = """ -tuples_type_form.py:12:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[int]` but is used as type `Tuple[int, int]`. -tuples_type_form.py:14:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[int]`. -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 Invalid type [31]: Expression `tuple[(int, int, ...)]` is not a valid type. -tuples_type_form.py:41:5 Invalid type [31]: Expression `tuple[...]` is not a valid type. -tuples_type_form.py:42:5 Invalid type [31]: Expression `tuple[(..., int)]` is not a valid type. -tuples_type_form.py:43:5 Invalid type [31]: Expression `tuple[(int, ..., int)]` is not a valid 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 = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 12: Expected 1 errors +Line 14: Expected 1 errors +Line 15: Expected 1 errors +Line 25: Expected 1 errors +Line 36: Expected 1 errors +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 44: Expected 1 errors +Line 45: Expected 1 errors """ diff --git a/conformance/results/pyre/tuples_unpacked.toml b/conformance/results/pyre/tuples_unpacked.toml index 9e1dd53b..80e8d683 100644 --- a/conformance/results/pyre/tuples_unpacked.toml +++ b/conformance/results/pyre/tuples_unpacked.toml @@ -3,32 +3,12 @@ notes = """ 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: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:31:4 Invalid type [31]: Expression `tuple[(*tuple[int], *tuple[int])]` is not a valid type. -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. -tuples_unpacked.py:40:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *tuple[(int, ...)])]` is not a valid type. -tuples_unpacked.py:41:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])], *tuple[(int, ...)])]` is not a valid type. -tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. -tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *Ts)]` is not a valid type. -tuples_unpacked.py:51:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *Ts)]` is not a valid 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 16: Unexpected errors ['tuples_unpacked.py:16:13 Invalid type [31]: Expression `tuple[(int, *tuple[(bool, bool)], str)]` is not a valid type.'] -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 31: Unexpected errors ['tuples_unpacked.py:31:4 Invalid type [31]: Expression `tuple[(*tuple[int], *tuple[int])]` is not a valid type.'] -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[(*Ts)]` is not a valid type.'] -Line 50: Unexpected errors ['tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *Ts)]` is not a valid type.'] +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 51: Expected 1 errors +Line 59: Expected 1 errors +Lines 60, 61: Expected error (tag 't14') """ diff --git a/conformance/results/pyre/typeddicts_alt_syntax.toml b/conformance/results/pyre/typeddicts_alt_syntax.toml index c172f19d..cd43a763 100644 --- a/conformance/results/pyre/typeddicts_alt_syntax.toml +++ b/conformance/results/pyre/typeddicts_alt_syntax.toml @@ -4,15 +4,12 @@ Does not report when name of TypedDict doesn't match assigned identifier name. Does not support keyword-argument form of alternative syntax (deprecated in 3.11). """ output = """ -typeddicts_alt_syntax.py:23:16 Call error [29]: `object` is not a function. -typeddicts_alt_syntax.py:41:9 Call error [29]: `object` is not a function. -typeddicts_alt_syntax.py:43:8 Undefined or invalid type [11]: Annotation `Movie2` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ +Line 23: Expected 1 errors Line 27: Expected 1 errors Line 31: Expected 1 errors Line 35: Expected 1 errors Line 45: Expected 1 errors -Line 43: Unexpected errors ['typeddicts_alt_syntax.py:43:8 Undefined or invalid type [11]: Annotation `Movie2` is not defined as a type.'] """ diff --git a/conformance/results/pyre/typeddicts_class_syntax.toml b/conformance/results/pyre/typeddicts_class_syntax.toml index 3bcd1520..d9b364a2 100644 --- a/conformance/results/pyre/typeddicts_class_syntax.toml +++ b/conformance/results/pyre/typeddicts_class_syntax.toml @@ -6,7 +6,6 @@ Does not report when other keyword argument is provided. Does not support generic TypedDict class. """ output = """ -typeddicts_class_syntax.py:59: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]`. """ conformance_automated = "Fail" errors_diff = """ @@ -15,5 +14,4 @@ Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors -Line 59: Unexpected errors ["typeddicts_class_syntax.py:59: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]`."] """ diff --git a/conformance/results/pyre/typeddicts_final.toml b/conformance/results/pyre/typeddicts_final.toml index 49994930..8de33b64 100644 --- a/conformance/results/pyre/typeddicts_final.toml +++ b/conformance/results/pyre/typeddicts_final.toml @@ -3,9 +3,7 @@ notes = """ Does not handle value with literal type as index to TypedDict object. """ output = """ -typeddicts_final.py:26:17 Incompatible parameter type [6]: In call `TypedDictionary.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal['name']` but got `Union[typing_extensions.Literal['name'], typing_extensions.Literal['year']]`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 26: Unexpected errors ["typeddicts_final.py:26:17 Incompatible parameter type [6]: In call `TypedDictionary.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal['name']` but got `Union[typing_extensions.Literal['name'], typing_extensions.Literal['year']]`."] """ diff --git a/conformance/results/pyre/typeddicts_inheritance.toml b/conformance/results/pyre/typeddicts_inheritance.toml index 3e91f5b6..655b5f51 100644 --- a/conformance/results/pyre/typeddicts_inheritance.toml +++ b/conformance/results/pyre/typeddicts_inheritance.toml @@ -3,10 +3,10 @@ notes = """ Does not reject TypedDict class that inherits from non-TypedDict class. """ output = """ -typeddicts_inheritance.py:54:0 Inconsistent override [15]: `x` overrides attribute defined in `X1` inconsistently. Type `int` is not a subtype of the overridden attribute `str`. -typeddicts_inheritance.py:65:0 Invalid inheritance [39]: Field `x` has type `int` in base class `X2` and type `str` in base class `Y2`. """ conformance_automated = "Fail" errors_diff = """ Line 44: Expected 1 errors +Line 65: Expected 1 errors +Lines 54, 55: Expected error (tag 'Y1') """ diff --git a/conformance/results/pyre/typeddicts_operations.toml b/conformance/results/pyre/typeddicts_operations.toml index 14ebfde9..93413bd3 100644 --- a/conformance/results/pyre/typeddicts_operations.toml +++ b/conformance/results/pyre/typeddicts_operations.toml @@ -3,19 +3,18 @@ notes = """ Does not reject `del` of required key. """ output = """ -typeddicts_operations.py:22:16 Invalid TypedDict operation [54]: Expected `str` to be assigned to `Movie` field `name` but got `int`. -typeddicts_operations.py:23:16 Invalid TypedDict operation [54]: Expected `int` to be assigned to `Movie` field `year` but got `str`. -typeddicts_operations.py:24:6 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `other`. -typeddicts_operations.py:26:12 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `other`. -typeddicts_operations.py:28:8 TypedDict initialization error [55]: Missing required field `year` for TypedDict `Movie`. -typeddicts_operations.py:29:8 TypedDict initialization error [55]: Expected type `int` for `Movie` field `year` but got `float`. -typeddicts_operations.py:32:8 TypedDict initialization error [55]: TypedDict `Movie` has no field `other`. -typeddicts_operations.py:37:4 Incompatible variable type [9]: movie is declared to have type `Movie` but is used as type `Dict[str, Union[int, str]]`. -typeddicts_operations.py:44:10 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `other`. -typeddicts_operations.py:47:0 Undefined attribute [16]: `Movie` has no attribute `clear`. -typeddicts_operations.py:62:0 Undefined attribute [16]: `MovieOptional` has no attribute `clear`. """ conformance_automated = "Fail" errors_diff = """ +Line 22: Expected 1 errors +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 26: Expected 1 errors +Line 28: Expected 1 errors +Line 29: Expected 1 errors +Line 32: Expected 1 errors +Line 37: Expected 1 errors +Line 47: Expected 1 errors Line 49: Expected 1 errors +Line 62: Expected 1 errors """ diff --git a/conformance/results/pyre/typeddicts_readonly.toml b/conformance/results/pyre/typeddicts_readonly.toml index 70380b51..f2044569 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:18:13 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ @@ -10,5 +9,4 @@ Line 50: Expected 1 errors Line 51: Expected 1 errors Line 60: Expected 1 errors Line 61: Expected 1 errors -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 a13a44a5..4d675842 100644 --- a/conformance/results/pyre/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyre/typeddicts_readonly_consistency.toml @@ -1,21 +1,13 @@ conformant = "Unsupported" output = """ -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`. -typeddicts_readonly_consistency.py:40:4 Incompatible variable type [9]: v5 is declared to have type `C1` but is used as type `A1`. -typeddicts_readonly_consistency.py:41:4 Incompatible variable type [9]: v6 is declared to have type `C1` but is used as type `B1`. -typeddicts_readonly_consistency.py:78:4 Incompatible variable type [9]: v1 is declared to have type `A2` but is used as type `B2`. -typeddicts_readonly_consistency.py:79:4 Incompatible variable type [9]: v2 is declared to have type `A2` but is used as type `C2`. -typeddicts_readonly_consistency.py:81:4 Incompatible variable type [9]: v3 is declared to have type `B2` but is used as type `A2`. -typeddicts_readonly_consistency.py:82:4 Incompatible variable type [9]: v4 is declared to have type `B2` but is used as type `C2`. -typeddicts_readonly_consistency.py:84:4 Incompatible variable type [9]: v5 is declared to have type `C2` but is used as type `A2`. -typeddicts_readonly_consistency.py:85:4 Incompatible variable type [9]: v6 is declared to have type `C2` but is used as type `B2`. """ conformance_automated = "Fail" errors_diff = """ -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`.'] -Line 79: Unexpected errors ['typeddicts_readonly_consistency.py:79:4 Incompatible variable type [9]: v2 is declared to have type `A2` but is used as type `C2`.'] +Line 37: Expected 1 errors +Line 38: Expected 1 errors +Line 40: Expected 1 errors +Line 81: Expected 1 errors +Line 82: Expected 1 errors +Line 84: Expected 1 errors +Line 85: Expected 1 errors """ diff --git a/conformance/results/pyre/typeddicts_readonly_inheritance.toml b/conformance/results/pyre/typeddicts_readonly_inheritance.toml index 8bcacffd..7f1722cc 100644 --- a/conformance/results/pyre/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyre/typeddicts_readonly_inheritance.toml @@ -1,27 +1,17 @@ conformant = "Unsupported" output = """ -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`. -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`. -typeddicts_readonly_inheritance.py:82:13 Invalid TypedDict operation [54]: Expected `str` to be assigned to `User` field `ident` but got `int`. -typeddicts_readonly_inheritance.py:83:4 TypedDict initialization error [55]: Expected type `str` for `User` field `ident` but got `int`. -typeddicts_readonly_inheritance.py:84:4 TypedDict initialization error [55]: Missing required field `ident` for TypedDict `User`. -typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `unknown` is not a subtype of the overridden attribute `int`. -typeddicts_readonly_inheritance.py:97:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`. -typeddicts_readonly_inheritance.py:119:0 Invalid inheritance [39]: Field `x` has type `int` in base class `TD_A1` and type `float` in base class `TD_A2`. """ conformance_automated = "Fail" errors_diff = """ Line 36: Expected 1 errors Line 50: Expected 1 errors +Line 65: Expected 1 errors +Line 82: Expected 1 errors +Line 83: Expected 1 errors +Line 84: Expected 1 errors Line 94: Expected 1 errors Line 98: Expected 1 errors Line 106: Expected 1 errors +Line 119: Expected 1 errors Line 132: Expected 1 errors -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`.'] -Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `unknown` is not a subtype of the overridden attribute `int`.'] -Line 97: Unexpected errors ['typeddicts_readonly_inheritance.py:97:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_kwargs.toml b/conformance/results/pyre/typeddicts_readonly_kwargs.toml index 911a969a..e9446c60 100644 --- a/conformance/results/pyre/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyre/typeddicts_readonly_kwargs.toml @@ -1,11 +1,7 @@ conformant = "Unsupported" output = """ -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 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 6f271f64..270c9ffa 100644 --- a/conformance/results/pyre/typeddicts_readonly_update.toml +++ b/conformance/results/pyre/typeddicts_readonly_update.toml @@ -1,11 +1,7 @@ conformant = "Unsupported" output = """ -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 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 2d84becd..8f8250df 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -7,9 +7,6 @@ Incorrectly complains about uninitialized attributes on TypedDict definitions. Incorrectly generates "attribute not initialized" errors for TypedDict fields. """ output = """ -typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`. -typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type. -typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`. """ conformance_automated = "Fail" errors_diff = """ @@ -17,7 +14,4 @@ Line 12: Expected 1 errors Line 19: Expected 1 errors Line 62: Expected 1 errors Line 63: Expected 1 errors -Line 15: Unexpected errors ['typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`.'] -Line 74: Unexpected errors ['typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type.'] -Line 77: Unexpected errors ['typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`.'] """ diff --git a/conformance/results/pyre/typeddicts_type_consistency.toml b/conformance/results/pyre/typeddicts_type_consistency.toml index 124f691f..d65aa7be 100644 --- a/conformance/results/pyre/typeddicts_type_consistency.toml +++ b/conformance/results/pyre/typeddicts_type_consistency.toml @@ -5,20 +5,16 @@ Does not return non-Optional value from `get` method for required key. Does not properly handle nested TypedDicts. """ output = """ -typeddicts_type_consistency.py:21:0 Incompatible variable type [9]: a1 is declared to have type `A1` but is used as type `B1`. -typeddicts_type_consistency.py:38:0 Incompatible variable type [9]: a2 is declared to have type `A2` but is used as type `B2`. -typeddicts_type_consistency.py:69:11 TypedDict initialization error [55]: TypedDict `A3` has no field `y`. -typeddicts_type_consistency.py:76:0 Incompatible variable type [9]: d1 is declared to have type `Dict[str, int]` but is used as type `B3`. -typeddicts_type_consistency.py:77:0 Incompatible variable type [9]: d2 is declared to have type `Dict[str, object]` but is used as type `B3`. -typeddicts_type_consistency.py:78:0 Incompatible variable type [9]: d3 is declared to have type `Dict[typing.Any, typing.Any]` but is used as type `B3`. -typeddicts_type_consistency.py:82:0 Incompatible variable type [9]: m1 is declared to have type `Mapping[str, int]` but is used as type `B3`. -typeddicts_type_consistency.py:101:0 Incompatible variable type [9]: name3 is declared to have type `str` but is used as type `Optional[str]`. -typeddicts_type_consistency.py:107:0 Incompatible variable type [9]: age4 is declared to have type `int` but is used as type `Union[str, int]`. -typeddicts_type_consistency.py:126:41 TypedDict initialization error [55]: Expected type `str` for `Inner1` field `inner_key` but got `int`. -typeddicts_type_consistency.py:152:0 Incompatible variable type [9]: o4 is declared to have type `Outer3` but is used as type `Outer2`. """ conformance_automated = "Fail" errors_diff = """ +Line 21: Expected 1 errors +Line 38: Expected 1 errors Line 65: Expected 1 errors -Line 152: Unexpected errors ['typeddicts_type_consistency.py:152:0 Incompatible variable type [9]: o4 is declared to have type `Outer3` but is used as type `Outer2`.'] +Line 69: Expected 1 errors +Line 76: Expected 1 errors +Line 77: Expected 1 errors +Line 78: Expected 1 errors +Line 82: Expected 1 errors +Line 126: Expected 1 errors """ diff --git a/conformance/results/pyre/typeddicts_usage.toml b/conformance/results/pyre/typeddicts_usage.toml index 02967540..b5b8ccfc 100644 --- a/conformance/results/pyre/typeddicts_usage.toml +++ b/conformance/results/pyre/typeddicts_usage.toml @@ -4,12 +4,12 @@ Does not report errant use of TypedDict in `isinstance` call. Does not reject use of TypedDict as TypeVar bound. """ output = """ -typeddicts_usage.py:23:6 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `director`. -typeddicts_usage.py:24:16 Invalid TypedDict operation [54]: Expected `int` to be assigned to `Movie` field `year` but got `str`. -typeddicts_usage.py:28:16 TypedDict initialization error [55]: Missing required field `name` for TypedDict `Movie`. """ conformance_automated = "Fail" errors_diff = """ +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 28: Expected 1 errors Line 35: Expected 1 errors Line 40: Expected 1 errors """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 31ee493d..894ac115 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 2.5 +test_duration = 0.9 diff --git a/conformance/results/pyright/directives_deprecated.toml b/conformance/results/pyright/directives_deprecated.toml new file mode 100644 index 00000000..8d2c63c9 --- /dev/null +++ b/conformance/results/pyright/directives_deprecated.toml @@ -0,0 +1,32 @@ +conformant = "Partial" +notes = """ +Does not report error for deprecated magic methods +Outputs an extra diagnostic when the imported symbol is used +""" +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 47: Expected 1 errors +Line 33: Unexpected errors ['directives_deprecated.py:33:7 - error: The class "Ham" is deprecated'] +""" +output = """ +directives_deprecated.py:15:44 - error: The class "Ham" is deprecated +  Use Spam instead (reportDeprecated) +directives_deprecated.py:23:9 - error: The function "norwegian_blue" is deprecated +  It is pining for the fiords (reportDeprecated) +directives_deprecated.py:24:13 - error: The function "norwegian_blue" is deprecated +  It is pining for the fiords (reportDeprecated) +directives_deprecated.py:29:9 - error: The function "foo" is deprecated +  Only str will be allowed (reportDeprecated) +directives_deprecated.py:33:7 - error: The class "Ham" is deprecated +  Use Spam instead (reportDeprecated) +directives_deprecated.py:43:6 - error: The getter for property "greasy" is deprecated +  All spam will be equally greasy (reportDeprecated) +directives_deprecated.py:46:6 - error: The setter for property "shape" is deprecated +  Shapes are becoming immutable (reportDeprecated) +directives_deprecated.py:57:9 - error: The function "lorem" is deprecated +  Deprecated (reportDeprecated) +directives_deprecated.py:87:13 - error: The method "foo" in class "Fooable" is deprecated +  Deprecated (reportDeprecated) +""" diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 3229acb5..8d523426 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.373" -test_duration = 1.4 +test_duration = 5.2 diff --git a/conformance/results/pytype/directives_deprecated.toml b/conformance/results/pytype/directives_deprecated.toml new file mode 100644 index 00000000..6fca5661 --- /dev/null +++ b/conformance/results/pytype/directives_deprecated.toml @@ -0,0 +1,26 @@ +conformant = "Unsupported" +notes = """ +Does not support @deprecated +""" +conformance_automated = "Fail" +errors_diff = """ +Line 23: Expected 1 errors +Line 24: Expected 1 errors +Line 29: Expected 1 errors +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 43: Expected 1 errors +Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 57: Expected 1 errors +Line 87: Expected 1 errors +Line 16: Unexpected errors ['File "directives_deprecated.py", line 16, in : Can\\'t find module \\'_directives_deprecated_library\\'. [import-error]'] +Line 18: Unexpected errors ['File "directives_deprecated.py", line 18, in : typing_extensions.deprecated not supported yet [not-supported-yet]'] +Line 66: Unexpected errors ['File "directives_deprecated.py", line 66, in : typing.override not supported yet [not-supported-yet]'] +""" +output = """ +File "directives_deprecated.py", line 15, in : Can't find module '_directives_deprecated_library'. [import-error] +File "directives_deprecated.py", line 16, in : Can't find module '_directives_deprecated_library'. [import-error] +File "directives_deprecated.py", line 18, in : typing_extensions.deprecated not supported yet [not-supported-yet] +File "directives_deprecated.py", line 66, in : typing.override not supported yet [not-supported-yet] +""" diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 16866283..58744829 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 32.7 +test_duration = 55.5 diff --git a/conformance/results/results.html b/conformance/results/results.html index 04c1a6ab..66448133 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

+ + + + + + From 9eef221c8e295153a68c3672f13fd55f043f56ff Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 18:48:13 +0000 Subject: [PATCH 07/12] Add missing punctuations, remove a note --- conformance/results/mypy/directives_deprecated.toml | 2 +- conformance/results/pyright/directives_deprecated.toml | 3 +-- conformance/results/pytype/directives_deprecated.toml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/conformance/results/mypy/directives_deprecated.toml b/conformance/results/mypy/directives_deprecated.toml index 1cd9d997..9c7552b5 100644 --- a/conformance/results/mypy/directives_deprecated.toml +++ b/conformance/results/mypy/directives_deprecated.toml @@ -1,6 +1,6 @@ conformant = "Unsupported" notes = """ -Does not support @deprecated +Does not support @deprecated. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pyright/directives_deprecated.toml b/conformance/results/pyright/directives_deprecated.toml index 8d2c63c9..20cf127a 100644 --- a/conformance/results/pyright/directives_deprecated.toml +++ b/conformance/results/pyright/directives_deprecated.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ -Does not report error for deprecated magic methods -Outputs an extra diagnostic when the imported symbol is used +Does not report error for deprecated magic methods. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/directives_deprecated.toml b/conformance/results/pytype/directives_deprecated.toml index 6fca5661..9fb6a4df 100644 --- a/conformance/results/pytype/directives_deprecated.toml +++ b/conformance/results/pytype/directives_deprecated.toml @@ -1,6 +1,6 @@ conformant = "Unsupported" notes = """ -Does not support @deprecated +Does not support @deprecated. """ conformance_automated = "Fail" errors_diff = """ From 7a70784dee34803abc38d2e6741e08b0e268b7d1 Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 18:49:59 +0000 Subject: [PATCH 08/12] Another period --- conformance/results/pyre/directives_deprecated.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/results/pyre/directives_deprecated.toml b/conformance/results/pyre/directives_deprecated.toml index 1cd9d997..9c7552b5 100644 --- a/conformance/results/pyre/directives_deprecated.toml +++ b/conformance/results/pyre/directives_deprecated.toml @@ -1,6 +1,6 @@ conformant = "Unsupported" notes = """ -Does not support @deprecated +Does not support @deprecated. """ conformance_automated = "Fail" errors_diff = """ From b57c8190c78ad1bf9edac74c30d5bed6b4c1955d Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 27 Jul 2024 12:40:56 -0700 Subject: [PATCH 09/12] Rerun on pyre --- conformance/results/mypy/version.toml | 2 +- .../results/pyre/aliases_explicit.toml | 38 ++++--- .../results/pyre/aliases_implicit.toml | 38 ++++--- conformance/results/pyre/aliases_newtype.toml | 14 +-- .../results/pyre/aliases_recursive.toml | 25 ++++- .../results/pyre/aliases_type_statement.toml | 2 + .../results/pyre/aliases_typealiastype.toml | 15 ++- .../results/pyre/aliases_variance.toml | 10 +- .../pyre/annotations_forward_refs.toml | 34 ++++--- .../results/pyre/annotations_generators.toml | 24 +++-- .../results/pyre/annotations_methods.toml | 1 + .../results/pyre/annotations_typeexpr.toml | 32 +++--- .../results/pyre/callables_annotation.toml | 52 +++++++--- .../results/pyre/callables_kwargs.toml | 18 +++- .../results/pyre/callables_protocol.toml | 32 +++--- .../results/pyre/callables_subtyping.toml | 79 +++++++++------ .../results/pyre/classes_classvar.toml | 18 ++-- .../results/pyre/classes_override.toml | 15 ++- .../results/pyre/constructors_call_init.toml | 14 ++- .../results/pyre/constructors_call_new.toml | 20 +++- .../results/pyre/constructors_call_type.toml | 18 ++-- .../results/pyre/constructors_callable.toml | 61 ++++++++++-- .../results/pyre/dataclasses_descriptors.toml | 12 ++- .../results/pyre/dataclasses_final.toml | 12 +-- .../results/pyre/dataclasses_frozen.toml | 10 +- .../results/pyre/dataclasses_kwonly.toml | 8 +- .../results/pyre/dataclasses_order.toml | 4 +- .../results/pyre/dataclasses_postinit.toml | 18 +++- .../results/pyre/dataclasses_slots.toml | 2 +- .../pyre/dataclasses_transform_class.toml | 18 ++-- .../pyre/dataclasses_transform_converter.toml | 46 +++++++-- .../pyre/dataclasses_transform_field.toml | 10 +- .../pyre/dataclasses_transform_func.toml | 36 ++++++- .../pyre/dataclasses_transform_meta.toml | 16 +-- .../results/pyre/dataclasses_usage.toml | 28 ++++-- .../results/pyre/directives_assert_type.toml | 14 +-- conformance/results/pyre/directives_cast.toml | 8 +- .../pyre/directives_no_type_check.toml | 9 +- .../results/pyre/directives_reveal_type.toml | 12 ++- .../pyre/directives_type_ignore_file1.toml | 4 +- .../pyre/directives_type_ignore_file2.toml | 4 +- .../pyre/directives_version_platform.toml | 8 +- .../results/pyre/enums_definition.toml | 11 ++- conformance/results/pyre/enums_expansion.toml | 6 +- .../results/pyre/enums_member_names.toml | 4 + .../results/pyre/enums_member_values.toml | 9 ++ conformance/results/pyre/enums_members.toml | 22 ++++- .../pyre/exceptions_context_managers.toml | 6 +- .../results/pyre/generics_base_class.toml | 8 +- conformance/results/pyre/generics_basic.toml | 15 +-- .../results/pyre/generics_defaults.toml | 98 ++++++++++++++++++- .../pyre/generics_defaults_referential.toml | 52 +++++++++- .../generics_defaults_specialization.toml | 34 ++++++- .../pyre/generics_paramspec_basic.toml | 13 ++- .../pyre/generics_paramspec_components.toml | 14 +-- .../pyre/generics_paramspec_semantics.toml | 21 ++-- .../generics_paramspec_specialization.toml | 18 +++- .../results/pyre/generics_scoping.toml | 24 +++-- .../results/pyre/generics_self_advanced.toml | 16 ++- .../pyre/generics_self_attributes.toml | 8 +- .../results/pyre/generics_self_basic.toml | 11 ++- .../results/pyre/generics_self_protocols.toml | 2 +- .../results/pyre/generics_self_usage.toml | 7 +- .../pyre/generics_syntax_compatibility.toml | 2 +- .../pyre/generics_syntax_declarations.toml | 2 + .../pyre/generics_syntax_infer_variance.toml | 2 + .../results/pyre/generics_syntax_scoping.toml | 2 +- .../results/pyre/generics_type_erasure.toml | 14 ++- .../pyre/generics_typevartuple_args.toml | 16 ++- .../pyre/generics_typevartuple_basic.toml | 67 +++++++++++-- .../pyre/generics_typevartuple_callable.toml | 20 +++- .../pyre/generics_typevartuple_concat.toml | 32 +++++- .../pyre/generics_typevartuple_overloads.toml | 13 ++- .../generics_typevartuple_specialization.toml | 71 +++++++++++++- .../pyre/generics_typevartuple_unpack.toml | 17 ++++ .../results/pyre/generics_upper_bound.toml | 5 +- .../results/pyre/generics_variance.toml | 12 +-- .../pyre/generics_variance_inference.toml | 2 + .../results/pyre/historical_positional.toml | 8 +- .../results/pyre/literals_interactions.toml | 6 ++ .../results/pyre/literals_literalstring.toml | 21 ++-- .../pyre/literals_parameterizations.toml | 38 ++++--- .../results/pyre/literals_semantics.toml | 10 +- .../pyre/namedtuples_define_class.toml | 36 +++++-- .../pyre/namedtuples_define_functional.toml | 35 +++++-- .../results/pyre/namedtuples_type_compat.toml | 10 +- .../results/pyre/namedtuples_usage.toml | 22 ++++- .../results/pyre/narrowing_typeguard.toml | 6 +- .../results/pyre/narrowing_typeis.toml | 24 +++++ conformance/results/pyre/overloads_basic.toml | 4 +- .../results/pyre/protocols_class_objects.toml | 4 +- .../results/pyre/protocols_definition.toml | 26 ++--- .../results/pyre/protocols_explicit.toml | 4 +- .../results/pyre/protocols_generic.toml | 12 +-- .../results/pyre/protocols_merging.toml | 10 +- .../results/pyre/protocols_subtyping.toml | 16 +-- .../results/pyre/protocols_variance.toml | 2 + .../results/pyre/qualifiers_annotated.toml | 40 ++++---- .../pyre/qualifiers_final_annotation.toml | 44 +++++---- .../pyre/qualifiers_final_decorator.toml | 19 ++-- .../results/pyre/specialtypes_any.toml | 8 +- .../results/pyre/specialtypes_never.toml | 16 ++- .../results/pyre/specialtypes_none.toml | 8 +- .../results/pyre/specialtypes_type.toml | 12 ++- .../results/pyre/tuples_type_compat.toml | 91 ++++++++++++++--- .../results/pyre/tuples_type_form.toml | 24 ++--- conformance/results/pyre/tuples_unpacked.toml | 30 +++++- .../results/pyre/typeddicts_alt_syntax.toml | 5 +- .../results/pyre/typeddicts_class_syntax.toml | 2 + .../results/pyre/typeddicts_final.toml | 4 +- .../results/pyre/typeddicts_inheritance.toml | 4 +- .../results/pyre/typeddicts_operations.toml | 21 ++-- .../results/pyre/typeddicts_readonly.toml | 2 + .../pyre/typeddicts_readonly_consistency.toml | 22 +++-- .../pyre/typeddicts_readonly_inheritance.toml | 20 +++- .../pyre/typeddicts_readonly_kwargs.toml | 4 + .../pyre/typeddicts_readonly_update.toml | 4 + .../results/pyre/typeddicts_required.toml | 6 ++ .../pyre/typeddicts_type_consistency.toml | 20 ++-- .../results/pyre/typeddicts_usage.toml | 6 +- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 16 +-- 124 files changed, 1674 insertions(+), 571 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index dcb5ffc5..b79e0a27 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.11.0" -test_duration = 2.9 +test_duration = 1.4 diff --git a/conformance/results/pyre/aliases_explicit.toml b/conformance/results/pyre/aliases_explicit.toml index e96d1f0f..473b04ee 100644 --- a/conformance/results/pyre/aliases_explicit.toml +++ b/conformance/results/pyre/aliases_explicit.toml @@ -9,6 +9,26 @@ Incorrectly rejects import alias of `TypeAlias` when used to define type alias. Does not report invalid specialization of already-specialized generic type alias. """ output = """ +aliases_explicit.py:23:0 Incompatible variable type [9]: GoodTypeAlias9 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. +aliases_explicit.py:23: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[object, TypeVar]`. +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]`. +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: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]]`. +aliases_explicit.py:83:0 Incompatible variable type [9]: BadTypeAlias5 is declared to have type `TA` but is used as type `Dict[str, str]`. +aliases_explicit.py:84:0 Incompatible variable type [9]: BadTypeAlias6 is declared to have type `TA` but is used as type `Type[int]`. +aliases_explicit.py:85:0 Incompatible variable type [9]: BadTypeAlias7 is declared to have type `TA` but is used as type `Type[int]`. +aliases_explicit.py:86:0 Incompatible variable type [9]: BadTypeAlias8 is declared to have type `TA` but is used as type `Type[Union[int, str]]`. +aliases_explicit.py:87:0 Incompatible variable type [9]: BadTypeAlias9 is declared to have type `TA` but is used as type `int`. +aliases_explicit.py:88:0 Incompatible variable type [9]: BadTypeAlias10 is declared to have type `TA` but is used as type `bool`. +aliases_explicit.py:89:0 Incompatible variable type [9]: BadTypeAlias11 is declared to have type `TA` but is used as type `int`. +aliases_explicit.py:90:0 Incompatible variable type [9]: BadTypeAlias12 is declared to have type `TA` but is used as type `Type[Union[list, set]]`. +aliases_explicit.py:91:0 Incompatible variable type [9]: BadTypeAlias13 is declared to have type `TA` but is used as type `str`. +aliases_explicit.py:97:16 Call error [29]: `TA` is not a function. +aliases_explicit.py:101:5 Call error [29]: `TA` is not a function. """ conformance_automated = "Fail" errors_diff = """ @@ -18,19 +38,11 @@ Line 69: Expected 1 errors Line 70: Expected 1 errors Line 71: Expected 1 errors Line 79: Expected 1 errors -Line 80: Expected 1 errors -Line 81: Expected 1 errors -Line 82: Expected 1 errors -Line 83: Expected 1 errors -Line 84: Expected 1 errors -Line 85: Expected 1 errors -Line 86: Expected 1 errors -Line 87: Expected 1 errors -Line 88: Expected 1 errors -Line 89: Expected 1 errors -Line 90: Expected 1 errors -Line 91: Expected 1 errors Line 100: Expected 1 errors -Line 101: Expected 1 errors Line 102: Expected 1 errors +Line 23: Unexpected errors ['aliases_explicit.py:23:0 Incompatible variable type [9]: GoodTypeAlias9 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'aliases_explicit.py:23: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[object, TypeVar]`.'] +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 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 88e7565d..1d00603e 100644 --- a/conformance/results/pyre/aliases_implicit.toml +++ b/conformance/results/pyre/aliases_implicit.toml @@ -8,6 +8,25 @@ Does not report error for attempt to instantiate union type alias. Does not report invalid specialization of already-specialized generic type alias. """ output = """ +aliases_implicit.py:38:26 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[object, TypeVar]`. +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: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. +aliases_implicit.py:109:8 Undefined or invalid type [11]: Annotation `BadTypeAlias4` is not defined as a type. +aliases_implicit.py:110:8 Undefined or invalid type [11]: Annotation `BadTypeAlias5` is not defined as a type. +aliases_implicit.py:111:8 Undefined or invalid type [11]: Annotation `BadTypeAlias6` is not defined as a type. +aliases_implicit.py:112:8 Undefined or invalid type [11]: Annotation `BadTypeAlias7` is not defined as a type. +aliases_implicit.py:113:8 Undefined or invalid type [11]: Annotation `BadTypeAlias8` is not defined as a type. +aliases_implicit.py:114:8 Undefined or invalid type [11]: Annotation `BadTypeAlias9` is not defined as a type. +aliases_implicit.py:115:9 Undefined or invalid type [11]: Annotation `BadTypeAlias10` is not defined as a type. +aliases_implicit.py:116:9 Undefined or invalid type [11]: Annotation `BadTypeAlias11` is not defined as a type. +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 = """ @@ -17,20 +36,11 @@ Line 78: Expected 1 errors Line 79: Expected 1 errors Line 80: Expected 1 errors Line 81: Expected 1 errors -Line 106: Expected 1 errors -Line 107: Expected 1 errors -Line 108: Expected 1 errors -Line 109: Expected 1 errors -Line 110: Expected 1 errors -Line 111: Expected 1 errors -Line 112: Expected 1 errors -Line 113: Expected 1 errors -Line 114: Expected 1 errors -Line 115: Expected 1 errors -Line 116: Expected 1 errors -Line 117: Expected 1 errors -Line 118: Expected 1 errors -Line 119: Expected 1 errors Line 133: Expected 1 errors Line 135: Expected 1 errors +Line 38: Unexpected errors ['aliases_implicit.py:38:26 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[object, TypeVar]`.'] +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 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_newtype.toml b/conformance/results/pyre/aliases_newtype.toml index d4ba459e..e9de5014 100644 --- a/conformance/results/pyre/aliases_newtype.toml +++ b/conformance/results/pyre/aliases_newtype.toml @@ -9,20 +9,20 @@ Does not reject use of NewType with TypedDict class. Does not reject use of NewType with Any. """ output = """ +aliases_newtype.py:11:7 Incompatible parameter type [6]: In call `UserId.__init__`, for 1st positional argument, expected `int` but got `str`. +aliases_newtype.py:12:0 Incompatible variable type [9]: u1 is declared to have type `UserId` but is used as type `int`. +aliases_newtype.py:38:5 Invalid type parameters [24]: Non-generic type `GoodNewType1` cannot take parameters. +aliases_newtype.py:44:37 Invalid inheritance [39]: `typing.Union[int, str]` is not a valid parent class. +aliases_newtype.py:51:37 Invalid inheritance [39]: `typing_extensions.Literal[7]` is not a valid parent class. +aliases_newtype.py:60:14 Too many arguments [19]: Call `NewType.__init__` expects 2 positional arguments, 3 were provided. +aliases_newtype.py:62:37 Invalid inheritance [39]: `typing.Any` is not a valid parent class. """ conformance_automated = "Fail" errors_diff = """ -Line 11: Expected 1 errors -Line 12: Expected 1 errors Line 20: Expected 1 errors Line 23: Expected 1 errors Line 32: Expected 1 errors -Line 38: Expected 1 errors -Line 44: Expected 1 errors Line 47: Expected 1 errors Line 49: Expected 1 errors -Line 51: Expected 1 errors Line 58: Expected 1 errors -Line 60: Expected 1 errors -Line 62: Expected 1 errors """ diff --git a/conformance/results/pyre/aliases_recursive.toml b/conformance/results/pyre/aliases_recursive.toml index 4c448b22..a87f4cf4 100644 --- a/conformance/results/pyre/aliases_recursive.toml +++ b/conformance/results/pyre/aliases_recursive.toml @@ -4,11 +4,22 @@ Does not properly handle some recursive type aliases. 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: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: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: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]`. +aliases_recursive.py:75:62 Incompatible variable type [9]: MutualReference2 is declared to have type `TypeAlias` but is used as type `Type[typing.Any]`. """ conformance_automated = "Fail" errors_diff = """ -Line 19: Expected 1 errors -Line 20: Expected 1 errors Line 38: Expected 1 errors Line 39: Expected 1 errors Line 50: Expected 1 errors @@ -16,6 +27,12 @@ Line 51: Expected 1 errors Line 52: Expected 1 errors Line 63: Expected 1 errors Line 69: Expected 1 errors -Line 72: Expected 1 errors -Line 75: Expected 1 errors +Line 30: Unexpected errors ['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: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 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_type_statement.toml b/conformance/results/pyre/aliases_type_statement.toml index 0858da06..02d923e1 100644 --- a/conformance/results/pyre/aliases_type_statement.toml +++ b/conformance/results/pyre/aliases_type_statement.toml @@ -3,6 +3,7 @@ notes = """ Does not support `type` statement. """ output = """ +aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -33,4 +34,5 @@ Line 81: Expected 1 errors Line 84: Expected 1 errors Line 86: Expected 1 errors Line 90: Expected 1 errors +Line 8: Unexpected errors ['aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/aliases_typealiastype.toml b/conformance/results/pyre/aliases_typealiastype.toml index 46513dbd..152a87de 100644 --- a/conformance/results/pyre/aliases_typealiastype.toml +++ b/conformance/results/pyre/aliases_typealiastype.toml @@ -3,10 +3,17 @@ notes = """ Support for TypeAliasType is not implemented. """ output = """ +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: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 `GoodAlias5` is not defined as a type. +aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ -Line 32: Expected 1 errors Line 40: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors @@ -27,4 +34,10 @@ 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 39: Unexpected errors ['aliases_typealiastype.py:39:4 Invalid type [31]: Expression `GoodAlias5[(int, str, [int, str], *tuple[(int, str, int)])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/aliases_variance.toml b/conformance/results/pyre/aliases_variance.toml index d0243da4..76fec94c 100644 --- a/conformance/results/pyre/aliases_variance.toml +++ b/conformance/results/pyre/aliases_variance.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ +aliases_variance.py:24:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. +aliases_variance.py:28:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. +aliases_variance.py:32:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. +aliases_variance.py:44:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 24: Expected 1 errors -Line 28: Expected 1 errors -Line 32: Expected 1 errors -Line 44: Expected 1 errors """ diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index c82dcc33..1e4ecf73 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -8,6 +8,23 @@ 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: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. +annotations_forward_refs.py:44:8 Undefined or invalid type [11]: Annotation `comprehension(int for generators(generator($target$i in range(1) if )))` is not defined as a type. +annotations_forward_refs.py:45:8 Invalid type [31]: Expression `"{ }"` is not a valid type. +annotations_forward_refs.py:46:8 Undefined or invalid type [11]: Annotation `lambda () (int)()` is not defined as a type. +annotations_forward_refs.py:47:8 Invalid type [31]: Expression `[int][0]` is not a valid type. +annotations_forward_refs.py:48:8 Invalid type [31]: Expression `"int if 1 < 3 else str"` is not a valid type. +annotations_forward_refs.py:49:8 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. +annotations_forward_refs.py:50:9 Invalid type [31]: Expression `"True"` is not a valid type. +annotations_forward_refs.py:51:9 Invalid type [31]: Expression `"1"` is not a valid type. +annotations_forward_refs.py:52:9 Invalid type [31]: Expression `"-1"` is not a valid type. +annotations_forward_refs.py:53:9 Invalid type [31]: Expression `"int or str"` is not a valid type. +annotations_forward_refs.py:55:9 Undefined or invalid type [11]: Annotation `types` is not defined as a type. +annotations_forward_refs.py:80:12 Undefined or invalid type [11]: Annotation `ClassF` is not defined as a type. +annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type. +annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation ` """ conformance_automated = "Fail" errors_diff = """ @@ -15,22 +32,9 @@ Line 22: Expected 1 errors Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors -Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 49: Expected 1 errors -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 52: Expected 1 errors -Line 53: Expected 1 errors Line 54: Expected 1 errors -Line 55: Expected 1 errors Line 66: Expected 1 errors -Line 80: Expected 1 errors Line 89: Expected 1 errors +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 103: Unexpected errors ['annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation `'] """ diff --git a/conformance/results/pyre/annotations_generators.toml b/conformance/results/pyre/annotations_generators.toml index 1fbec79d..4f05a084 100644 --- a/conformance/results/pyre/annotations_generators.toml +++ b/conformance/results/pyre/annotations_generators.toml @@ -4,19 +4,23 @@ Does not report invalid return type for generator when function implicitly retur Incorrectly evaluates type of call to async generator. """ output = """ +annotations_generators.py:54:8 Incompatible return type [7]: Expected `Generator[A, B, C]` but got `Generator[typing.Any, typing.Any, bool]`. +annotations_generators.py:57:8 Incompatible return type [7]: Expected `Generator[A, B, C]` but got `Generator[int, typing.Any, typing.Any]`. +annotations_generators.py:66:8 Incompatible return type [7]: Expected `Generator[A, int, typing.Any]` but got `Generator[int, typing.Any, typing.Any]`. +annotations_generators.py:75:4 Incompatible return type [7]: Expected `Iterator[A]` but got `Generator[B, typing.Any, typing.Any]`. +annotations_generators.py:87:4 Incompatible return type [7]: Expected `int` but got `Generator[None, typing.Any, typing.Any]`. +annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`. +annotations_generators.py:91:0 Incompatible async generator return type [57]: Expected return annotation to be AsyncGenerator or a superclass but got `int`. +annotations_generators.py:92:4 Incompatible return type [7]: Expected `int` but got `AsyncGenerator[None, typing.Any]`. +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: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 54: Expected 1 errors -Line 57: Expected 1 errors -Line 66: Expected 1 errors -Line 75: Expected 1 errors Line 86: Expected 1 errors -Line 87: Expected 1 errors -Line 91: Expected 1 errors -Line 92: Expected 1 errors -Line 118: Expected 1 errors -Line 119: Expected 1 errors -Line 135: 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 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 4d458161..c6be1388 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 1298ee2e..457e5a3d 100644 --- a/conformance/results/pyre/annotations_typeexpr.toml +++ b/conformance/results/pyre/annotations_typeexpr.toml @@ -1,21 +1,21 @@ conformant = "Pass" output = """ +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. +annotations_typeexpr.py:91:8 Invalid type [31]: Expression `comprehension(int for generators(generator(i in range(1) if )))` is not a valid type. +annotations_typeexpr.py:92:8 Invalid type [31]: Expression `{ }` is not a valid type. +annotations_typeexpr.py:93:8 Invalid type [31]: Expression `lambda () (int)()` is not a valid type. +annotations_typeexpr.py:94:8 Invalid type [31]: Expression `[int][0]` is not a valid type. +annotations_typeexpr.py:95:8 Invalid type [31]: Expression `int if 1 < 3 else str` is not a valid type. +annotations_typeexpr.py:96:8 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. +annotations_typeexpr.py:97:9 Invalid type [31]: Expression `True` is not a valid type. +annotations_typeexpr.py:98:9 Invalid type [31]: Expression `1` is not a valid type. +annotations_typeexpr.py:99:9 Invalid type [31]: Expression `-1` is not a valid type. +annotations_typeexpr.py:100:9 Invalid type [31]: Expression `int or str` is not a valid type. +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 88: Expected 1 errors -Line 89: Expected 1 errors -Line 90: Expected 1 errors -Line 91: Expected 1 errors -Line 92: Expected 1 errors -Line 93: Expected 1 errors -Line 94: Expected 1 errors -Line 95: Expected 1 errors -Line 96: Expected 1 errors -Line 97: Expected 1 errors -Line 98: Expected 1 errors -Line 99: Expected 1 errors -Line 100: Expected 1 errors -Line 101: Expected 1 errors -Line 102: Expected 1 errors """ diff --git a/conformance/results/pyre/callables_annotation.toml b/conformance/results/pyre/callables_annotation.toml index d7e33bdd..384310ba 100644 --- a/conformance/results/pyre/callables_annotation.toml +++ b/conformance/results/pyre/callables_annotation.toml @@ -5,23 +5,47 @@ Does not correctly implement type compatibility rules for "...". Does not treat "*args: Any, **kwargs: Any" as "...". """ output = """ +callables_annotation.py:25:4 Missing argument [20]: PositionalOnly call expects argument in position 1. +callables_annotation.py:26:10 Incompatible parameter type [6]: In anonymous call, for 2nd positional argument, expected `str` but got `int`. +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: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 Invalid type [31]: Expression `typing.Callable[([...], int)]` is not a valid 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]]`. +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]]`. +callables_annotation.py:171:8 Undefined or invalid type [11]: Annotation `Callback1` is not defined as a type. +callables_annotation.py:172:8 Undefined or invalid type [11]: Annotation `Callback2` is not defined as a type. +callables_annotation.py:181:0 Incompatible variable type [9]: CallbackWithInt is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. +callables_annotation.py:182:0 Incompatible variable type [9]: CallbackWithStr is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`. +callables_annotation.py:186:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type. +callables_annotation.py:187:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(str, ...)], str)]` is not a valid type. +callables_annotation.py:188:8 Undefined or invalid type [11]: Annotation `CallbackWithInt` is not defined as a type. +callables_annotation.py:189:8 Undefined or invalid type [11]: Annotation `CallbackWithStr` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ -Line 25: Expected 1 errors -Line 26: Expected 1 errors -Line 27: Expected 1 errors -Line 29: Expected 1 errors -Line 35: 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 91: Expected 1 errors Line 93: Expected 1 errors -Line 159: Expected 1 errors -Line 172: Expected 1 errors -Line 187: Expected 1 errors -Line 189: Expected 1 errors +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]]`.'] +Line 171: Unexpected errors ['callables_annotation.py:171:8 Undefined or invalid type [11]: Annotation `Callback1` is not defined as a type.'] +Line 181: Unexpected errors ['callables_annotation.py:181:0 Incompatible variable type [9]: CallbackWithInt is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] +Line 182: Unexpected errors ['callables_annotation.py:182:0 Incompatible variable type [9]: CallbackWithStr is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., str]]`.'] +Line 186: Unexpected errors ['callables_annotation.py:186:8 Invalid type [31]: Expression `typing.Callable[(typing.Concatenate[(int, ...)], str)]` is not a valid type.'] +Line 188: Unexpected errors ['callables_annotation.py:188:8 Undefined or invalid type [11]: Annotation `CallbackWithInt` is not defined as a type.'] """ diff --git a/conformance/results/pyre/callables_kwargs.toml b/conformance/results/pyre/callables_kwargs.toml index e0cbf231..596abc4d 100644 --- a/conformance/results/pyre/callables_kwargs.toml +++ b/conformance/results/pyre/callables_kwargs.toml @@ -3,19 +3,29 @@ notes = """ 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`. +callables_kwargs.py:65:18 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `str` but got `object`. +callables_kwargs.py:122:20 Invalid type variable [34]: The type variable `Variable[T (bound to callables_kwargs.TD2)]` isn't present in the function's parameters. """ conformance_automated = "Fail" errors_diff = """ Line 46: Expected 1 errors Line 51: Expected 1 errors -Line 52: Expected 1 errors Line 58: Expected 1 errors Line 63: Expected 1 errors -Line 64: Expected 1 errors -Line 65: Expected 1 errors Line 101: Expected 1 errors Line 102: Expected 1 errors Line 103: Expected 1 errors Line 111: Expected 1 errors -Line 122: 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/callables_protocol.toml b/conformance/results/pyre/callables_protocol.toml index 2034abcc..c4630b5e 100644 --- a/conformance/results/pyre/callables_protocol.toml +++ b/conformance/results/pyre/callables_protocol.toml @@ -7,24 +7,28 @@ Does not report type incompatibility for callback missing a default argument for Does not report type incompatibility for callback missing a default argument for keyword parameter. """ output = """ +callables_protocol.py:35:0 Incompatible variable type [9]: cb1 is declared to have type `Proto1` but is used as type `typing.Callable(cb1_bad1)[[Variable(bytes), KeywordOnly(max_items, Optional[int])], List[bytes]]`. +callables_protocol.py:36:0 Incompatible variable type [9]: cb1 is declared to have type `Proto1` but is used as type `typing.Callable(cb1_bad2)[[Variable(bytes)], List[bytes]]`. +callables_protocol.py:37:0 Incompatible variable type [9]: cb1 is declared to have type `Proto1` but is used as type `typing.Callable(cb1_bad3)[[Variable(bytes), KeywordOnly(max_len, Optional[str])], List[bytes]]`. +callables_protocol.py:67:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad1)[[Variable(bytes)], typing.Any]`. +callables_protocol.py:68:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad2)[[Variable(str), Keywords(str)], typing.Any]`. +callables_protocol.py:69:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad3)[[Variable(bytes), Keywords(bytes)], typing.Any]`. +callables_protocol.py:70:0 Incompatible variable type [9]: cb2 is declared to have type `Proto2` but is used as type `typing.Callable(cb2_bad4)[[Keywords(str)], typing.Any]`. +callables_protocol.py:97:0 Incompatible variable type [9]: var4 is declared to have type `Proto4` but is used as type `typing.Callable(cb4_bad1)[[Named(x, int)], None]`. +callables_protocol.py:121:0 Incompatible variable type [9]: cb6 is declared to have type `NotProto6` but is used as type `typing.Callable(cb6_bad1)[[Variable(bytes), KeywordOnly(max_len, Optional[int], default)], List[bytes]]`. +callables_protocol.py:169:0 Incompatible variable type [9]: cb8 is declared to have type `Proto8` but is used as type `typing.Callable(cb8_bad1)[[Named(x, int)], typing.Any]`. +callables_protocol.py:186:4 Incompatible attribute type [8]: Attribute `other_attribute` declared in class `Proto9` has type `int` but is used as type `str`. +callables_protocol.py:187:4 Undefined attribute [16]: `Proto9` has no attribute `xxx`. +callables_protocol.py:197:6 Undefined attribute [16]: `Proto9` has no attribute `other_attribute2`. +callables_protocol.py:216:0 Incompatible variable type [9]: cb10 is declared to have type `Proto10` but is used as type `typing.Callable(cb10_good)[[], None]`. +callables_protocol.py:259:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_good2)[[Variable(typing.Any), Keywords(typing.Any)], None]`. +callables_protocol.py:260:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_bad1)[[Variable(typing.Any), KeywordOnly(kwarg0, typing.Any)], None]`. """ conformance_automated = "Fail" errors_diff = """ -Line 35: Expected 1 errors -Line 36: Expected 1 errors -Line 37: Expected 1 errors -Line 67: Expected 1 errors -Line 68: Expected 1 errors -Line 69: Expected 1 errors -Line 70: Expected 1 errors -Line 97: Expected 1 errors -Line 121: Expected 1 errors -Line 169: Expected 1 errors -Line 186: Expected 1 errors -Line 187: Expected 1 errors -Line 197: Expected 1 errors Line 238: Expected 1 errors -Line 260: Expected 1 errors Line 284: Expected 1 errors Line 311: Expected 1 errors +Line 216: Unexpected errors ['callables_protocol.py:216:0 Incompatible variable type [9]: cb10 is declared to have type `Proto10` but is used as type `typing.Callable(cb10_good)[[], None]`.'] +Line 259: Unexpected errors ['callables_protocol.py:259:0 Incompatible variable type [9]: cb12 is declared to have type `Proto12` but is used as type `typing.Callable(cb12_good2)[[Variable(typing.Any), Keywords(typing.Any)], None]`.'] """ diff --git a/conformance/results/pyre/callables_subtyping.toml b/conformance/results/pyre/callables_subtyping.toml index 5a07468e..4c686d89 100644 --- a/conformance/results/pyre/callables_subtyping.toml +++ b/conformance/results/pyre/callables_subtyping.toml @@ -4,39 +4,56 @@ Rejects standard parameter as incompatible with keyword-only parameter. Rejects use of Callable with ParamSpec in TypeAlias definition. """ errors_diff = """ -Line 26: Expected 1 errors -Line 29: Expected 1 errors -Line 51: Expected 1 errors -Line 52: Expected 1 errors -Line 55: Expected 1 errors -Line 58: Expected 1 errors -Line 82: Expected 1 errors -Line 85: Expected 1 errors -Line 86: Expected 1 errors -Line 116: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors -Line 122: Expected 1 errors -Line 124: Expected 1 errors -Line 125: Expected 1 errors -Line 126: Expected 1 errors -Line 151: Expected 1 errors -Line 154: Expected 1 errors -Line 155: Expected 1 errors -Line 187: Expected 1 errors -Line 190: Expected 1 errors -Line 191: Expected 1 errors -Line 193: Expected 1 errors -Line 195: Expected 1 errors -Line 196: Expected 1 errors -Line 197: Expected 1 errors Line 236: Expected 1 errors -Line 237: Expected 1 errors -Line 240: Expected 1 errors -Line 243: Expected 1 errors -Line 273: Expected 1 errors -Line 297: Expected 1 errors +Line 57: Unexpected errors ['callables_subtyping.py:57:4 Incompatible variable type [9]: f5 is declared to have type `KwOnly2` but is used as type `Standard2`.'] +Line 188: Unexpected errors ['callables_subtyping.py:188:4 Incompatible variable type [9]: f2 is declared to have type `KwOnly6` but is used as type `IntStrKwargs6`.'] +Line 189: Unexpected errors ['callables_subtyping.py:189:4 Incompatible variable type [9]: f3 is declared to have type `KwOnly6` but is used as type `StrKwargs6`.'] +Line 192: Unexpected errors ['callables_subtyping.py:192:4 Incompatible variable type [9]: f6 is declared to have type `StrKwargs6` but is used as type `IntStrKwargs6`.'] +Line 208: Unexpected errors ['callables_subtyping.py:208:0 Incompatible variable type [9]: TypeAliasWithP is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'callables_subtyping.py:208:37 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 211: Unexpected errors ['callables_subtyping.py:211:39 Undefined or invalid type [11]: Annotation `TypeAliasWithP` is not defined as a type.'] +Line 253: Unexpected errors ['callables_subtyping.py:253:4 Missing overload implementation [42]: Overloaded function `Overloaded9.__call__` must have an implementation.'] +Line 282: Unexpected errors ['callables_subtyping.py:282:4 Missing overload implementation [42]: Overloaded function `Overloaded10.__call__` must have an implementation.'] """ output = """ +callables_subtyping.py:26:4 Incompatible variable type [9]: f6 is declared to have type `typing.Callable[[float], float]` but is used as type `typing.Callable[[int], int]`. +callables_subtyping.py:29:4 Incompatible variable type [9]: f8 is declared to have type `typing.Callable[[int], int]` but is used as type `typing.Callable[[float], float]`. +callables_subtyping.py:51:4 Incompatible variable type [9]: f1 is declared to have type `Standard2` but is used as type `PosOnly2`. +callables_subtyping.py:52:4 Incompatible variable type [9]: f2 is declared to have type `Standard2` but is used as type `KwOnly2`. +callables_subtyping.py:55:4 Incompatible variable type [9]: f4 is declared to have type `PosOnly2` but is used as type `KwOnly2`. +callables_subtyping.py:57:4 Incompatible variable type [9]: f5 is declared to have type `KwOnly2` but is used as type `Standard2`. +callables_subtyping.py:58:4 Incompatible variable type [9]: f6 is declared to have type `KwOnly2` but is used as type `PosOnly2`. +callables_subtyping.py:82:4 Incompatible variable type [9]: f3 is declared to have type `IntArgs3` but is used as type `NoArgs3`. +callables_subtyping.py:85:4 Incompatible variable type [9]: f5 is declared to have type `FloatArgs3` but is used as type `NoArgs3`. +callables_subtyping.py:86:4 Incompatible variable type [9]: f6 is declared to have type `FloatArgs3` but is used as type `IntArgs3`. +callables_subtyping.py:116:4 Incompatible variable type [9]: f1 is declared to have type `PosOnly4` but is used as type `IntArgs4`. +callables_subtyping.py:119:4 Incompatible variable type [9]: f4 is declared to have type `IntStrArgs4` but is used as type `StrArgs4`. +callables_subtyping.py:120:4 Incompatible variable type [9]: f5 is declared to have type `IntStrArgs4` but is used as type `IntArgs4`. +callables_subtyping.py:122:4 Incompatible variable type [9]: f7 is declared to have type `StrArgs4` but is used as type `IntArgs4`. +callables_subtyping.py:124:4 Incompatible variable type [9]: f9 is declared to have type `IntArgs4` but is used as type `StrArgs4`. +callables_subtyping.py:125:4 Incompatible variable type [9]: f10 is declared to have type `Standard4` but is used as type `IntStrArgs4`. +callables_subtyping.py:126:4 Incompatible variable type [9]: f11 is declared to have type `Standard4` but is used as type `StrArgs4`. +callables_subtyping.py:151:4 Incompatible variable type [9]: f3 is declared to have type `IntKwargs5` but is used as type `NoKwargs5`. +callables_subtyping.py:154:4 Incompatible variable type [9]: f5 is declared to have type `FloatKwargs5` but is used as type `NoKwargs5`. +callables_subtyping.py:155:4 Incompatible variable type [9]: f6 is declared to have type `FloatKwargs5` but is used as type `IntKwargs5`. +callables_subtyping.py:187:4 Incompatible variable type [9]: f1 is declared to have type `KwOnly6` but is used as type `IntKwargs6`. +callables_subtyping.py:188:4 Incompatible variable type [9]: f2 is declared to have type `KwOnly6` but is used as type `IntStrKwargs6`. +callables_subtyping.py:189:4 Incompatible variable type [9]: f3 is declared to have type `KwOnly6` but is used as type `StrKwargs6`. +callables_subtyping.py:190:4 Incompatible variable type [9]: f4 is declared to have type `IntStrKwargs6` but is used as type `StrKwargs6`. +callables_subtyping.py:191:4 Incompatible variable type [9]: f5 is declared to have type `IntStrKwargs6` but is used as type `IntKwargs6`. +callables_subtyping.py:192:4 Incompatible variable type [9]: f6 is declared to have type `StrKwargs6` but is used as type `IntStrKwargs6`. +callables_subtyping.py:193:4 Incompatible variable type [9]: f7 is declared to have type `StrKwargs6` but is used as type `IntKwargs6`. +callables_subtyping.py:195:4 Incompatible variable type [9]: f9 is declared to have type `IntKwargs6` but is used as type `StrKwargs6`. +callables_subtyping.py:196:4 Incompatible variable type [9]: f10 is declared to have type `Standard6` but is used as type `IntStrKwargs6`. +callables_subtyping.py:197:4 Incompatible variable type [9]: f11 is declared to have type `Standard6` but is used as type `StrKwargs6`. +callables_subtyping.py:208:0 Incompatible variable type [9]: TypeAliasWithP is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. +callables_subtyping.py:208:37 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]`. +callables_subtyping.py:211:39 Undefined or invalid type [11]: Annotation `TypeAliasWithP` is not defined as a type. +callables_subtyping.py:237:4 Incompatible variable type [9]: f2 is declared to have type `DefaultArg8` but is used as type `NoX8`. +callables_subtyping.py:240:4 Incompatible variable type [9]: f4 is declared to have type `NoDefaultArg8` but is used as type `NoX8`. +callables_subtyping.py:243:4 Incompatible variable type [9]: f6 is declared to have type `NoX8` but is used as type `NoDefaultArg8`. +callables_subtyping.py:253:4 Missing overload implementation [42]: Overloaded function `Overloaded9.__call__` must have an implementation. +callables_subtyping.py:273:4 Incompatible variable type [9]: f3 is declared to have type `FloatArg9` but is used as type `Overloaded9`. +callables_subtyping.py:282:4 Missing overload implementation [42]: Overloaded function `Overloaded10.__call__` must have an implementation. +callables_subtyping.py:297:4 Incompatible variable type [9]: f2 is declared to have type `Overloaded10` but is used as type `StrArg10`. """ conformance_automated = "Fail" diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index a559ad76..52902aed 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -11,24 +11,28 @@ Does not reject use of ClassVar in type alias definition. Does not infer type from initialization for bare ClassVar. """ output = """ +classes_classvar.py:38:10 Invalid type parameters [24]: Generic type `CV` expects 1 type parameter, received 2. +classes_classvar.py:39:10 Invalid type [31]: Expression `typing.ClassVar[3]` is not a valid type. +classes_classvar.py:40:13 Unbound name [10]: Name `var` is used but not defined in the current scope. +classes_classvar.py:52:4 Incompatible attribute type [8]: Attribute `bad8` declared in class `ClassA` has type `List[str]` but is used as type `Dict[Variable[_KT], Variable[_VT]]`. +classes_classvar.py:65:8 Undefined attribute [16]: `ClassA` has no attribute `xx`. +classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`. +classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`. +classes_classvar.py:105:0 Invalid assignment [41]: Assigning to class variable through instance, did you mean to assign to `Starship.stats` instead? +classes_classvar.py:134:0 Incompatible variable type [9]: a is declared to have type `ProtoA` but is used as type `ProtoAImpl`. """ conformance_automated = "Fail" errors_diff = """ -Line 38: Expected 1 errors -Line 39: Expected 1 errors -Line 40: Expected 1 errors Line 45: Expected 1 errors Line 46: Expected 1 errors Line 47: Expected 1 errors -Line 52: Expected 1 errors Line 54: Expected 1 errors Line 55: Expected 1 errors Line 63: Expected 1 errors Line 64: Expected 1 errors -Line 65: Expected 1 errors Line 67: Expected 1 errors Line 71: Expected 1 errors Line 72: Expected 1 errors -Line 105: Expected 1 errors -Line 134: Expected 1 errors +Line 68: Unexpected errors ['classes_classvar.py:68:8 Incompatible return type [7]: Expected `CV[int]` but got `int`.'] +Line 78: Unexpected errors ['classes_classvar.py:78:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `float` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/classes_override.toml b/conformance/results/pyre/classes_override.toml index 9a7a711e..ac73d049 100644 --- a/conformance/results/pyre/classes_override.toml +++ b/conformance/results/pyre/classes_override.toml @@ -3,12 +3,17 @@ notes = """ Does not allow Any as a base class, leading to false positives. """ output = """ +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: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: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: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: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: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 53: Expected 1 errors -Line 79: Expected 1 errors -Line 84: Expected 1 errors -Line 89: Expected 1 errors -Lines 56, 65: Expected error (tag 'method4') +Line 95: Unexpected errors ['classes_override.py:95:14 Invalid inheritance [39]: `typing.Any` is not a valid parent class.'] +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 d881a6ff..9358ef09 100644 --- a/conformance/results/pyre/constructors_call_init.toml +++ b/conformance/results/pyre/constructors_call_init.toml @@ -6,11 +6,21 @@ Does not reject use of class-scoped type variables in annotation of self paramet """ conformance_automated = "Fail" errors_diff = """ -Line 21: Expected 1 errors Line 42: Expected 1 errors Line 56: Expected 1 errors Line 107: Expected 1 errors -Line 130: 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 6b4b14dc..3974f524 100644 --- a/conformance/results/pyre/constructors_call_new.toml +++ b/conformance/results/pyre/constructors_call_new.toml @@ -5,8 +5,26 @@ Does not report errors during binding to cls parameter of __new__ method. """ conformance_automated = "Fail" errors_diff = """ -Line 21: Expected 1 errors Line 145: Expected 1 errors +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_call_type.toml b/conformance/results/pyre/constructors_call_type.toml index 3a2f99ea..b78a1daf 100644 --- a/conformance/results/pyre/constructors_call_type.toml +++ b/conformance/results/pyre/constructors_call_type.toml @@ -1,14 +1,14 @@ conformant = "Pass" errors_diff = """ -Line 30: Expected 1 errors -Line 40: Expected 1 errors -Line 50: Expected 1 errors -Line 59: Expected 1 errors -Line 64: Expected 1 errors -Line 72: Expected 1 errors -Line 81: Expected 1 errors -Line 82: Expected 1 errors """ output = """ +constructors_call_type.py:30:4 Missing argument [20]: Call `Meta1.__call__` expects argument `x`. +constructors_call_type.py:40:4 Missing argument [20]: Call `Class2.__new__` expects argument `x`. +constructors_call_type.py:50:4 Missing argument [20]: Call `Class3.__init__` expects argument `x`. +constructors_call_type.py:59:4 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. +constructors_call_type.py:64:4 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. +constructors_call_type.py:72:4 Missing argument [20]: Call `Meta1.__call__` expects argument `x`. +constructors_call_type.py:81:4 Missing argument [20]: Call `Class2.__new__` expects argument `y`. +constructors_call_type.py:82:11 Incompatible parameter type [6]: In call `Class2.__new__`, for 2nd positional argument, expected `str` but got `int`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" diff --git a/conformance/results/pyre/constructors_callable.toml b/conformance/results/pyre/constructors_callable.toml index 50483f3a..6ab0dffa 100644 --- a/conformance/results/pyre/constructors_callable.toml +++ b/conformance/results/pyre/constructors_callable.toml @@ -7,18 +7,63 @@ Does not use annotated type of self in __init__ method to generate return type o """ conformance_automated = "Fail" errors_diff = """ -Line 38: Expected 1 errors -Line 39: Expected 1 errors -Line 51: Expected 1 errors -Line 65: Expected 1 errors -Line 66: Expected 1 errors -Line 67: Expected 1 errors -Line 79: Expected 1 errors -Line 80: Expected 1 errors 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 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 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: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 8fb83ff8..0f99b597 100644 --- a/conformance/results/pyre/dataclasses_descriptors.toml +++ b/conformance/results/pyre/dataclasses_descriptors.toml @@ -3,7 +3,17 @@ notes = """ Incorrectly generates error when calling constructor of dataclass with descriptor. """ 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 = "Pass" +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_final.toml b/conformance/results/pyre/dataclasses_final.toml index 2a6b20d0..c579f132 100644 --- a/conformance/results/pyre/dataclasses_final.toml +++ b/conformance/results/pyre/dataclasses_final.toml @@ -1,11 +1,11 @@ conformant = "Pass" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 27: Expected 1 errors -Line 35: Expected 1 errors -Line 36: Expected 1 errors -Line 37: Expected 1 errors -Line 38: Expected 1 errors """ output = """ +dataclasses_final.py:27:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_classvar`. +dataclasses_final.py:35:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_no_default`. +dataclasses_final.py:36:0 Invalid assignment [41]: Cannot reassign final attribute `d.final_with_default`. +dataclasses_final.py:37:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_no_default`. +dataclasses_final.py:38:0 Invalid assignment [41]: Cannot reassign final attribute `D.final_with_default`. """ diff --git a/conformance/results/pyre/dataclasses_frozen.toml b/conformance/results/pyre/dataclasses_frozen.toml index 10323d7e..410c163f 100644 --- a/conformance/results/pyre/dataclasses_frozen.toml +++ b/conformance/results/pyre/dataclasses_frozen.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ +dataclasses_frozen.py:16:0 Invalid assignment [41]: Cannot reassign final attribute `dc1.a`. +dataclasses_frozen.py:17:0 Invalid assignment [41]: Cannot reassign final attribute `dc1.b`. +dataclasses_frozen.py:23:0 Invalid inheritance [39]: Non-frozen dataclass `DC2` cannot inherit from frozen dataclass `DC1`. +dataclasses_frozen.py:33:0 Invalid inheritance [39]: Frozen dataclass `DC4` cannot inherit from non-frozen dataclass `DC3`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 16: Expected 1 errors -Line 17: Expected 1 errors -Lines 22, 23: Expected error (tag 'DC2') -Lines 32, 33: Expected error (tag 'DC4') """ diff --git a/conformance/results/pyre/dataclasses_kwonly.toml b/conformance/results/pyre/dataclasses_kwonly.toml index 2cfa94bf..9e66c08f 100644 --- a/conformance/results/pyre/dataclasses_kwonly.toml +++ b/conformance/results/pyre/dataclasses_kwonly.toml @@ -3,10 +3,12 @@ notes = """ Rejects legitimate use of dataclass field with `kw_only=True`. """ output = """ +dataclasses_kwonly.py:23:0 Too many arguments [19]: Call `DC1.__init__` expects 1 positional argument, 2 were provided. +dataclasses_kwonly.py:38:0 Too many arguments [19]: Call `DC2.__init__` expects 1 positional argument, 2 were provided. +dataclasses_kwonly.py:53:0 Too many arguments [19]: Call `DC3.__init__` expects 1 positional argument, 2 were provided. +dataclasses_kwonly.py:61:0 Unexpected keyword [28]: Unexpected keyword argument `b` to call `DC4.__init__`. """ conformance_automated = "Fail" errors_diff = """ -Line 23: Expected 1 errors -Line 38: Expected 1 errors -Line 53: Expected 1 errors +Line 61: Unexpected errors ['dataclasses_kwonly.py:61:0 Unexpected keyword [28]: Unexpected keyword argument `b` to call `DC4.__init__`.'] """ diff --git a/conformance/results/pyre/dataclasses_order.toml b/conformance/results/pyre/dataclasses_order.toml index d8eda5a7..0452db28 100644 --- a/conformance/results/pyre/dataclasses_order.toml +++ b/conformance/results/pyre/dataclasses_order.toml @@ -1,7 +1,7 @@ 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 922e559a..31199486 100644 --- a/conformance/results/pyre/dataclasses_postinit.toml +++ b/conformance/results/pyre/dataclasses_postinit.toml @@ -4,11 +4,25 @@ Does not perform validation of `__post_init__` method. 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_slots.toml b/conformance/results/pyre/dataclasses_slots.toml index e8108e48..ca83a885 100644 --- a/conformance/results/pyre/dataclasses_slots.toml +++ b/conformance/results/pyre/dataclasses_slots.toml @@ -5,12 +5,12 @@ Does not reject write to instance variable that is not defined in __slots__. Does not reject access to `__slots__` from dataclass instance when `slots=False`. """ output = """ +dataclasses_slots.py:66:0 Undefined attribute [16]: `DC6` has no attribute `__slots__`. """ conformance_automated = "Fail" errors_diff = """ Line 25: Expected 1 errors Line 38: Expected 1 errors -Line 66: Expected 1 errors Line 69: Expected 1 errors Lines 10, 11: Expected error (tag 'DC1') """ diff --git a/conformance/results/pyre/dataclasses_transform_class.toml b/conformance/results/pyre/dataclasses_transform_class.toml index a0596517..bdb113d3 100644 --- a/conformance/results/pyre/dataclasses_transform_class.toml +++ b/conformance/results/pyre/dataclasses_transform_class.toml @@ -4,13 +4,19 @@ Does not support field specifiers. Emits "attribute not initialized" error for dataclass field. """ output = """ +dataclasses_transform_class.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. +dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. +dataclasses_transform_class.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. +dataclasses_transform_class.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_class.py:72:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. +dataclasses_transform_class.py:82:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized. +dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized. +dataclasses_transform_class.py:122:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 51: Expected 1 errors -Line 63: Expected 1 errors -Line 66: Expected 1 errors -Line 72: Expected 1 errors -Line 82: Expected 1 errors -Line 122: Expected 1 errors +Line 60: Unexpected errors ['dataclasses_transform_class.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] +Line 90: Unexpected errors ['dataclasses_transform_class.py:90:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `GenericModelBase` to have type `Variable[T]` but is never initialized.'] +Line 111: Unexpected errors ['dataclasses_transform_class.py:111:4 Uninitialized attribute [13]: Attribute `not_a_field` is declared in class `ModelBaseFrozen` to have type `str` but is never initialized.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_converter.toml b/conformance/results/pyre/dataclasses_transform_converter.toml index ab8e064b..810debae 100644 --- a/conformance/results/pyre/dataclasses_transform_converter.toml +++ b/conformance/results/pyre/dataclasses_transform_converter.toml @@ -4,15 +4,45 @@ Converter parameter not yet supported. """ conformance_automated = "Fail" errors_diff = """ -Line 48: Expected 1 errors -Line 49: Expected 1 errors -Line 107: Expected 1 errors -Line 108: Expected 1 errors -Line 109: Expected 1 errors Line 118: Expected 1 errors -Line 119: Expected 1 errors -Line 130: Expected 1 errors -Line 133: Expected 1 errors +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:112:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`.', 'dataclasses_transform_converter.py:112:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`.'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`.'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`.'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`.'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`.', 'dataclasses_transform_converter.py:121:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`.', 'dataclasses_transform_converter.py:121:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`.'] """ output = """ +dataclasses_transform_converter.py:48:30 Incompatible parameter type [6]: In call `model_field`, for argument `converter`, expected `typing.Callable[[Variable[S]], Variable[T]]` but got `typing.Callable(bad_converter1)[[], int]`. +dataclasses_transform_converter.py:49:30 Incompatible parameter type [6]: In call `model_field`, for argument `converter`, expected `typing.Callable[[Variable[S]], Variable[T]]` but got `typing.Callable(bad_converter2)[[KeywordOnly(x, int)], int]`. +dataclasses_transform_converter.py:107:7 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:107:13 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:107:19 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. +dataclasses_transform_converter.py:107:26 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. +dataclasses_transform_converter.py:108:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:108:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:108:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:108:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `int`. +dataclasses_transform_converter.py:108:25 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. +dataclasses_transform_converter.py:109:4 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:109:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:109:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:109:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. +dataclasses_transform_converter.py:109:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `complex`. +dataclasses_transform_converter.py:112:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:112:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:112:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:112:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `bytes`. +dataclasses_transform_converter.py:112:35 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `List[Variable[_T]]`. +dataclasses_transform_converter.py:114:0 Incompatible attribute type [8]: Attribute `field0` declared in class `DC2` has type `int` but is used as type `str`. +dataclasses_transform_converter.py:115:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `str`. +dataclasses_transform_converter.py:116:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `bytes`. +dataclasses_transform_converter.py:119:0 Incompatible attribute type [8]: Attribute `field3` declared in class `DC2` has type `ConverterClass` but is used as type `int`. +dataclasses_transform_converter.py:121:10 Incompatible parameter type [6]: In call `DC2.__init__`, for 1st positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:121:16 Incompatible parameter type [6]: In call `DC2.__init__`, for 2nd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:121:22 Incompatible parameter type [6]: In call `DC2.__init__`, for 3rd positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:121:28 Incompatible parameter type [6]: In call `DC2.__init__`, for 4th positional argument, expected `ConverterClass` but got `str`. +dataclasses_transform_converter.py:121:34 Incompatible parameter type [6]: In call `DC2.__init__`, for 5th positional argument, expected `int` but got `str`. +dataclasses_transform_converter.py:121:39 Incompatible parameter type [6]: In call `DC2.__init__`, for 6th positional argument, expected `Dict[str, str]` but got `Tuple[Tuple[str, str], Tuple[str, str]]`. +dataclasses_transform_converter.py:130:58 Incompatible parameter type [6]: In call `model_field`, for argument `default`, expected `Optional[Variable[S]]` but got `int`. +dataclasses_transform_converter.py:133:58 Incompatible parameter type [6]: In call `model_field`, for argument `default_factory`, expected `Optional[typing.Callable[[], Variable[S]]]` but got `Type[int]`. """ diff --git a/conformance/results/pyre/dataclasses_transform_field.toml b/conformance/results/pyre/dataclasses_transform_field.toml index d038ffe0..b1750267 100644 --- a/conformance/results/pyre/dataclasses_transform_field.toml +++ b/conformance/results/pyre/dataclasses_transform_field.toml @@ -3,9 +3,17 @@ notes = """ 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: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 75: 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 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 7569e15d..2f69091f 100644 --- a/conformance/results/pyre/dataclasses_transform_func.toml +++ b/conformance/results/pyre/dataclasses_transform_func.toml @@ -5,13 +5,39 @@ Does not detect non-frozen class inheriting from frozen class. Emits "attribute not initialized" error for dataclass field. """ output = """ +dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`. +dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized. +dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized. +dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized. +dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized. +dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized. +dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_func.py:57:0 Incompatible attribute type [8]: Attribute `name` declared in class `Customer1` has type `str` but is used as type `int`. +dataclasses_transform_func.py:61:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. +dataclasses_transform_func.py:65:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`. +dataclasses_transform_func.py:71:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`. +dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized. +dataclasses_transform_func.py:97:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 57: Expected 1 errors -Line 61: Expected 1 errors -Line 65: Expected 1 errors -Line 71: Expected 1 errors -Line 97: Expected 1 errors Lines 89, 90: Expected error (tag 'Customer3Subclass') +Line 20: Unexpected errors ['dataclasses_transform_func.py:20:0 Incompatible overload [43]: The implementation of `create_model` does not accept all possible arguments of overload defined on line `20`.'] +Line 25: Unexpected errors ["dataclasses_transform_func.py:25:5 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 29: Unexpected errors ['dataclasses_transform_func.py:29:0 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] +Line 35: Unexpected errors ['dataclasses_transform_func.py:35:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer1` to have type `int` but is never initialized.'] +Line 36: Unexpected errors ['dataclasses_transform_func.py:36:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer1` to have type `str` but is never initialized.'] +Line 41: Unexpected errors ['dataclasses_transform_func.py:41:4 Uninitialized attribute [13]: Attribute `id` is declared in class `Customer2` to have type `int` but is never initialized.'] +Line 42: Unexpected errors ['dataclasses_transform_func.py:42:4 Uninitialized attribute [13]: Attribute `name` is declared in class `Customer2` to have type `str` but is never initialized.'] +Line 47: Unexpected errors ['dataclasses_transform_func.py:47:4 Uninitialized attribute [13]: Attribute `salary` is declared in class `Customer2Subclass` to have type `float` but is never initialized.'] +Line 50: Unexpected errors ['dataclasses_transform_func.py:50:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] +Line 53: Unexpected errors ['dataclasses_transform_func.py:53:7 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 2 were provided.'] +Line 67: Unexpected errors ['dataclasses_transform_func.py:67:7 Unexpected keyword [28]: Unexpected keyword argument `id` to call `object.__init__`.'] +Line 73: Unexpected errors ['dataclasses_transform_func.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer2` and `Customer2`.'] +Line 91: Unexpected errors ['dataclasses_transform_func.py:91:4 Uninitialized attribute [13]: Attribute `age` is declared in class `Customer3Subclass` to have type `int` but is never initialized.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_meta.toml b/conformance/results/pyre/dataclasses_transform_meta.toml index bf3fccbd..ffcce3b4 100644 --- a/conformance/results/pyre/dataclasses_transform_meta.toml +++ b/conformance/results/pyre/dataclasses_transform_meta.toml @@ -5,13 +5,17 @@ Incorrectly rejects frozen dataclass that inherits from non-frozen. Emits "attribute not initialized" error for dataclass field. """ output = """ +dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`. +dataclasses_transform_meta.py:51:0 Invalid inheritance [39]: Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1`. +dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`. +dataclasses_transform_meta.py:63:0 Invalid assignment [41]: Cannot reassign final attribute `c1_1.id`. +dataclasses_transform_meta.py:66:7 Too many arguments [19]: Call `Customer1.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_meta.py:73:5 Unsupported operand [58]: `<` is not supported for operand types `Customer1` and `Customer1`. +dataclasses_transform_meta.py:83:7 Too many arguments [19]: Call `Customer2.__init__` expects 0 positional arguments, 2 were provided. +dataclasses_transform_meta.py:103:0 Invalid assignment [41]: Cannot reassign final attribute `c3_1.id`. """ conformance_automated = "Fail" errors_diff = """ -Line 51: Expected 1 errors -Line 63: Expected 1 errors -Line 66: Expected 1 errors -Line 73: Expected 1 errors -Line 83: Expected 1 errors -Line 103: Expected 1 errors +Line 43: Unexpected errors ['dataclasses_transform_meta.py:43:0 Invalid inheritance [39]: Frozen dataclass `Customer1` cannot inherit from non-frozen dataclass `ModelBase`.'] +Line 60: Unexpected errors ['dataclasses_transform_meta.py:60:7 Unexpected keyword [28]: Unexpected keyword argument `other_name` to call `Customer1.__init__`.'] """ diff --git a/conformance/results/pyre/dataclasses_usage.toml b/conformance/results/pyre/dataclasses_usage.toml index 23ec8794..4620f9ec 100644 --- a/conformance/results/pyre/dataclasses_usage.toml +++ b/conformance/results/pyre/dataclasses_usage.toml @@ -5,18 +5,30 @@ 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 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:127:0 Too many arguments [19]: Call `DC7.__init__` expects 1 positional argument, 2 were provided. +dataclasses_usage.py:130:0 Missing argument [20]: Call `DC8.__init__` expects argument `y`. +dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized. +dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized. +dataclasses_usage.py:179:0 Too many arguments [19]: Call `object.__init__` expects 0 positional arguments, 1 was provided. +dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`. +dataclasses_usage.py:213: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 = """ -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 52: Expected 1 errors -Line 83: Expected 1 errors -Line 88: Expected 1 errors -Line 127: Expected 1 errors -Line 130: Expected 1 errors -Line 179: Expected 1 errors 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 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 173: Unexpected errors ['dataclasses_usage.py:173:4 Uninitialized attribute [13]: Attribute `x` is declared in class `DC13` to have type `int` but is never initialized.'] +Line 174: Unexpected errors ['dataclasses_usage.py:174:4 Uninitialized attribute [13]: Attribute `x_squared` is declared in class `DC13` to have type `int` but is never initialized.'] +Line 205: Unexpected errors ['dataclasses_usage.py:205:0 Incompatible variable type [9]: v7 is declared to have type `DataclassProto` but is used as type `DC15`.'] +Line 213: Unexpected errors ['dataclasses_usage.py:213: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 03ed5501..2afa3ee8 100644 --- a/conformance/results/pyre/directives_assert_type.toml +++ b/conformance/results/pyre/directives_assert_type.toml @@ -3,13 +3,13 @@ notes = """ 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 31: Expected 1 errors -Line 32: Expected 1 errors -Line 33: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_cast.toml b/conformance/results/pyre/directives_cast.toml index a7edd8c2..8046276e 100644 --- a/conformance/results/pyre/directives_cast.toml +++ b/conformance/results/pyre/directives_cast.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ +directives_cast.py:15:7 Missing argument [20]: Call `cast` expects argument `typ`. +directives_cast.py:16:12 Invalid type [31]: Expression `1` is not a valid type. +directives_cast.py:17:7 Too many arguments [19]: Call `cast` expects 2 positional arguments, 3 were provided. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 15: Expected 1 errors -Line 16: Expected 1 errors -Line 17: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_no_type_check.toml b/conformance/results/pyre/directives_no_type_check.toml index 87b037ac..f08913ea 100644 --- a/conformance/results/pyre/directives_no_type_check.toml +++ b/conformance/results/pyre/directives_no_type_check.toml @@ -3,8 +3,13 @@ notes = """ Does not honor @no_type_check decorator. """ output = """ +directives_no_type_check.py:15:4 Incompatible attribute type [8]: Attribute `x` declared in class `ClassA` has type `int` but is used as type `str`. +directives_no_type_check.py:25:12 Unsupported operand [58]: `+` is not supported for operand types `int` and `str`. +directives_no_type_check.py:26:4 Incompatible return type [7]: Expected `None` but got `int`. +directives_no_type_check.py:29:6 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `int` but got `bytes`. +directives_no_type_check.py:29:18 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `str` but got `bytes`. +directives_no_type_check.py:32:0 Missing argument [20]: Call `func1` expects argument `a`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 32: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_reveal_type.toml b/conformance/results/pyre/directives_reveal_type.toml index 9bd8ee44..ff69a169 100644 --- a/conformance/results/pyre/directives_reveal_type.toml +++ b/conformance/results/pyre/directives_reveal_type.toml @@ -4,9 +4,17 @@ 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 Revealed type [-1]: Revealed type for `a` is `typing.Union[int, str]`. """ conformance_automated = "Fail" errors_diff = """ -Line 19: Expected 1 errors -Line 20: Expected 1 errors +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/directives_type_ignore_file1.toml b/conformance/results/pyre/directives_type_ignore_file1.toml index 52bc0972..3efc56a3 100644 --- a/conformance/results/pyre/directives_type_ignore_file1.toml +++ b/conformance/results/pyre/directives_type_ignore_file1.toml @@ -3,7 +3,9 @@ notes = """ Does not support file-level `#type: ignore` comment. """ output = """ +directives_type_ignore_file1.py:16:0 Incompatible variable type [9]: x is declared to have type `int` but is used as type `str`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 16: Unexpected errors ['directives_type_ignore_file1.py:16:0 Incompatible variable type [9]: x is declared to have type `int` but is used as type `str`.'] """ diff --git a/conformance/results/pyre/directives_type_ignore_file2.toml b/conformance/results/pyre/directives_type_ignore_file2.toml index 86845706..7e43e7dc 100644 --- a/conformance/results/pyre/directives_type_ignore_file2.toml +++ b/conformance/results/pyre/directives_type_ignore_file2.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ +directives_type_ignore_file2.py:14:0 Incompatible variable type [9]: x is declared to have type `int` but is used as type `str`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 14: Expected 1 errors """ diff --git a/conformance/results/pyre/directives_version_platform.toml b/conformance/results/pyre/directives_version_platform.toml index 81d30e36..24d9f1ea 100644 --- a/conformance/results/pyre/directives_version_platform.toml +++ b/conformance/results/pyre/directives_version_platform.toml @@ -4,7 +4,13 @@ Does not support sys.platform checks. Does not support os.name checks. """ output = """ +directives_version_platform.py:31:4 Incompatible variable type [9]: val5 is declared to have type `int` but is used as type `str`. +directives_version_platform.py:36:4 Incompatible variable type [9]: val6 is declared to have type `int` but is used as type `str`. +directives_version_platform.py:40:4 Incompatible variable type [9]: val7 is declared to have type `int` but is used as type `str`. +directives_version_platform.py:45:4 Incompatible variable type [9]: val8 is declared to have type `int` but is used as type `str`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 31: Unexpected errors ['directives_version_platform.py:31:4 Incompatible variable type [9]: val5 is declared to have type `int` but is used as type `str`.'] +Line 36: Unexpected errors ['directives_version_platform.py:36:4 Incompatible variable type [9]: val6 is declared to have type `int` but is used as type `str`.'] """ diff --git a/conformance/results/pyre/enums_definition.toml b/conformance/results/pyre/enums_definition.toml index 717426e9..832a9d48 100644 --- a/conformance/results/pyre/enums_definition.toml +++ b/conformance/results/pyre/enums_definition.toml @@ -3,8 +3,17 @@ notes = """ Does not support custom Enum classes based on EnumType metaclass. Does not support some functional forms for Enum class definitions (optional). """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 75: Unexpected errors ['enums_definition.py:75:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color11.RED]` but got `int`.'] """ output = """ +enums_definition.py:24:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 4 were provided. +enums_definition.py:27:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. +enums_definition.py:28:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. +enums_definition.py:31:9 Too many arguments [19]: Call `Enum.__new__` expects 1 positional argument, 2 were provided. +enums_definition.py:33:12 Undefined attribute [16]: `Enum` has no attribute `RED`. +enums_definition.py:38:12 Undefined attribute [16]: `Color7` has no attribute `RED`. +enums_definition.py:39:12 Undefined attribute [16]: `Color8` has no attribute `RED`. +enums_definition.py:75:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color11.RED]` but got `int`. """ diff --git a/conformance/results/pyre/enums_expansion.toml b/conformance/results/pyre/enums_expansion.toml index cf383d41..8b75a929 100644 --- a/conformance/results/pyre/enums_expansion.toml +++ b/conformance/results/pyre/enums_expansion.toml @@ -2,9 +2,11 @@ conformant = "Pass" notes = """ Does not perform type narrowing based on enum literal expansion (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 53: Expected 1 errors """ output = """ +enums_expansion.py:25:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Color.GREEN]` but got `Color`. +enums_expansion.py:35:12 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Never` but got `Color`. +enums_expansion.py:53:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[CustomFlags.FLAG3]` but got `CustomFlags`. """ diff --git a/conformance/results/pyre/enums_member_names.toml b/conformance/results/pyre/enums_member_names.toml index 993bbd88..109185b5 100644 --- a/conformance/results/pyre/enums_member_names.toml +++ b/conformance/results/pyre/enums_member_names.toml @@ -6,4 +6,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ +enums_member_names.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal['RED']` but got `str`. +enums_member_names.py:22:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal['RED']` but got `typing.Any`. +enums_member_names.py:26:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['RED']]` but got `typing.Any`. +enums_member_names.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['GREEN'], typing_extensions.Literal['RED']]` but got `typing.Any`. """ diff --git a/conformance/results/pyre/enums_member_values.toml b/conformance/results/pyre/enums_member_values.toml index 69d8b861..84241741 100644 --- a/conformance/results/pyre/enums_member_values.toml +++ b/conformance/results/pyre/enums_member_values.toml @@ -9,6 +9,15 @@ conformance_automated = "Fail" errors_diff = """ Line 78: Expected 1 errors Line 85: Expected 1 errors +Line 76: Unexpected errors ['enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized.'] """ output = """ +enums_member_values.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:22:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:26:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[3]]` but got `typing.Any`. +enums_member_values.py:30:4 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[2], typing_extensions.Literal[3]]` but got `typing.Any`. +enums_member_values.py:54:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:68:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:76:4 Uninitialized attribute [13]: Attribute `_value_` is declared in class `Color3` to have type `Color3` but is never initialized. +enums_member_values.py:96:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. """ diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml index 50e938a1..914ecb99 100644 --- a/conformance/results/pyre/enums_members.toml +++ b/conformance/results/pyre/enums_members.toml @@ -14,10 +14,28 @@ errors_diff = """ Line 50: Expected 1 errors Line 82: Expected 1 errors Line 83: Expected 1 errors -Line 84: Expected 1 errors -Line 85: Expected 1 errors Line 116: Expected 1 errors Line 129: Expected 1 errors +Line 27: Unexpected errors ['enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] +Line 28: Unexpected errors ['enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`.'] +Line 35: Unexpected errors ['enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] +Line 36: Unexpected errors ['enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`.'] +Line 100: Unexpected errors ['enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] +Line 117: Unexpected errors ['enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`.'] +Line 128: Unexpected errors ['enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final).'] +Line 139: Unexpected errors ['enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`.'] """ output = """ +enums_members.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. +enums_members.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet`. +enums_members.py:35:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. +enums_members.py:36:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Pet2`. +enums_members.py:84:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.species]` but got `str`. +enums_members.py:85:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. +enums_members.py:100:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. +enums_members.py:117:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `typing_extensions.Literal[Example.c]` but got `member[typing.Callable(Example.c)[[Named(self, Example)], None]]`. +enums_members.py:128:8 Revealed type [-1]: Revealed type for `enums_members.Example2._Example2__B` is `typing_extensions.Literal[Example2._Example2__B]` (final). +enums_members.py:139:4 Inconsistent override [15]: `_ignore_` overrides attribute defined in `Enum` inconsistently. Type `Pet5` is not a subtype of the overridden attribute `typing.Union[typing.List[str], str]`. +enums_members.py:146:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. +enums_members.py:147:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Pet5`. """ diff --git a/conformance/results/pyre/exceptions_context_managers.toml b/conformance/results/pyre/exceptions_context_managers.toml index 54fcb612..9dff9945 100644 --- a/conformance/results/pyre/exceptions_context_managers.toml +++ b/conformance/results/pyre/exceptions_context_managers.toml @@ -2,8 +2,12 @@ conformant = "Unsupported" notes = """ Does not understand context manager exception rules. """ -conformance_automated = "Pass" +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 64fa72b3..0e50c8f7 100644 --- a/conformance/results/pyre/generics_base_class.toml +++ b/conformance/results/pyre/generics_base_class.toml @@ -4,13 +4,13 @@ Does not reject illegal use of Generic. 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: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[...]. """ conformance_automated = "Fail" errors_diff = """ -Line 26: Expected 1 errors Line 29: Expected 1 errors Line 30: Expected 1 errors -Line 49: Expected 1 errors -Line 61: Expected 1 errors -Line 68: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_basic.toml b/conformance/results/pyre/generics_basic.toml index e5a3c7cd..b7e8d00b 100644 --- a/conformance/results/pyre/generics_basic.toml +++ b/conformance/results/pyre/generics_basic.toml @@ -7,16 +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 `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: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[...]. """ conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors -Line 41: Expected 1 errors -Line 49: Expected 1 errors -Line 55: Expected 1 errors -Line 69: Expected 1 errors -Line 121: Expected 1 errors 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 `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 e98d1812..5e641c5b 100644 --- a/conformance/results/pyre/generics_defaults.toml +++ b/conformance/results/pyre/generics_defaults.toml @@ -3,12 +3,106 @@ 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: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: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: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[(*DefaultTs)]` is not a valid type. +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: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[(*Ts, 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[(*Ts, 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: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 = """ -Line 24: Expected 1 errors Line 50: Expected 1 errors Line 104: Expected 1 errors Line 111: Expected 1 errors -Line 138: 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: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: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: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: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[(*DefaultTs)]` is not a valid type.'] +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[(*Ts, 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: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 64c0a213..3da14a21 100644 --- a/conformance/results/pyre/generics_defaults_referential.toml +++ b/conformance/results/pyre/generics_defaults_referential.toml @@ -1,13 +1,61 @@ conformant = "Unsupported" 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: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: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: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: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 53: 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: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: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: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: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 a196a8ad..7de25df9 100644 --- a/conformance/results/pyre/generics_defaults_specialization.toml +++ b/conformance/results/pyre/generics_defaults_specialization.toml @@ -3,9 +3,39 @@ 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 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: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. +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. """ conformance_automated = "Fail" errors_diff = """ -Line 30: Expected 1 errors -Line 55: Expected 1 errors +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 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: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_basic.toml b/conformance/results/pyre/generics_paramspec_basic.toml index ad1538f5..74f97773 100644 --- a/conformance/results/pyre/generics_paramspec_basic.toml +++ b/conformance/results/pyre/generics_paramspec_basic.toml @@ -5,14 +5,21 @@ Incorrectly reports error for legitimate use of ParamSpec in generic type alias. Does not reject ParamSpec when used in various invalid locations. """ output = """ +generics_paramspec_basic.py:15:0 Undefined or invalid type [11]: Annotation `P` is not defined as a type. +generics_paramspec_basic.py:17:0 Incompatible variable type [9]: TA2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. +generics_paramspec_basic.py:17:26 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]`. +generics_paramspec_basic.py:18:0 Incompatible variable type [9]: TA3 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`. +generics_paramspec_basic.py:18:26 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[object, None]`. +generics_paramspec_basic.py:27:13 Invalid type variable [34]: The type variable `P` isn't present in the function's parameters. +generics_paramspec_basic.py:27:13 Undefined or invalid type [11]: Annotation `Concatenate` is not defined as a type. +generics_paramspec_basic.py:31:13 Invalid type parameters [24]: Single type parameter `Variable[_T]` expected, but a callable parameters `generics_paramspec_basic.P` was given for generic type list. """ conformance_automated = "Fail" errors_diff = """ Line 10: Expected 1 errors -Line 15: Expected 1 errors Line 23: Expected 1 errors -Line 27: Expected 1 errors -Line 31: Expected 1 errors Line 35: Expected 1 errors Line 39: Expected 1 errors +Line 17: Unexpected errors ['generics_paramspec_basic.py:17:0 Incompatible variable type [9]: TA2 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'generics_paramspec_basic.py:17:26 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 18: Unexpected errors ['generics_paramspec_basic.py:18:0 Incompatible variable type [9]: TA3 is declared to have type `TypeAlias` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'generics_paramspec_basic.py:18:26 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[object, None]`.'] """ diff --git a/conformance/results/pyre/generics_paramspec_components.toml b/conformance/results/pyre/generics_paramspec_components.toml index 093958aa..daf77e2f 100644 --- a/conformance/results/pyre/generics_paramspec_components.toml +++ b/conformance/results/pyre/generics_paramspec_components.toml @@ -8,10 +8,17 @@ Does not report error when keyword argument is specified between P.args and P.kw Does not report error when calling callable and argument is missing for concatenated parameters. """ 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: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`. """ conformance_automated = "Fail" errors_diff = """ -Line 17: Expected 1 errors Line 20: Expected 1 errors Line 23: Expected 1 errors Line 26: Expected 1 errors @@ -20,11 +27,6 @@ Line 35: Expected 1 errors Line 36: Expected 1 errors Line 38: Expected 1 errors Line 41: Expected 1 errors -Line 49: Expected 1 errors Line 51: Expected 1 errors Line 60: Expected 1 errors -Line 70: Expected 1 errors -Line 72: Expected 1 errors -Line 83: Expected 1 errors -Line 98: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_paramspec_semantics.toml b/conformance/results/pyre/generics_paramspec_semantics.toml index b33334e4..a3a645b6 100644 --- a/conformance/results/pyre/generics_paramspec_semantics.toml +++ b/conformance/results/pyre/generics_paramspec_semantics.toml @@ -1,15 +1,16 @@ 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:98:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. +generics_paramspec_semantics.py:108:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `bool` but got `int`. +generics_paramspec_semantics.py:120:3 Incompatible parameter type [6]: In anonymous call, for 1st positional argument, expected `str` but got `int`. +generics_paramspec_semantics.py:127: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:132: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:137: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" +conformance_automated = "Pass" errors_diff = """ -Line 26: Expected 1 errors -Line 27: Expected 1 errors -Line 61: Expected 1 errors -Line 98: Expected 1 errors -Line 108: Expected 1 errors -Line 120: Expected 1 errors -Line 127: Expected 1 errors -Line 132: Expected 1 errors -Line 137: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_paramspec_specialization.toml b/conformance/results/pyre/generics_paramspec_specialization.toml index dba669c0..34a215ee 100644 --- a/conformance/results/pyre/generics_paramspec_specialization.toml +++ b/conformance/results/pyre/generics_paramspec_specialization.toml @@ -3,12 +3,20 @@ notes = """ Reports error for legitimate use of `...` to specialize ParamSpec """ output = """ +generics_paramspec_specialization.py:32: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:36: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:44: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:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:54:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:55:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:60:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. +generics_paramspec_specialization.py:61:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided. """ conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors -Line 54: Expected 1 errors -Line 55: Expected 1 errors -Line 60: Expected 1 errors -Line 61: Expected 1 errors +Line 32: Unexpected errors ['generics_paramspec_specialization.py:32:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P2`, but a single type `...` was given for generic type ClassB.'] +Line 36: Unexpected errors ['generics_paramspec_specialization.py:36:14 Invalid type parameters [24]: Callable parameters expected for parameter specification `P1`, but a single type `...` was given for generic type ClassA.'] +Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] +Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:4 Too many arguments [19]: PositionalOnly call expects 2 positional arguments, 3 were provided.'] """ diff --git a/conformance/results/pyre/generics_scoping.toml b/conformance/results/pyre/generics_scoping.toml index 4f86bd70..ae6cd48c 100644 --- a/conformance/results/pyre/generics_scoping.toml +++ b/conformance/results/pyre/generics_scoping.toml @@ -4,17 +4,25 @@ 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: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:87:23 Undefined attribute [16]: `list` has no attribute `__getitem__`. +generics_scoping.py:94:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. +generics_scoping.py:95:13 Invalid type variable [34]: The type variable `Variable[T]` can only be used to annotate generic classes or functions. +generics_scoping.py:96:0 Undefined attribute [16]: `list` has no attribute `__getitem__`. """ conformance_automated = "Fail" errors_diff = """ -Line 29: Expected 1 errors -Line 50: Expected 1 errors -Line 54: Expected 1 errors Line 65: Expected 1 errors Line 75: Expected 1 errors -Line 78: Expected 1 errors -Line 87: Expected 1 errors -Line 94: Expected 1 errors -Line 95: Expected 1 errors -Line 96: 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']`."] """ diff --git a/conformance/results/pyre/generics_self_advanced.toml b/conformance/results/pyre/generics_self_advanced.toml index 4796db85..e7ef9d28 100644 --- a/conformance/results/pyre/generics_self_advanced.toml +++ b/conformance/results/pyre/generics_self_advanced.toml @@ -3,7 +3,21 @@ notes = """ 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: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 = "Pass" +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: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_attributes.toml b/conformance/results/pyre/generics_self_attributes.toml index 7bc2b5e3..557fadbf 100644 --- a/conformance/results/pyre/generics_self_attributes.toml +++ b/conformance/results/pyre/generics_self_attributes.toml @@ -3,9 +3,13 @@ notes = """ Does not understand `Self` type. """ output = """ +generics_self_attributes.py:16:10 Undefined or invalid type [11]: Annotation `Self` is not defined as a type. +generics_self_attributes.py:26:5 Unexpected keyword [28]: Unexpected keyword argument `next` to call `OrdinalLinkedList.__init__`. +generics_self_attributes.py:29:14 Unexpected keyword [28]: Unexpected keyword argument `next` to call `OrdinalLinkedList.__init__`. +generics_self_attributes.py:32:14 Unexpected keyword [28]: Unexpected keyword argument `next` to call `LinkedList.__init__`. """ conformance_automated = "Fail" errors_diff = """ -Line 26: Expected 1 errors -Line 32: Expected 1 errors +Line 16: Unexpected errors ['generics_self_attributes.py:16:10 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] +Line 29: Unexpected errors ['generics_self_attributes.py:29:14 Unexpected keyword [28]: Unexpected keyword argument `next` to call `OrdinalLinkedList.__init__`.'] """ diff --git a/conformance/results/pyre/generics_self_basic.toml b/conformance/results/pyre/generics_self_basic.toml index 02a58a1c..8b64f812 100644 --- a/conformance/results/pyre/generics_self_basic.toml +++ b/conformance/results/pyre/generics_self_basic.toml @@ -3,10 +3,17 @@ notes = """ Does not handle use of `Self` as a generic type. """ output = """ +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:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`. +generics_self_basic.py:33:8 Incompatible return type [7]: Expected `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]` but got `Shape`. +generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. """ conformance_automated = "Fail" errors_diff = """ -Line 20: Expected 1 errors -Line 33: Expected 1 errors Line 67: Expected 1 errors +Line 14: Unexpected errors ['generics_self_basic.py:14:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.', 'generics_self_basic.py:14:26 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] +Line 27: Unexpected errors ['generics_self_basic.py:27:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] +Line 40: Unexpected errors ['generics_self_basic.py:40:8 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] """ diff --git a/conformance/results/pyre/generics_self_protocols.toml b/conformance/results/pyre/generics_self_protocols.toml index 0d95e9a9..309def8b 100644 --- a/conformance/results/pyre/generics_self_protocols.toml +++ b/conformance/results/pyre/generics_self_protocols.toml @@ -3,9 +3,9 @@ notes = """ Does not reject protocol compatibility due to method `Self` return type. """ output = """ +generics_self_protocols.py:61:18 Incompatible parameter type [6]: In call `accepts_shape`, for 1st positional argument, expected `ShapeProtocol` but got `BadReturnType`. """ conformance_automated = "Fail" errors_diff = """ -Line 61: Expected 1 errors Line 64: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_self_usage.toml b/conformance/results/pyre/generics_self_usage.toml index 69cd993a..8907b5e7 100644 --- a/conformance/results/pyre/generics_self_usage.toml +++ b/conformance/results/pyre/generics_self_usage.toml @@ -8,18 +8,21 @@ 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: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" errors_diff = """ Line 73: Expected 1 errors Line 76: Expected 1 errors Line 82: Expected 1 errors -Line 86: Expected 1 errors Line 101: Expected 1 errors Line 103: Expected 1 errors -Line 106: Expected 1 errors Line 111: Expected 1 errors Line 116: Expected 1 errors Line 121: Expected 1 errors Line 125: Expected 1 errors +Line 20: Unexpected errors ['generics_self_usage.py:20:34 Undefined or invalid type [11]: Annotation `Self` is not defined as a type.'] """ diff --git a/conformance/results/pyre/generics_syntax_compatibility.toml b/conformance/results/pyre/generics_syntax_compatibility.toml index 4c39980d..46268f56 100644 --- a/conformance/results/pyre/generics_syntax_compatibility.toml +++ b/conformance/results/pyre/generics_syntax_compatibility.toml @@ -3,9 +3,9 @@ notes = """ Type parameter syntax not yet support. """ output = """ +generics_syntax_compatibility.py:14:13 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ -Line 14: Expected 1 errors Line 26: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_syntax_declarations.toml b/conformance/results/pyre/generics_syntax_declarations.toml index fed137d7..59b938d5 100644 --- a/conformance/results/pyre/generics_syntax_declarations.toml +++ b/conformance/results/pyre/generics_syntax_declarations.toml @@ -3,6 +3,7 @@ notes = """ Type parameter syntax not yet support. """ output = """ +generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -16,4 +17,5 @@ Line 66: Expected 1 errors Line 73: Expected 1 errors Line 77: Expected 1 errors Line 81: Expected 1 errors +Line 13: Unexpected errors ['generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index be4fcbbd..2a2c10d6 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -3,6 +3,7 @@ notes = """ Type parameter syntax not yet support. """ output = """ +generics_syntax_infer_variance.py:125:25 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -25,4 +26,5 @@ Line 121: Expected 1 errors Line 129: Expected 1 errors Line 137: Expected 1 errors Line 148: Expected 1 errors +Line 125: Unexpected errors ['generics_syntax_infer_variance.py:125:25 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/generics_syntax_scoping.toml b/conformance/results/pyre/generics_syntax_scoping.toml index 5424b352..db9a56f1 100644 --- a/conformance/results/pyre/generics_syntax_scoping.toml +++ b/conformance/results/pyre/generics_syntax_scoping.toml @@ -3,10 +3,10 @@ notes = """ Type parameter syntax not yet support. """ output = """ +generics_syntax_scoping.py:14:13 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ -Line 14: Expected 1 errors Line 18: Expected 1 errors Line 35: Expected 1 errors Line 44: Expected 1 errors diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index 6b193b5a..f2bc6919 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -5,14 +5,24 @@ False negatives on instance attribute access on the type. Does not infer type of `DefaultDict` with explicit type parameters on constructor. """ output = """ +generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. +generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. +generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`. +generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`. +generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. +generics_type_erasure.py:40:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. +generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ -Line 38: Expected 1 errors -Line 40: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors Line 44: Expected 1 errors Line 45: Expected 1 errors Line 46: Expected 1 errors +Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] +Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] +Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] +Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[0]`.'] +Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_args.toml b/conformance/results/pyre/generics_typevartuple_args.toml index 12b55605..eaca737d 100644 --- a/conformance/results/pyre/generics_typevartuple_args.toml +++ b/conformance/results/pyre/generics_typevartuple_args.toml @@ -3,6 +3,15 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ +generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*Ts` is not a valid type. +generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*Ts, generics_typevartuple_args.Env)]` is not a valid type. +generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +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. +generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_args.py:75:12 Incompatible parameter type [6]: In call `func4`, for 2nd positional argument, expected `Tuple[]` but got `Tuple[int, int]`. Expected has length 1, but actual has length 2. """ conformance_automated = "Fail" errors_diff = """ @@ -13,6 +22,11 @@ Line 57: Expected 1 errors Line 58: Expected 1 errors Line 59: Expected 1 errors Line 67: Expected 1 errors -Line 75: Expected 1 errors Line 76: Expected 1 errors +Line 16: Unexpected errors ['generics_typevartuple_args.py:16:25 Invalid type [31]: Expression `*Ts` is not a valid type.', 'generics_typevartuple_args.py:16:33 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] +Line 27: Unexpected errors ['generics_typevartuple_args.py:27:30 Invalid type [31]: Expression `*tuple[(*Ts, generics_typevartuple_args.Env)]` is not a valid type.', 'generics_typevartuple_args.py:27:76 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] +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.'] +Line 70: Unexpected errors ['generics_typevartuple_args.py:70:17 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_basic.toml b/conformance/results/pyre/generics_typevartuple_basic.toml index 053768fd..8964996a 100644 --- a/conformance/results/pyre/generics_typevartuple_basic.toml +++ b/conformance/results/pyre/generics_typevartuple_basic.toml @@ -3,22 +3,71 @@ notes = """ Does not support TypeVarTuple. """ output = """ +generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. +generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*Ts` is not a valid type. +generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:36:0 Incompatible variable type [9]: v1 is declared to have type `Array[]` but is used as type `Array`. +generics_typevartuple_basic.py:36:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:36:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Height, Width]`. Expected has length 1, but actual has length 2. +generics_typevartuple_basic.py:37:0 Incompatible variable type [9]: v2 is declared to have type `Array[]` but is used as type `Array`. +generics_typevartuple_basic.py:37:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:37:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Height, Width]`. Expected has length 1, but actual has length 3. +generics_typevartuple_basic.py:38:0 Incompatible variable type [9]: v3 is declared to have type `Array[]` but is used as type `Array`. +generics_typevartuple_basic.py:38:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:39:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Height, Width]`. Expected has length 1, but actual has length 4. +generics_typevartuple_basic.py:42:0 Incompatible variable type [9]: v4 is declared to have type `Array[]` but is used as type `Array`. +generics_typevartuple_basic.py:42:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:42:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Height`. +generics_typevartuple_basic.py:43:0 Incompatible variable type [9]: v5 is declared to have type `Array[]` but is used as type `Array`. +generics_typevartuple_basic.py:43:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:43:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Width]`. Expected has length 1, but actual has length 2. +generics_typevartuple_basic.py:44:0 Incompatible variable type [9]: v6 is declared to have type `Array[]` but is used as type `Array`. +generics_typevartuple_basic.py:44:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:45:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Width, Height]`. Expected has length 1, but actual has length 4. +generics_typevartuple_basic.py:52:13 Undefined or invalid type [11]: Annotation `Shape` is not defined as a type. +generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:65:6 Unexpected keyword [28]: Unexpected keyword argument `covariant` to call `TypeVarTuple.__init__`. +generics_typevartuple_basic.py:66:6 Too many arguments [19]: Call `TypeVarTuple.__init__` expects 1 positional argument, 3 were provided. +generics_typevartuple_basic.py:67:6 Unexpected keyword [28]: Unexpected keyword argument `bound` to call `TypeVarTuple.__init__`. +generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_basic.py:90:6 Incompatible parameter type [6]: In call `func2`, for 1st positional argument, expected `Tuple[]` but got `Tuple[int, int]`. Expected has length 1, but actual has length 2. +generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type. +generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:97:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:97:31 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:97:48 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_basic.py:106:13 Invalid type [31]: Expression `typing.Generic[(*Ts1, *Ts2)]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 52: Expected 1 errors Line 53: Expected 1 errors Line 56: Expected 1 errors Line 59: Expected 1 errors -Line 65: Expected 1 errors -Line 66: Expected 1 errors -Line 67: Expected 1 errors Line 89: Expected 1 errors -Line 90: Expected 1 errors Line 99: Expected 1 errors Line 100: Expected 1 errors -Line 106: Expected 1 errors -Lines 44, 45: Expected error (tag 'v6') +Line 12: Unexpected errors ['generics_typevartuple_basic.py:12:13 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] +Line 16: Unexpected errors ['generics_typevartuple_basic.py:16:17 Invalid type [31]: Expression `*Ts` is not a valid type.', 'generics_typevartuple_basic.py:16:25 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] +Line 23: Unexpected errors ['generics_typevartuple_basic.py:23:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type.'] +Line 24: Unexpected errors ['generics_typevartuple_basic.py:24:30 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] +Line 25: Unexpected errors ['generics_typevartuple_basic.py:25:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] +Line 27: Unexpected errors ['generics_typevartuple_basic.py:27:27 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] +Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:0 Incompatible variable type [9]: v1 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:36:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:36:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Height, Width]`. Expected has length 1, but actual has length 2.'] +Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:0 Incompatible variable type [9]: v2 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:37:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:37:40 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Batch, Height, Width]`. Expected has length 1, but actual has length 3.'] +Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:0 Incompatible variable type [9]: v3 is declared to have type `Array[]` but is used as type `Array`.', 'generics_typevartuple_basic.py:38:4 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 39: Unexpected errors ['generics_typevartuple_basic.py:39:4 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Time, Batch, Height, Width]`. Expected has length 1, but actual has length 4.'] +Line 54: Unexpected errors ['generics_typevartuple_basic.py:54:21 Invalid type [31]: Expression `tuple[(*Shape)]` is not a valid type.'] +Line 75: Unexpected errors ['generics_typevartuple_basic.py:75:16 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:34 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_basic.py:75:49 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.'] +Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:16 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:16 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:34 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:34 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:93:52 Invalid type [31]: Expression `generics_typevartuple_basic.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_basic.py:93:52 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:97:31 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_basic.py:97:48 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_callable.toml b/conformance/results/pyre/generics_typevartuple_callable.toml index 3d6c9c44..e3c989ea 100644 --- a/conformance/results/pyre/generics_typevartuple_callable.toml +++ b/conformance/results/pyre/generics_typevartuple_callable.toml @@ -3,8 +3,26 @@ notes = """ Does not support TypeVarTuple. """ output = """ +generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*Ts], None)]` is not a valid type. +generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +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. +generics_typevartuple_callable.py:26: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:26:22 Incompatible parameter type [6]: In call `Process.__init__`, for argument `args`, expected `Tuple[]` but got `Tuple[str, int]`. Expected has length 1, but actual has length 2. +generics_typevartuple_callable.py:29:13 Invalid type [31]: Expression `typing.Callable[([int, *Ts, T], tuple[(T, *Ts)])]` is not a valid type. +generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*Ts, 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: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, *Ts, T)]` is not a valid type. +generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[(T, *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. """ conformance_automated = "Fail" errors_diff = """ -Line 26: Expected 1 errors +Line 17: Unexpected errors ['generics_typevartuple_callable.py:17:31 Invalid type [31]: Expression `typing.Callable[([*Ts], None)]` is not a valid type.', 'generics_typevartuple_callable.py:17:60 Invalid type [31]: Expression `tuple[(*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, *Ts, T], tuple[(T, *Ts)])]` is not a valid type.', 'generics_typevartuple_callable.py:29:56 Invalid type [31]: Expression `tuple[(*Ts, 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]]`.'] +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, *Ts, T)]` is not a valid type.', 'generics_typevartuple_callable.py:45:42 Invalid type [31]: Expression `tuple[(T, *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."] """ diff --git a/conformance/results/pyre/generics_typevartuple_concat.toml b/conformance/results/pyre/generics_typevartuple_concat.toml index fc713546..e3a1bf0f 100644 --- a/conformance/results/pyre/generics_typevartuple_concat.toml +++ b/conformance/results/pyre/generics_typevartuple_concat.toml @@ -3,7 +3,37 @@ notes = """ Does not support TypeVarTuple. """ output = """ +generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. +generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. +generics_typevartuple_concat.py:26:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type. +generics_typevartuple_concat.py:26:40 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *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 `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type. +generics_typevartuple_concat.py:30:47 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_concat.py:34:26 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*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 `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *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:47:26 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[(T, *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:55:36 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type. +generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*Ts, 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]`. +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`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 22: Unexpected errors ['generics_typevartuple_concat.py:22:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] +Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(*Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:22 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_concat.py:26:40 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_concat.py:26:40 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:22 Invalid type [31]: Expression `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *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 `generics_typevartuple_concat.Array[(*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 `generics_typevartuple_concat.Array[(*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 `generics_typevartuple_concat.Array[(generics_typevartuple_concat.Batch, *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 47: Unexpected errors ['generics_typevartuple_concat.py:47:26 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:47:41 Invalid type [31]: Expression `tuple[(T, *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 55: Unexpected errors ['generics_typevartuple_concat.py:55:36 Invalid type [31]: Expression `tuple[(T, *Ts)]` is not a valid type.', 'generics_typevartuple_concat.py:55:54 Invalid type [31]: Expression `tuple[(*Ts, 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 2f19de53..9696e56a 100644 --- a/conformance/results/pyre/generics_typevartuple_overloads.toml +++ b/conformance/results/pyre/generics_typevartuple_overloads.toml @@ -3,7 +3,18 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ +generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type. +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. +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. +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. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 16: Unexpected errors ['generics_typevartuple_overloads.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Shape)]` is not a valid type.'] +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.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_specialization.toml b/conformance/results/pyre/generics_typevartuple_specialization.toml index 7f281215..d6cf07fe 100644 --- a/conformance/results/pyre/generics_typevartuple_specialization.toml +++ b/conformance/results/pyre/generics_typevartuple_specialization.toml @@ -3,13 +3,78 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ +generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. +generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `generics_typevartuple_specialization.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. +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: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: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[(DType, *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: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:92:13 Undefined or invalid type [11]: Annotation `VariadicTuple` is not defined as a type. +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 Unable to concatenate tuple [60]: Concatenation not yet support for multiple variadic tuples: `*Ts, *tuple[(int, ...)]`. +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 `TA7[(*Ts, T1, 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[(*Ts)], T1, 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:143:13 Invalid type [31]: Expression `TA8[(T1, *Ts, T2, 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[(*Ts)], T1, T2, 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. +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 `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 `TA9[(*tuple[(int, ...)], str)]` is not a valid type. +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 121: Expected 1 errors -Line 122: Expected 1 errors -Line 127: Expected 1 errors Line 163: Expected 1 errors +Line 16: Unexpected errors ['generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] +Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:26 Invalid type [31]: Expression `generics_typevartuple_specialization.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: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 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[(DType, *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: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 92: Unexpected errors ['generics_typevartuple_specialization.py:92:13 Undefined or invalid type [11]: Annotation `VariadicTuple` is not defined as a type.'] +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 `TA7[(*Ts, T1, 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[(*Ts)], T1, 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 143: Unexpected errors ['generics_typevartuple_specialization.py:143:13 Invalid type [31]: Expression `TA8[(T1, *Ts, T2, 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[(*Ts)], T1, T2, 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 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 `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 `TA9[(*tuple[(int, ...)], str)]` is not a valid type.'] +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 278fe056..7e2f93c9 100644 --- a/conformance/results/pyre/generics_typevartuple_unpack.toml +++ b/conformance/results/pyre/generics_typevartuple_unpack.toml @@ -3,8 +3,25 @@ notes = """ Does not support star expressions for `Unpack`. """ output = """ +generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type. +generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type. +generics_typevartuple_unpack.py:21:30 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_unpack.py:26:7 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_unpack.py:26:49 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_unpack.py:26:76 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *Shape)]` is not a valid type. +generics_typevartuple_unpack.py:36:29 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_unpack.py:40:28 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. +generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(*tuple[(typing.Any, ...)])]` is not a valid type. +generics_typevartuple_unpack.py:44:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters. """ conformance_automated = "Fail" errors_diff = """ Line 30: Expected 1 errors +Line 17: Unexpected errors ['generics_typevartuple_unpack.py:17:12 Invalid type [31]: Expression `typing.Generic[(*Ts)]` is not a valid type.'] +Line 21: Unexpected errors ['generics_typevartuple_unpack.py:21:30 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *tuple[(typing.Any, ...)], generics_typevartuple_unpack.Channels)]` is not a valid type.', 'generics_typevartuple_unpack.py:21:30 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 26: Unexpected errors ['generics_typevartuple_unpack.py:26:7 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_unpack.py:26:49 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.', 'generics_typevartuple_unpack.py:26:76 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 36: Unexpected errors ['generics_typevartuple_unpack.py:36:29 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(generics_typevartuple_unpack.Batch, *Shape)]` is not a valid type.', 'generics_typevartuple_unpack.py:36:29 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 40: Unexpected errors ['generics_typevartuple_unpack.py:40:28 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] +Line 44: Unexpected errors ['generics_typevartuple_unpack.py:44:13 Invalid type [31]: Expression `generics_typevartuple_unpack.Array[(*tuple[(typing.Any, ...)])]` is not a valid type.', 'generics_typevartuple_unpack.py:44:13 Invalid type parameters [24]: Non-generic type `Array` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_upper_bound.toml b/conformance/results/pyre/generics_upper_bound.toml index 2d884827..b54303c5 100644 --- a/conformance/results/pyre/generics_upper_bound.toml +++ b/conformance/results/pyre/generics_upper_bound.toml @@ -4,10 +4,11 @@ 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: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`. """ conformance_automated = "Fail" errors_diff = """ -Line 24: Expected 1 errors -Line 51: Expected 1 errors Line 56: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_variance.toml b/conformance/results/pyre/generics_variance.toml index 4f5db55c..3054f35e 100644 --- a/conformance/results/pyre/generics_variance.toml +++ b/conformance/results/pyre/generics_variance.toml @@ -4,20 +4,20 @@ Does not reject a TypeVar that is defined as both covariant and contravariant. Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible. """ output = """ +generics_variance.py:77:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. +generics_variance.py:81:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T]` because subclasses cannot use more permissive type variables than their superclasses. +generics_variance.py:93:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T_co](covariant)` because subclasses cannot use more permissive type variables than their superclasses. +generics_variance.py:105:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T_contra](contravariant)` because subclasses cannot use more permissive type variables than their superclasses. +generics_variance.py:125:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T_contra](contravariant)` because subclasses cannot use more permissive type variables than their superclasses. +generics_variance.py:131:0 Invalid type variance [46]: The type variable `Variable[T_contra](contravariant)` is incompatible with parent class type variable `Variable[T_co](covariant)` because subclasses cannot use more permissive type variables than their superclasses. """ conformance_automated = "Fail" errors_diff = """ Line 14: Expected 1 errors -Line 77: Expected 1 errors -Line 81: Expected 1 errors -Line 93: Expected 1 errors -Line 105: Expected 1 errors Line 113: Expected 1 errors Line 163: Expected 1 errors Line 167: Expected 1 errors Line 191: Expected 1 errors -Lines 125, 126: Expected error (tag 'CoContra_Child2') -Lines 131, 132: Expected error (tag 'CoContra_Child3') Lines 141, 142: Expected error (tag 'CoContra_Child5') Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') """ diff --git a/conformance/results/pyre/generics_variance_inference.toml b/conformance/results/pyre/generics_variance_inference.toml index 6282d44d..a0efdd76 100644 --- a/conformance/results/pyre/generics_variance_inference.toml +++ b/conformance/results/pyre/generics_variance_inference.toml @@ -3,6 +3,7 @@ notes = """ Type parameter syntax not yet support. """ output = """ +generics_variance_inference.py:15:13 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -29,4 +30,5 @@ Line 169: Expected 1 errors Line 170: Expected 1 errors Line 181: Expected 1 errors Line 194: Expected 1 errors +Line 15: Unexpected errors ['generics_variance_inference.py:15:13 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/historical_positional.toml b/conformance/results/pyre/historical_positional.toml index 97c3b23a..9e1a52b2 100644 --- a/conformance/results/pyre/historical_positional.toml +++ b/conformance/results/pyre/historical_positional.toml @@ -5,11 +5,15 @@ 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`. +historical_positional.py:32:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f3`. +historical_positional.py:43:0 Unexpected keyword [28]: Unexpected keyword argument `__x` to call `A.m1`. +historical_positional.py:53:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f4`. """ conformance_automated = "Fail" errors_diff = """ -Line 18: Expected 1 errors Line 26: Expected 1 errors Line 38: Expected 1 errors -Line 43: Expected 1 errors +Line 32: Unexpected errors ['historical_positional.py:32:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f3`.'] +Line 53: Unexpected errors ['historical_positional.py:53:0 Unexpected keyword [28]: Unexpected keyword argument `__y` to call `f4`.'] """ diff --git a/conformance/results/pyre/literals_interactions.toml b/conformance/results/pyre/literals_interactions.toml index eabf31e3..fd34d1f4 100644 --- a/conformance/results/pyre/literals_interactions.toml +++ b/conformance/results/pyre/literals_interactions.toml @@ -6,6 +6,9 @@ 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: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. """ conformance_automated = "Fail" errors_diff = """ @@ -13,4 +16,7 @@ Line 15: Expected 1 errors Line 16: Expected 1 errors Line 17: Expected 1 errors Line 18: Expected 1 errors +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 27cfa146..d9248118 100644 --- a/conformance/results/pyre/literals_literalstring.toml +++ b/conformance/results/pyre/literals_literalstring.toml @@ -3,16 +3,19 @@ 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']`. +literals_literalstring.py:120:21 Incompatible parameter type [6]: In call `literal_identity`, for 1st positional argument, expected `Variable[TLiteral (bound to typing_extensions.LiteralString)]` but got `str`. +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 = "Fail" errors_diff = """ -Line 36: Expected 1 errors -Line 37: Expected 1 errors -Line 43: Expected 1 errors -Line 66: Expected 1 errors -Line 74: Expected 1 errors -Line 75: Expected 1 errors -Line 120: Expected 1 errors -Line 134: Expected 1 errors -Line 171: Expected 1 errors +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 3e6bd453..6dc0a522 100644 --- a/conformance/results/pyre/literals_parameterizations.toml +++ b/conformance/results/pyre/literals_parameterizations.toml @@ -6,24 +6,32 @@ Does not reject tuple in Literal type expression. Does not reject "bare" Literal in type expression. """ output = """ +literals_parameterizations.py:33:0 Invalid type [31]: Expression `AppendMode` is not a literal value. +literals_parameterizations.py:33:0 Invalid type [31]: Expression `ReadOnlyMode` is not a literal value. +literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteAndTruncateMode` is not a literal value. +literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteNoTruncateMode` is not a literal value. +literals_parameterizations.py:33:0 Undefined or invalid type [11]: Annotation `` is not defined as a type. +literals_parameterizations.py:35:8 Invalid type [31]: Expression `typing.Literal[(typing.Literal[(typing.Literal[(1, 2, 3)], "foo")], 5, None)]` is not a valid type. +literals_parameterizations.py:41:6 Invalid type [31]: Expression `typing.Literal[3 + 4]` is not a valid type. +literals_parameterizations.py:42:6 Invalid type [31]: Expression `typing.Literal["foo".replace("o", "b")]` is not a valid type. +literals_parameterizations.py:43:6 Invalid type [31]: Expression `typing.Literal[4 + 3.000000j]` is not a valid type. +literals_parameterizations.py:44:6 Invalid type [31]: Expression `typing.Literal[~ 5]` is not a valid type. +literals_parameterizations.py:45:6 Invalid type [31]: Expression `typing.Literal[not False]` is not a valid type. +literals_parameterizations.py:47:6 Invalid type [31]: Expression `typing.Literal[{ "a":"b","c":"d" }]` is not a valid type. +literals_parameterizations.py:48:6 Invalid type [31]: Expression `typing.Literal[int]` is not a valid type. +literals_parameterizations.py:49:6 Invalid type [31]: Expression `variable` is not a literal value. +literals_parameterizations.py:50:7 Invalid type [31]: Expression `T` is not a literal value. +literals_parameterizations.py:51:7 Invalid type [31]: Expression `typing.Literal[3.140000]` is not a valid type. +literals_parameterizations.py:52:7 Invalid type [31]: Expression `Any` is not a literal value. +literals_parameterizations.py:53:7 Invalid type [31]: Expression `typing.Literal[...]` is not a valid type. +literals_parameterizations.py:56:19 Invalid type [31]: Expression `typing.Literal[1 + 2]` is not a valid type. +literals_parameterizations.py:61:3 Invalid type [31]: Expression `my_function` is not a literal value. +literals_parameterizations.py:65:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.Literal['Color.RED']` but is used as type `typing_extensions.Literal[Color.RED]`. """ conformance_automated = "Fail" errors_diff = """ -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 49: Expected 1 errors -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 52: Expected 1 errors -Line 53: Expected 1 errors -Line 56: Expected 1 errors Line 60: Expected 1 errors -Line 61: Expected 1 errors -Line 65: Expected 1 errors +Line 33: Unexpected errors ['literals_parameterizations.py:33:0 Invalid type [31]: Expression `AppendMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `ReadOnlyMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteAndTruncateMode` is not a literal value.', 'literals_parameterizations.py:33:0 Invalid type [31]: Expression `WriteNoTruncateMode` is not a literal value.', 'literals_parameterizations.py:33:0 Undefined or invalid type [11]: Annotation `` is not defined as a type.'] +Line 35: Unexpected errors ['literals_parameterizations.py:35:8 Invalid type [31]: Expression `typing.Literal[(typing.Literal[(typing.Literal[(1, 2, 3)], "foo")], 5, None)]` is not a valid type.'] """ diff --git a/conformance/results/pyre/literals_semantics.toml b/conformance/results/pyre/literals_semantics.toml index 1e7ee183..b2d2d151 100644 --- a/conformance/results/pyre/literals_semantics.toml +++ b/conformance/results/pyre/literals_semantics.toml @@ -1,10 +1,10 @@ conformant = "Pass" output = """ +literals_semantics.py:10:0 Incompatible variable type [9]: v2 is declared to have type `typing_extensions.Literal[3]` but is used as type `typing_extensions.Literal[4]`. +literals_semantics.py:24:4 Incompatible variable type [9]: x1 is declared to have type `typing_extensions.Literal[False]` but is used as type `typing_extensions.Literal[0]`. +literals_semantics.py:25:4 Incompatible variable type [9]: x2 is declared to have type `typing_extensions.Literal[0]` but is used as type `typing_extensions.Literal[False]`. +literals_semantics.py:33:4 Incompatible variable type [9]: a is declared to have type `Union[typing_extensions.Literal[3], typing_extensions.Literal[4], typing_extensions.Literal[5]]` but is used as type `int`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 10: Expected 1 errors -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 33: Expected 1 errors """ diff --git a/conformance/results/pyre/namedtuples_define_class.toml b/conformance/results/pyre/namedtuples_define_class.toml index 9169ea7b..49225bc7 100644 --- a/conformance/results/pyre/namedtuples_define_class.toml +++ b/conformance/results/pyre/namedtuples_define_class.toml @@ -8,19 +8,39 @@ 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: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`. +namedtuples_define_class.py:47:17 Incompatible parameter type [6]: In call `Point.__init__`, for argument `units`, expected `str` but got `int`. +namedtuples_define_class.py:48:5 Too many arguments [19]: Call `Point.__init__` expects 3 positional arguments, 4 were provided. +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" errors_diff = """ Line 32: Expected 1 errors Line 33: 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 49: Expected 1 errors Line 59: Expected 1 errors -Line 79: Expected 1 errors -Line 98: Expected 1 errors Line 105: Expected 1 errors +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 a40236c5..ac10f8e5 100644 --- a/conformance/results/pyre/namedtuples_define_functional.toml +++ b/conformance/results/pyre/namedtuples_define_functional.toml @@ -5,16 +5,33 @@ Does not handle defined fields correctly when extra flags like `rename` or `defa Does not support defaults in functional form. """ output = """ +namedtuples_define_functional.py:16:7 Missing argument [20]: Call `Point1.__init__` expects argument `y`. +namedtuples_define_functional.py:21:7 Missing argument [20]: Call `Point2.__init__` expects argument `x`. +namedtuples_define_functional.py:26:7 Too many arguments [19]: Call `Point3.__init__` expects 2 positional arguments, 3 were provided. +namedtuples_define_functional.py:31:7 Unexpected keyword [28]: Unexpected keyword argument `z` to call `Point4.__init__`. +namedtuples_define_functional.py:36:17 Incompatible parameter type [6]: In call `Point5.__init__`, for 2nd positional argument, expected `int` but got `str`. +namedtuples_define_functional.py:37:7 Too many arguments [19]: Call `Point5.__init__` expects 2 positional arguments, 3 were provided. +namedtuples_define_functional.py:42:17 Incompatible parameter type [6]: In call `Point6.__init__`, for 2nd positional argument, expected `int` but got `str`. +namedtuples_define_functional.py:43:14 Incompatible parameter type [6]: In call `Point6.__init__`, for argument `x`, expected `int` but got `float`. +namedtuples_define_functional.py:52:0 Duplicate parameter [65]: Duplicate parameter name `a`. +namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `False` is not a valid type. +namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `False` is not a valid type. +namedtuples_define_functional.py:54:47 Invalid type [31]: Expression `typing.Final[False]` is not a valid type. +namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type. +namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type. +namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `typing.Final[True]` is not a valid type. +namedtuples_define_functional.py:57:0 Unexpected keyword [28]: Unexpected keyword argument `abc` to call `NT4.__init__`. +namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type. +namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type. +namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type. +namedtuples_define_functional.py:63:42 Invalid type parameters [24]: Generic type `typing.Final` expects 1 type parameter, received 2. +namedtuples_define_functional.py:65:0 Too many arguments [19]: Call `NT5.__init__` expects 1 positional argument, 3 were provided. +namedtuples_define_functional.py:66:0 Missing argument [20]: Call `NT5.__init__` expects argument `defaults`. """ conformance_automated = "Fail" errors_diff = """ -Line 16: Expected 1 errors -Line 21: Expected 1 errors -Line 26: Expected 1 errors -Line 31: Expected 1 errors -Line 36: Expected 1 errors -Line 37: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 66: Expected 1 errors +Line 56: Unexpected errors ['namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type.', 'namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `True` is not a valid type.', 'namedtuples_define_functional.py:56:47 Invalid type [31]: Expression `typing.Final[True]` is not a valid type.'] +Line 57: Unexpected errors ['namedtuples_define_functional.py:57:0 Unexpected keyword [28]: Unexpected keyword argument `abc` to call `NT4.__init__`.'] +Line 63: Unexpected errors ['namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `typing.Final[(1, 2)]` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type [31]: Expression `(1, 2)` is not a valid type.', 'namedtuples_define_functional.py:63:42 Invalid type parameters [24]: Generic type `typing.Final` expects 1 type parameter, received 2.'] +Line 65: Unexpected errors ['namedtuples_define_functional.py:65:0 Too many arguments [19]: Call `NT5.__init__` expects 1 positional argument, 3 were provided.'] """ diff --git a/conformance/results/pyre/namedtuples_type_compat.toml b/conformance/results/pyre/namedtuples_type_compat.toml index b1f8fe73..76f3303c 100644 --- a/conformance/results/pyre/namedtuples_type_compat.toml +++ b/conformance/results/pyre/namedtuples_type_compat.toml @@ -3,9 +3,15 @@ notes = """ Rejects valid type compatibility between named tuple and tuple. """ output = """ +namedtuples_type_compat.py:20:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. +namedtuples_type_compat.py:21:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. +namedtuples_type_compat.py:22:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. +namedtuples_type_compat.py:23:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. +namedtuples_type_compat.py:27:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple. """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors +Line 20: Unexpected errors ['namedtuples_type_compat.py:20:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple.'] +Line 21: Unexpected errors ['namedtuples_type_compat.py:21:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple.'] +Line 27: Unexpected errors ['namedtuples_type_compat.py:27:0 Incompatible variable type [9]: Unable to unpack `Point`, expected a tuple.'] """ diff --git a/conformance/results/pyre/namedtuples_usage.toml b/conformance/results/pyre/namedtuples_usage.toml index bd0e145a..a9956c36 100644 --- a/conformance/results/pyre/namedtuples_usage.toml +++ b/conformance/results/pyre/namedtuples_usage.toml @@ -7,15 +7,29 @@ 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. +namedtuples_usage.py:53:0 Unable to unpack [23]: Unable to unpack 3 values, 4 were expected. +namedtuples_usage.py:61:0 Unable to unpack [23]: Unable to unpack 0 values, 3 were expected. """ conformance_automated = "Fail" errors_diff = """ Line 34: Expected 1 errors Line 35: Expected 1 errors -Line 40: Expected 1 errors -Line 41: Expected 1 errors Line 42: Expected 1 errors Line 43: Expected 1 errors -Line 52: Expected 1 errors -Line 53: 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 a0640951..7bf7ead7 100644 --- a/conformance/results/pyre/narrowing_typeguard.toml +++ b/conformance/results/pyre/narrowing_typeguard.toml @@ -3,11 +3,13 @@ notes = """ Does not reject TypeGuard method with too few parameters. """ output = """ +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]]`. """ conformance_automated = "Fail" errors_diff = """ Line 102: Expected 1 errors Line 107: Expected 1 errors -Line 128: Expected 1 errors -Line 148: Expected 1 errors +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 a2ba4fe8..2746dc5f 100644 --- a/conformance/results/pyre/narrowing_typeis.toml +++ b/conformance/results/pyre/narrowing_typeis.toml @@ -1,5 +1,17 @@ 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: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 = """ @@ -12,4 +24,16 @@ Line 170: Expected 1 errors Line 191: Expected 1 errors 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: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/overloads_basic.toml b/conformance/results/pyre/overloads_basic.toml index 9eb8ad76..7de070af 100644 --- a/conformance/results/pyre/overloads_basic.toml +++ b/conformance/results/pyre/overloads_basic.toml @@ -3,10 +3,10 @@ notes = """ Does not reject a function with a single @overload signature. """ output = """ +overloads_basic.py:37:2 Incompatible parameter type [6]: In call `Bytes.__getitem__`, for 1st positional argument, expected `int` but got `str`. +overloads_basic.py:75:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation. """ conformance_automated = "Fail" errors_diff = """ -Line 37: Expected 1 errors Lines 62, 63: Expected error (tag 'func1') -Lines 74, 75: Expected error (tag 'func2') """ diff --git a/conformance/results/pyre/protocols_class_objects.toml b/conformance/results/pyre/protocols_class_objects.toml index 500a6f9f..9a640450 100644 --- a/conformance/results/pyre/protocols_class_objects.toml +++ b/conformance/results/pyre/protocols_class_objects.toml @@ -5,15 +5,17 @@ Incorrectly reports some class objects as incompatible with a protocol. Fails to report some class objects as incompatible with a protocol. """ output = """ +protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`. +protocols_class_objects.py:58:0 Incompatible variable type [9]: pa1 is declared to have type `ProtoA1` but is used as type `Type[ConcreteA]`. """ conformance_automated = "Fail" errors_diff = """ Line 29: Expected 1 errors Line 34: Expected 1 errors -Line 58: Expected 1 errors Line 74: Expected 1 errors Line 104: Expected 1 errors Line 106: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors +Line 26: Unexpected errors ['protocols_class_objects.py:26:11 Invalid class instantiation [45]: Cannot instantiate abstract class `Proto` with abstract method `meth`.'] """ diff --git a/conformance/results/pyre/protocols_definition.toml b/conformance/results/pyre/protocols_definition.toml index 659f73de..10231997 100644 --- a/conformance/results/pyre/protocols_definition.toml +++ b/conformance/results/pyre/protocols_definition.toml @@ -8,27 +8,27 @@ Does not reject immutable named tuple attribute in concrete class when protocol Does not reject immutable frozen dataclass attribute in concrete class when protocol attribute is mutable. """ output = """ +protocols_definition.py:30:10 Incompatible parameter type [6]: In call `close_all`, for 1st positional argument, expected `Iterable[SupportsClose]` but got `Iterable[int]`. +protocols_definition.py:67:8 Undefined attribute [16]: `Template` has no attribute `temp`. +protocols_definition.py:114:0 Incompatible variable type [9]: v2_bad1 is declared to have type `Template2` but is used as type `Concrete2_Bad1`. +protocols_definition.py:115:0 Incompatible variable type [9]: v2_bad2 is declared to have type `Template2` but is used as type `Concrete2_Bad2`. +protocols_definition.py:156:0 Incompatible variable type [9]: v3_bad1 is declared to have type `Template3` but is used as type `Concrete3_Bad1`. +protocols_definition.py:159:0 Incompatible variable type [9]: v3_bad4 is declared to have type `Template3` but is used as type `Concrete3_Bad4`. +protocols_definition.py:218:0 Incompatible variable type [9]: v4_bad1 is declared to have type `Template4` but is used as type `Concrete4_Bad1`. +protocols_definition.py:219:0 Incompatible variable type [9]: v4_bad2 is declared to have type `Template4` but is used as type `Concrete4_Bad2`. +protocols_definition.py:285:0 Incompatible variable type [9]: v5_bad1 is declared to have type `Template5` but is used as type `Concrete5_Bad1`. +protocols_definition.py:286:0 Incompatible variable type [9]: v5_bad2 is declared to have type `Template5` but is used as type `Concrete5_Bad2`. +protocols_definition.py:287:0 Incompatible variable type [9]: v5_bad3 is declared to have type `Template5` but is used as type `Concrete5_Bad3`. +protocols_definition.py:288:0 Incompatible variable type [9]: v5_bad4 is declared to have type `Template5` but is used as type `Concrete5_Bad4`. +protocols_definition.py:289:0 Incompatible variable type [9]: v5_bad5 is declared to have type `Template5` but is used as type `Concrete5_Bad5`. """ conformance_automated = "Fail" errors_diff = """ -Line 30: Expected 1 errors -Line 67: Expected 1 errors -Line 114: Expected 1 errors -Line 115: Expected 1 errors Line 116: Expected 1 errors Line 117: Expected 1 errors -Line 156: Expected 1 errors Line 157: Expected 1 errors Line 158: Expected 1 errors -Line 159: Expected 1 errors Line 160: Expected 1 errors -Line 218: Expected 1 errors -Line 219: Expected 1 errors -Line 285: Expected 1 errors -Line 286: Expected 1 errors -Line 287: Expected 1 errors -Line 288: Expected 1 errors -Line 289: Expected 1 errors Line 339: Expected 1 errors Line 340: Expected 1 errors Line 341: Expected 1 errors diff --git a/conformance/results/pyre/protocols_explicit.toml b/conformance/results/pyre/protocols_explicit.toml index 54ad5894..0e7d70ef 100644 --- a/conformance/results/pyre/protocols_explicit.toml +++ b/conformance/results/pyre/protocols_explicit.toml @@ -4,14 +4,14 @@ Does not report error when calling unimplemented protocol method from derived cl Does not report error when method is not implemented in derived class. """ output = """ +protocols_explicit.py:60:4 Invalid class instantiation [45]: Cannot instantiate abstract class `Point` with abstract method `intensity`. +protocols_explicit.py:165:6 Invalid class instantiation [45]: Cannot instantiate abstract class `Concrete7A` with abstract method `method1`. """ conformance_automated = "Fail" errors_diff = """ Line 27: Expected 1 errors Line 56: Expected 1 errors -Line 60: Expected 1 errors Line 90: Expected 1 errors Line 110: Expected 1 errors Line 135: Expected 1 errors -Line 165: Expected 1 errors """ diff --git a/conformance/results/pyre/protocols_generic.toml b/conformance/results/pyre/protocols_generic.toml index 19c75eb7..f1370fa7 100644 --- a/conformance/results/pyre/protocols_generic.toml +++ b/conformance/results/pyre/protocols_generic.toml @@ -4,15 +4,15 @@ Does not reject the use of Protocol and Generic together as base classes. Does not detect protocol mismatch when method-scoped TypeVar is used in protocol. """ output = """ +protocols_generic.py:40:0 Incompatible variable type [9]: p2 is declared to have type `Proto1[int, str]` but is used as type `Concrete1`. +protocols_generic.py:56:4 Incompatible variable type [9]: v2 is declared to have type `Box[int]` but is used as type `Box[float]`. +protocols_generic.py:66:4 Incompatible variable type [9]: v2 is declared to have type `Sender[float]` but is used as type `Sender[int]`. +protocols_generic.py:74:4 Incompatible variable type [9]: v1 is declared to have type `AttrProto[float]` but is used as type `AttrProto[int]`. +protocols_generic.py:75:4 Incompatible variable type [9]: v2 is declared to have type `AttrProto[int]` but is used as type `AttrProto[float]`. +protocols_generic.py:146:0 Incompatible variable type [9]: hp3 is declared to have type `HasPropertyProto` but is used as type `ConcreteHasProperty3`. """ conformance_automated = "Fail" errors_diff = """ -Line 40: Expected 1 errors Line 44: Expected 1 errors -Line 56: Expected 1 errors -Line 66: Expected 1 errors -Line 74: Expected 1 errors -Line 75: Expected 1 errors -Line 146: Expected 1 errors Line 147: Expected 1 errors """ diff --git a/conformance/results/pyre/protocols_merging.toml b/conformance/results/pyre/protocols_merging.toml index 8bcbb9c4..c471755f 100644 --- a/conformance/results/pyre/protocols_merging.toml +++ b/conformance/results/pyre/protocols_merging.toml @@ -3,13 +3,13 @@ notes = """ Does not reject a protocol class that derives from a non-protocol class. """ output = """ +protocols_merging.py:52:0 Incompatible variable type [9]: s6 is declared to have type `SizedAndClosable1` but is used as type `SCConcrete2`. +protocols_merging.py:53:0 Incompatible variable type [9]: s7 is declared to have type `SizedAndClosable2` but is used as type `SCConcrete2`. +protocols_merging.py:54:0 Incompatible variable type [9]: s8 is declared to have type `SizedAndClosable3` but is used as type `SCConcrete2`. +protocols_merging.py:82:4 Invalid class instantiation [45]: Cannot instantiate abstract class `SizedAndClosable4` with abstract method `close`. +protocols_merging.py:83:0 Incompatible variable type [9]: y is declared to have type `SizedAndClosable4` but is used as type `SCConcrete1`. """ conformance_automated = "Fail" errors_diff = """ -Line 52: Expected 1 errors -Line 53: Expected 1 errors -Line 54: Expected 1 errors Line 67: Expected 1 errors -Line 82: Expected 1 errors -Line 83: Expected 1 errors """ diff --git a/conformance/results/pyre/protocols_subtyping.toml b/conformance/results/pyre/protocols_subtyping.toml index 8abfa6ee..1c8c18fc 100644 --- a/conformance/results/pyre/protocols_subtyping.toml +++ b/conformance/results/pyre/protocols_subtyping.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ +protocols_subtyping.py:16:5 Invalid class instantiation [45]: Cannot instantiate protocol `Proto1`. +protocols_subtyping.py:38:4 Incompatible variable type [9]: v2 is declared to have type `Concrete2` but is used as type `Proto2`. +protocols_subtyping.py:55:4 Incompatible variable type [9]: v2 is declared to have type `Proto3` but is used as type `Proto2`. +protocols_subtyping.py:79:4 Incompatible variable type [9]: v3 is declared to have type `Proto4[int, float]` but is used as type `Proto5[int]`. +protocols_subtyping.py:80:4 Incompatible variable type [9]: v4 is declared to have type `Proto5[float]` but is used as type `Proto4[int, int]`. +protocols_subtyping.py:102:4 Incompatible variable type [9]: v4 is declared to have type `Proto7[int, float]` but is used as type `Proto6[float, float]`. +protocols_subtyping.py:103:4 Incompatible variable type [9]: v5 is declared to have type `Proto7[float, object]` but is used as type `Proto6[float, float]`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 16: Expected 1 errors -Line 38: Expected 1 errors -Line 55: Expected 1 errors -Line 79: Expected 1 errors -Line 80: Expected 1 errors -Line 102: Expected 1 errors -Line 103: Expected 1 errors """ diff --git a/conformance/results/pyre/protocols_variance.toml b/conformance/results/pyre/protocols_variance.toml index 0417da5b..5577f252 100644 --- a/conformance/results/pyre/protocols_variance.toml +++ b/conformance/results/pyre/protocols_variance.toml @@ -3,6 +3,8 @@ notes = """ Does not detect incorrect TypeVar variance within generic protocols. """ output = """ +protocols_variance.py:62:17 Invalid type variance [46]: The type variable `Variable[T1_co](covariant)` is covariant and cannot be a parameter type. +protocols_variance.py:72:4 Invalid type variance [46]: The type variable `Variable[T1_contra](contravariant)` is contravariant and cannot be a return type. """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pyre/qualifiers_annotated.toml b/conformance/results/pyre/qualifiers_annotated.toml index c571c185..2c9bc289 100644 --- a/conformance/results/pyre/qualifiers_annotated.toml +++ b/conformance/results/pyre/qualifiers_annotated.toml @@ -4,27 +4,31 @@ Does not reject Annotated with a single parameter. Does not reject call of Annotated with no type arguments. """ output = """ +qualifiers_annotated.py:43:6 Undefined or invalid type [11]: Annotation `` is not defined as a type. +qualifiers_annotated.py:44:6 Invalid type [31]: Expression `typing.Annotated[(((int, str)), "")]` is not a valid type. +qualifiers_annotated.py:45:6 Invalid type [31]: Expression `typing.Annotated[(comprehension(int for generators(generator(i in range(1) if ))), "")]` is not a valid type. +qualifiers_annotated.py:46:6 Invalid type [31]: Expression `typing.Annotated[({ "a":"b" }, "")]` is not a valid type. +qualifiers_annotated.py:47:6 Invalid type [31]: Expression `typing.Annotated[(lambda () (int)(), "")]` is not a valid type. +qualifiers_annotated.py:48:6 Invalid type [31]: Expression `typing.Annotated[([int][0], "")]` is not a valid type. +qualifiers_annotated.py:49:6 Invalid type [31]: Expression `typing.Annotated[(int if 1 < 3 else str, "")]` is not a valid type. +qualifiers_annotated.py:50:16 Unbound name [10]: Name `var1` is used but not defined in the current scope. +qualifiers_annotated.py:51:6 Invalid type [31]: Expression `typing.Annotated[(True, "")]` is not a valid type. +qualifiers_annotated.py:52:7 Invalid type [31]: Expression `typing.Annotated[(1, "")]` is not a valid type. +qualifiers_annotated.py:53:7 Invalid type [31]: Expression `typing.Annotated[(list or set, "")]` is not a valid type. +qualifiers_annotated.py:54:7 Invalid type [31]: Expression `typing.Annotated[(f"{"int"}", "")]` is not a valid type. +qualifiers_annotated.py:76:33 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:77:0 Incompatible variable type [9]: not_type2 is declared to have type `Type[typing.Any]` but is used as type `TypeAlias`. +qualifiers_annotated.py:84:16 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[str], str]`. Expected has length 0, but actual has length 2. +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 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 49: Expected 1 errors -Line 50: Expected 1 errors -Line 51: Expected 1 errors -Line 52: Expected 1 errors -Line 53: Expected 1 errors -Line 54: Expected 1 errors Line 64: Expected 1 errors -Line 76: Expected 1 errors -Line 77: Expected 1 errors -Line 84: Expected 1 errors -Line 85: Expected 1 errors Line 91: Expected 1 errors -Line 92: Expected 1 errors -Line 93: 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/qualifiers_final_annotation.toml b/conformance/results/pyre/qualifiers_final_annotation.toml index f5482dd1..1e7cb4c6 100644 --- a/conformance/results/pyre/qualifiers_final_annotation.toml +++ b/conformance/results/pyre/qualifiers_final_annotation.toml @@ -5,31 +5,33 @@ Does not report error for invalid nesting of Final and ClassVar. Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition. """ output = """ +qualifiers_final_annotation.py:18:6 Invalid type parameters [24]: Generic type `Final` expects 1 type parameter, received 2. +qualifiers_final_annotation.py:34:4 Invalid assignment [41]: Cannot reassign final attribute `ClassA.ID2`. +qualifiers_final_annotation.py:38:4 Uninitialized attribute [13]: Attribute `ID3` is declared in class `ClassA` to have type `int` but is never initialized. +qualifiers_final_annotation.py:54:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID5`. +qualifiers_final_annotation.py:62:8 Undefined attribute [16]: `ClassA` has no attribute `id3`. +qualifiers_final_annotation.py:63:8 Undefined attribute [16]: `ClassA` has no attribute `id4`. +qualifiers_final_annotation.py:65:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID7`. +qualifiers_final_annotation.py:67:8 Invalid assignment [41]: Cannot reassign final attribute `self.ID7`. +qualifiers_final_annotation.py:71:0 Invalid assignment [41]: Cannot reassign final attribute `RATE`. +qualifiers_final_annotation.py:81:0 Invalid assignment [41]: Cannot reassign final attribute `ClassB.DEFAULT_ID`. +qualifiers_final_annotation.py:94:4 Invalid assignment [41]: Cannot reassign final attribute `BORDER_WIDTH`. +qualifiers_final_annotation.py:118:0 Invalid type [31]: Expression `typing.List[Final[int]]` is not a valid type. Final cannot be nested. +qualifiers_final_annotation.py:121:10 Invalid type [31]: Parameter `x` cannot be annotated with Final. +qualifiers_final_annotation.py:133:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`. +qualifiers_final_annotation.py:134:0 Unexpected keyword [28]: Unexpected keyword argument `a` to call `N.__init__`. +qualifiers_final_annotation.py:135:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`. +qualifiers_final_annotation.py:141:4 Invalid assignment [41]: Cannot reassign final attribute `ID1`. +qualifiers_final_annotation.py:145:4 Invalid assignment [41]: Cannot reassign final attribute `x`. +qualifiers_final_annotation.py:147:9 Invalid assignment [41]: Cannot reassign final attribute `x`. +qualifiers_final_annotation.py:149:8 Invalid assignment [41]: Cannot reassign final attribute `x`. +qualifiers_final_annotation.py:152:29 Invalid assignment [41]: Cannot reassign final attribute `x`. +qualifiers_final_annotation.py:155:8 Invalid assignment [41]: Cannot reassign final attribute `x`. """ conformance_automated = "Fail" errors_diff = """ Line 16: Expected 1 errors -Line 18: Expected 1 errors -Line 34: Expected 1 errors -Line 38: Expected 1 errors -Line 54: Expected 1 errors -Line 62: Expected 1 errors -Line 63: Expected 1 errors -Line 65: Expected 1 errors -Line 67: Expected 1 errors -Line 71: Expected 1 errors -Line 81: Expected 1 errors -Line 94: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 118: Expected 1 errors -Line 121: Expected 1 errors -Line 134: Expected 1 errors -Line 135: Expected 1 errors -Line 141: Expected 1 errors -Line 145: Expected 1 errors -Line 147: Expected 1 errors -Line 149: Expected 1 errors -Line 152: Expected 1 errors -Line 155: Expected 1 errors +Line 133: Unexpected errors ['qualifiers_final_annotation.py:133:0 Unexpected keyword [28]: Unexpected keyword argument `x` to call `N.__init__`.'] """ diff --git a/conformance/results/pyre/qualifiers_final_decorator.toml b/conformance/results/pyre/qualifiers_final_decorator.toml index 9613895b..ef5be734 100644 --- a/conformance/results/pyre/qualifiers_final_decorator.toml +++ b/conformance/results/pyre/qualifiers_final_decorator.toml @@ -5,17 +5,20 @@ Does not report error for overloaded @final method defined in stub file. Reports misleading error when overload is marked @final but implementation is not. """ output = """ +qualifiers_final_decorator.py:21:0 Invalid inheritance [39]: Cannot inherit from final class `Base1`. +qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +qualifiers_final_decorator.py:56:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method1` cannot override final method defined in `Base2`. +qualifiers_final_decorator.py:60:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method2` cannot override final method defined in `Base2`. +qualifiers_final_decorator.py:64:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method3` cannot override final method defined in `Base2`. +qualifiers_final_decorator.py:75:4 Invalid override [40]: `qualifiers_final_decorator.Derived2.method4` cannot override final method defined in `Base2`. +qualifiers_final_decorator.py:86:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s). +qualifiers_final_decorator.py:118:4 Inconsistent override [14]: `qualifiers_final_decorator.Derived5.method` overrides method defined in `Base5_2` inconsistently. Could not find parameter `v` in overriding signature. +qualifiers_final_decorator.py:118:4 Invalid override [40]: `qualifiers_final_decorator.Derived5.method` cannot override final method defined in `Base5_2`. +qualifiers_final_decorator.py:126:0 Invalid inheritance [39]: `final` cannot be used with non-method functions. """ conformance_automated = "Fail" errors_diff = """ -Line 21: Expected 1 errors -Line 56: Expected 1 errors -Line 118: Expected 1 errors -Lines 59, 60: Expected error (tag 'method2') -Lines 63, 64: Expected error (tag 'method3') -Lines 67, 75: Expected error (tag 'method4') Lines 80, 89: Expected error (tag 'Derived3') -Lines 84, 85, 86: Expected error (tag 'Derived3-2') Lines 94, 102: Expected error (tag 'Derived4') -Lines 125, 126: Expected error (tag 'func') +Line 51: Unexpected errors ['qualifiers_final_decorator.py:51:4 Incompatible overload [43]: This definition does not have the same decorators as the preceding overload(s).'] """ diff --git a/conformance/results/pyre/specialtypes_any.toml b/conformance/results/pyre/specialtypes_any.toml index 427d91c6..b3b83dde 100644 --- a/conformance/results/pyre/specialtypes_any.toml +++ b/conformance/results/pyre/specialtypes_any.toml @@ -3,7 +3,13 @@ notes = """ Does not support Any as a base class. """ output = """ +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 = "Pass" +conformance_automated = "Fail" errors_diff = """ +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_never.toml b/conformance/results/pyre/specialtypes_never.toml index 0c1a6a09..d65de23e 100644 --- a/conformance/results/pyre/specialtypes_never.toml +++ b/conformance/results/pyre/specialtypes_never.toml @@ -3,10 +3,22 @@ notes = """ Does not treat Never as compatible with all other types. """ output = """ +specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`. +specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`. +specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`. +specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`. +specialtypes_never.py:86:4 Incompatible variable type [9]: v3 is declared to have type `List[int]` but is used as type `List[Never]`. +specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`. +specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`. +specialtypes_never.py:105:4 Incompatible return type [7]: Expected `ClassC[Variable[U]]` but got `ClassC[Never]`. """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors -Line 86: Expected 1 errors -Line 105: Expected 1 errors +Line 21: Unexpected errors ['specialtypes_never.py:21:8 Incompatible return type [7]: Function declared non-returnable, but got `None`.'] +Line 68: Unexpected errors ['specialtypes_never.py:68:4 Incompatible variable type [9]: v1 is declared to have type `int` but is used as type `Never`.'] +Line 69: Unexpected errors ['specialtypes_never.py:69:4 Incompatible variable type [9]: v2 is declared to have type `str` but is used as type `Never`.'] +Line 70: Unexpected errors ['specialtypes_never.py:70:4 Incompatible variable type [9]: v3 is declared to have type `List[str]` but is used as type `Never`.'] +Line 87: Unexpected errors ['specialtypes_never.py:87:4 Incompatible variable type [9]: v4 is declared to have type `Never` but is used as type `NoReturn`.'] +Line 96: Unexpected errors ['specialtypes_never.py:96:4 Incompatible return type [7]: Expected `ClassB[Variable[U]]` but got `ClassB[Never]`.'] """ diff --git a/conformance/results/pyre/specialtypes_none.toml b/conformance/results/pyre/specialtypes_none.toml index 2dc7005d..a9c3b091 100644 --- a/conformance/results/pyre/specialtypes_none.toml +++ b/conformance/results/pyre/specialtypes_none.toml @@ -1,9 +1,9 @@ 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: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 21: Expected 1 errors -Line 27: Expected 1 errors -Line 41: Expected 1 errors """ diff --git a/conformance/results/pyre/specialtypes_type.toml b/conformance/results/pyre/specialtypes_type.toml index d85d614a..78343fa2 100644 --- a/conformance/results/pyre/specialtypes_type.toml +++ b/conformance/results/pyre/specialtypes_type.toml @@ -7,16 +7,20 @@ Does not reject access to unknown attributes from object of type `Type[object]`. 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:117:4 Undefined attribute [16]: `object` has no attribute `unknown`. +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]`. """ conformance_automated = "Fail" errors_diff = """ -Line 56: Expected 1 errors Line 70: Expected 1 errors -Line 76: Expected 1 errors -Line 117: Expected 1 errors Line 120: Expected 1 errors -Line 143: Expected 1 errors Line 144: Expected 1 errors Line 145: Expected 1 errors Line 146: Expected 1 errors +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 ac928139..3d3a3578 100644 --- a/conformance/results/pyre/tuples_type_compat.toml +++ b/conformance/results/pyre/tuples_type_compat.toml @@ -6,23 +6,92 @@ Does not support tuple narrowing based on `len()` type guard (optional). Does not correctly evaluate `Sequence[Never]` for `tuple[()]`. """ output = """ +tuples_type_compat.py:15:4 Incompatible variable type [9]: v2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[float, complex]`. +tuples_type_compat.py:22:30 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type. +tuples_type_compat.py:27:8 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type. +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: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: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: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]`. +tuples_type_compat.py:146:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)])]` is not a valid type. +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['']]`. +tuples_type_compat.py:148: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[''], typing_extensions.Literal['']]`. +tuples_type_compat.py:149: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[1], typing_extensions.Literal['']]`. +tuples_type_compat.py:150: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[''], typing_extensions.Literal[1]]`. +tuples_type_compat.py:153:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[int, unknown, int]` but is used as type `Tuple[int, int]`. +tuples_type_compat.py:153:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)], int)]` is not a valid type. +tuples_type_compat.py:154:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[2]]`. +tuples_type_compat.py:155:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[2]]`. +tuples_type_compat.py:156:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal['']]`. +tuples_type_compat.py:157:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[''], float]`. +tuples_type_compat.py:159:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[unknown, int]` but is used as type `Tuple[int]`. +tuples_type_compat.py:159:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], int)]` is not a valid type. +tuples_type_compat.py:160:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[1]]`. +tuples_type_compat.py:161:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[1]]`. +tuples_type_compat.py:162:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[1]]`. +tuples_type_compat.py:163:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[''], float]`. +tuples_type_compat.py:167:4 Incompatible variable type [9]: t1 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:167:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(int, ...)])]` is not a valid type. +tuples_type_compat.py:168:4 Incompatible variable type [9]: t2 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:168:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[int])]` is not a valid type. +tuples_type_compat.py:169:8 Invalid type [31]: Expression `tuple[(str, *tuple[(str, ...)])]` is not a valid type. +tuples_type_compat.py:170:4 Incompatible variable type [9]: t4 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:170:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(str, ...)])]` is not a valid type. +tuples_type_compat.py:171:4 Incompatible variable type [9]: t5 is declared to have type `Tuple[str, str, str, unknown]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:171:8 Invalid type [31]: Expression `tuple[(str, str, str, *tuple[(str, ...)])]` is not a valid type. +tuples_type_compat.py:172:4 Incompatible variable type [9]: t6 is declared to have type `Tuple[str, unknown, str]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:172:8 Invalid type [31]: Expression `tuple[(str, *tuple[(int, ...)], str)]` is not a valid type. +tuples_type_compat.py:173:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type. +tuples_type_compat.py:174:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type. +tuples_type_compat.py:175:4 Incompatible variable type [9]: t9 is declared to have type `Tuple[unknown, str, str, str]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:175:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str, str, str)]` is not a valid type. """ conformance_automated = "Fail" errors_diff = """ -Line 15: Expected 1 errors Line 29: Expected 1 errors Line 32: Expected 1 errors Line 33: Expected 1 errors Line 43: Expected 1 errors Line 62: Expected 1 errors -Line 144: Expected 1 errors -Line 149: Expected 1 errors -Line 150: Expected 1 errors -Line 156: Expected 1 errors -Line 157: Expected 1 errors -Line 162: Expected 1 errors -Line 163: Expected 1 errors -Line 168: Expected 1 errors -Line 171: Expected 1 errors -Line 175: Expected 1 errors +Line 22: Unexpected errors ['tuples_type_compat.py:22:30 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type.'] +Line 27: Unexpected errors ['tuples_type_compat.py:27:8 Invalid type [31]: Expression `tuple[(int, *tuple[(int, ...)])]` is not a valid type.'] +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 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 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 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['']]`."] +Line 148: Unexpected errors ["tuples_type_compat.py:148: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[''], typing_extensions.Literal['']]`."] +Line 153: Unexpected errors ['tuples_type_compat.py:153:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[int, unknown, int]` but is used as type `Tuple[int, int]`.', 'tuples_type_compat.py:153:4 Invalid type [31]: Expression `tuple[(int, *tuple[(str, ...)], int)]` is not a valid type.'] +Line 154: Unexpected errors ["tuples_type_compat.py:154:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[2]]`."] +Line 155: Unexpected errors ["tuples_type_compat.py:155:0 Incompatible variable type [9]: t3 is declared to have type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[2]]` but is used as type `Tuple[typing_extensions.Literal[1], typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[2]]`."] +Line 159: Unexpected errors ['tuples_type_compat.py:159:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[unknown, int]` but is used as type `Tuple[int]`.', 'tuples_type_compat.py:159:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], int)]` is not a valid type.'] +Line 160: Unexpected errors ["tuples_type_compat.py:160:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[1]]`."] +Line 161: Unexpected errors ["tuples_type_compat.py:161:0 Incompatible variable type [9]: t4 is declared to have type `Tuple[typing_extensions.Literal[1]]` but is used as type `Tuple[typing_extensions.Literal[''], typing_extensions.Literal[''], typing_extensions.Literal[1]]`."] +Line 167: Unexpected errors ['tuples_type_compat.py:167:4 Incompatible variable type [9]: t1 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`.', 'tuples_type_compat.py:167:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(int, ...)])]` is not a valid type.'] +Line 169: Unexpected errors ['tuples_type_compat.py:169:8 Invalid type [31]: Expression `tuple[(str, *tuple[(str, ...)])]` is not a valid type.'] +Line 170: Unexpected errors ['tuples_type_compat.py:170:4 Incompatible variable type [9]: t4 is declared to have type `Tuple[str, str, unknown]` but is used as type `Tuple[str, str]`.', 'tuples_type_compat.py:170:8 Invalid type [31]: Expression `tuple[(str, str, *tuple[(str, ...)])]` is not a valid type.'] +Line 172: Unexpected errors ['tuples_type_compat.py:172:4 Incompatible variable type [9]: t6 is declared to have type `Tuple[str, unknown, str]` but is used as type `Tuple[str, str]`.', 'tuples_type_compat.py:172:8 Invalid type [31]: Expression `tuple[(str, *tuple[(int, ...)], str)]` is not a valid type.'] +Line 173: Unexpected errors ['tuples_type_compat.py:173:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type.'] +Line 174: Unexpected errors ['tuples_type_compat.py:174:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], str)]` is not a valid type.'] """ diff --git a/conformance/results/pyre/tuples_type_form.toml b/conformance/results/pyre/tuples_type_form.toml index 168ecc90..750fc795 100644 --- a/conformance/results/pyre/tuples_type_form.toml +++ b/conformance/results/pyre/tuples_type_form.toml @@ -1,17 +1,17 @@ conformant = "Pass" output = """ +tuples_type_form.py:12:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[int]` but is used as type `Tuple[int, int]`. +tuples_type_form.py:14:0 Incompatible variable type [9]: t2 is declared to have type `Tuple[int, int]` but is used as type `Tuple[int]`. +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 Invalid type [31]: Expression `tuple[(int, int, ...)]` is not a valid type. +tuples_type_form.py:41:5 Invalid type [31]: Expression `tuple[...]` is not a valid type. +tuples_type_form.py:42:5 Invalid type [31]: Expression `tuple[(..., int)]` is not a valid type. +tuples_type_form.py:43:5 Invalid type [31]: Expression `tuple[(int, ..., int)]` is not a valid 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" +conformance_automated = "Pass" errors_diff = """ -Line 12: Expected 1 errors -Line 14: Expected 1 errors -Line 15: Expected 1 errors -Line 25: Expected 1 errors -Line 36: Expected 1 errors -Line 40: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 44: Expected 1 errors -Line 45: Expected 1 errors """ diff --git a/conformance/results/pyre/tuples_unpacked.toml b/conformance/results/pyre/tuples_unpacked.toml index 80e8d683..9e1dd53b 100644 --- a/conformance/results/pyre/tuples_unpacked.toml +++ b/conformance/results/pyre/tuples_unpacked.toml @@ -3,12 +3,32 @@ notes = """ 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: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:31:4 Invalid type [31]: Expression `tuple[(*tuple[int], *tuple[int])]` is not a valid type. +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. +tuples_unpacked.py:40:4 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *tuple[(int, ...)])]` is not a valid type. +tuples_unpacked.py:41:4 Invalid type [31]: Expression `tuple[(*tuple[(str, *tuple[(str, ...)])], *tuple[(int, ...)])]` is not a valid type. +tuples_unpacked.py:49:13 Invalid type [31]: Expression `tuple[(*Ts)]` is not a valid type. +tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *Ts)]` is not a valid type. +tuples_unpacked.py:51:8 Invalid type [31]: Expression `tuple[(*tuple[(str, ...)], *Ts)]` is not a valid 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 40: Expected 1 errors -Line 41: Expected 1 errors -Line 51: Expected 1 errors -Line 59: Expected 1 errors -Lines 60, 61: Expected error (tag 't14') +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 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 31: Unexpected errors ['tuples_unpacked.py:31:4 Invalid type [31]: Expression `tuple[(*tuple[int], *tuple[int])]` is not a valid type.'] +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[(*Ts)]` is not a valid type.'] +Line 50: Unexpected errors ['tuples_unpacked.py:50:8 Invalid type [31]: Expression `tuple[(*tuple[str], *Ts)]` is not a valid type.'] """ diff --git a/conformance/results/pyre/typeddicts_alt_syntax.toml b/conformance/results/pyre/typeddicts_alt_syntax.toml index cd43a763..c172f19d 100644 --- a/conformance/results/pyre/typeddicts_alt_syntax.toml +++ b/conformance/results/pyre/typeddicts_alt_syntax.toml @@ -4,12 +4,15 @@ Does not report when name of TypedDict doesn't match assigned identifier name. Does not support keyword-argument form of alternative syntax (deprecated in 3.11). """ output = """ +typeddicts_alt_syntax.py:23:16 Call error [29]: `object` is not a function. +typeddicts_alt_syntax.py:41:9 Call error [29]: `object` is not a function. +typeddicts_alt_syntax.py:43:8 Undefined or invalid type [11]: Annotation `Movie2` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ -Line 23: Expected 1 errors Line 27: Expected 1 errors Line 31: Expected 1 errors Line 35: Expected 1 errors Line 45: Expected 1 errors +Line 43: Unexpected errors ['typeddicts_alt_syntax.py:43:8 Undefined or invalid type [11]: Annotation `Movie2` is not defined as a type.'] """ diff --git a/conformance/results/pyre/typeddicts_class_syntax.toml b/conformance/results/pyre/typeddicts_class_syntax.toml index d9b364a2..3bcd1520 100644 --- a/conformance/results/pyre/typeddicts_class_syntax.toml +++ b/conformance/results/pyre/typeddicts_class_syntax.toml @@ -6,6 +6,7 @@ Does not report when other keyword argument is provided. Does not support generic TypedDict class. """ output = """ +typeddicts_class_syntax.py:59: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]`. """ conformance_automated = "Fail" errors_diff = """ @@ -14,4 +15,5 @@ Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors +Line 59: Unexpected errors ["typeddicts_class_syntax.py:59: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]`."] """ diff --git a/conformance/results/pyre/typeddicts_final.toml b/conformance/results/pyre/typeddicts_final.toml index 8de33b64..49994930 100644 --- a/conformance/results/pyre/typeddicts_final.toml +++ b/conformance/results/pyre/typeddicts_final.toml @@ -3,7 +3,9 @@ notes = """ Does not handle value with literal type as index to TypedDict object. """ output = """ +typeddicts_final.py:26:17 Incompatible parameter type [6]: In call `TypedDictionary.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal['name']` but got `Union[typing_extensions.Literal['name'], typing_extensions.Literal['year']]`. """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 26: Unexpected errors ["typeddicts_final.py:26:17 Incompatible parameter type [6]: In call `TypedDictionary.__getitem__`, for 1st positional argument, expected `typing_extensions.Literal['name']` but got `Union[typing_extensions.Literal['name'], typing_extensions.Literal['year']]`."] """ diff --git a/conformance/results/pyre/typeddicts_inheritance.toml b/conformance/results/pyre/typeddicts_inheritance.toml index 655b5f51..3e91f5b6 100644 --- a/conformance/results/pyre/typeddicts_inheritance.toml +++ b/conformance/results/pyre/typeddicts_inheritance.toml @@ -3,10 +3,10 @@ notes = """ Does not reject TypedDict class that inherits from non-TypedDict class. """ output = """ +typeddicts_inheritance.py:54:0 Inconsistent override [15]: `x` overrides attribute defined in `X1` inconsistently. Type `int` is not a subtype of the overridden attribute `str`. +typeddicts_inheritance.py:65:0 Invalid inheritance [39]: Field `x` has type `int` in base class `X2` and type `str` in base class `Y2`. """ conformance_automated = "Fail" errors_diff = """ Line 44: Expected 1 errors -Line 65: Expected 1 errors -Lines 54, 55: Expected error (tag 'Y1') """ diff --git a/conformance/results/pyre/typeddicts_operations.toml b/conformance/results/pyre/typeddicts_operations.toml index 93413bd3..14ebfde9 100644 --- a/conformance/results/pyre/typeddicts_operations.toml +++ b/conformance/results/pyre/typeddicts_operations.toml @@ -3,18 +3,19 @@ notes = """ Does not reject `del` of required key. """ output = """ +typeddicts_operations.py:22:16 Invalid TypedDict operation [54]: Expected `str` to be assigned to `Movie` field `name` but got `int`. +typeddicts_operations.py:23:16 Invalid TypedDict operation [54]: Expected `int` to be assigned to `Movie` field `year` but got `str`. +typeddicts_operations.py:24:6 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `other`. +typeddicts_operations.py:26:12 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `other`. +typeddicts_operations.py:28:8 TypedDict initialization error [55]: Missing required field `year` for TypedDict `Movie`. +typeddicts_operations.py:29:8 TypedDict initialization error [55]: Expected type `int` for `Movie` field `year` but got `float`. +typeddicts_operations.py:32:8 TypedDict initialization error [55]: TypedDict `Movie` has no field `other`. +typeddicts_operations.py:37:4 Incompatible variable type [9]: movie is declared to have type `Movie` but is used as type `Dict[str, Union[int, str]]`. +typeddicts_operations.py:44:10 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `other`. +typeddicts_operations.py:47:0 Undefined attribute [16]: `Movie` has no attribute `clear`. +typeddicts_operations.py:62:0 Undefined attribute [16]: `MovieOptional` has no attribute `clear`. """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors -Line 24: Expected 1 errors -Line 26: Expected 1 errors -Line 28: Expected 1 errors -Line 29: Expected 1 errors -Line 32: Expected 1 errors -Line 37: Expected 1 errors -Line 47: Expected 1 errors Line 49: Expected 1 errors -Line 62: Expected 1 errors """ diff --git a/conformance/results/pyre/typeddicts_readonly.toml b/conformance/results/pyre/typeddicts_readonly.toml index f2044569..70380b51 100644 --- a/conformance/results/pyre/typeddicts_readonly.toml +++ b/conformance/results/pyre/typeddicts_readonly.toml @@ -1,5 +1,6 @@ conformant = "Unsupported" output = """ +typeddicts_readonly.py:18:13 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ @@ -9,4 +10,5 @@ Line 50: Expected 1 errors Line 51: Expected 1 errors Line 60: Expected 1 errors Line 61: Expected 1 errors +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 4d675842..a13a44a5 100644 --- a/conformance/results/pyre/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyre/typeddicts_readonly_consistency.toml @@ -1,13 +1,21 @@ conformant = "Unsupported" output = """ +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`. +typeddicts_readonly_consistency.py:40:4 Incompatible variable type [9]: v5 is declared to have type `C1` but is used as type `A1`. +typeddicts_readonly_consistency.py:41:4 Incompatible variable type [9]: v6 is declared to have type `C1` but is used as type `B1`. +typeddicts_readonly_consistency.py:78:4 Incompatible variable type [9]: v1 is declared to have type `A2` but is used as type `B2`. +typeddicts_readonly_consistency.py:79:4 Incompatible variable type [9]: v2 is declared to have type `A2` but is used as type `C2`. +typeddicts_readonly_consistency.py:81:4 Incompatible variable type [9]: v3 is declared to have type `B2` but is used as type `A2`. +typeddicts_readonly_consistency.py:82:4 Incompatible variable type [9]: v4 is declared to have type `B2` but is used as type `C2`. +typeddicts_readonly_consistency.py:84:4 Incompatible variable type [9]: v5 is declared to have type `C2` but is used as type `A2`. +typeddicts_readonly_consistency.py:85:4 Incompatible variable type [9]: v6 is declared to have type `C2` but is used as type `B2`. """ conformance_automated = "Fail" errors_diff = """ -Line 37: Expected 1 errors -Line 38: Expected 1 errors -Line 40: Expected 1 errors -Line 81: Expected 1 errors -Line 82: Expected 1 errors -Line 84: Expected 1 errors -Line 85: Expected 1 errors +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`.'] +Line 79: Unexpected errors ['typeddicts_readonly_consistency.py:79:4 Incompatible variable type [9]: v2 is declared to have type `A2` but is used as type `C2`.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_inheritance.toml b/conformance/results/pyre/typeddicts_readonly_inheritance.toml index 7f1722cc..8bcacffd 100644 --- a/conformance/results/pyre/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyre/typeddicts_readonly_inheritance.toml @@ -1,17 +1,27 @@ conformant = "Unsupported" output = """ +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`. +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`. +typeddicts_readonly_inheritance.py:82:13 Invalid TypedDict operation [54]: Expected `str` to be assigned to `User` field `ident` but got `int`. +typeddicts_readonly_inheritance.py:83:4 TypedDict initialization error [55]: Expected type `str` for `User` field `ident` but got `int`. +typeddicts_readonly_inheritance.py:84:4 TypedDict initialization error [55]: Missing required field `ident` for TypedDict `User`. +typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `unknown` is not a subtype of the overridden attribute `int`. +typeddicts_readonly_inheritance.py:97:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`. +typeddicts_readonly_inheritance.py:119:0 Invalid inheritance [39]: Field `x` has type `int` in base class `TD_A1` and type `float` in base class `TD_A2`. """ conformance_automated = "Fail" errors_diff = """ Line 36: Expected 1 errors Line 50: Expected 1 errors -Line 65: Expected 1 errors -Line 82: Expected 1 errors -Line 83: Expected 1 errors -Line 84: Expected 1 errors Line 94: Expected 1 errors Line 98: Expected 1 errors Line 106: Expected 1 errors -Line 119: Expected 1 errors Line 132: Expected 1 errors +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`.'] +Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `unknown` is not a subtype of the overridden attribute `int`.'] +Line 97: Unexpected errors ['typeddicts_readonly_inheritance.py:97:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` is not a subtype of the overridden attribute `int`.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_kwargs.toml b/conformance/results/pyre/typeddicts_readonly_kwargs.toml index e9446c60..911a969a 100644 --- a/conformance/results/pyre/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyre/typeddicts_readonly_kwargs.toml @@ -1,7 +1,11 @@ conformant = "Unsupported" output = """ +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 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 270c9ffa..6f271f64 100644 --- a/conformance/results/pyre/typeddicts_readonly_update.toml +++ b/conformance/results/pyre/typeddicts_readonly_update.toml @@ -1,7 +1,11 @@ conformant = "Unsupported" output = """ +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 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 8f8250df..2d84becd 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -7,6 +7,9 @@ Incorrectly complains about uninitialized attributes on TypedDict definitions. Incorrectly generates "attribute not initialized" errors for TypedDict fields. """ output = """ +typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`. +typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type. +typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`. """ conformance_automated = "Fail" errors_diff = """ @@ -14,4 +17,7 @@ Line 12: Expected 1 errors Line 19: Expected 1 errors Line 62: Expected 1 errors Line 63: Expected 1 errors +Line 15: Unexpected errors ['typeddicts_required.py:15:8 Incompatible attribute type [8]: Attribute `x` declared in class `NotTypedDict` has type `Required[int]` but is used as type `int`.'] +Line 74: Unexpected errors ['typeddicts_required.py:74:62 Undefined or invalid type [11]: Annotation `RecursiveMovie` is not defined as a type.'] +Line 77: Unexpected errors ['typeddicts_required.py:77:24 TypedDict initialization error [55]: Expected type `unknown` for `RecursiveMovie` field `predecessor` but got `typing.Dict[str, str]`.'] """ diff --git a/conformance/results/pyre/typeddicts_type_consistency.toml b/conformance/results/pyre/typeddicts_type_consistency.toml index d65aa7be..124f691f 100644 --- a/conformance/results/pyre/typeddicts_type_consistency.toml +++ b/conformance/results/pyre/typeddicts_type_consistency.toml @@ -5,16 +5,20 @@ Does not return non-Optional value from `get` method for required key. Does not properly handle nested TypedDicts. """ output = """ +typeddicts_type_consistency.py:21:0 Incompatible variable type [9]: a1 is declared to have type `A1` but is used as type `B1`. +typeddicts_type_consistency.py:38:0 Incompatible variable type [9]: a2 is declared to have type `A2` but is used as type `B2`. +typeddicts_type_consistency.py:69:11 TypedDict initialization error [55]: TypedDict `A3` has no field `y`. +typeddicts_type_consistency.py:76:0 Incompatible variable type [9]: d1 is declared to have type `Dict[str, int]` but is used as type `B3`. +typeddicts_type_consistency.py:77:0 Incompatible variable type [9]: d2 is declared to have type `Dict[str, object]` but is used as type `B3`. +typeddicts_type_consistency.py:78:0 Incompatible variable type [9]: d3 is declared to have type `Dict[typing.Any, typing.Any]` but is used as type `B3`. +typeddicts_type_consistency.py:82:0 Incompatible variable type [9]: m1 is declared to have type `Mapping[str, int]` but is used as type `B3`. +typeddicts_type_consistency.py:101:0 Incompatible variable type [9]: name3 is declared to have type `str` but is used as type `Optional[str]`. +typeddicts_type_consistency.py:107:0 Incompatible variable type [9]: age4 is declared to have type `int` but is used as type `Union[str, int]`. +typeddicts_type_consistency.py:126:41 TypedDict initialization error [55]: Expected type `str` for `Inner1` field `inner_key` but got `int`. +typeddicts_type_consistency.py:152:0 Incompatible variable type [9]: o4 is declared to have type `Outer3` but is used as type `Outer2`. """ conformance_automated = "Fail" errors_diff = """ -Line 21: Expected 1 errors -Line 38: Expected 1 errors Line 65: Expected 1 errors -Line 69: Expected 1 errors -Line 76: Expected 1 errors -Line 77: Expected 1 errors -Line 78: Expected 1 errors -Line 82: Expected 1 errors -Line 126: Expected 1 errors +Line 152: Unexpected errors ['typeddicts_type_consistency.py:152:0 Incompatible variable type [9]: o4 is declared to have type `Outer3` but is used as type `Outer2`.'] """ diff --git a/conformance/results/pyre/typeddicts_usage.toml b/conformance/results/pyre/typeddicts_usage.toml index b5b8ccfc..02967540 100644 --- a/conformance/results/pyre/typeddicts_usage.toml +++ b/conformance/results/pyre/typeddicts_usage.toml @@ -4,12 +4,12 @@ Does not report errant use of TypedDict in `isinstance` call. Does not reject use of TypedDict as TypeVar bound. """ output = """ +typeddicts_usage.py:23:6 TypedDict accessed with a missing key [27]: TypedDict `Movie` has no key `director`. +typeddicts_usage.py:24:16 Invalid TypedDict operation [54]: Expected `int` to be assigned to `Movie` field `year` but got `str`. +typeddicts_usage.py:28:16 TypedDict initialization error [55]: Missing required field `name` for TypedDict `Movie`. """ conformance_automated = "Fail" errors_diff = """ -Line 23: Expected 1 errors -Line 24: Expected 1 errors -Line 28: Expected 1 errors Line 35: Expected 1 errors Line 40: Expected 1 errors """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 894ac115..dc6693ab 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 0.9 +test_duration = 1.8 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 8d523426..4d7fa4a5 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.373" -test_duration = 5.2 +test_duration = 1.2 diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 58744829..cf447499 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.04.11" -test_duration = 55.5 +test_duration = 30.0 diff --git a/conformance/results/results.html b/conformance/results/results.html index 66448133..fd3eec95 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

 
mypy 1.11.0
-
1.0sec
+
2.9sec
pyright 1.1.373
-
1.4sec
+
5.2sec
pyre 0.9.22
-
2.5sec
+
0.9sec
pytype 2024.04.11
-
32.7sec
+
55.5sec
@@ -972,6 +972,12 @@

Python Type System Conformance Test Results

Pass
Partial

Does not reject a call to "cast" with additional arguments.

     directives_deprecatedUnknownUnknownUnknownUnknown
     directives_no_type_check
Partial

Does not honor `@no_type_check` class decorator (allowed).

Does not reject invalid call of `@no_type_check` function.

Pass*

Does not honor `@no_type_check` class decorator (allowed).

- - - - + + + + From d921fe0ea97bdca2ad3f1b83ff13f58124df9c92 Mon Sep 17 00:00:00 2001 From: Jelle Zijlstra Date: Sat, 27 Jul 2024 12:42:27 -0700 Subject: [PATCH 10/12] Update conformance/results/pyre/directives_reveal_type.toml --- conformance/results/pyre/directives_reveal_type.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/conformance/results/pyre/directives_reveal_type.toml b/conformance/results/pyre/directives_reveal_type.toml index ff69a169..ed30bc74 100644 --- a/conformance/results/pyre/directives_reveal_type.toml +++ b/conformance/results/pyre/directives_reveal_type.toml @@ -1,6 +1,5 @@ conformant = "Partial" notes = """ -" Produces errors rather than warnings on `reveal_type`. """ output = """ From a7d36a23b4ce86a3511b9a052dcef92a68315b11 Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 19:53:30 +0000 Subject: [PATCH 11/12] Add new `__call__()` testcase per PR review --- conformance/tests/_directives_deprecated_library.py | 2 +- conformance/tests/directives_deprecated.py | 12 ++++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/conformance/tests/_directives_deprecated_library.py b/conformance/tests/_directives_deprecated_library.py index f9abd9e7..efcc6dcf 100644 --- a/conformance/tests/_directives_deprecated_library.py +++ b/conformance/tests/_directives_deprecated_library.py @@ -1,5 +1,5 @@ """ -Support module for directive_deprecated_pep702_example. +Support module for directive_deprecated. """ from typing import Self, overload diff --git a/conformance/tests/directives_deprecated.py b/conformance/tests/directives_deprecated.py index bd46f6d6..e321e3ef 100644 --- a/conformance/tests/directives_deprecated.py +++ b/conformance/tests/directives_deprecated.py @@ -33,7 +33,13 @@ ham = Ham() # no error (already reported above) -# > Any syntax that indirectly triggers a call to the function. +# > * Any syntax that indirectly triggers a call to the function. + +class Invocable: + + @deprecated("Deprecated") + def __call__(self) -> None: ... + spam = library.Spam() @@ -46,9 +52,11 @@ spam.shape = "cube" # E: Use of deprecated property setter Spam.shape spam.shape += "cube" # E: Use of deprecated property setter Spam.shape +invocable = Invocable() +invocable() # E: Use of deprecated method __call__ -# > * Any usage of deprecated objects in their defining module +# > * Any usage of deprecated objects in their defining module @deprecated("Deprecated") def lorem() -> None: ... From 61f334d2065ca16d820e33d20af6bec0f2405c60 Mon Sep 17 00:00:00 2001 From: InSync Date: Sat, 27 Jul 2024 20:09:15 +0000 Subject: [PATCH 12/12] Prefer "OK" to "no error" --- conformance/tests/directives_deprecated.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/conformance/tests/directives_deprecated.py b/conformance/tests/directives_deprecated.py index e321e3ef..cbae6054 100644 --- a/conformance/tests/directives_deprecated.py +++ b/conformance/tests/directives_deprecated.py @@ -27,31 +27,31 @@ # > For deprecated overloads, this includes all calls that resolve to the deprecated overload. library.foo(1) # E: Use of deprecated overload for foo -library.foo("x") # no error +library.foo("x") # OK -ham = Ham() # no error (already reported above) +ham = Ham() # OK (already reported above) # > * Any syntax that indirectly triggers a call to the function. -class Invocable: - - @deprecated("Deprecated") - def __call__(self) -> None: ... - - spam = library.Spam() _ = spam + 1 # E: Use of deprecated method Spam.__add__ spam += 1 # E: Use of deprecated method Spam.__add__ spam.greasy # E: Use of deprecated property Spam.greasy -spam.shape # no error +spam.shape # OK spam.shape = "cube" # E: Use of deprecated property setter Spam.shape spam.shape += "cube" # E: Use of deprecated property setter Spam.shape + +class Invocable: + + @deprecated("Deprecated") + def __call__(self) -> None: ... + invocable = Invocable() invocable() # E: Use of deprecated method __call__
 
mypy 1.11.0
-
2.9sec
+
1.4sec
pyright 1.1.373
-
5.2sec
+
1.2sec
pyre 0.9.22
-
0.9sec
+
1.8sec
pytype 2024.04.11
-
55.5sec
+
30.0sec
@@ -973,10 +973,10 @@

Python Type System Conformance Test Results

Partial

Does not reject a call to "cast" with additional arguments.

     directives_deprecatedUnknownUnknownUnknownUnknown
Unsupported

Does not support @deprecated.

Partial

Does not report error for deprecated magic methods.

Unsupported

Does not support @deprecated.

Unsupported

Does not support @deprecated.

     directives_no_type_check
Partial

Does not honor `@no_type_check` class decorator (allowed).

Does not reject invalid call of `@no_type_check` function.