From e74d9604a5d01c81b9ee3b8392ab4f2efc75c496 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 9 Aug 2024 01:29:42 -0700 Subject: [PATCH 01/29] writing_stubs: add examples of allowed and disallowed language features (#1837) --- docs/guides/writing_stubs.rst | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 1d1af917..703d9749 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -579,8 +579,14 @@ Language Features ----------------- Use the latest language features available, even for stubs targeting older -Python versions. Do not use quotes around forward references and do not use -``__future__`` imports. See :ref:`stub-file-syntax` for more information. +Python versions. For example, Python 3.7 added the ``async`` keyword (see +:pep:`492`). Stubs should use it to mark coroutines, even if the implementation +still uses the ``@coroutine`` decorator. On the other hand, the ``type`` soft +keyword from :pep:`695`, introduced in Python 3.12, should not be used in stubs +until Python 3.11 reaches end-of-life in October 2027. + +Do not use quotes around forward references and do not use ``__future__`` +imports. See :ref:`stub-file-syntax` for more information. Yes:: From d2d599f128190acac408faa740b2d1da017c8d90 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Wed, 21 Aug 2024 16:25:48 -0700 Subject: [PATCH 02/29] Merge the specification portion of the "Type Stubs" doc into the spec (#1815) * Type Stubs: move intro and syntax to spec. * Moves some content into spec, deletes duplicate spec content. * Adds placeholders for where remaining content will be moved. It will be split between the spec and the writing_stubs doc. * Move "Stub Contents" to writing_stubs. Moves the section on what to include in stubs with editorial changes only - e.g., changing "type stub" to "stub file" to match surrounding terminology. * Moves "Style Guide" to writing_stubs doc. Moves the style guide with a few updates: * Editorial changes like tweaking code examples to use recommended style. * Attribute declarations can use assignments when needed to convey extra information - e.g., final attributes and enum members. * Tweaks a reference to the double-underscore convention for positional-only arguments to note that it's historical. * Change :ref:`stubs` occurrences to :ref:`stub-files`. * Move a few "Supported Constructs" sections into spec. The only substantive change is an update to "Comments" to note that many formats of error suppression comments are allowed. * Migrated "Imports" and "Module Level Attributes" supported constructs. Added `x: Final = ` to module-level attributes section. No other changes. * Migrate "Enums" supported construct section. Replaces outdated info with a link to the enums section of the spec. * Move "Classes" and "Decorators" supported constructs sections. Added an example of an inner class to "Classes." Removed mention of asyncio.coroutine from "Decorators" as it's very deprecated. Added functions decorated with `@dataclass_transform` to list of decorators that type checkers should recognize. * Port "Functions and Methods" supported constructs section. Removed mention of individual supported/unsupported features from this section. Where we state that all typing features from the latest released version are supported, added a caveat with a link to the typeshed feature tracker. * Adds an "Import Conventions" section (deduplication). * Remove missed reference to deleted stubs doc. * Fix broken refs. * Formatting fix to docs/guides/writing_stubs.rst Co-authored-by: Sebastian Rittau * Reword paragraph on argument names to be more concise. Co-authored-by: Sebastian Rittau * Wording clarification in docs/guides/writing_stubs.rst Co-authored-by: Sebastian Rittau * Modernize code example in docs/guides/writing_stubs.rst Co-authored-by: Sebastian Rittau * Typo fix in docs/spec/distributing.rst Co-authored-by: Sebastian Rittau * Typo fix in docs/spec/distributing.rst Co-authored-by: Sebastian Rittau * Grammar fixes * Property deleters should also be understood. * Address future notes. * Fix silly formatting error. * Undelete stubs.rst. * Address review comments. * Reword some sections to focus on type checker behavior. * Move or remove some sections that fit better in the writing_stubs guide or are redundant. * Address more review comments. Cuts redundant sections, moves things to writing_stubs, tries out a new "these should be supported fully" and "these should be supported to at least the described minimum" structure. * Remove no-longer-needed anchor. * And add back an accidentally deleted newline... * Slight rewording of Decorators advice. * Address more reviewer comments. Moves "Library Interface" into spec, further trims redundant text. * Remove extra colon. * Revert changes to wrting_stubs that should be made separately. * Delete unnecessary sentence. Co-authored-by: Carl Meyer * Clarify some language and terminology. * Address reviewer feedback. * Formatting * Drop "annotation contexts." * Add "in annotation expressions" to newer syntax explanation. * Update docs/spec/distributing.rst Co-authored-by: Jelle Zijlstra * Reword syntax section. * Update docs/spec/distributing.rst Co-authored-by: Jelle Zijlstra * [pre-commit.ci] auto fixes from pre-commit.com hooks --------- Co-authored-by: Sebastian Rittau Co-authored-by: Carl Meyer Co-authored-by: Jelle Zijlstra Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docs/guides/libraries.rst | 49 +--- docs/guides/writing_stubs.rst | 2 +- docs/reference/index.rst | 1 - docs/reference/stubs.rst | 455 +--------------------------------- docs/spec/directives.rst | 2 + docs/spec/distributing.rst | 245 ++++++++++++++---- docs/spec/literal.rst | 3 + 7 files changed, 209 insertions(+), 548 deletions(-) diff --git a/docs/guides/libraries.rst b/docs/guides/libraries.rst index 376811ad..4b90da49 100644 --- a/docs/guides/libraries.rst +++ b/docs/guides/libraries.rst @@ -43,7 +43,7 @@ library: Inline type annotations simply refers to the use of annotations within your ``.py`` files. In contrast, with type stub files, type information lives in -separate ``.pyi`` files; see :ref:`stubs` and :ref:`writing_stubs` for more +separate ``.pyi`` files; see :ref:`stub-files` and :ref:`writing_stubs` for more details. We recommend using the inline type annotations approach, since it has the @@ -193,51 +193,8 @@ How much of my library needs types? A "py.typed" library should aim to be type complete so that type checking and inspection can work to their full extent. Here we say that a library is “type complete” if all of the symbols -that comprise its interface have type annotations that refer to types -that are fully known. Private symbols are exempt. - -Library interface (public and private symbols) ----------------------------------------------- - -If a ``py.typed`` module is present, a type checker will treat all modules -within that package (i.e. all files that end in ``.py`` or ``.pyi``) as -importable unless the file name begins with an underscore. These modules -comprise the supported interface for the library. - -Each module exposes a set of symbols. Some of these symbols are -considered "private” — implementation details that are not part of the -library’s interface. Type checkers can use the following rules -to determine which symbols are visible outside of the package. - -- Symbols whose names begin with an underscore (but are not dunder - names) are considered private. -- Imported symbols are considered private by default. If they use the - ``import A as A`` (a redundant module alias), ``from X import A as A`` (a - redundant symbol alias), or ``from . import A`` forms, symbol ``A`` is - not private unless the name begins with an underscore. If a file - ``__init__.py`` uses form ``from .A import X``, symbol ``A`` is treated - likewise. If a wildcard import (of the form ``from X import *``) is - used, all symbols referenced by the wildcard are not private. -- A module can expose an ``__all__`` symbol at the module level that - provides a list of names that are considered part of the interface. - This overrides all other rules above, allowing imported symbols or - symbols whose names begin with an underscore to be included in the - interface. -- Local variables within a function (including nested functions) are - always considered private. - -The following idioms are supported for defining the values contained -within ``__all__``. These restrictions allow type checkers to statically -determine the value of ``__all__``. - -- ``__all__ = ('a', b')`` -- ``__all__ = ['a', b']`` -- ``__all__ += ['a', b']`` -- ``__all__ += submodule.__all__`` -- ``__all__.extend(['a', b'])`` -- ``__all__.extend(submodule.__all__)`` -- ``__all__.append('a')`` -- ``__all__.remove('a')`` +that comprise its :ref:`interface ` have type annotations +that refer to types that are fully known. Private symbols are exempt. Type Completeness ----------------- diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 703d9749..71d13a71 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -5,7 +5,7 @@ Writing and Maintaining Stub Files ********************************** Stub files are a means of providing type information for Python modules. -For a full reference, refer to :ref:`stubs`. +For a full reference, refer to :ref:`stub-files`. Maintaining stubs can be a little cumbersome because they are separated from the implementation. This page lists some tools that make writing and maintaining diff --git a/docs/reference/index.rst b/docs/reference/index.rst index 010f3b49..720e2127 100644 --- a/docs/reference/index.rst +++ b/docs/reference/index.rst @@ -8,7 +8,6 @@ Type System Reference generics protocols - stubs best_practices quality typing Module Documentation diff --git a/docs/reference/stubs.rst b/docs/reference/stubs.rst index aac21f98..b0ce5671 100644 --- a/docs/reference/stubs.rst +++ b/docs/reference/stubs.rst @@ -1,457 +1,8 @@ -.. _stubs: +:orphan: ********** Type Stubs ********** -Introduction -============ - -*type stubs*, also called *stub files*, provide type information for untyped -Python packages and modules. Type stubs serve multiple purposes: - -* They are the only way to add type information to extension modules. -* They can provide type information for packages that do not wish to - add them inline. -* They can be distributed separately from the implementation. - This allows stubs to be developed at a different pace or by different - authors, which is especially useful when adding type annotations to - existing packages. -* They can act as documentation, succinctly explaining the external - API of a package, without including the implementation or private - members. - -This document aims to give guidance to both authors of type stubs and developers -of type checkers and other tools. It describes the constructs that can be used -safely in type stubs and lists constructs that type checkers are expected to -support. - -Type stubs that only use constructs described in this document should work with -all type checkers that also follow this document. -Type stub authors can elect to use additional constructs, but -must be prepared that some type checkers will not parse them as expected. - -A type checker that conforms to this document will parse a type stub that only uses -constructs described here without error and will not interpret any -construct in a contradictory manner. However, type checkers are not -required to implement checks for all these constructs, and -can elect to ignore unsupported ones. Additionally type checkers -can support constructs not described in this document and tool authors are -encouraged to experiment with additional features. - -.. _stub-file-syntax: - -Syntax -====== - -Type stubs are syntactically valid Python 3.8 files with a ``.pyi`` suffix. -The Python syntax used for type stubs is independent from the Python -versions supported by the implementation, and from the Python version the type -checker runs under (if any). Therefore, type stub authors should use the -latest available syntax features in stubs (up to Python 3.8), even if the -implementation supports older, pre-3.8 Python versions. -Type checker authors are encouraged to support syntax features from -post-3.8 Python versions, although type stub authors should not use such -features if they wish to maintain compatibility with all type checkers. - -For example, Python 3.7 added the ``async`` keyword (see :pep:`492`). -Stub authors should use it to mark coroutines, even if the implementation -still uses the ``@coroutine`` decorator. On the other hand, type stubs should -not use the ``type`` soft keyword from :pep:`695`, introduced in -Python 3.12, although type checker authors are encouraged to support it. - -Stubs are treated as if ``from __future__ import annotations`` is enabled. -In particular, built-in generics, pipe union syntax (``X | Y``), and forward -references can be used. - -The :py:mod:`ast` module from the standard library supports -all syntax features required by this document. - -Distribution -============ - -Type stubs can be distributed with or separately from the implementation; -see :ref:`distributing-type` and :ref:`providing-type-annotations` -for more information. - -Supported Constructs -==================== - -This sections lists constructs that type checkers will accept in type stubs. -Type stub authors can safely use these constructs. If a -construct is marked as "unspecified", type checkers may handle it -as they best see fit or report an error. Linters should usually -flag those constructs. Type stub authors should avoid using them to -ensure compatibility across type checkers. - -Unless otherwise mentioned, type stubs support all features from the -``typing`` module of the latest released Python version. If a stub uses -typing features from a later Python version than what the implementation -supports, these features can be imported from ``typing_extensions`` instead -of ``typing``. - -For example, a stub could use ``Literal``, introduced in Python 3.8, -for a library supporting Python 3.7+:: - - from typing_extensions import Literal - - def foo(x: Literal[""]) -> int: ... - -Comments --------- - -Standard Python comments are accepted everywhere Python syntax allows them. - -Two kinds of structured comments are accepted: - -* A ``# type: X`` comment at the end of a line that defines a variable, - declaring that the variable has type ``X``. However, :pep:`526`-style - variable annotations are preferred over type comments. -* A ``# type: ignore`` comment at the end of any line, which suppresses all type - errors in that line. The type checker mypy supports suppressing certain - type errors by using ``# type: ignore[error-type]``. This is not supported - by other type checkers and should not be used in stubs. - -Imports -------- - -Type stubs distinguish between imports that are re-exported and those -that are only used internally. Imports are re-exported if they use one of these -forms (:pep:`484`): - -* ``import X as X`` -* ``from Y import X as X`` -* ``from Y import *`` - -Here are some examples of imports that make names available for internal use in -a stub but do not re-export them:: - - import X - from Y import X - from Y import X as OtherX - -Type aliases can be used to re-export an import under a different name:: - - from foo import bar as _bar - new_bar = _bar # "bar" gets re-exported with the name "new_bar" - -Sub-modules are always exported when they are imported in a module. -For example, consider the following file structure:: - - foo/ - __init__.pyi - bar.pyi - -Then ``foo`` will export ``bar`` when one of the following constructs is used in -``__init__.pyi``:: - - from . import bar - from .bar import Bar - -Stubs support customizing star import semantics by defining a module-level -variable called ``__all__``. In stubs, this must be a string list literal. -Other types are not supported. Neither is the dynamic creation of this -variable (for example by concatenation). - -By default, ``from foo import *`` imports all names in ``foo`` that -do not begin with an underscore. When ``__all__`` is defined, only those names -specified in ``__all__`` are imported:: - - __all__ = ['public_attr', '_private_looking_public_attr'] - - public_attr: int - _private_looking_public_attr: int - private_attr: int - -Type checkers support cyclic imports in stub files. - -Module Level Attributes ------------------------ - -Module level variables and constants can be annotated using either -type comments or variable annotation syntax:: - - x: int # recommended - x: int = 0 - x = 0 # type: int - x = ... # type: int - -The type of a variable is unspecified when the variable is unannotated or -when the annotation -and the assigned value disagree. As an exception, the ellipsis literal can -stand in for any type:: - - x = 0 # type is unspecified - x = ... # type is unspecified - x: int = "" # type is unspecified - x: int = ... # type is int - -Classes -------- - -Class definition syntax follows general Python syntax, but type checkers -are only expected to understand the following constructs in class bodies: - -* The ellipsis literal ``...`` is ignored and used for empty - class bodies. Using ``pass`` in class bodies is undefined. -* Instance attributes follow the same rules as module level attributes - (see above). -* Method definitions (see below) and properties. -* Method aliases. -* Inner class definitions. - -More complex statements don't need to be supported:: - - class Simple: ... - - class Complex(Base): - read_write: int - @property - def read_only(self) -> int: ... - def do_stuff(self, y: str) -> None: ... - doStuff = do_stuff - -The type of generic classes can be narrowed by annotating the ``self`` -argument of the ``__init__`` method:: - - class Foo(Generic[_T]): - @overload - def __init__(self: Foo[str], type: Literal["s"]) -> None: ... - @overload - def __init__(self: Foo[int], type: Literal["i"]) -> None: ... - @overload - def __init__(self, type: str) -> None: ... - -The class must match the class in which it is declared. Using other classes, -including sub or super classes, will not work. In addition, the ``self`` -annotation cannot contain type variables. - -.. _supported-functions: - -Functions and Methods ---------------------- - -Function and method definition syntax follows general Python syntax. -For backwards compatibility, positional-only parameters can also be marked by -prefixing their name with two underscores (but not suffixing it with two -underscores):: - - # x is positional-only - # y can be used positionally or as keyword argument - # z is keyword-only - def foo(x, /, y, *, z): ... # recommended - def foo(__x, y, *, z): ... # backwards compatible syntax - -If an argument or return type is unannotated, per :pep:`484` its -type is assumed to be ``Any``. It is preferred to leave unknown -types unannotated rather than explicitly marking them as ``Any``, as some -type checkers can optionally warn about unannotated arguments. - -If an argument has a literal or constant default value, it must match the implementation -and the type of the argument (if specified) must match the default value. -Alternatively, ``...`` can be used in place of any default value:: - - # The following arguments all have type Any. - def unannotated(a, b=42, c=...): ... - # The following arguments all have type int. - def annotated(a: int, b: int = 42, c: int = ...): ... - # The following default values are invalid and the types are unspecified. - def invalid(a: int = "", b: Foo = Foo()): ... - -For a class ``C``, the type of the first argument to a classmethod is -assumed to be ``type[C]``, if unannotated. For other non-static methods, -its type is assumed to be ``C``:: - - class Foo: - def do_things(self): ... # self has type Foo - @classmethod - def create_it(cls): ... # cls has type Type[Foo] - @staticmethod - def utility(x): ... # x has type Any - -But:: - - _T = TypeVar("_T") - - class Foo: - def do_things(self: _T) -> _T: ... # self has type _T - @classmethod - def create_it(cls: _T) -> _T: ... # cls has type _T - -:pep:`612` parameter specification variables (``ParamSpec``) -are supported in argument and return types:: - - _P = ParamSpec("_P") - _R = TypeVar("_R") - - def foo(cb: Callable[_P, _R], *args: _P.args, **kwargs: _P.kwargs) -> _R: ... - -However, ``Concatenate`` from PEP 612 is not yet supported; nor is using -a ``ParamSpec`` to parameterize a generic class. - -:pep:`647` type guards are supported. - -Using a function or method body other than the ellipsis literal is currently -unspecified. Stub authors may experiment with other bodies, but it is up to -individual type checkers how to interpret them:: - - def foo(): ... # compatible - def bar(): pass # behavior undefined - -Aliases and NewType -------------------- - -Type checkers should accept module-level type aliases, optionally using -``TypeAlias`` (:pep:`613`), e.g.:: - - _IntList = list[int] - _StrList: TypeAlias = list[str] - -Type checkers should also accept regular module-level or class-level aliases, -e.g.:: - - def a() -> None: ... - b = a - - class C: - def f(self) -> int: ... - g = f - -A type alias may contain type variables. As per :pep:`484`, -all type variables must be substituted when the alias is used:: - - _K = TypeVar("_K") - _V = TypeVar("_V") - _MyMap: TypeAlias = dict[str, dict[_K, _V]] - - # either concrete types or other type variables can be substituted - def f(x: _MyMap[str, _V]) -> _V: ... - # explicitly substitute in Any rather than using a bare alias - def g(x: _MyMap[Any, Any]) -> Any: ... - -Otherwise, type variables in aliases follow the same rules as type variables in -generic class definitions. - -``typing.NewType`` is also supported in stubs. - -.. _stub-decorators: - -Decorators ----------- - -Type stubs may only use decorators defined in the ``typing`` module, plus a -fixed set of additional ones: - -* ``classmethod`` -* ``staticmethod`` -* ``property`` (including ``.setter``) -* ``abc.abstractmethod`` -* ``dataclasses.dataclass`` -* ``asyncio.coroutine`` (although ``async`` should be used instead) - -Version and Platform Checks ---------------------------- - -Type stubs for libraries that support multiple Python versions can use version -checks to supply version-specific type hints. Type stubs for different Python -versions should still conform to the most recent supported Python version's -syntax, as explain in the Syntax_ section above. - -Version checks are if-statements that use ``sys.version_info`` to determine the -current Python version. Version checks should only check against the ``major`` and -``minor`` parts of ``sys.version_info``. Type checkers are only required to -support the tuple-based version check syntax:: - - if sys.version_info >= (3,): - # Python 3-specific type hints. This tuple-based syntax is recommended. - else: - # Python 2-specific type hints. - - if sys.version_info >= (3, 5): - # Specific minor version features can be easily checked with tuples. - - if sys.version_info < (3,): - # This is only necessary when a feature has no Python 3 equivalent. - -Type stubs should avoid checking against ``sys.version_info.major`` -directly and should not use comparison operators other than ``<`` and ``>=``. - -No:: - - if sys.version_info.major >= 3: - # Semantically the same as the first tuple check. - - if sys.version_info[0] >= 3: - # This is also the same. - - if sys.version_info <= (2, 7): - # This does not work because e.g. (2, 7, 1) > (2, 7). - -Some type stubs also may need to specify type hints for different platforms. -Platform checks must be equality comparisons between ``sys.platform`` and the name -of a platform as a string literal: - -Yes:: - - if sys.platform == 'win32': - # Windows-specific type hints. - else: - # Posix-specific type hints. - -No:: - - if sys.platform.startswith('linux'): - # Not necessary since Python 3.3. - - if sys.platform in ['linux', 'cygwin', 'darwin']: - # Only '==' or '!=' should be used in platform checks. - -Version and platform comparisons can be chained using the ``and`` and ``or`` -operators:: - - if sys.platform == 'linux' and (sys.version_info < (3,) or sys,version_info >= (3, 7)): ... - -Enums ------ - -Enum classes are supported in stubs, regardless of the Python version targeted by -the stubs. - -Enum members may be specified just like other forms of assignments, for example as -``x: int``, ``x = 0``, or ``x = ...``. The first syntax is preferred because it -allows type checkers to correctly type the ``.value`` attribute of enum members, -without providing unnecessary information like the runtime value of the enum member. - -Additional properties on enum members should be specified with ``@property``, so they -do not get interpreted by type checkers as enum members. - -Yes:: - - from enum import Enum - - class Color(Enum): - RED: int - BLUE: int - @property - def rgb_value(self) -> int: ... - - class Color(Enum): - # discouraged; type checkers will not understand that Color.RED.value is an int - RED = ... - BLUE = ... - @property - def rgb_value(self) -> int: ... - -No:: - - from enum import Enum - - class Color(Enum): - RED: int - BLUE: int - rgb_value: int # no way for type checkers to know that this is not an enum member - -Copyright -========= - -This document is placed in the public domain or under the CC0-1.0-Universal license, whichever is more permissive. +The contents of this document have been moved to :ref:`stub-files` and +:ref:`writing_stubs`. diff --git a/docs/spec/directives.rst b/docs/spec/directives.rst index 7fca698a..62e1b3c4 100644 --- a/docs/spec/directives.rst +++ b/docs/spec/directives.rst @@ -128,6 +128,8 @@ and return type annotations and treat the function as if it were unannotated. The behavior for the ``no_type_check`` decorator when applied to a class is left undefined by the typing spec at this time. +.. _`version-and-platform-checks`: + Version and platform checking ----------------------------- diff --git a/docs/spec/distributing.rst b/docs/spec/distributing.rst index 9bcd3a6f..57bcc66e 100644 --- a/docs/spec/distributing.rst +++ b/docs/spec/distributing.rst @@ -10,72 +10,164 @@ Stub files (Originally specified in :pep:`484`.) -Stub files are files containing type hints that are only for use by -the type checker, not at runtime. There are several use cases for -stub files: +*Stub files*, also called *type stubs*, provide type information for untyped +Python packages and modules. Stub files serve multiple purposes: + +* They are the only way to add type information to extension modules. +* They can provide type information for packages that do not wish to + add them inline. +* They can be distributed separately from the package or module that they + provide types for. The latter is referred to as the *implementation*. + This allows stubs to be developed at a different pace or by different + authors, which is especially useful when adding type annotations to + existing packages. +* They can act as documentation, succinctly explaining the external + API of a package, without including implementation details or private + members. + +Stub files use a subset of the constructs used in Python source files, as +described in :ref:`stub-file-supported-constructs` below. Type checkers should +parse a stub that uses only such constructs without error and not interpret any +construct in a manner contradictory to this specification. However, type +checkers are not required to implement checks for all of these constructs and +can elect to ignore unsupported ones. Additionally, type checkers can support +constructs not described here. + +If a stub file is found for a module, the type checker should not read the +corresponding "real" module. See :ref:`mro` for more information. + +.. _stub-file-syntax: + +Syntax +^^^^^^ + +Stub files are syntactically valid Python files with a ``.pyi`` suffix. They +should be parseable (e.g., with :py:func:`ast.parse`) in all Python versions +that are supported by the implementation and that are still supported +by the CPython project. For example, defining a type alias using the +``type`` keyword is only accepted by the Python parser in Python 3.12 and later, +so stubs supporting Python 3.11 or earlier versions should not use this syntax. +This allows type checkers implemented in Python to parse stub files using +functionality from the standard library. +Type checkers may choose to support syntactic features from newer Python versions +in stub files, but stubs that rely on such features may not be portable to all +type checkers. Type checkers may also choose to support Python versions that +are no longer supported by CPython; if so, they cannot rely on standard library +functionality to parse stub files. + +Type checkers should evaluate all :term:`annotation expressions ` as if they are quoted. +Consequently, forward references do not need to be quoted, and type system +features that do not depend on Python syntax changes are supported in stubs regardless +of the Python version supported. For example, the use of the ``|`` operator +to create unions (``X | Y``) was introduced in Python 3.10, but may be used +even in stubs that support Python 3.9 and older versions. + +.. _stub-file-supported-constructs: + +Supported Constructs +^^^^^^^^^^^^^^^^^^^^ + +Type checkers should fully support these constructs: + +* All features from the ``typing`` module of the latest released Python version + that use :ref:`supported syntax ` +* Comments, including type declaration (``# type: X``) and error suppression + (``# type: ignore``) comments +* Import statements, including the standard :ref:`import-conventions` and cyclic + imports +* Aliases, including type aliases, at both the module and class level +* :ref:`Simple version and platform checks ` -* Extension modules +The constructs in the following subsections may be supported in a more limited +fashion, as described below. -* Third-party modules whose authors have not yet added type hints +Value Expressions +""""""""""""""""" -* Standard library modules for which type hints have not yet been - written +In locations where value expressions can appear, such as the right-hand side of +assignment statements and function parameter defaults, type checkers should +support the following expressions: -* Modules that must be compatible with Python 2 and 3 +* The ellipsis literal, ``...``, which can stand in for any value +* Any value that is a + :ref:`legal parameter for typing.Literal ` +* Floating point literals, such as ``3.14`` +* Complex literals, such as ``1 + 2j`` -* Modules that use annotations for other purposes +Module Level Attributes +""""""""""""""""""""""" -Stub files have the same syntax as regular Python modules. There is one -feature of the ``typing`` module that is different in stub files: -the ``@overload`` decorator described below. +Type checkers should support module-level variable annotations, with and without +assignments:: -The type checker should only check function signatures in stub files; -It is recommended that function bodies in stub files just be a single -ellipsis (``...``). + x: int + x: int = 0 + x = 0 # type: int + x = ... # type: int -The type checker should have a configurable search path for stub files. -If a stub file is found the type checker should not read the -corresponding "real" module. +The :ref:`Literal shortcut using Final ` should be +supported:: -While stub files are syntactically valid Python modules, they use the -``.pyi`` extension to make it possible to maintain stub files in the -same directory as the corresponding real module. This also reinforces -the notion that no runtime behavior should be expected of stub files. + x: Final = 0 # type is Literal[0] -Additional notes on stub files: +When the type of a variable is omitted or disagrees from the assigned value, +type checker behavior is undefined:: -* Modules and variables imported into the stub are not considered - exported from the stub unless the import uses the ``import ... as - ...`` form or the equivalent ``from ... import ... as ...`` form. - (*UPDATE:* To clarify, the intention here is that only names - imported using the form ``X as X`` will be exported, i.e. the name - before and after ``as`` must be the same.) + x = 0 # behavior undefined + x: Final = ... # behavior undefined + x: int = "" # behavior undefined -* However, as an exception to the previous bullet, all objects - imported into a stub using ``from ... import *`` are considered - exported. (This makes it easier to re-export all objects from a - given module that may vary by Python version.) +Classes +""""""" -* Just like in `normal Python files `_, submodules - automatically become exported attributes of their parent module - when imported. For example, if the ``spam`` package has the - following directory structure:: +Class definition syntax follows general Python syntax, but type checkers +are expected to understand only the following constructs in class bodies: - spam/ - __init__.pyi - ham.pyi +* The ellipsis literal ``...`` is used for empty class bodies. Using ``pass`` in + class bodies is undefined. +* Instance attributes follow the same rules as module level attributes + (see above). +* Method definitions (see below) and properties. +* Aliases. +* Inner class definitions. - where ``__init__.pyi`` contains a line such as ``from . import ham`` - or ``from .ham import Ham``, then ``ham`` is an exported attribute - of ``spam``. +Yes:: -* Stub files may be incomplete. To make type checkers aware of this, the file - can contain the following code:: + class Simple: ... + + class Complex(Base): + read_write: int + @property + def read_only(self) -> int: ... + def do_stuff(self, y: str) -> None: ... + doStuff = do_stuff + IntList: TypeAlias = list[int] + class Inner: ... + +Functions and Methods +""""""""""""""""""""" - def __getattr__(name) -> Any: ... +Function and method definition follows general Python syntax. Using a function +or method body other than the ellipsis literal is undefined:: - Any identifier not defined in the stub is therefore assumed to be of type - ``Any``. + def foo(): ... # compatible + def bar(): pass # behavior undefined + +.. _stub-decorators: + +Decorators +"""""""""" + +Type checkers are expected to understand the effects of all decorators defined +in the ``typing`` module, plus these additional ones: + + * ``classmethod`` + * ``staticmethod`` + * ``property`` (including ``.setter`` and ``.deleter``) + * ``abc.abstractmethod`` + * ``dataclasses.dataclass`` + * ``warnings.deprecated`` + * functions decorated with ``@typing.dataclass_transform`` The Typeshed Project ^^^^^^^^^^^^^^^^^^^^ @@ -266,3 +358,60 @@ of that Python version. This can be queried e.g. ``pythonX.Y -c 'import site; print(site.getsitepackages())'``. It is also recommended that the type checker allow for the user to point to a particular Python binary, in case it is not in the path. + +.. _library-interface: + +Library interface (public and private symbols) +---------------------------------------------- + +If a ``py.typed`` module is present, a type checker will treat all modules +within that package (i.e. all files that end in ``.py`` or ``.pyi``) as +importable unless the file name begins with an underscore. These modules +comprise the supported interface for the library. + +Each module exposes a set of symbols. Some of these symbols are +considered "private” — implementation details that are not part of the +library’s interface. Type checkers can use the following rules +to determine which symbols are visible outside of the package. + +- Symbols whose names begin with an underscore (but are not dunder + names) are considered private. +- Imported symbols are considered private by default. A fixed set of + :ref:`import forms ` re-export imported symbols. +- A module can expose an ``__all__`` symbol at the module level that + provides a list of names that are considered part of the interface. + This overrides all other rules above, allowing imported symbols or + symbols whose names begin with an underscore to be included in the + interface. +- Local variables within a function (including nested functions) are + always considered private. + +The following idioms are supported for defining the values contained +within ``__all__``. These restrictions allow type checkers to statically +determine the value of ``__all__``. + +- ``__all__ = ('a', b')`` +- ``__all__ = ['a', b']`` +- ``__all__ += ['a', b']`` +- ``__all__ += submodule.__all__`` +- ``__all__.extend(['a', b'])`` +- ``__all__.extend(submodule.__all__)`` +- ``__all__.append('a')`` +- ``__all__.remove('a')`` + +.. _import-conventions: + +Import Conventions +------------------ + +By convention, certain import forms indicate to type checkers that an imported +symbol is re-exported and should be considered part of the importing module's +public interface. All other imported symbols are considered private by default. + +The following import forms re-export symbols: + +* ``import X as X`` (a redundant module alias): re-exports ``X``. +* ``from Y import X as X`` (a redundant symbol alias): re-exports ``X``. +* ``from Y import *``: if ``Y`` defines a module-level ``__all__`` list, + re-exports all names in ``__all__``; otherwise, re-exports all public symbols + in ``Y``'s global scope. diff --git a/docs/spec/literal.rst b/docs/spec/literal.rst index 5cd50a44..564ddaa4 100644 --- a/docs/spec/literal.rst +++ b/docs/spec/literal.rst @@ -93,6 +93,7 @@ what values may and may not be used as parameters. In short, a ``Literal[...]`` type may be parameterized by one or more literal expressions, and nothing else. +.. _literal-legal-parameters: Legal parameters for ``Literal`` at type check time """"""""""""""""""""""""""""""""""""""""""""""""""" @@ -505,6 +506,8 @@ involving Literal bools. For example, we can combine ``Literal[True]``, else: scalar += "foo" # Type checks: type of 'scalar' is narrowed to 'str' +.. _literal-final-interactions: + Interactions with Final """"""""""""""""""""""" From 69ec68bec06940997158d99136340d1faf0afb8b Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 28 Aug 2024 12:06:15 +0100 Subject: [PATCH 03/29] Spec: fix indentation in `Annotated` bullets (#1849) --- docs/spec/qualifiers.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index 8cfb476d..4a3bcc9f 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -225,10 +225,10 @@ Here are the specific details of the syntax: * The base expression (the first argument to ``Annotated``) must be valid in the context where it is being used: - * If ``Annotated`` is used in a place where arbitrary - :term:`annotation expressions ` are allowed, - the base expression may be an annotation expression. - * Otherwise, the base expression must be a valid :term:`type expression`. + * If ``Annotated`` is used in a place where arbitrary + :term:`annotation expressions ` are allowed, + the base expression may be an annotation expression. + * Otherwise, the base expression must be a valid :term:`type expression`. * Multiple metadata elements are supported (``Annotated`` supports variadic arguments):: From 618dbc3fdafa07cc2f5eecad73a6290da658af78 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:51:27 +0300 Subject: [PATCH 04/29] Docs: Add reference to TypeIs to use via InterSphinx (#1852) --- docs/spec/narrowing.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/spec/narrowing.rst b/docs/spec/narrowing.rst index b7c6cc0d..27094e94 100644 --- a/docs/spec/narrowing.rst +++ b/docs/spec/narrowing.rst @@ -110,6 +110,8 @@ is not narrowed in the negative case. reveal_type(val) # tuple[str, str] ... +.. _`typeis`: + TypeIs ------ From f816a64b4d468cda3319f2879b16086c3783bb7c Mon Sep 17 00:00:00 2001 From: Shaygan Hooshyari Date: Tue, 3 Sep 2024 12:43:51 -0700 Subject: [PATCH 05/29] Fix type annotation with two string literals (#1853) Co-authored-by: Jelle Zijlstra --- conformance/tests/annotations_forward_refs.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/tests/annotations_forward_refs.py b/conformance/tests/annotations_forward_refs.py index 24111176..18f111e0 100644 --- a/conformance/tests/annotations_forward_refs.py +++ b/conformance/tests/annotations_forward_refs.py @@ -38,7 +38,7 @@ class ClassA: # The following should all generate errors because they are not legal type # expressions, despite being enclosed in quotes. def invalid_annotations( - p1: "eval(" ".join(map(chr, [105, 110, 116])))", # E + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E p2: "[int, str]", # E p3: "(int, str)", # E p4: "[int for i in range(1)]", # E From d93fba96510bb2f6df59a36fe04558226821220c Mon Sep 17 00:00:00 2001 From: InSync Date: Wed, 18 Sep 2024 04:45:17 +0700 Subject: [PATCH 06/29] Specify that `type[]` distributes over unions (#1841) --- docs/spec/special-types.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/spec/special-types.rst b/docs/spec/special-types.rst index 46e1f2bf..ce6f336b 100644 --- a/docs/spec/special-types.rst +++ b/docs/spec/special-types.rst @@ -175,7 +175,10 @@ Note that it is legal to use a union of classes as the parameter for user = new_user(user_class) ... -However the actual argument passed in at runtime must still be a +``type[]`` distributes over unions: +``type[A | B]`` is :term:`equivalent` to ``type[A] | type[B]``. + +However, the actual argument passed in at runtime must still be a concrete class object, e.g. in the above example:: new_non_team_user(ProUser) # OK From 0f38667c1424fecf4e42bad6b867702cf6e8ad4b Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Fri, 27 Sep 2024 10:08:17 -0700 Subject: [PATCH 07/29] TypedDict: clarify that a non-ReadOnly key cannot be redeclared as ReadOnly. (#1859) This is covered in the conformance tests ( https://github.com/python/typing/blob/d93fba96510bb2f6df59a36fe04558226821220c/conformance/tests/typeddicts_readonly_consistency.py#L38 and https://github.com/python/typing/blob/d93fba96510bb2f6df59a36fe04558226821220c/conformance/tests/typeddicts_readonly_consistency.py#L81 ) but not explicitly stated in the spec. --- docs/spec/typeddict.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 94846172..38a2e4b8 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -749,7 +749,8 @@ only if all of the following are satisfied: * For each item in ``A``, if ``B`` has the corresponding key, the corresponding value type in ``B`` is assignable to the value type in ``A``. * For each non-read-only item in ``A``, its value type is assignable to the - corresponding value type in ``B``. + corresponding value type in ``B``, and the corresponding key is not read-only + in ``B``. * For each required key in ``A``, the corresponding key is required in ``B``. * For each non-required key in ``A``, if the item is not read-only in ``A``, the corresponding key is not required in ``B``. From 70d41820e197b215f62f3f4df492ffd14a864f15 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Thu, 10 Oct 2024 12:13:48 -0700 Subject: [PATCH 08/29] =?UTF-8?q?Updated=20conformance=20tests=20and=20res?= =?UTF-8?q?ults=20for=20latest=20versions=20of=20type=20che=E2=80=A6=20(#1?= =?UTF-8?q?863)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Updated conformance tests and results for latest versions of type checkers. One test case in the `generics_syntax_infer_variance` was commented out temporarily until we decide how to handle variance inference for dataclasses in Python 3.13. Mypy version was updated from 1.11.1 to 1.11.2. Minor error message change but no other substantive changes to the conformance results. Pyright version was updated from 1.1.374 to 1.1.384. Many error messages changed slightly. Tests also identified three conformance regressions. Pytype version was updated from 2024.04.11 to 2024.09.13. Error message format changed significantly, requiring updates to the test logic. No other substantive changes to conformance results. Changed test infrastructure to make sure old versions of type checkers are uninstalled before installing new to guarantee correct version and increase determinism of timings. * Added "--version" invocation to mypy after installation to eliminate the artificial time associated with malware scanning on MacOS. --- .../mypy/annotations_forward_refs.toml | 11 +- .../mypy/generics_syntax_infer_variance.toml | 165 +++-- conformance/results/mypy/version.toml | 4 +- .../pyre/annotations_forward_refs.toml | 2 +- .../pyre/generics_syntax_infer_variance.toml | 29 +- conformance/results/pyre/version.toml | 2 +- .../results/pyright/aliases_explicit.toml | 20 +- .../results/pyright/aliases_implicit.toml | 7 +- .../results/pyright/aliases_newtype.toml | 10 +- .../results/pyright/aliases_recursive.toml | 122 ++-- .../pyright/aliases_type_statement.toml | 32 +- .../pyright/aliases_typealiastype.toml | 12 +- .../pyright/annotations_forward_refs.toml | 20 +- .../pyright/annotations_generators.toml | 32 +- .../results/pyright/annotations_methods.toml | 2 +- .../results/pyright/annotations_typeexpr.toml | 18 +- .../results/pyright/callables_annotation.toml | 30 +- .../results/pyright/callables_kwargs.toml | 25 +- .../results/pyright/callables_protocol.toml | 68 ++- .../results/pyright/callables_subtyping.toml | 162 ++--- .../results/pyright/classes_classvar.toml | 7 +- .../pyright/constructors_call_init.toml | 10 +- .../pyright/constructors_call_new.toml | 6 +- .../pyright/constructors_call_type.toml | 13 +- .../pyright/constructors_callable.toml | 4 +- .../results/pyright/dataclasses_final.toml | 15 +- .../results/pyright/dataclasses_frozen.toml | 6 +- .../results/pyright/dataclasses_hash.toml | 8 +- .../results/pyright/dataclasses_postinit.toml | 2 +- .../pyright/dataclasses_transform_class.toml | 6 +- .../dataclasses_transform_converter.toml | 40 +- .../pyright/dataclasses_transform_func.toml | 5 +- .../pyright/dataclasses_transform_meta.toml | 6 +- .../results/pyright/dataclasses_usage.toml | 6 +- .../pyright/directives_no_type_check.toml | 4 +- .../pyright/directives_type_ignore_file2.toml | 4 +- .../results/pyright/enums_member_values.toml | 6 +- .../results/pyright/generics_base_class.toml | 2 +- .../results/pyright/generics_basic.toml | 10 +- .../generics_defaults_referential.toml | 4 +- .../generics_paramspec_components.toml | 4 +- .../pyright/generics_paramspec_semantics.toml | 20 +- .../generics_paramspec_specialization.toml | 8 +- .../results/pyright/generics_scoping.toml | 2 +- .../pyright/generics_self_attributes.toml | 14 +- .../results/pyright/generics_self_basic.toml | 8 +- .../pyright/generics_self_protocols.toml | 8 +- .../results/pyright/generics_self_usage.toml | 4 +- .../pyright/generics_syntax_declarations.toml | 2 +- .../generics_syntax_infer_variance.toml | 80 ++- .../pyright/generics_type_erasure.toml | 12 +- .../pyright/generics_typevartuple_args.toml | 21 +- .../pyright/generics_typevartuple_basic.toml | 18 +- .../generics_typevartuple_callable.toml | 4 +- .../pyright/generics_typevartuple_unpack.toml | 2 +- .../results/pyright/generics_upper_bound.toml | 4 +- .../pyright/generics_variance_inference.toml | 119 ++-- .../pyright/literals_literalstring.toml | 28 +- .../pyright/literals_parameterizations.toml | 16 +- .../results/pyright/literals_semantics.toml | 19 +- .../pyright/namedtuples_define_class.toml | 6 +- .../namedtuples_define_functional.toml | 6 +- .../pyright/namedtuples_type_compat.toml | 10 +- .../results/pyright/namedtuples_usage.toml | 6 +- .../results/pyright/narrowing_typeguard.toml | 12 +- .../results/pyright/narrowing_typeis.toml | 30 +- .../results/pyright/overloads_basic.toml | 2 +- .../pyright/protocols_class_objects.toml | 24 +- .../results/pyright/protocols_definition.toml | 68 ++- .../results/pyright/protocols_explicit.toml | 5 +- .../results/pyright/protocols_generic.toml | 62 +- .../results/pyright/protocols_merging.toml | 14 +- .../results/pyright/protocols_modules.toml | 12 +- .../results/pyright/protocols_subtyping.toml | 34 +- .../results/pyright/protocols_variance.toml | 14 +- .../results/pyright/qualifiers_annotated.toml | 27 +- .../pyright/qualifiers_final_annotation.toml | 18 +- .../results/pyright/specialtypes_never.toml | 8 +- .../results/pyright/specialtypes_none.toml | 6 +- .../results/pyright/specialtypes_type.toml | 10 +- .../results/pyright/tuples_type_compat.toml | 66 +- .../results/pyright/tuples_type_form.toml | 20 +- .../pyright/typeddicts_alt_syntax.toml | 4 +- .../pyright/typeddicts_operations.toml | 14 +- .../typeddicts_readonly_consistency.toml | 16 +- .../typeddicts_readonly_inheritance.toml | 12 +- .../pyright/typeddicts_readonly_update.toml | 2 +- .../results/pyright/typeddicts_required.toml | 2 +- .../pyright/typeddicts_type_consistency.toml | 34 +- .../results/pyright/typeddicts_usage.toml | 4 +- conformance/results/pyright/version.toml | 4 +- .../results/pytype/aliases_explicit.toml | 114 +++- .../results/pytype/aliases_implicit.toml | 334 +++++++++- .../results/pytype/aliases_newtype.toml | 24 +- .../results/pytype/aliases_recursive.toml | 126 +++- .../results/pytype/aliases_typealiastype.toml | 69 ++- .../results/pytype/aliases_variance.toml | 16 +- .../pytype/annotations_forward_refs.toml | 445 +++++++++++++- .../pytype/annotations_generators.toml | 80 ++- .../results/pytype/annotations_methods.toml | 6 +- .../results/pytype/annotations_typeexpr.toml | 362 ++++++++++- .../results/pytype/callables_kwargs.toml | 98 ++- .../results/pytype/callables_protocol.toml | 52 +- .../results/pytype/callables_subtyping.toml | 44 +- .../results/pytype/classes_classvar.toml | 123 +++- .../results/pytype/classes_override.toml | 60 +- .../pytype/constructors_call_init.toml | 94 ++- .../pytype/constructors_call_metaclass.toml | 40 +- .../results/pytype/constructors_call_new.toml | 46 +- .../pytype/constructors_call_type.toml | 44 +- .../results/pytype/constructors_callable.toml | 270 ++++++-- .../pytype/dataclasses_descriptors.toml | 66 +- .../results/pytype/dataclasses_final.toml | 26 +- .../results/pytype/dataclasses_kwonly.toml | 50 +- .../results/pytype/dataclasses_postinit.toml | 22 +- .../results/pytype/dataclasses_slots.toml | 28 +- .../pytype/dataclasses_transform_class.toml | 52 +- .../dataclasses_transform_converter.toml | 122 +++- .../pytype/dataclasses_transform_field.toml | 16 +- .../pytype/dataclasses_transform_func.toml | 80 ++- .../pytype/dataclasses_transform_meta.toml | 30 +- .../results/pytype/dataclasses_usage.toml | 66 +- .../pytype/directives_assert_type.toml | 30 +- .../results/pytype/directives_cast.toml | 12 +- .../results/pytype/directives_deprecated.toml | 30 +- .../pytype/directives_no_type_check.toml | 30 +- .../pytype/directives_reveal_type.toml | 38 +- .../pytype/directives_type_ignore.toml | 15 +- .../pytype/directives_version_platform.toml | 18 +- .../results/pytype/enums_definition.toml | 6 +- .../results/pytype/enums_member_values.toml | 66 +- conformance/results/pytype/enums_members.toml | 146 ++++- .../pytype/exceptions_context_managers.toml | 16 +- .../results/pytype/generics_base_class.toml | 26 +- .../results/pytype/generics_basic.toml | 86 ++- .../results/pytype/generics_defaults.toml | 415 ++++++++++--- .../pytype/generics_defaults_referential.toml | 270 ++++++-- .../generics_defaults_specialization.toml | 127 +++- .../generics_paramspec_specialization.toml | 86 ++- .../results/pytype/generics_scoping.toml | 94 ++- .../pytype/generics_self_advanced.toml | 100 ++- .../pytype/generics_self_attributes.toml | 6 +- .../results/pytype/generics_self_basic.toml | 62 +- .../results/pytype/generics_self_usage.toml | 76 ++- .../generics_syntax_infer_variance.toml | 27 +- .../pytype/generics_typevartuple_args.toml | 144 ++++- .../pytype/generics_typevartuple_basic.toml | 358 +++++++++-- .../generics_typevartuple_callable.toml | 148 ++++- .../pytype/generics_typevartuple_concat.toml | 187 ++++-- .../generics_typevartuple_overloads.toml | 81 ++- .../generics_typevartuple_specialization.toml | 575 ++++++++++++++---- .../pytype/generics_typevartuple_unpack.toml | 82 ++- .../results/pytype/generics_upper_bound.toml | 40 +- .../results/pytype/generics_variance.toml | 44 +- .../results/pytype/historical_positional.toml | 6 +- .../results/pytype/literals_interactions.toml | 84 ++- .../pytype/literals_literalstring.toml | 86 ++- .../pytype/literals_parameterizations.toml | 111 +++- .../results/pytype/literals_semantics.toml | 62 +- .../pytype/namedtuples_define_class.toml | 76 ++- .../pytype/namedtuples_define_functional.toml | 74 ++- .../pytype/namedtuples_type_compat.toml | 12 +- .../results/pytype/namedtuples_usage.toml | 40 +- .../results/pytype/narrowing_typeguard.toml | 12 +- .../results/pytype/narrowing_typeis.toml | 40 +- .../results/pytype/overloads_basic.toml | 22 +- .../pytype/protocols_class_objects.toml | 18 +- .../results/pytype/protocols_definition.toml | 50 +- .../results/pytype/protocols_explicit.toml | 20 +- .../results/pytype/protocols_generic.toml | 56 +- .../results/pytype/protocols_merging.toml | 30 +- .../results/pytype/protocols_modules.toml | 16 +- .../results/pytype/protocols_recursive.toml | 24 +- .../results/pytype/protocols_self.toml | 32 +- .../results/pytype/protocols_subtyping.toml | 28 +- .../results/pytype/protocols_variance.toml | 24 +- .../results/pytype/qualifiers_annotated.toml | 68 ++- .../pytype/qualifiers_final_annotation.toml | 123 +++- .../pytype/qualifiers_final_decorator.toml | 268 +++++++- .../results/pytype/specialtypes_never.toml | 47 +- .../results/pytype/specialtypes_none.toml | 12 +- .../pytype/specialtypes_promotions.toml | 6 +- .../results/pytype/specialtypes_type.toml | 90 ++- .../results/pytype/tuples_type_compat.toml | 388 +++++++++--- .../results/pytype/tuples_type_form.toml | 78 ++- .../results/pytype/tuples_unpacked.toml | 196 ++++-- .../results/pytype/typeddicts_alt_syntax.toml | 12 +- .../pytype/typeddicts_class_syntax.toml | 12 +- .../pytype/typeddicts_inheritance.toml | 24 +- .../results/pytype/typeddicts_operations.toml | 32 +- .../results/pytype/typeddicts_readonly.toml | 8 +- .../typeddicts_readonly_consistency.toml | 30 +- .../typeddicts_readonly_inheritance.toml | 148 ++++- .../pytype/typeddicts_readonly_kwargs.toml | 22 +- .../pytype/typeddicts_readonly_update.toml | 8 +- .../pytype/typeddicts_type_consistency.toml | 26 +- .../results/pytype/typeddicts_usage.toml | 18 +- conformance/results/pytype/version.toml | 4 +- conformance/results/results.html | 20 +- conformance/src/type_checker.py | 60 +- .../tests/generics_syntax_infer_variance.py | 11 +- 201 files changed, 8378 insertions(+), 2584 deletions(-) diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index 14d8cb64..bee7ebbd 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -6,9 +6,8 @@ Incorrectly generates error for quoted type defined in class scope. """ output = """ annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] -annotations_forward_refs.py:42: error: Bracketed expression "[...]" is not valid as a type [valid-type] -annotations_forward_refs.py:43: error: Syntax error in type annotation [syntax] -annotations_forward_refs.py:43: note: Suggestion: Use Tuple[T1, ..., Tn] instead of (T1, ..., Tn) +annotations_forward_refs.py:42: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:43: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:44: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:45: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:46: error: Invalid type comment or annotation [valid-type] @@ -16,9 +15,9 @@ annotations_forward_refs.py:47: error: Invalid type comment or annotation [vali annotations_forward_refs.py:48: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:49: error: Variable "annotations_forward_refs.var1" is not valid as a type [valid-type] annotations_forward_refs.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -annotations_forward_refs.py:50: error: Invalid type: try using Literal[True] instead? [valid-type] -annotations_forward_refs.py:51: error: Invalid type: try using Literal[1] instead? [valid-type] -annotations_forward_refs.py:52: error: Invalid type: try using Literal[-1] instead? [valid-type] +annotations_forward_refs.py:50: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:51: error: Invalid type comment or annotation [valid-type] +annotations_forward_refs.py:52: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:53: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:54: error: Invalid type comment or annotation [valid-type] annotations_forward_refs.py:55: error: Module "types" is not valid as a type [valid-type] diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index b354ae22..1db3d4a8 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -34,70 +34,66 @@ generics_syntax_infer_variance.py:46: error: The type "type[ShouldBeCovariant3]" generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc] generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:51: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:54: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:54: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:55: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:55: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:58: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:59: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:59: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:63: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:63: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:67: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:67: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:68: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:68: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:71: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:72: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:74: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:74: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:78: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:78: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:79: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:79: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:82: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:83: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:83: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:91: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:95: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:95: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:96: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:96: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:100: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:103: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:103: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:106: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:110: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:110: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:111: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:111: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:114: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:118: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:119: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:119: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:120: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:120: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:121: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] -generics_syntax_infer_variance.py:121: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:129: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] -generics_syntax_infer_variance.py:137: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] -generics_syntax_infer_variance.py:140: error: Free type variable expected in Generic[...] [misc] -generics_syntax_infer_variance.py:141: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:141: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:144: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] -generics_syntax_infer_variance.py:144: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -generics_syntax_infer_variance.py:148: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:148: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] -generics_syntax_infer_variance.py:149: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] -generics_syntax_infer_variance.py:149: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:66: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:70: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:75: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:75: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:79: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:81: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:86: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:86: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:102: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:103: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:103: error: The type "type[ShouldBeInvariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:107: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:110: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:113: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:117: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:117: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:118: error: "ShouldBeInvariant2" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:118: error: The type "type[ShouldBeInvariant2]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:121: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:125: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:125: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:126: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:126: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:127: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:127: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:128: error: "ShouldBeInvariant3" expects no type arguments, but 2 given [type-arg] +generics_syntax_infer_variance.py:128: error: The type "type[ShouldBeInvariant3]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:136: error: Incompatible types in assignment (expression has type "ShouldBeInvariant4[int]", variable has type "ShouldBeInvariant4[float]") [assignment] +generics_syntax_infer_variance.py:144: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] +generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc] +generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:148: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:151: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:155: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:155: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] +generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg] +generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc] """ conformance_automated = "Fail" errors_diff = """ @@ -115,25 +111,24 @@ Line 41: Unexpected errors ['generics_syntax_infer_variance.py:41: error: Variab Line 45: Unexpected errors ['generics_syntax_infer_variance.py:45: error: "ShouldBeCovariant3" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:45: error: The type "type[ShouldBeCovariant3]" is not generic and not indexable [misc]'] Line 50: Unexpected errors ['generics_syntax_infer_variance.py:50: error: Free type variable expected in Generic[...] [misc]'] Line 51: Unexpected errors ['generics_syntax_infer_variance.py:51: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 54: Unexpected errors ['generics_syntax_infer_variance.py:54: error: "ShouldBeCovariant4" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:54: error: The type "type[ShouldBeCovariant4]" is not generic and not indexable [misc]'] -Line 58: Unexpected errors ['generics_syntax_infer_variance.py:58: error: Free type variable expected in Generic[...] [misc]'] -Line 59: Unexpected errors ['generics_syntax_infer_variance.py:59: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 63: Unexpected errors ['generics_syntax_infer_variance.py:63: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 67: Unexpected errors ['generics_syntax_infer_variance.py:67: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:67: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] -Line 71: Unexpected errors ['generics_syntax_infer_variance.py:71: error: Free type variable expected in Generic[...] [misc]'] -Line 72: Unexpected errors ['generics_syntax_infer_variance.py:72: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 78: Unexpected errors ['generics_syntax_infer_variance.py:78: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:78: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] -Line 82: Unexpected errors ['generics_syntax_infer_variance.py:82: error: Free type variable expected in Generic[...] [misc]'] -Line 83: Unexpected errors ['generics_syntax_infer_variance.py:83: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 91: Unexpected errors ['generics_syntax_infer_variance.py:91: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 99: Unexpected errors ['generics_syntax_infer_variance.py:99: error: Free type variable expected in Generic[...] [misc]'] -Line 100: Unexpected errors ['generics_syntax_infer_variance.py:100: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 103: Unexpected errors ['generics_syntax_infer_variance.py:103: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 114: Unexpected errors ['generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:114: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] -Line 140: Unexpected errors ['generics_syntax_infer_variance.py:140: error: Free type variable expected in Generic[...] [misc]'] -Line 141: Unexpected errors ['generics_syntax_infer_variance.py:141: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 144: Unexpected errors ['generics_syntax_infer_variance.py:144: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] -Line 149: Unexpected errors ['generics_syntax_infer_variance.py:149: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:149: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] +Line 65: Unexpected errors ['generics_syntax_infer_variance.py:65: error: Free type variable expected in Generic[...] [misc]'] +Line 66: Unexpected errors ['generics_syntax_infer_variance.py:66: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 70: Unexpected errors ['generics_syntax_infer_variance.py:70: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 74: Unexpected errors ['generics_syntax_infer_variance.py:74: error: "ShouldBeCovariant5" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:74: error: The type "type[ShouldBeCovariant5]" is not generic and not indexable [misc]'] +Line 78: Unexpected errors ['generics_syntax_infer_variance.py:78: error: Free type variable expected in Generic[...] [misc]'] +Line 79: Unexpected errors ['generics_syntax_infer_variance.py:79: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 81: Unexpected errors ['generics_syntax_infer_variance.py:81: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] +Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]'] +Line 90: Unexpected errors ['generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 98: Unexpected errors ['generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc]'] +Line 107: Unexpected errors ['generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 110: Unexpected errors ['generics_syntax_infer_variance.py:110: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 113: Unexpected errors ['generics_syntax_infer_variance.py:113: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 121: Unexpected errors ['generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.K" is not valid as a type [valid-type]', 'generics_syntax_infer_variance.py:121: error: Variable "generics_syntax_infer_variance.V" is not valid as a type [valid-type]'] +Line 147: Unexpected errors ['generics_syntax_infer_variance.py:147: error: Free type variable expected in Generic[...] [misc]'] +Line 148: Unexpected errors ['generics_syntax_infer_variance.py:148: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 151: Unexpected errors ['generics_syntax_infer_variance.py:151: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 156: Unexpected errors ['generics_syntax_infer_variance.py:156: error: "ShouldBeContravariant1" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:156: error: The type "type[ShouldBeContravariant1]" is not generic and not indexable [misc]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index efd7c799..aa90cb33 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.11.1" -test_duration = 13.2 +version = "mypy 1.11.2" +test_duration = 1.9 diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 1e4ecf73..6c52e88e 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -8,7 +8,7 @@ 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:41:8 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid 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. diff --git a/conformance/results/pyre/generics_syntax_infer_variance.toml b/conformance/results/pyre/generics_syntax_infer_variance.toml index 2a2c10d6..7a848658 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -3,7 +3,7 @@ notes = """ Type parameter syntax not yet support. """ output = """ -generics_syntax_infer_variance.py:125:25 Parsing failure [404]: invalid syntax +generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ @@ -12,19 +12,18 @@ Line 17: Expected 1 errors Line 29: Expected 1 errors Line 37: Expected 1 errors Line 46: Expected 1 errors -Line 55: Expected 1 errors -Line 68: Expected 1 errors -Line 79: Expected 1 errors -Line 95: Expected 1 errors -Line 96: Expected 1 errors -Line 110: Expected 1 errors -Line 111: Expected 1 errors +Line 75: Expected 1 errors +Line 86: Expected 1 errors +Line 102: Expected 1 errors +Line 103: Expected 1 errors +Line 117: Expected 1 errors Line 118: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors -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'] +Line 125: Expected 1 errors +Line 126: Expected 1 errors +Line 127: Expected 1 errors +Line 128: Expected 1 errors +Line 136: Expected 1 errors +Line 144: Expected 1 errors +Line 155: Expected 1 errors +Line 132: Unexpected errors ['generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 9de046bf..f4f08845 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 5.4 +test_duration = 4.5 diff --git a/conformance/results/pyright/aliases_explicit.toml b/conformance/results/pyright/aliases_explicit.toml index 2d555719..a1e82c9e 100644 --- a/conformance/results/pyright/aliases_explicit.toml +++ b/conformance/results/pyright/aliases_explicit.toml @@ -9,40 +9,40 @@ aliases_explicit.py:71:24 - error: Expected ParamSpec, ellipsis, or list of type aliases_explicit.py:79:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:79:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:80:21 - error: List expression not allowed in type annotation +aliases_explicit.py:80:21 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:80:21 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:81:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:81:21 - error: Tuple expression not allowed in type annotation +aliases_explicit.py:81:21 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:82:21 - error: List expression not allowed in type annotation +aliases_explicit.py:82:21 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:82:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_explicit.py:83:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type annotation +aliases_explicit.py:83:21 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) aliases_explicit.py:83:21 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_explicit.py:83:28 - error: "b" is not defined (reportUndefinedVariable) aliases_explicit.py:84:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:84:21 - error: Call expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:85:21 - error: List expression not allowed in type annotation +aliases_explicit.py:85:21 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_explicit.py:85:21 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_explicit.py:85:27 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) aliases_explicit.py:86:21 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:86:21 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +aliases_explicit.py:86:21 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) aliases_explicit.py:87:21 - error: Variable not allowed in type expression (reportInvalidTypeForm) +aliases_explicit.py:88:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:88:22 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_explicit.py:89:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) aliases_explicit.py:89:22 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_explicit.py:90:22 - error: Invalid expression form for type alias definition (reportInvalidTypeForm) -aliases_explicit.py:90:22 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -aliases_explicit.py:91:22 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_explicit.py:90:22 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +aliases_explicit.py:91:22 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) aliases_explicit.py:100:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) -aliases_explicit.py:101:6 - error: Object of type "UnionType" is not callable -  Attribute "__call__" is unknown (reportCallIssue) +aliases_explicit.py:101:6 - error: Object of type "UnionType" is not callable (reportCallIssue) aliases_explicit.py:102:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) aliases_explicit.py:102:5 - error: Type "set[Unknown]" is already specialized (reportInvalidTypeArguments) """ diff --git a/conformance/results/pyright/aliases_implicit.toml b/conformance/results/pyright/aliases_implicit.toml index fde2e84c..32f2b7be 100644 --- a/conformance/results/pyright/aliases_implicit.toml +++ b/conformance/results/pyright/aliases_implicit.toml @@ -7,8 +7,8 @@ aliases_implicit.py:78:29 - error: Too many type arguments provided for "GoodTyp aliases_implicit.py:79:29 - error: Too many type arguments provided for "GoodTypeAlias8[T@GoodTypeAlias8]"; expected 1 but received 2 (reportInvalidTypeForm) aliases_implicit.py:80:24 - error: Expected ParamSpec, ellipsis, or list of types (reportInvalidTypeForm) aliases_implicit.py:81:9 - error: Could not specialize type "GoodTypeAlias12[TFloat@GoodTypeAlias12]" -  Type "str" is incompatible with type "float" -    "str" is incompatible with "float" (reportInvalidTypeForm) +  Type "str" is not assignable to type "float" +    "str" is not assignable to "float" (reportInvalidTypeForm) aliases_implicit.py:106:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:107:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:108:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) @@ -23,8 +23,7 @@ aliases_implicit.py:116:10 - error: Variable not allowed in type expression (rep aliases_implicit.py:117:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:118:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_implicit.py:119:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) -aliases_implicit.py:133:6 - error: Object of type "UnionType" is not callable -  Attribute "__call__" is unknown (reportCallIssue) +aliases_implicit.py:133:6 - error: Object of type "UnionType" is not callable (reportCallIssue) aliases_implicit.py:135:5 - error: Type "list[Unknown]" is already specialized (reportInvalidTypeArguments) aliases_implicit.py:135:5 - error: Type "set[Unknown]" is already specialized (reportInvalidTypeArguments) """ diff --git a/conformance/results/pyright/aliases_newtype.toml b/conformance/results/pyright/aliases_newtype.toml index 6d46e752..256c1361 100644 --- a/conformance/results/pyright/aliases_newtype.toml +++ b/conformance/results/pyright/aliases_newtype.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ aliases_newtype.py:11:8 - error: Argument of type "Literal['user']" cannot be assigned to parameter "_x" of type "int" in function "__init__" -  "Literal['user']" is incompatible with "int" (reportArgumentType) -aliases_newtype.py:12:14 - error: Expression of type "Literal[42]" is incompatible with declared type "UserId" -  "Literal[42]" is incompatible with "UserId" (reportAssignmentType) +  "Literal['user']" is not assignable to "int" (reportArgumentType) +aliases_newtype.py:12:14 - error: Type "Literal[42]" is not assignable to declared type "UserId" +  "Literal[42]" is not assignable to "UserId" (reportAssignmentType) aliases_newtype.py:20:16 - error: Second argument to "isinstance" must be a class or tuple of classes   Class created with NewType cannot be used with instance and class checks (reportArgumentType) aliases_newtype.py:23:21 - error: Base class "UserId" is marked final and cannot be subclassed (reportGeneralTypeIssues) @@ -11,9 +11,9 @@ aliases_newtype.py:32:1 - error: NewType must be assigned to a variable with the aliases_newtype.py:38:19 - error: Expected no type arguments for class "GoodNewType1" (reportInvalidTypeArguments) aliases_newtype.py:44:38 - error: Expected class as second argument to NewType (reportGeneralTypeIssues) aliases_newtype.py:47:43 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) -aliases_newtype.py:49:38 - error: NewType cannot be used with structural type (a protocol or TypedDict class) (reportGeneralTypeIssues) +aliases_newtype.py:49:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) aliases_newtype.py:51:38 - error: NewType cannot be used with Literal type (reportGeneralTypeIssues) -aliases_newtype.py:58:38 - error: NewType cannot be used with structural type (a protocol or TypedDict class) (reportGeneralTypeIssues) +aliases_newtype.py:58:38 - error: NewType cannot be used with structural type (a Protocol or TypedDict class) (reportGeneralTypeIssues) aliases_newtype.py:60:15 - error: NewType requires two positional arguments (reportCallIssue) aliases_newtype.py:62:38 - error: The second argument to NewType must be a known class, not Any or Unknown (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/aliases_recursive.toml b/conformance/results/pyright/aliases_recursive.toml index eafd7b25..dd135ac2 100644 --- a/conformance/results/pyright/aliases_recursive.toml +++ b/conformance/results/pyright/aliases_recursive.toml @@ -1,66 +1,74 @@ conformant = "Pass" output = """ -aliases_recursive.py:19:12 - error: Expression of type "dict[str, int | complex]" is incompatible with declared type "Json" -  Type "dict[str, int | complex]" is incompatible with type "Json" -    "dict[str, int | complex]" is incompatible with "None" -    "dict[str, int | complex]" is incompatible with "int" -    "dict[str, int | complex]" is incompatible with "str" -    "dict[str, int | complex]" is incompatible with "float" -    "dict[str, int | complex]" is incompatible with "list[Json]" -    "dict[str, int | complex]" is incompatible with "dict[str, Json]" +aliases_recursive.py:19:12 - error: Type "dict[str, int | complex]" is not assignable to declared type "Json" +  Type "dict[str, int | complex]" is not assignable to type "Json" +    "dict[str, int | complex]" is not assignable to "None" +    "dict[str, int | complex]" is not assignable to "int" +    "dict[str, int | complex]" is not assignable to "str" +    "dict[str, int | complex]" is not assignable to "float" +    "dict[str, int | complex]" is not assignable to "list[Json]" +    "dict[str, int | complex]" is not assignable to "dict[str, Json]"       Type parameter "_VT@dict" is invariant, but "int | complex" is not the same as "Json" ... (reportAssignmentType) -aliases_recursive.py:20:16 - error: Expression of type "list[int | complex]" is incompatible with declared type "Json" -  Type "complex" is incompatible with type "Json" -    "complex" is incompatible with "None" -    "complex" is incompatible with "int" -    "complex" is incompatible with "str" -    "complex" is incompatible with "float" -    "complex" is incompatible with "list[Json]" -    "complex" is incompatible with "dict[str, Json]" (reportAssignmentType) -aliases_recursive.py:38:22 - error: Expression of type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with declared type "RecursiveTuple" -  Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with type "RecursiveTuple" -    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "str" -    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "int" -    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is incompatible with "tuple[RecursiveTuple, ...]" -      Tuple entry 1 is incorrect type (reportAssignmentType) -aliases_recursive.py:39:22 - error: Expression of type "tuple[Literal[1], list[int]]" is incompatible with declared type "RecursiveTuple" -  Type "tuple[Literal[1], list[int]]" is incompatible with type "RecursiveTuple" -    "tuple[Literal[1], list[int]]" is incompatible with "str" -    "tuple[Literal[1], list[int]]" is incompatible with "int" -    "tuple[Literal[1], list[int]]" is incompatible with "tuple[RecursiveTuple, ...]" -      Tuple entry 1 is incorrect type (reportAssignmentType) -aliases_recursive.py:50:24 - error: Expression of type "dict[str, list[int]]" is incompatible with declared type "RecursiveMapping" -  Type "dict[str, list[int]]" is incompatible with type "RecursiveMapping" -    "dict[str, list[int]]" is incompatible with "str" -    "dict[str, list[int]]" is incompatible with "int" -    "dict[str, list[int]]" is incompatible with "Mapping[str, RecursiveMapping]" +aliases_recursive.py:20:16 - error: Type "list[int | complex]" is not assignable to declared type "Json" +  Type "complex" is not assignable to type "Json" +    "complex" is not assignable to "None" +    "complex" is not assignable to "int" +    "complex" is not assignable to "str" +    "complex" is not assignable to "float" +    "complex" is not assignable to "list[Json]" +    "complex" is not assignable to "dict[str, Json]" (reportAssignmentType) +aliases_recursive.py:38:22 - error: Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to declared type "RecursiveTuple" +  Type "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to type "RecursiveTuple" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to "str" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to "int" +    "tuple[Literal[1], tuple[str, int], tuple[int, tuple[int, list[int]]]]" is not assignable to "tuple[RecursiveTuple, ...]" +      Tuple entry 1 is incorrect type +        Type "tuple[str, int] | tuple[int, tuple[int, list[int]]] | Literal[1]" is not assignable to type "RecursiveTuple" +          Type "tuple[int, tuple[int, list[int]]]" is not assignable to type "RecursiveTuple" (reportAssignmentType) +aliases_recursive.py:39:22 - error: Type "tuple[Literal[1], list[int]]" is not assignable to declared type "RecursiveTuple" +  Type "tuple[Literal[1], list[int]]" is not assignable to type "RecursiveTuple" +    "tuple[Literal[1], list[int]]" is not assignable to "str" +    "tuple[Literal[1], list[int]]" is not assignable to "int" +    "tuple[Literal[1], list[int]]" is not assignable to "tuple[RecursiveTuple, ...]" +      Tuple entry 1 is incorrect type +        Type "list[int] | Literal[1]" is not assignable to type "RecursiveTuple" +          Type "list[int]" is not assignable to type "RecursiveTuple" (reportAssignmentType) +aliases_recursive.py:50:24 - error: Type "dict[str, list[int]]" is not assignable to declared type "RecursiveMapping" +  Type "dict[str, list[int]]" is not assignable to type "RecursiveMapping" +    "dict[str, list[int]]" is not assignable to "str" +    "dict[str, list[int]]" is not assignable to "int" +    "dict[str, list[int]]" is not assignable to "Mapping[str, RecursiveMapping]"       Type parameter "_VT_co@Mapping" is covariant, but "list[int]" is not a subtype of "RecursiveMapping" -        Type "list[int]" is incompatible with type "RecursiveMapping" -          "list[int]" is incompatible with "str" -          "list[int]" is incompatible with "int" +        Type "list[int]" is not assignable to type "RecursiveMapping" +          "list[int]" is not assignable to "str" +          "list[int]" is not assignable to "int" ... (reportAssignmentType) -aliases_recursive.py:51:24 - error: Expression of type "dict[str, str | int | list[int]]" is incompatible with declared type "RecursiveMapping" -  Type "dict[str, str | int | list[int]]" is incompatible with type "RecursiveMapping" -    "dict[str, str | int | list[int]]" is incompatible with "str" -    "dict[str, str | int | list[int]]" is incompatible with "int" -    "dict[str, str | int | list[int]]" is incompatible with "Mapping[str, RecursiveMapping]" -      Type parameter "_VT_co@Mapping" is covariant, but "str | int | list[int]" is not a subtype of "RecursiveMapping" (reportAssignmentType) -aliases_recursive.py:52:24 - error: Expression of type "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with declared type "RecursiveMapping" -  Type "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with type "RecursiveMapping" -    "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with "str" -    "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with "int" -    "dict[str, str | int | dict[str, str | int | list[int]]]" is incompatible with "Mapping[str, RecursiveMapping]" -      Type parameter "_VT_co@Mapping" is covariant, but "str | int | dict[str, str | int | list[int]]" is not a subtype of "RecursiveMapping" (reportAssignmentType) -aliases_recursive.py:63:38 - error: Expression of type "list[str | list[float]]" is incompatible with declared type "GenericTypeAlias1[str]" -  Type "float" is incompatible with type "GenericTypeAlias1[T1@GenericTypeAlias1] | str" -    "float" is incompatible with "list[GenericTypeAlias1 | str]" -    "float" is incompatible with "str" (reportAssignmentType) -aliases_recursive.py:69:51 - error: Expression of type "list[list[int | list[str | int | list[float]]] | str]" is incompatible with declared type "GenericTypeAlias2[str, int]" -  Type "float" is incompatible with type "GenericTypeAlias2[T1@GenericTypeAlias2, T2@GenericTypeAlias2] | str | int" -    "float" is incompatible with "list[GenericTypeAlias2 | str | int]" -    "float" is incompatible with "str" -    "float" is incompatible with "int" (reportAssignmentType) +aliases_recursive.py:51:24 - error: Type "dict[str, str | int | list[int]]" is not assignable to declared type "RecursiveMapping" +  Type "dict[str, str | int | list[int]]" is not assignable to type "RecursiveMapping" +    "dict[str, str | int | list[int]]" is not assignable to "str" +    "dict[str, str | int | list[int]]" is not assignable to "int" +    "dict[str, str | int | list[int]]" is not assignable to "Mapping[str, RecursiveMapping]" +      Type parameter "_VT_co@Mapping" is covariant, but "str | int | list[int]" is not a subtype of "RecursiveMapping" +        Type "str | int | list[int]" is not assignable to type "RecursiveMapping" +          Type "list[int]" is not assignable to type "RecursiveMapping" (reportAssignmentType) +aliases_recursive.py:52:24 - error: Type "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to declared type "RecursiveMapping" +  Type "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to type "RecursiveMapping" +    "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to "str" +    "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to "int" +    "dict[str, str | int | dict[str, str | int | list[int]]]" is not assignable to "Mapping[str, RecursiveMapping]" +      Type parameter "_VT_co@Mapping" is covariant, but "str | int | dict[str, str | int | list[int]]" is not a subtype of "RecursiveMapping" +        Type "str | int | dict[str, str | int | list[int]]" is not assignable to type "RecursiveMapping" +          Type "dict[str, str | int | list[int]]" is not assignable to type "RecursiveMapping" (reportAssignmentType) +aliases_recursive.py:63:38 - error: Type "list[str | list[float]]" is not assignable to declared type "GenericTypeAlias1[str]" +  Type "float" is not assignable to type "GenericTypeAlias1[T1@GenericTypeAlias1] | str" +    "float" is not assignable to "list[GenericTypeAlias1 | str]" +    "float" is not assignable to "str" (reportAssignmentType) +aliases_recursive.py:69:51 - error: Type "list[list[int | list[str | int | list[float]]] | str]" is not assignable to declared type "GenericTypeAlias2[str, int]" +  Type "float" is not assignable to type "GenericTypeAlias2[T1@GenericTypeAlias2, T2@GenericTypeAlias2] | str | int" +    "float" is not assignable to "list[GenericTypeAlias2 | str | int]" +    "float" is not assignable to "str" +    "float" is not assignable to "int" (reportAssignmentType) aliases_recursive.py:72:29 - error: Type alias "RecursiveUnion" cannot use itself in its definition (reportGeneralTypeIssues) aliases_recursive.py:75:31 - error: Type alias "MutualReference1" cannot use itself in its definition (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/aliases_type_statement.toml b/conformance/results/pyright/aliases_type_statement.toml index c134a70e..ee9f8f7c 100644 --- a/conformance/results/pyright/aliases_type_statement.toml +++ b/conformance/results/pyright/aliases_type_statement.toml @@ -8,44 +8,44 @@ aliases_type_statement.py:23:18 - error: Cannot access attribute "other_attrib"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) aliases_type_statement.py:26:18 - error: A type alias defined in a "type" statement cannot be used as a base class (reportGeneralTypeIssues) aliases_type_statement.py:31:22 - error: Argument of type "TypeAliasType" cannot be assigned to parameter "class_or_tuple" of type "_ClassInfo" in function "isinstance" -  Type "TypeAliasType" is incompatible with type "_ClassInfo" -    "TypeAliasType" is incompatible with "type" -    "TypeAliasType" is incompatible with "UnionType" -    "TypeAliasType" is incompatible with "tuple[_ClassInfo, ...]" (reportArgumentType) +  Type "TypeAliasType" is not assignable to type "_ClassInfo" +    "TypeAliasType" is not assignable to "type" +    "TypeAliasType" is not assignable to "UnionType" +    "TypeAliasType" is not assignable to "tuple[_ClassInfo, ...]" (reportArgumentType) aliases_type_statement.py:37:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_type_statement.py:38:22 - error: List expression not allowed in type annotation +aliases_type_statement.py:38:22 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:38:22 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type annotation +aliases_type_statement.py:39:22 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -aliases_type_statement.py:40:22 - error: List expression not allowed in type annotation +aliases_type_statement.py:40:22 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:40:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type annotation +aliases_type_statement.py:41:22 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) aliases_type_statement.py:41:22 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_type_statement.py:41:29 - error: "b" is not defined (reportUndefinedVariable) aliases_type_statement.py:42:22 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_type_statement.py:43:22 - error: List expression not allowed in type annotation +aliases_type_statement.py:43:22 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_type_statement.py:43:22 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_type_statement.py:43:28 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +aliases_type_statement.py:44:22 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:45:22 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:46:23 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_type_statement.py:47:23 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -aliases_type_statement.py:48:23 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -aliases_type_statement.py:49:23 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_type_statement.py:48:23 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +aliases_type_statement.py:49:23 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) aliases_type_statement.py:52:10 - error: Type alias declaration "BadTypeAlias14" is obscured by a declaration of the same name (reportRedeclaration) aliases_type_statement.py:58:10 - error: A type statement can be used only within a module or class scope (reportGeneralTypeIssues) aliases_type_statement.py:64:23 - error: Type parameter "V" is not included in the type parameter list for "TA1" (reportGeneralTypeIssues) aliases_type_statement.py:69:17 - error: Type parameter "T1" is not included in the type parameter list for "TA2" (reportGeneralTypeIssues) aliases_type_statement.py:79:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" -  Type "str" is incompatible with type "int" -    "str" is incompatible with "int" (reportInvalidTypeForm) +  Type "str" is not assignable to type "int" +    "str" is not assignable to "int" (reportInvalidTypeForm) aliases_type_statement.py:81:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" -  Type "int" is incompatible with type "str" -    "int" is incompatible with "str" (reportInvalidTypeForm) +  Type "int" is not assignable to type "str" +    "int" is not assignable to "str" (reportInvalidTypeForm) aliases_type_statement.py:84:28 - error: Type alias "RecursiveTypeAlias3" cannot use itself in its definition (reportGeneralTypeIssues) aliases_type_statement.py:86:31 - error: Type alias "RecursiveTypeAlias4" cannot use itself in its definition (reportGeneralTypeIssues) aliases_type_statement.py:90:28 - error: Type alias "RecursiveTypeAlias6" cannot use itself in its definition (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index dc1e9900..64ebf8cf 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -3,8 +3,8 @@ output = """ aliases_typealiastype.py:32:18 - error: Cannot access attribute "other_attrib" for class "TypeAliasType"   Attribute "other_attrib" is unknown (reportAttributeAccessIssue) aliases_typealiastype.py:40:5 - error: Could not specialize type "GoodAlias5[S@GoodAlias5, TStr@GoodAlias5, P@GoodAlias5, Ts@GoodAlias5]" -  Type "int" is incompatible with type "str" -    "int" is incompatible with "str" (reportInvalidTypeForm) +  Type "int" is not assignable to type "str" +    "int" is not assignable to "str" (reportInvalidTypeForm) aliases_typealiastype.py:43:45 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) aliases_typealiastype.py:44:45 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) aliases_typealiastype.py:45:57 - error: Type parameter list must be a tuple containing only TypeVar, TypeVarTuple, or ParamSpec (reportGeneralTypeIssues) @@ -18,16 +18,16 @@ aliases_typealiastype.py:55:42 - error: Expected class but received "list[type[i aliases_typealiastype.py:56:42 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) aliases_typealiastype.py:56:49 - error: "b" is not defined (reportUndefinedVariable) aliases_typealiastype.py:57:42 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -aliases_typealiastype.py:58:42 - error: List expression not allowed in type annotation +aliases_typealiastype.py:58:42 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) aliases_typealiastype.py:58:42 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) aliases_typealiastype.py:58:48 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +aliases_typealiastype.py:59:42 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:60:42 - error: Variable not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:61:42 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) aliases_typealiastype.py:62:42 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -aliases_typealiastype.py:64:42 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +aliases_typealiastype.py:64:42 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_forward_refs.toml b/conformance/results/pyright/annotations_forward_refs.toml index ae62e5d0..29709674 100644 --- a/conformance/results/pyright/annotations_forward_refs.toml +++ b/conformance/results/pyright/annotations_forward_refs.toml @@ -4,30 +4,30 @@ annotations_forward_refs.py:22:7 - error: "ClassA" is not defined (reportUndefin annotations_forward_refs.py:23:12 - error: "ClassA" is not defined (reportUndefinedVariable) annotations_forward_refs.py:24:7 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues) annotations_forward_refs.py:25:13 - error: Union syntax cannot be used with string operand; use quotes around entire expression (reportGeneralTypeIssues) -annotations_forward_refs.py:41:9 - error: Expected type but received a string literal (reportGeneralTypeIssues) -annotations_forward_refs.py:42:10 - error: List expression not allowed in type annotation +annotations_forward_refs.py:41:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:42:10 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:42:10 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type annotation +annotations_forward_refs.py:43:10 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_forward_refs.py:44:10 - error: List expression not allowed in type annotation +annotations_forward_refs.py:44:10 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:44:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type annotation +annotations_forward_refs.py:45:10 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) annotations_forward_refs.py:45:10 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_forward_refs.py:46:10 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -annotations_forward_refs.py:47:10 - error: List expression not allowed in type annotation +annotations_forward_refs.py:47:10 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_forward_refs.py:47:10 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_forward_refs.py:47:16 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +annotations_forward_refs.py:48:10 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:49:10 - error: Variable not allowed in type expression (reportInvalidTypeForm) annotations_forward_refs.py:50:11 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) annotations_forward_refs.py:51:11 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -annotations_forward_refs.py:52:11 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_forward_refs.py:53:11 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_forward_refs.py:54:11 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +annotations_forward_refs.py:52:11 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:53:11 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +annotations_forward_refs.py:54:11 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) annotations_forward_refs.py:55:10 - error: Module cannot be used as a type (reportGeneralTypeIssues) annotations_forward_refs.py:66:26 - error: "ClassB" is not defined (reportUndefinedVariable) annotations_forward_refs.py:80:14 - error: Type of "ClassF" could not be determined because it refers to itself (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/annotations_generators.toml b/conformance/results/pyright/annotations_generators.toml index 23081ff4..fd4b61db 100644 --- a/conformance/results/pyright/annotations_generators.toml +++ b/conformance/results/pyright/annotations_generators.toml @@ -1,35 +1,35 @@ conformant = "Pass" output = """ annotations_generators.py:51:21 - error: Function with declared return type "C" must return value on all code paths -  "None" is incompatible with "C" (reportReturnType) -annotations_generators.py:54:16 - error: Expression of type "Literal[False]" is incompatible with return type "C" -  "Literal[False]" is incompatible with "C" (reportReturnType) +  "None" is not assignable to "C" (reportReturnType) +annotations_generators.py:54:16 - error: Type "Literal[False]" is not assignable to return type "C" +  "Literal[False]" is not assignable to "C" (reportReturnType) annotations_generators.py:57:15 - error: Return type of generator function must be compatible with "Generator[Literal[3], Any, Any]" -  "Literal[3]" is incompatible with "A" (reportReturnType) +  "Literal[3]" is not assignable to "A" (reportReturnType) annotations_generators.py:66:15 - error: Return type of generator function must be compatible with "Generator[Literal[3], Any, Any]" -  "Literal[3]" is incompatible with "A" (reportReturnType) +  "Literal[3]" is not assignable to "A" (reportReturnType) annotations_generators.py:75:11 - error: Return type of generator function must be compatible with "Generator[B, Any, Any]" -  "B" is incompatible with "A" (reportReturnType) +  "B" is not assignable to "A" (reportReturnType) annotations_generators.py:86:21 - error: Return type of generator function must be compatible with "Generator[Any, Any, Any]" -  "Generator[Any, Any, Any]" is incompatible with "int" (reportInvalidTypeForm) +  "Generator[Any, Any, Any]" is not assignable to "int" (reportInvalidTypeForm) annotations_generators.py:87:11 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]" -  "Generator[None, Unknown, Unknown]" is incompatible with "int" (reportReturnType) +  "Generator[None, Unknown, Unknown]" is not assignable to "int" (reportReturnType) annotations_generators.py:91:27 - error: Return type of async generator function must be compatible with "AsyncGenerator[Any, Any]" -  "AsyncGenerator[Any, Any, Any]" is incompatible with "int" (reportInvalidTypeForm) +  "AsyncGenerator[Any, Any, Any]" is not assignable to "int" (reportInvalidTypeForm) annotations_generators.py:92:11 - error: Return type of async generator function must be compatible with "AsyncGenerator[None, Any]" -  "AsyncGenerator[None, Unknown, Unknown]" is incompatible with "int" (reportReturnType) +  "AsyncGenerator[None, Unknown, Unknown]" is not assignable to "int" (reportReturnType) annotations_generators.py:118:16 - error: Return type of generator function must be compatible with "Generator[A, Any, Any]" -  "Generator[A, Unknown, Unknown]" is incompatible with "Iterator[B]" +  "Generator[A, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "A" is not a subtype of "B" -      "A" is incompatible with "B" (reportReturnType) +      "A" is not assignable to "B" (reportReturnType) annotations_generators.py:119:16 - error: Return type of generator function must be compatible with "Generator[int, Any, Any]" -  "Generator[int, Unknown, Unknown]" is incompatible with "Iterator[B]" +  "Generator[int, Unknown, Unknown]" is not assignable to "Iterator[B]"     Type parameter "_T_co@Iterator" is covariant, but "int" is not a subtype of "B" -      "int" is incompatible with "B" (reportReturnType) +      "int" is not assignable to "B" (reportReturnType) annotations_generators.py:135:16 - error: Return type of generator function must be compatible with "Generator[None, Any, Any]" -  "Generator[None, int, Unknown]" is incompatible with "Generator[None, str, None]" +  "Generator[None, int, Unknown]" is not assignable to "Generator[None, str, None]"     Type parameter "_SendT_contra@Generator" is contravariant, but "int" is not a supertype of "str" -      "str" is incompatible with "int" (reportReturnType) +      "str" is not assignable to "int" (reportReturnType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_methods.toml b/conformance/results/pyright/annotations_methods.toml index 120e85ca..27ff70b9 100644 --- a/conformance/results/pyright/annotations_methods.toml +++ b/conformance/results/pyright/annotations_methods.toml @@ -4,7 +4,7 @@ Type evaluation differs from other type checkers because of ambiguity in the spe """ output = """ annotations_methods.py:46:8 - error: Argument of type "A" cannot be assigned to parameter "self" of type "B" in function "copy" -  "A" is incompatible with "B" (reportArgumentType) +  "A" is not assignable to "B" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/annotations_typeexpr.toml b/conformance/results/pyright/annotations_typeexpr.toml index 9eed10f3..5504e946 100644 --- a/conformance/results/pyright/annotations_typeexpr.toml +++ b/conformance/results/pyright/annotations_typeexpr.toml @@ -1,29 +1,29 @@ conformant = "Pass" output = """ annotations_typeexpr.py:88:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -annotations_typeexpr.py:89:9 - error: List expression not allowed in type annotation +annotations_typeexpr.py:89:9 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:89:9 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type annotation +annotations_typeexpr.py:90:9 - error: Tuple expression not allowed in type expression   Use tuple[T1, ..., Tn] to indicate a tuple type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -annotations_typeexpr.py:91:9 - error: List expression not allowed in type annotation +annotations_typeexpr.py:91:9 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:91:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) -annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type annotation +annotations_typeexpr.py:92:9 - error: Dictionary expression not allowed in type expression   Use Dict[T1, T2] to indicate a dictionary type (reportInvalidTypeForm) annotations_typeexpr.py:92:9 - error: Expected class but received "dict[Unknown, Unknown]" (reportGeneralTypeIssues) annotations_typeexpr.py:93:9 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -annotations_typeexpr.py:94:9 - error: List expression not allowed in type annotation +annotations_typeexpr.py:94:9 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) annotations_typeexpr.py:94:9 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) annotations_typeexpr.py:94:15 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +annotations_typeexpr.py:95:9 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:96:9 - error: Variable not allowed in type expression (reportInvalidTypeForm) annotations_typeexpr.py:97:10 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) annotations_typeexpr.py:98:10 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -annotations_typeexpr.py:99:10 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_typeexpr.py:100:10 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -annotations_typeexpr.py:101:10 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +annotations_typeexpr.py:99:10 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) +annotations_typeexpr.py:100:10 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +annotations_typeexpr.py:101:10 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) annotations_typeexpr.py:102:10 - error: Module cannot be used as a type (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/callables_annotation.toml b/conformance/results/pyright/callables_annotation.toml index 8da8432a..66fdcb54 100644 --- a/conformance/results/pyright/callables_annotation.toml +++ b/conformance/results/pyright/callables_annotation.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ callables_annotation.py:25:5 - error: Expected 1 more positional argument (reportCallIssue) callables_annotation.py:26:11 - error: Argument of type "Literal[2]" cannot be assigned to parameter of type "str" -  "Literal[2]" is incompatible with "str" (reportArgumentType) +  "Literal[2]" is not assignable to "str" (reportArgumentType) callables_annotation.py:27:15 - error: Expected 2 positional arguments (reportCallIssue) callables_annotation.py:29:10 - error: Expected 2 more positional arguments (reportCallIssue) callables_annotation.py:35:8 - error: Expected 0 positional arguments (reportCallIssue) @@ -12,29 +12,29 @@ callables_annotation.py:57:18 - error: List expression not allowed for this type callables_annotation.py:58:14 - error: Expected parameter type list or "..." (reportInvalidTypeForm) callables_annotation.py:58:24 - error: Expected only two type arguments to "Callable" (reportInvalidTypeForm) callables_annotation.py:59:15 - error: "..." is not allowed in this context (reportInvalidTypeForm) -callables_annotation.py:91:7 - error: Expression of type "() -> str" is incompatible with declared type "(int, ...) -> str" -  Type "() -> str" is incompatible with type "(int, ...) -> str" +callables_annotation.py:91:7 - error: Type "() -> str" is not assignable to declared type "(int, ...) -> str" +  Type "() -> str" is not assignable to type "(int, ...) -> str"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_annotation.py:93:7 - error: Expression of type "(*, a: int) -> str" is incompatible with declared type "(int, ...) -> str" -  Type "(*, a: int) -> str" is incompatible with type "(int, ...) -> str" +callables_annotation.py:93:7 - error: Type "(*, a: int) -> str" is not assignable to declared type "(int, ...) -> str" +  Type "(*, a: int) -> str" is not assignable to type "(int, ...) -> str"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_annotation.py:159:25 - error: Expression of type "Proto8" is incompatible with declared type "Proto5[Any]" +callables_annotation.py:159:25 - error: Type "Proto8" is not assignable to declared type "Proto5[Any]"   "Proto8" is incompatible with protocol "Proto5[Any]"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(*args: T_contra@Proto5, **kwargs: T_contra@Proto5) -> None" +      Type "() -> None" is not assignable to type "(*args: T_contra@Proto5, **kwargs: T_contra@Proto5) -> None"         Parameter "*args" has no corresponding parameter         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_annotation.py:172:26 - error: Expression of type "() -> str" is incompatible with declared type "Callback2[...]" -  Type "() -> str" is incompatible with type "Callback2[...]" +callables_annotation.py:172:26 - error: Type "() -> str" is not assignable to declared type "Callback2[...]" +  Type "() -> str" is not assignable to type "Callback2[...]"     Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_annotation.py:187:48 - error: Expression of type "(int, str) -> str" is incompatible with declared type "(str, ...) -> str" -  Type "(int, str) -> str" is incompatible with type "(str, ...) -> str" +callables_annotation.py:187:48 - error: Type "(int, str) -> str" is not assignable to declared type "(str, ...) -> str" +  Type "(int, str) -> str" is not assignable to type "(str, ...) -> str"     Parameter 1: type "str" is incompatible with type "int" -      "str" is incompatible with "int" (reportAssignmentType) -callables_annotation.py:189:32 - error: Expression of type "(int, str) -> str" is incompatible with declared type "CallbackWithStr[...]" -  Type "(int, str) -> str" is incompatible with type "CallbackWithStr[...]" +      "str" is not assignable to "int" (reportAssignmentType) +callables_annotation.py:189:32 - error: Type "(int, str) -> str" is not assignable to declared type "CallbackWithStr[...]" +  Type "(int, str) -> str" is not assignable to type "CallbackWithStr[...]"     Parameter 1: type "str" is incompatible with type "int" -      "str" is incompatible with "int" (reportAssignmentType) +      "str" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index 51ad276d..b3e1e6c0 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -1,33 +1,38 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly handles assert_type for unpacked TypedDict. +""" output = """ callables_kwargs.py:28:5 - error: Could not access item in TypedDict   "v2" is not a required key in "*TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) +callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure) callables_kwargs.py:46:5 - error: Arguments missing for parameters "v1", "v3" (reportCallIssue) callables_kwargs.py:51:32 - error: No parameter named "v4" (reportCallIssue) callables_kwargs.py:52:11 - error: Expected 0 positional arguments (reportCallIssue) callables_kwargs.py:58:13 - error: Argument of type "str" cannot be assigned to parameter "v1" of type "int" in function "func1" -  "str" is incompatible with "int" (reportArgumentType) +  "str" is not assignable to "int" (reportArgumentType) callables_kwargs.py:63:19 - error: Unable to match unpacked TypedDict argument to parameters   Parameter "v1" is already assigned (reportCallIssue) callables_kwargs.py:64:16 - error: Unable to match unpacked TypedDict argument to parameters   Parameter "v3" is already assigned (reportCallIssue) callables_kwargs.py:65:19 - error: Unable to match unpacked TypedDict argument to parameters   Parameter "v1" is already assigned (reportCallIssue) -callables_kwargs.py:101:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol3" -  Type "(**kwargs: **TD2) -> None" is incompatible with type "(*, v1: int, v2: int, v3: str) -> None" +callables_kwargs.py:101:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol3" +  Type "(**kwargs: **TD2) -> None" is not assignable to type "(*, v1: int, v2: int, v3: str) -> None"     Keyword parameter "v2" of type "int" is incompatible with type "str" -      "int" is incompatible with "str" (reportAssignmentType) -callables_kwargs.py:102:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol4" -  Type "(**kwargs: **TD2) -> None" is incompatible with type "(*, v1: int) -> None" +      "int" is not assignable to "str" (reportAssignmentType) +callables_kwargs.py:102:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol4" +  Type "(**kwargs: **TD2) -> None" is not assignable to type "(*, v1: int) -> None"     Extra parameter "v3" (reportAssignmentType) -callables_kwargs.py:103:19 - error: Expression of type "(**kwargs: **TD2) -> None" is incompatible with declared type "TDProtocol5" -  Type "(**kwargs: **TD2) -> None" is incompatible with type "(v1: int, v3: str) -> None" +callables_kwargs.py:103:19 - error: Type "(**kwargs: **TD2) -> None" is not assignable to declared type "TDProtocol5" +  Type "(**kwargs: **TD2) -> None" is not assignable to type "(v1: int, v3: str) -> None"     Function accepts too many positional parameters; expected 0 but received 2       Extra parameter "v1"       Extra parameter "v3" (reportAssignmentType) callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues) callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 41: Unexpected errors ['callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure)'] """ diff --git a/conformance/results/pyright/callables_protocol.toml b/conformance/results/pyright/callables_protocol.toml index df57b9b3..47af0047 100644 --- a/conformance/results/pyright/callables_protocol.toml +++ b/conformance/results/pyright/callables_protocol.toml @@ -1,62 +1,66 @@ conformant = "Pass" output = """ -callables_protocol.py:35:7 - error: Expression of type "(*vals: bytes, max_items: int | None) -> list[bytes]" is incompatible with declared type "Proto1" -  Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" +callables_protocol.py:35:7 - error: Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is not assignable to declared type "Proto1" +  Type "(*vals: bytes, max_items: int | None) -> list[bytes]" is not assignable to type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Extra parameter "max_items"     Missing keyword parameter "max_len" (reportAssignmentType) -callables_protocol.py:36:7 - error: Expression of type "(*vals: bytes) -> list[bytes]" is incompatible with declared type "Proto1" -  Type "(*vals: bytes) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" +callables_protocol.py:36:7 - error: Type "(*vals: bytes) -> list[bytes]" is not assignable to declared type "Proto1" +  Type "(*vals: bytes) -> list[bytes]" is not assignable to type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Missing keyword parameter "max_len" (reportAssignmentType) -callables_protocol.py:37:7 - error: Expression of type "(*vals: bytes, max_len: str | None) -> list[bytes]" is incompatible with declared type "Proto1" -  Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is incompatible with type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" +callables_protocol.py:37:7 - error: Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is not assignable to declared type "Proto1" +  Type "(*vals: bytes, max_len: str | None) -> list[bytes]" is not assignable to type "(*vals: bytes, max_len: int | None = None) -> list[bytes]"     Keyword parameter "max_len" of type "int | None" is incompatible with type "str | None" +      Type "int | None" is not assignable to type "str | None" +        Type "int" is not assignable to type "str | None" +          "int" is not assignable to "str" +          "int" is not assignable to "None"     Parameter "max_len" is missing default argument (reportAssignmentType) -callables_protocol.py:67:7 - error: Expression of type "(*a: bytes) -> None" is incompatible with declared type "Proto2" -  Type "(*a: bytes) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +callables_protocol.py:67:7 - error: Type "(*a: bytes) -> None" is not assignable to declared type "Proto2" +  Type "(*a: bytes) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_protocol.py:68:7 - error: Expression of type "(*a: str, **b: str) -> None" is incompatible with declared type "Proto2" -  Type "(*a: str, **b: str) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +callables_protocol.py:68:7 - error: Type "(*a: str, **b: str) -> None" is not assignable to declared type "Proto2" +  Type "(*a: str, **b: str) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter 1: type "*tuple[bytes, ...]" is incompatible with type "*tuple[str, ...]" -      "*tuple[bytes, ...]" is incompatible with "*tuple[str, ...]" +      "*tuple[bytes, ...]" is not assignable to "*tuple[str, ...]"         Tuple entry 1 is incorrect type -          "bytes" is incompatible with "str" (reportAssignmentType) -callables_protocol.py:69:7 - error: Expression of type "(*a: bytes, **b: bytes) -> None" is incompatible with declared type "Proto2" -  Type "(*a: bytes, **b: bytes) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +          "bytes" is not assignable to "str" (reportAssignmentType) +callables_protocol.py:69:7 - error: Type "(*a: bytes, **b: bytes) -> None" is not assignable to declared type "Proto2" +  Type "(*a: bytes, **b: bytes) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter 2: type "str" is incompatible with type "bytes" -      "str" is incompatible with "bytes" (reportAssignmentType) -callables_protocol.py:70:7 - error: Expression of type "(**b: str) -> None" is incompatible with declared type "Proto2" -  Type "(**b: str) -> None" is incompatible with type "(*vals: bytes, **kwargs: str) -> None" +      "str" is not assignable to "bytes" (reportAssignmentType) +callables_protocol.py:70:7 - error: Type "(**b: str) -> None" is not assignable to declared type "Proto2" +  Type "(**b: str) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None"     Parameter "*vals" has no corresponding parameter (reportAssignmentType) -callables_protocol.py:97:16 - error: Expression of type "(x: int) -> None" is incompatible with declared type "Proto4" +callables_protocol.py:97:16 - error: Type "(x: int) -> None" is not assignable to declared type "Proto4"   "function" is incompatible with protocol "Proto4"     "other_attribute" is not present     "__call__" is not present (reportAssignmentType) -callables_protocol.py:121:18 - error: Expression of type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" is incompatible with declared type "NotProto6" -  "function" is incompatible with "NotProto6" (reportAssignmentType) -callables_protocol.py:169:7 - error: Expression of type "(x: int) -> Any" is incompatible with declared type "Proto8" +callables_protocol.py:121:18 - error: Type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" is not assignable to declared type "NotProto6" +  "function" is not assignable to "NotProto6" (reportAssignmentType) +callables_protocol.py:169:7 - error: Type "(x: int) -> Any" is not assignable to declared type "Proto8"   One or more overloads of "__call__" is not assignable -    Type "(x: int) -> Any" is incompatible with type "(x: str) -> str" +    Type "(x: int) -> Any" is not assignable to type "(x: str) -> str"       Parameter 1: type "str" is incompatible with type "int" -        "str" is incompatible with "int" (reportAssignmentType) +        "str" is not assignable to "int" (reportAssignmentType) callables_protocol.py:186:33 - error: Cannot assign to attribute "other_attribute" for class "Proto9[P@decorator1, R@decorator1]" -  "Literal['str']" is incompatible with "int" (reportAttributeAccessIssue) +  "Literal['str']" is not assignable to "int" (reportAttributeAccessIssue) callables_protocol.py:187:15 - error: Cannot assign to attribute "xxx" for class "Proto9[P@decorator1, R@decorator1]"   Attribute "xxx" is unknown (reportAttributeAccessIssue) callables_protocol.py:197:16 - error: Cannot access attribute "other_attribute2" for class "Proto9[(x: int), str]"   Attribute "other_attribute2" is unknown (reportAttributeAccessIssue) -callables_protocol.py:238:8 - error: Expression of type "(x: int, y: str, /) -> Any" is incompatible with declared type "Proto11" -  Type "(x: int, y: str, /) -> Any" is incompatible with type "(x: int, /, y: str) -> Any" +callables_protocol.py:238:8 - error: Type "(x: int, y: str, /) -> Any" is not assignable to declared type "Proto11" +  Type "(x: int, y: str, /) -> Any" is not assignable to type "(x: int, /, y: str) -> Any"     Missing keyword parameter "y"       Position-only parameter mismatch; parameter "y" is not position-only       Position-only parameter mismatch; expected 2 but received 1 (reportAssignmentType) -callables_protocol.py:260:8 - error: Expression of type "(*args: Any, kwarg0: Any) -> None" is incompatible with declared type "Proto12" -  Type "(*args: Any, kwarg0: Any) -> None" is incompatible with type "(*args: Any, kwarg0: Any, kwarg1: Any) -> None" +callables_protocol.py:260:8 - error: Type "(*args: Any, kwarg0: Any) -> None" is not assignable to declared type "Proto12" +  Type "(*args: Any, kwarg0: Any) -> None" is not assignable to type "(*args: Any, kwarg0: Any, kwarg1: Any) -> None"     Missing keyword parameter "kwarg1" (reportAssignmentType) -callables_protocol.py:284:27 - error: Expression of type "(path: str) -> str" is incompatible with declared type "Proto13_Default" -  Type "(path: str) -> str" is incompatible with type "(path: str = ...) -> str" +callables_protocol.py:284:27 - error: Type "(path: str) -> str" is not assignable to declared type "Proto13_Default" +  Type "(path: str) -> str" is not assignable to type "(path: str = ...) -> str"     Parameter "path" is missing default argument (reportAssignmentType) -callables_protocol.py:311:27 - error: Expression of type "(*, path: str) -> str" is incompatible with declared type "Proto14_Default" -  Type "(*, path: str) -> str" is incompatible with type "(*, path: str = ...) -> str" +callables_protocol.py:311:27 - error: Type "(*, path: str) -> str" is not assignable to declared type "Proto14_Default" +  Type "(*, path: str) -> str" is not assignable to type "(*, path: str = ...) -> str"     Parameter "path" is missing default argument (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/callables_subtyping.toml b/conformance/results/pyright/callables_subtyping.toml index 932c0799..134de40c 100644 --- a/conformance/results/pyright/callables_subtyping.toml +++ b/conformance/results/pyright/callables_subtyping.toml @@ -2,199 +2,199 @@ conformant = "Pass" errors_diff = """ """ output = """ -callables_subtyping.py:26:36 - error: Expression of type "(int) -> int" is incompatible with declared type "(float) -> float" -  Type "(int) -> int" is incompatible with type "(float) -> float" +callables_subtyping.py:26:36 - error: Type "(int) -> int" is not assignable to declared type "(float) -> float" +  Type "(int) -> int" is not assignable to type "(float) -> float"     Parameter 1: type "float" is incompatible with type "int" -      "float" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:29:32 - error: Expression of type "(float) -> float" is incompatible with declared type "(int) -> int" -  Type "(float) -> float" is incompatible with type "(int) -> int" +      "float" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:29:32 - error: Type "(float) -> float" is not assignable to declared type "(int) -> int" +  Type "(float) -> float" is not assignable to type "(int) -> int"     Function return type "float" is incompatible with type "int" -      "float" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:51:21 - error: Expression of type "PosOnly2" is incompatible with declared type "Standard2" +      "float" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:51:21 - error: Type "PosOnly2" is not assignable to declared type "Standard2"   "PosOnly2" is incompatible with protocol "Standard2"     "__call__" is an incompatible type -      Type "(b: int, a: int, /) -> None" is incompatible with type "(a: int, b: int) -> None" +      Type "(b: int, a: int, /) -> None" is not assignable to type "(a: int, b: int) -> None"         Missing keyword parameter "a"         Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; parameter "b" is not position-only           Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType) -callables_subtyping.py:52:21 - error: Expression of type "KwOnly2" is incompatible with declared type "Standard2" +callables_subtyping.py:52:21 - error: Type "KwOnly2" is not assignable to declared type "Standard2"   "KwOnly2" is incompatible with protocol "Standard2"     "__call__" is an incompatible type -      Type "(*, b: int, a: int) -> None" is incompatible with type "(a: int, b: int) -> None" +      Type "(*, b: int, a: int) -> None" is not assignable to type "(a: int, b: int) -> None"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "b"           Extra parameter "a" (reportAssignmentType) -callables_subtyping.py:55:20 - error: Expression of type "KwOnly2" is incompatible with declared type "PosOnly2" +callables_subtyping.py:55:20 - error: Type "KwOnly2" is not assignable to declared type "PosOnly2"   "KwOnly2" is incompatible with protocol "PosOnly2"     "__call__" is an incompatible type -      Type "(*, b: int, a: int) -> None" is incompatible with type "(b: int, a: int, /) -> None" +      Type "(*, b: int, a: int) -> None" is not assignable to type "(b: int, a: int, /) -> None"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "b"           Extra parameter "a" (reportAssignmentType) -callables_subtyping.py:58:19 - error: Expression of type "PosOnly2" is incompatible with declared type "KwOnly2" +callables_subtyping.py:58:19 - error: Type "PosOnly2" is not assignable to declared type "KwOnly2"   "PosOnly2" is incompatible with protocol "KwOnly2"     "__call__" is an incompatible type -      Type "(b: int, a: int, /) -> None" is incompatible with type "(*, b: int, a: int) -> None" +      Type "(b: int, a: int, /) -> None" is not assignable to type "(*, b: int, a: int) -> None"         Position-only parameter mismatch; expected 2 but received 0         Function accepts too few positional parameters; expected 2 but received 0         Missing keyword parameter "b"         Missing keyword parameter "a" (reportAssignmentType) -callables_subtyping.py:82:20 - error: Expression of type "NoArgs3" is incompatible with declared type "IntArgs3" +callables_subtyping.py:82:20 - error: Type "NoArgs3" is not assignable to declared type "IntArgs3"   "NoArgs3" is incompatible with protocol "IntArgs3"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(*args: int) -> None" +      Type "() -> None" is not assignable to type "(*args: int) -> None"         Parameter "*args" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:85:22 - error: Expression of type "NoArgs3" is incompatible with declared type "FloatArgs3" +callables_subtyping.py:85:22 - error: Type "NoArgs3" is not assignable to declared type "FloatArgs3"   "NoArgs3" is incompatible with protocol "FloatArgs3"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(*args: float) -> None" +      Type "() -> None" is not assignable to type "(*args: float) -> None"         Parameter "*args" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:86:22 - error: Expression of type "IntArgs3" is incompatible with declared type "FloatArgs3" +callables_subtyping.py:86:22 - error: Type "IntArgs3" is not assignable to declared type "FloatArgs3"   "IntArgs3" is incompatible with protocol "FloatArgs3"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(*args: float) -> None" +      Type "(*args: int) -> None" is not assignable to type "(*args: float) -> None"         Parameter 1: type "*tuple[float, ...]" is incompatible with type "*tuple[int, ...]" -          "*tuple[float, ...]" is incompatible with "*tuple[int, ...]" (reportAssignmentType) -callables_subtyping.py:116:20 - error: Expression of type "IntArgs4" is incompatible with declared type "PosOnly4" +          "*tuple[float, ...]" is not assignable to "*tuple[int, ...]" (reportAssignmentType) +callables_subtyping.py:116:20 - error: Type "IntArgs4" is not assignable to declared type "PosOnly4"   "IntArgs4" is incompatible with protocol "PosOnly4"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(a: int, b: str, /) -> None" +      Type "(*args: int) -> None" is not assignable to type "(a: int, b: str, /) -> None"         Parameter 2: type "str" is incompatible with type "int" -          "str" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:119:23 - error: Expression of type "StrArgs4" is incompatible with declared type "IntStrArgs4" +          "str" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:119:23 - error: Type "StrArgs4" is not assignable to declared type "IntStrArgs4"   "StrArgs4" is incompatible with protocol "IntStrArgs4"     "__call__" is an incompatible type -      Type "(a: int, /, *args: str) -> None" is incompatible with type "(*args: int | str) -> None" +      Type "(a: int, /, *args: str) -> None" is not assignable to type "(*args: int | str) -> None"         Parameter 2: type "int | str" is incompatible with type "str" -          Type "int | str" is incompatible with type "str" +          Type "int | str" is not assignable to type "str"         Parameter 1: type "*tuple[int | str, ...]" is incompatible with type "*tuple[str, ...]" -          "*tuple[int | str, ...]" is incompatible with "*tuple[str, ...]" (reportAssignmentType) -callables_subtyping.py:120:23 - error: Expression of type "IntArgs4" is incompatible with declared type "IntStrArgs4" +          "*tuple[int | str, ...]" is not assignable to "*tuple[str, ...]" (reportAssignmentType) +callables_subtyping.py:120:23 - error: Type "IntArgs4" is not assignable to declared type "IntStrArgs4"   "IntArgs4" is incompatible with protocol "IntStrArgs4"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(*args: int | str) -> None" +      Type "(*args: int) -> None" is not assignable to type "(*args: int | str) -> None"         Parameter 1: type "*tuple[int | str, ...]" is incompatible with type "*tuple[int, ...]" -          "*tuple[int | str, ...]" is incompatible with "*tuple[int, ...]" (reportAssignmentType) -callables_subtyping.py:122:20 - error: Expression of type "IntArgs4" is incompatible with declared type "StrArgs4" +          "*tuple[int | str, ...]" is not assignable to "*tuple[int, ...]" (reportAssignmentType) +callables_subtyping.py:122:20 - error: Type "IntArgs4" is not assignable to declared type "StrArgs4"   "IntArgs4" is incompatible with protocol "StrArgs4"     "__call__" is an incompatible type -      Type "(*args: int) -> None" is incompatible with type "(a: int, /, *args: str) -> None" +      Type "(*args: int) -> None" is not assignable to type "(a: int, /, *args: str) -> None"         Parameter 2: type "str" is incompatible with type "int" -          "str" is incompatible with "int" +          "str" is not assignable to "int"         Parameter 3: type "*tuple[str, ...]" is incompatible with type "*tuple[int, ...]" -          "*tuple[str, ...]" is incompatible with "*tuple[int, ...]" (reportAssignmentType) -callables_subtyping.py:124:20 - error: Expression of type "StrArgs4" is incompatible with declared type "IntArgs4" +          "*tuple[str, ...]" is not assignable to "*tuple[int, ...]" (reportAssignmentType) +callables_subtyping.py:124:20 - error: Type "StrArgs4" is not assignable to declared type "IntArgs4"   "StrArgs4" is incompatible with protocol "IntArgs4"     "__call__" is an incompatible type -      Type "(a: int, /, *args: str) -> None" is incompatible with type "(*args: int) -> None" +      Type "(a: int, /, *args: str) -> None" is not assignable to type "(*args: int) -> None"         Parameter 2: type "int" is incompatible with type "str" -          "int" is incompatible with "str" +          "int" is not assignable to "str"         Parameter 1: type "*tuple[int, ...]" is incompatible with type "*tuple[str, ...]" -          "*tuple[int, ...]" is incompatible with "*tuple[str, ...]" (reportAssignmentType) -callables_subtyping.py:125:22 - error: Expression of type "IntStrArgs4" is incompatible with declared type "Standard4" +          "*tuple[int, ...]" is not assignable to "*tuple[str, ...]" (reportAssignmentType) +callables_subtyping.py:125:22 - error: Type "IntStrArgs4" is not assignable to declared type "Standard4"   "IntStrArgs4" is incompatible with protocol "Standard4"     "__call__" is an incompatible type -      Type "(*args: int | str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(*args: int | str) -> None" is not assignable to type "(a: int, b: str) -> None"         Missing keyword parameter "a"         Missing keyword parameter "b" (reportAssignmentType) -callables_subtyping.py:126:22 - error: Expression of type "StrArgs4" is incompatible with declared type "Standard4" +callables_subtyping.py:126:22 - error: Type "StrArgs4" is not assignable to declared type "Standard4"   "StrArgs4" is incompatible with protocol "Standard4"     "__call__" is an incompatible type -      Type "(a: int, /, *args: str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(a: int, /, *args: str) -> None" is not assignable to type "(a: int, b: str) -> None"         Missing keyword parameter "a"         Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; expected 1 but received 0 (reportAssignmentType) -callables_subtyping.py:151:22 - error: Expression of type "NoKwargs5" is incompatible with declared type "IntKwargs5" +callables_subtyping.py:151:22 - error: Type "NoKwargs5" is not assignable to declared type "IntKwargs5"   "NoKwargs5" is incompatible with protocol "IntKwargs5"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(**kwargs: int) -> None" +      Type "() -> None" is not assignable to type "(**kwargs: int) -> None"         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:154:24 - error: Expression of type "NoKwargs5" is incompatible with declared type "FloatKwargs5" +callables_subtyping.py:154:24 - error: Type "NoKwargs5" is not assignable to declared type "FloatKwargs5"   "NoKwargs5" is incompatible with protocol "FloatKwargs5"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(**kwargs: float) -> None" +      Type "() -> None" is not assignable to type "(**kwargs: float) -> None"         Parameter "**kwargs" has no corresponding parameter (reportAssignmentType) -callables_subtyping.py:155:24 - error: Expression of type "IntKwargs5" is incompatible with declared type "FloatKwargs5" +callables_subtyping.py:155:24 - error: Type "IntKwargs5" is not assignable to declared type "FloatKwargs5"   "IntKwargs5" is incompatible with protocol "FloatKwargs5"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(**kwargs: float) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(**kwargs: float) -> None"         Parameter 1: type "float" is incompatible with type "int" -          "float" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:187:19 - error: Expression of type "IntKwargs6" is incompatible with declared type "KwOnly6" +          "float" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:187:19 - error: Type "IntKwargs6" is not assignable to declared type "KwOnly6"   "IntKwargs6" is incompatible with protocol "KwOnly6"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(*, a: int, b: str) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(*, a: int, b: str) -> None"         Parameter 3: type "str" is incompatible with type "int" -          "str" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:190:25 - error: Expression of type "StrKwargs6" is incompatible with declared type "IntStrKwargs6" +          "str" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:190:25 - error: Type "StrKwargs6" is not assignable to declared type "IntStrKwargs6"   "StrKwargs6" is incompatible with protocol "IntStrKwargs6"     "__call__" is an incompatible type -      Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(**kwargs: int | str) -> None" +      Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(**kwargs: int | str) -> None"         Parameter 1: type "int | str" is incompatible with type "int" -          Type "int | str" is incompatible with type "int" +          Type "int | str" is not assignable to type "int"         Parameter 1: type "int | str" is incompatible with type "str" -          Type "int | str" is incompatible with type "str" (reportAssignmentType) -callables_subtyping.py:191:25 - error: Expression of type "IntKwargs6" is incompatible with declared type "IntStrKwargs6" +          Type "int | str" is not assignable to type "str" (reportAssignmentType) +callables_subtyping.py:191:25 - error: Type "IntKwargs6" is not assignable to declared type "IntStrKwargs6"   "IntKwargs6" is incompatible with protocol "IntStrKwargs6"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(**kwargs: int | str) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(**kwargs: int | str) -> None"         Parameter 1: type "int | str" is incompatible with type "int" -          Type "int | str" is incompatible with type "int" (reportAssignmentType) -callables_subtyping.py:193:22 - error: Expression of type "IntKwargs6" is incompatible with declared type "StrKwargs6" +          Type "int | str" is not assignable to type "int" (reportAssignmentType) +callables_subtyping.py:193:22 - error: Type "IntKwargs6" is not assignable to declared type "StrKwargs6"   "IntKwargs6" is incompatible with protocol "StrKwargs6"     "__call__" is an incompatible type -      Type "(**kwargs: int) -> None" is incompatible with type "(*, a: int, **kwargs: str) -> None" +      Type "(**kwargs: int) -> None" is not assignable to type "(*, a: int, **kwargs: str) -> None"         Parameter 3: type "str" is incompatible with type "int" -          "str" is incompatible with "int" (reportAssignmentType) -callables_subtyping.py:195:22 - error: Expression of type "StrKwargs6" is incompatible with declared type "IntKwargs6" +          "str" is not assignable to "int" (reportAssignmentType) +callables_subtyping.py:195:22 - error: Type "StrKwargs6" is not assignable to declared type "IntKwargs6"   "StrKwargs6" is incompatible with protocol "IntKwargs6"     "__call__" is an incompatible type -      Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(**kwargs: int) -> None" +      Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(**kwargs: int) -> None"         Parameter 1: type "int" is incompatible with type "str" -          "int" is incompatible with "str" (reportAssignmentType) -callables_subtyping.py:196:22 - error: Expression of type "IntStrKwargs6" is incompatible with declared type "Standard6" +          "int" is not assignable to "str" (reportAssignmentType) +callables_subtyping.py:196:22 - error: Type "IntStrKwargs6" is not assignable to declared type "Standard6"   "IntStrKwargs6" is incompatible with protocol "Standard6"     "__call__" is an incompatible type -      Type "(**kwargs: int | str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(**kwargs: int | str) -> None" is not assignable to type "(a: int, b: str) -> None"         Function accepts too many positional parameters; expected 0 but received 2 (reportAssignmentType) -callables_subtyping.py:197:22 - error: Expression of type "StrKwargs6" is incompatible with declared type "Standard6" +callables_subtyping.py:197:22 - error: Type "StrKwargs6" is not assignable to declared type "Standard6"   "StrKwargs6" is incompatible with protocol "Standard6"     "__call__" is an incompatible type -      Type "(*, a: int, **kwargs: str) -> None" is incompatible with type "(a: int, b: str) -> None" +      Type "(*, a: int, **kwargs: str) -> None" is not assignable to type "(a: int, b: str) -> None"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "a" (reportAssignmentType) -callables_subtyping.py:236:23 - error: Expression of type "NoDefaultArg8" is incompatible with declared type "DefaultArg8" +callables_subtyping.py:236:23 - error: Type "NoDefaultArg8" is not assignable to declared type "DefaultArg8"   "NoDefaultArg8" is incompatible with protocol "DefaultArg8"     "__call__" is an incompatible type -      Type "(x: int) -> None" is incompatible with type "(x: int = 0) -> None" +      Type "(x: int) -> None" is not assignable to type "(x: int = 0) -> None"         Parameter "x" is missing default argument (reportAssignmentType) -callables_subtyping.py:237:23 - error: Expression of type "NoX8" is incompatible with declared type "DefaultArg8" +callables_subtyping.py:237:23 - error: Type "NoX8" is not assignable to declared type "DefaultArg8"   "NoX8" is incompatible with protocol "DefaultArg8"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(x: int = 0) -> None" +      Type "() -> None" is not assignable to type "(x: int = 0) -> None"         Function accepts too many positional parameters; expected 0 but received 1 (reportAssignmentType) -callables_subtyping.py:240:25 - error: Expression of type "NoX8" is incompatible with declared type "NoDefaultArg8" +callables_subtyping.py:240:25 - error: Type "NoX8" is not assignable to declared type "NoDefaultArg8"   "NoX8" is incompatible with protocol "NoDefaultArg8"     "__call__" is an incompatible type -      Type "() -> None" is incompatible with type "(x: int) -> None" +      Type "() -> None" is not assignable to type "(x: int) -> None"         Function accepts too many positional parameters; expected 0 but received 1 (reportAssignmentType) -callables_subtyping.py:243:16 - error: Expression of type "NoDefaultArg8" is incompatible with declared type "NoX8" +callables_subtyping.py:243:16 - error: Type "NoDefaultArg8" is not assignable to declared type "NoX8"   "NoDefaultArg8" is incompatible with protocol "NoX8"     "__call__" is an incompatible type -      Type "(x: int) -> None" is incompatible with type "() -> None" +      Type "(x: int) -> None" is not assignable to type "() -> None"         Extra parameter "x" (reportAssignmentType) -callables_subtyping.py:273:21 - error: Expression of type "Overloaded9" is incompatible with declared type "FloatArg9" +callables_subtyping.py:273:21 - error: Type "Overloaded9" is not assignable to declared type "FloatArg9"   "Overloaded9" is incompatible with protocol "FloatArg9"     "__call__" is an incompatible type       No overloaded function matches type "(x: float) -> float" (reportAssignmentType) -callables_subtyping.py:297:24 - error: Expression of type "StrArg10" is incompatible with declared type "Overloaded10" +callables_subtyping.py:297:24 - error: Type "StrArg10" is not assignable to declared type "Overloaded10"   "StrArg10" is incompatible with protocol "Overloaded10"     "__call__" is an incompatible type       One or more overloads of "__call__" is not assignable -        Type "(x: str) -> complex" is incompatible with type "(x: int, y: str) -> float" +        Type "(x: str) -> complex" is not assignable to type "(x: int, y: str) -> float"           Function accepts too many positional parameters; expected 1 but received 2 (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/classes_classvar.toml b/conformance/results/pyright/classes_classvar.toml index f18dfc60..42c7a249 100644 --- a/conformance/results/pyright/classes_classvar.toml +++ b/conformance/results/pyright/classes_classvar.toml @@ -6,7 +6,7 @@ classes_classvar.py:40:14 - error: "var" is not defined (reportUndefinedVariable classes_classvar.py:45:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:46:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) classes_classvar.py:47:20 - error: "ClassVar" type cannot include type variables (reportGeneralTypeIssues) -classes_classvar.py:52:33 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "list[str]" (reportAssignmentType) +classes_classvar.py:52:33 - error: Type "dict[Any, Any]" is not assignable to declared type "list[str]" (reportAssignmentType) classes_classvar.py:54:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:55:17 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:63:26 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) @@ -16,9 +16,8 @@ classes_classvar.py:67:26 - error: "ClassVar" is not allowed in this context (re classes_classvar.py:71:8 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:72:20 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) classes_classvar.py:105:14 - error: Cannot assign to attribute "stats" for class "Starship" -  Attribute "stats" cannot be assigned through a class instance because it is a ClassVar -    Attribute "__set__" is unknown (reportAttributeAccessIssue) -classes_classvar.py:134:13 - error: Expression of type "ProtoAImpl" is incompatible with declared type "ProtoA" +  Attribute "stats" cannot be assigned through a class instance because it is a ClassVar (reportAttributeAccessIssue) +classes_classvar.py:134:13 - error: Type "ProtoAImpl" is not assignable to declared type "ProtoA"   "ProtoAImpl" is incompatible with protocol "ProtoA"     "x" is defined as a ClassVar in protocol     "y" is defined as a ClassVar in protocol (reportAssignmentType) diff --git a/conformance/results/pyright/constructors_call_init.toml b/conformance/results/pyright/constructors_call_init.toml index dc74b3f9..4d667258 100644 --- a/conformance/results/pyright/constructors_call_init.toml +++ b/conformance/results/pyright/constructors_call_init.toml @@ -4,14 +4,14 @@ errors_diff = """ """ output = """ constructors_call_init.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__init__" -  "float" is incompatible with "int" (reportArgumentType) +  "float" is not assignable to "int" (reportArgumentType) constructors_call_init.py:42:8 - error: Argument of type "Class2[Unknown]" cannot be assigned to parameter "x" of type "Class3 | None" in function "__init__" -  Type "Class2[Unknown]" is incompatible with type "Class3 | None" -    "Class2[Unknown]" is incompatible with "Class3" -    "Class2[Unknown]" is incompatible with "None" (reportArgumentType) +  Type "Class2[Unknown]" is not assignable to type "Class3 | None" +    "Class2[Unknown]" is not assignable to "Class3" +    "Class2[Unknown]" is not assignable to "None" (reportArgumentType) constructors_call_init.py:56:1 - error:   Could not bind method "__init__" because "Class4[str]" is not assignable to parameter "self" -    "Class4[str]" is incompatible with "Class4[int]" +    "Class4[str]" is not assignable to "Class4[int]"       Type parameter "T@Class4" is invariant, but "str" is not the same as "int" (reportGeneralTypeIssues) constructors_call_init.py:107:24 - warning: Type annotation for "self" parameter of "__init__" method cannot contain class-scoped type variables (reportInvalidTypeVarUse) constructors_call_init.py:130:9 - error: Expected 0 positional arguments (reportCallIssue) diff --git a/conformance/results/pyright/constructors_call_new.toml b/conformance/results/pyright/constructors_call_new.toml index 5880ad7f..1585d37d 100644 --- a/conformance/results/pyright/constructors_call_new.toml +++ b/conformance/results/pyright/constructors_call_new.toml @@ -3,11 +3,11 @@ errors_diff = """ """ output = """ constructors_call_new.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__new__" -  "float" is incompatible with "int" (reportArgumentType) +  "float" is not assignable to "int" (reportArgumentType) constructors_call_new.py:145:1 - error:   Could not bind method "__new__" because "type[Class11[str]]" is not assignable to parameter "cls" -    "type[Class11[str]]" is incompatible with "type[Class11[int]]" -    Type "type[Class11[str]]" is incompatible with type "type[Class11[int]]" +    "type[Class11[str]]" is not assignable to "type[Class11[int]]" +    Type "type[Class11[str]]" is not assignable to type "type[Class11[int]]"       Type parameter "T@Class11" is invariant, but "str" is not the same as "int" (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/constructors_call_type.toml b/conformance/results/pyright/constructors_call_type.toml index 70f197b8..2e33755c 100644 --- a/conformance/results/pyright/constructors_call_type.toml +++ b/conformance/results/pyright/constructors_call_type.toml @@ -1,15 +1,18 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Fails to report error when passing incorrect arguments for metaclass __call__ method. +""" errors_diff = """ +Line 30: Expected 1 errors +Line 72: Expected 1 errors """ output = """ -constructors_call_type.py:30:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:40:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:50:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:59:9 - error: Expected 0 positional arguments (reportCallIssue) constructors_call_type.py:64:9 - error: Expected 0 positional arguments (reportCallIssue) -constructors_call_type.py:72:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:81:5 - error: Argument missing for parameter "y" (reportCallIssue) constructors_call_type.py:82:12 - error: Argument of type "Literal[2]" cannot be assigned to parameter "y" of type "str" in function "__new__" -  "Literal[2]" is incompatible with "str" (reportArgumentType) +  "Literal[2]" is not assignable to "str" (reportArgumentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" diff --git a/conformance/results/pyright/constructors_callable.toml b/conformance/results/pyright/constructors_callable.toml index 6c003966..708e4555 100644 --- a/conformance/results/pyright/constructors_callable.toml +++ b/conformance/results/pyright/constructors_callable.toml @@ -26,8 +26,8 @@ constructors_callable.py:144:8 - error: Expected 0 positional arguments (reportC constructors_callable.py:162:5 - information: Type of "r7" is "Overload[(x: int) -> Class7[int], (x: str) -> Class7[str]]" constructors_callable.py:182:13 - information: Type of "r8" is "(x: list[T@Class8], y: list[T@Class8]) -> Class8[T@Class8]" constructors_callable.py:184:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@Class8]" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) constructors_callable.py:193:13 - information: Type of "r9" is "(x: list[T@__init__], y: list[T@__init__]) -> Class9" constructors_callable.py:195:10 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@__init__]" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) """ diff --git a/conformance/results/pyright/dataclasses_final.toml b/conformance/results/pyright/dataclasses_final.toml index a0ab43da..9b85ad5a 100644 --- a/conformance/results/pyright/dataclasses_final.toml +++ b/conformance/results/pyright/dataclasses_final.toml @@ -4,18 +4,13 @@ errors_diff = """ """ output = """ dataclasses_final.py:27:3 - error: Cannot assign to attribute "final_classvar" for class "type[D]" -  "final_classvar" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_classvar" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:35:3 - error: Cannot assign to attribute "final_no_default" for class "D" -  "final_no_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_no_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:36:3 - error: Cannot assign to attribute "final_with_default" for class "D" -  "final_with_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_with_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:37:3 - error: Cannot assign to attribute "final_no_default" for class "type[D]" -  "final_no_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_no_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) dataclasses_final.py:38:3 - error: Cannot assign to attribute "final_with_default" for class "type[D]" -  "final_with_default" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "final_with_default" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/dataclasses_frozen.toml b/conformance/results/pyright/dataclasses_frozen.toml index 4175c762..87a046e2 100644 --- a/conformance/results/pyright/dataclasses_frozen.toml +++ b/conformance/results/pyright/dataclasses_frozen.toml @@ -1,11 +1,9 @@ conformant = "Pass" output = """ dataclasses_frozen.py:16:5 - error: Cannot assign to attribute "a" for class "DC1" -  "DC1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "a" is read-only (reportAttributeAccessIssue) dataclasses_frozen.py:17:5 - error: Cannot assign to attribute "b" for class "DC1" -  "DC1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "b" is read-only (reportAttributeAccessIssue) dataclasses_frozen.py:22:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_frozen.py:32:12 - error: A frozen class cannot inherit from a class that is not frozen (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/dataclasses_hash.toml b/conformance/results/pyright/dataclasses_hash.toml index 748f32bd..bd6c15f8 100644 --- a/conformance/results/pyright/dataclasses_hash.toml +++ b/conformance/results/pyright/dataclasses_hash.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ -dataclasses_hash.py:15:16 - error: Expression of type "DC1" is incompatible with declared type "Hashable" +dataclasses_hash.py:15:16 - error: Type "DC1" is not assignable to declared type "Hashable"   "DC1" is incompatible with protocol "Hashable"     "__hash__" is an incompatible type -      Type "None" is incompatible with type "() -> int" (reportAssignmentType) -dataclasses_hash.py:32:16 - error: Expression of type "DC3" is incompatible with declared type "Hashable" +      Type "None" is not assignable to type "() -> int" (reportAssignmentType) +dataclasses_hash.py:32:16 - error: Type "DC3" is not assignable to declared type "Hashable"   "DC3" is incompatible with protocol "Hashable"     "__hash__" is an incompatible type -      Type "None" is incompatible with type "() -> int" (reportAssignmentType) +      Type "None" is not assignable to type "() -> int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_postinit.toml b/conformance/results/pyright/dataclasses_postinit.toml index 029868bc..9ba5550a 100644 --- a/conformance/results/pyright/dataclasses_postinit.toml +++ b/conformance/results/pyright/dataclasses_postinit.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ dataclasses_postinit.py:19:40 - error: Dataclass __post_init__ method parameter type mismatch for field "y" -  "str" is incompatible with "int" (reportGeneralTypeIssues) +  "str" is not assignable to "int" (reportGeneralTypeIssues) dataclasses_postinit.py:28:11 - error: Cannot access attribute "x" for class "DC1"   "x" is an init-only field (reportAttributeAccessIssue) dataclasses_postinit.py:29:11 - error: Cannot access attribute "y" for class "DC1" diff --git a/conformance/results/pyright/dataclasses_transform_class.toml b/conformance/results/pyright/dataclasses_transform_class.toml index b7bf3083..25b8ccc8 100644 --- a/conformance/results/pyright/dataclasses_transform_class.toml +++ b/conformance/results/pyright/dataclasses_transform_class.toml @@ -2,14 +2,12 @@ conformant = "Pass" output = """ dataclasses_transform_class.py:51:7 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_transform_class.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1" -  "Customer1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) dataclasses_transform_class.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_class.py:72:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) dataclasses_transform_class.py:82:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_class.py:122:6 - error: Cannot assign to attribute "id" for class "Customer3" -  "Customer3" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_transform_converter.toml b/conformance/results/pyright/dataclasses_transform_converter.toml index ec34af35..479f0d75 100644 --- a/conformance/results/pyright/dataclasses_transform_converter.toml +++ b/conformance/results/pyright/dataclasses_transform_converter.toml @@ -4,41 +4,41 @@ errors_diff = """ """ output = """ dataclasses_transform_converter.py:48:31 - error: Argument of type "() -> int" is not a valid converter for field "field1" of type "int" -  Type "() -> int" is incompatible with type "(__converterInput) -> int" +  Type "() -> int" is not assignable to type "(__converterInput) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportGeneralTypeIssues) dataclasses_transform_converter.py:48:41 - error: Argument of type "() -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field" -  Type "() -> int" is incompatible with type "(S@model_field) -> int" +  Type "() -> int" is not assignable to type "(S@model_field) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) dataclasses_transform_converter.py:49:31 - error: Argument of type "(*, x: int) -> int" is not a valid converter for field "field2" of type "int" -  Type "(*, x: int) -> int" is incompatible with type "(__converterInput) -> int" +  Type "(*, x: int) -> int" is not assignable to type "(__converterInput) -> int"     Function accepts too many positional parameters; expected 0 but received 1       Extra parameter "x" (reportGeneralTypeIssues) dataclasses_transform_converter.py:49:41 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "converter" of type "(S@model_field) -> T@model_field" in function "model_field" -  Type "(*, x: int) -> int" is incompatible with type "(S@model_field) -> int" +  Type "(*, x: int) -> int" is not assignable to type "(S@model_field) -> int"     Function accepts too many positional parameters; expected 0 but received 1       Extra parameter "x" (reportArgumentType) dataclasses_transform_converter.py:107:5 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field0" of type "str" in function "__init__" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) dataclasses_transform_converter.py:108:23 - error: Argument of type "Literal[1]" cannot be assigned to parameter "field3" of type "str | bytes" in function "__init__" -  Type "Literal[1]" is incompatible with type "str | bytes" -    "Literal[1]" is incompatible with "str" -    "Literal[1]" is incompatible with "bytes" (reportArgumentType) +  Type "Literal[1]" is not assignable to type "str | bytes" +    "Literal[1]" is not assignable to "str" +    "Literal[1]" is not assignable to "bytes" (reportArgumentType) dataclasses_transform_converter.py:109:29 - error: Argument of type "complex" cannot be assigned to parameter "field4" of type "str | list[str]" in function "__init__" -  Type "complex" is incompatible with type "str | list[str]" -    "complex" is incompatible with "str" -    "complex" is incompatible with "list[str]" (reportArgumentType) +  Type "complex" is not assignable to type "str | list[str]" +    "complex" is not assignable to "str" +    "complex" is not assignable to "list[str]" (reportArgumentType) dataclasses_transform_converter.py:118:14 - error: Cannot assign to attribute "field0" for class "DC2" -  "Literal[1]" is incompatible with "str" (reportAttributeAccessIssue) +  "Literal[1]" is not assignable to "str" (reportAttributeAccessIssue) dataclasses_transform_converter.py:119:14 - error: Cannot assign to attribute "field3" for class "DC2" -  Type "Literal[1]" is incompatible with type "str | bytes" -    "Literal[1]" is incompatible with "str" -    "Literal[1]" is incompatible with "bytes" (reportAttributeAccessIssue) +  Type "Literal[1]" is not assignable to type "str | bytes" +    "Literal[1]" is not assignable to "str" +    "Literal[1]" is not assignable to "bytes" (reportAttributeAccessIssue) dataclasses_transform_converter.py:130:67 - error: Argument of type "Literal[1]" cannot be assigned to parameter "default" of type "S@model_field | None" in function "model_field" -  Type "Literal[1]" is incompatible with type "str | None" -    "Literal[1]" is incompatible with "str" -    "Literal[1]" is incompatible with "None" (reportArgumentType) +  Type "Literal[1]" is not assignable to type "str | None" +    "Literal[1]" is not assignable to "str" +    "Literal[1]" is not assignable to "None" (reportArgumentType) dataclasses_transform_converter.py:133:75 - error: Argument of type "type[int]" cannot be assigned to parameter "default_factory" of type "(() -> S@model_field) | None" in function "model_field" -  Type "type[int]" is incompatible with type "(() -> str) | None" +  Type "type[int]" is not assignable to type "(() -> str) | None"     No overloaded function matches type "() -> str" -    "type[type]" is incompatible with "type[None]" (reportArgumentType) +    "type[type]" is not assignable to "type[None]" (reportArgumentType) """ diff --git a/conformance/results/pyright/dataclasses_transform_func.toml b/conformance/results/pyright/dataclasses_transform_func.toml index 55a0df3e..164f9337 100644 --- a/conformance/results/pyright/dataclasses_transform_func.toml +++ b/conformance/results/pyright/dataclasses_transform_func.toml @@ -1,14 +1,13 @@ conformant = "Pass" output = """ dataclasses_transform_func.py:57:13 - error: Cannot assign to attribute "name" for class "Customer1" -  "Literal[3]" is incompatible with "str" (reportAttributeAccessIssue) +  "Literal[3]" is not assignable to "str" (reportAttributeAccessIssue) dataclasses_transform_func.py:61:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) dataclasses_transform_func.py:65:36 - error: No parameter named "salary" (reportCallIssue) dataclasses_transform_func.py:71:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_func.py:89:1 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_transform_func.py:97:6 - error: Cannot assign to attribute "id" for class "Customer3" -  "Customer3" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_transform_meta.toml b/conformance/results/pyright/dataclasses_transform_meta.toml index d5974719..392f95a7 100644 --- a/conformance/results/pyright/dataclasses_transform_meta.toml +++ b/conformance/results/pyright/dataclasses_transform_meta.toml @@ -2,14 +2,12 @@ conformant = "Pass" output = """ dataclasses_transform_meta.py:51:36 - error: A non-frozen class cannot inherit from a class that is frozen (reportGeneralTypeIssues) dataclasses_transform_meta.py:63:6 - error: Cannot assign to attribute "id" for class "Customer1" -  "Customer1" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) dataclasses_transform_meta.py:66:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_meta.py:73:6 - error: Operator "<" not supported for types "Customer1" and "Customer1" (reportOperatorIssue) dataclasses_transform_meta.py:83:18 - error: Expected 0 positional arguments (reportCallIssue) dataclasses_transform_meta.py:103:6 - error: Cannot assign to attribute "id" for class "Customer3" -  "Customer3" is frozen -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "id" is read-only (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/dataclasses_usage.toml b/conformance/results/pyright/dataclasses_usage.toml index cb3906bf..67ec33f2 100644 --- a/conformance/results/pyright/dataclasses_usage.toml +++ b/conformance/results/pyright/dataclasses_usage.toml @@ -2,14 +2,14 @@ conformant = "Pass" output = """ dataclasses_usage.py:50:6 - error: Argument missing for parameter "unit_price" (reportCallIssue) dataclasses_usage.py:51:28 - error: Argument of type "Literal['price']" cannot be assigned to parameter "unit_price" of type "float" in function "__init__" -  "Literal['price']" is incompatible with "float" (reportArgumentType) +  "Literal['price']" is not assignable to "float" (reportArgumentType) dataclasses_usage.py:52:36 - error: Expected 3 positional arguments (reportCallIssue) dataclasses_usage.py:61:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:67:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:73:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) dataclasses_usage.py:83:13 - error: Expected 1 positional argument (reportCallIssue) -dataclasses_usage.py:88:14 - error: Expression of type "str" is incompatible with declared type "int" -  "str" is incompatible with "int" (reportAssignmentType) +dataclasses_usage.py:88:14 - error: Type "str" is not assignable to declared type "int" +  "str" is not assignable to "int" (reportAssignmentType) dataclasses_usage.py:127:8 - error: Expected 1 positional argument (reportCallIssue) dataclasses_usage.py:130:1 - error: Argument missing for parameter "y" (reportCallIssue) dataclasses_usage.py:179:6 - error: Expected 0 positional arguments (reportCallIssue) diff --git a/conformance/results/pyright/directives_no_type_check.toml b/conformance/results/pyright/directives_no_type_check.toml index 9f73f715..858c581e 100644 --- a/conformance/results/pyright/directives_no_type_check.toml +++ b/conformance/results/pyright/directives_no_type_check.toml @@ -3,8 +3,8 @@ notes = """ Does not honor `@no_type_check` class decorator (allowed). """ output = """ -directives_no_type_check.py:15:14 - error: Expression of type "Literal['']" is incompatible with declared type "int" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +directives_no_type_check.py:15:14 - error: Type "Literal['']" is not assignable to declared type "int" +  "Literal['']" is not assignable to "int" (reportAssignmentType) directives_no_type_check.py:32:1 - error: Arguments missing for parameters "a", "b" (reportCallIssue) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/directives_type_ignore_file2.toml b/conformance/results/pyright/directives_type_ignore_file2.toml index 21a0a593..667eeb77 100644 --- a/conformance/results/pyright/directives_type_ignore_file2.toml +++ b/conformance/results/pyright/directives_type_ignore_file2.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ -directives_type_ignore_file2.py:14:10 - error: Expression of type "Literal['']" is incompatible with declared type "int" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +directives_type_ignore_file2.py:14:10 - error: Type "Literal['']" is not assignable to declared type "int" +  "Literal['']" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/enums_member_values.toml b/conformance/results/pyright/enums_member_values.toml index 566fcd4f..2efe3d76 100644 --- a/conformance/results/pyright/enums_member_values.toml +++ b/conformance/results/pyright/enums_member_values.toml @@ -7,8 +7,8 @@ enums_member_values.py:50:12 - error: Argument missing for parameter "radius" (r enums_member_values.py:51:15 - error: Arguments missing for parameters "mass", "radius" (reportCallIssue) enums_member_values.py:54:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "Any" (reportAssertTypeFailure) enums_member_values.py:68:13 - error: "assert_type" mismatch: expected "Literal[1]" but received "int" (reportAssertTypeFailure) -enums_member_values.py:78:13 - error: Expression of type "Literal['green']" is incompatible with declared type "int" -  "Literal['green']" is incompatible with "int" (reportAssignmentType) +enums_member_values.py:78:13 - error: Type "Literal['green']" is not assignable to declared type "int" +  "Literal['green']" is not assignable to "int" (reportAssignmentType) enums_member_values.py:85:24 - error: Cannot assign to attribute "_value_" for class "Planet2*" -  "int" is incompatible with "str" (reportAttributeAccessIssue) +  "int" is not assignable to "str" (reportAttributeAccessIssue) """ diff --git a/conformance/results/pyright/generics_base_class.toml b/conformance/results/pyright/generics_base_class.toml index a008e5e3..fa4abde3 100644 --- a/conformance/results/pyright/generics_base_class.toml +++ b/conformance/results/pyright/generics_base_class.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ generics_base_class.py:26:26 - error: Argument of type "SymbolTable" cannot be assigned to parameter "x" of type "dict[str, list[object]]" in function "takes_dict_incorrect" -  "SymbolTable" is incompatible with "dict[str, list[object]]" +  "SymbolTable" is not assignable to "dict[str, list[object]]"     Type parameter "_VT@dict" is invariant, but "list[Node]" is not the same as "list[object]"     Consider switching from "dict" to "Mapping" which is covariant in the value type (reportArgumentType) generics_base_class.py:29:14 - error: "Generic" is not valid in this context (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_basic.toml b/conformance/results/pyright/generics_basic.toml index b57456ed..290ffe41 100644 --- a/conformance/results/pyright/generics_basic.toml +++ b/conformance/results/pyright/generics_basic.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ generics_basic.py:40:15 - error: Argument of type "bytes" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" -  "bytes" is incompatible with "str" (reportArgumentType) +  "bytes" is not assignable to "str" (reportArgumentType) generics_basic.py:41:15 - error: Argument of type "str" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" -  "str" is incompatible with "bytes" (reportArgumentType) +  "str" is not assignable to "bytes" (reportArgumentType) generics_basic.py:49:44 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) generics_basic.py:55:53 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) generics_basic.py:69:15 - error: Argument of type "bytes" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" -  "bytes" is incompatible with "str" (reportArgumentType) +  "bytes" is not assignable to "str" (reportArgumentType) generics_basic.py:121:24 - error: Type arguments for "Generic" must be unique (reportInvalidTypeForm) generics_basic.py:157:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" -  "Literal[0]" is incompatible with "str" (reportArgumentType) +  "Literal[0]" is not assignable to "str" (reportArgumentType) generics_basic.py:158:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" -  "Literal[0]" is incompatible with "str" (reportArgumentType) +  "Literal[0]" is not assignable to "str" (reportArgumentType) generics_basic.py:191:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_defaults_referential.toml b/conformance/results/pyright/generics_defaults_referential.toml index ff318bc3..229c13d3 100644 --- a/conformance/results/pyright/generics_defaults_referential.toml +++ b/conformance/results/pyright/generics_defaults_referential.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ generics_defaults_referential.py:36:13 - error: Argument of type "Literal['']" cannot be assigned to parameter "b" of type "int" in function "__init__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_defaults_referential.py:37:10 - error: Argument of type "Literal['']" cannot be assigned to parameter "a" of type "int" in function "__init__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_defaults_referential.py:53:7 - error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope   Type variable "StopT" is not in scope (reportGeneralTypeIssues) generics_defaults_referential.py:60:11 - error: Type parameter "S2" has a default type that refers to one or more type variables that are out of scope diff --git a/conformance/results/pyright/generics_paramspec_components.toml b/conformance/results/pyright/generics_paramspec_components.toml index fb7b7d5b..91d07a57 100644 --- a/conformance/results/pyright/generics_paramspec_components.toml +++ b/conformance/results/pyright/generics_paramspec_components.toml @@ -18,9 +18,9 @@ generics_paramspec_components.py:70:12 - error: Expected 1 positional argument ( generics_paramspec_components.py:72:12 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:83:19 - error: Expected 1 positional argument (reportCallIssue) generics_paramspec_components.py:98:20 - error: Argument of type "Literal['A']" cannot be assigned to parameter "a" of type "int" -  "Literal['A']" is incompatible with "int" (reportArgumentType) +  "Literal['A']" is not assignable to "int" (reportArgumentType) generics_paramspec_components.py:98:25 - error: Argument of type "Literal[1]" cannot be assigned to parameter "b" of type "str" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_paramspec_semantics.toml b/conformance/results/pyright/generics_paramspec_semantics.toml index df1e43dc..e24a0a9c 100644 --- a/conformance/results/pyright/generics_paramspec_semantics.toml +++ b/conformance/results/pyright/generics_paramspec_semantics.toml @@ -5,30 +5,30 @@ Constraint solver doesn't find common type for two signatures captured by a sing output = """ generics_paramspec_semantics.py:26:6 - error: Expected 2 more positional arguments (reportCallIssue) generics_paramspec_semantics.py:27:9 - error: Argument of type "Literal['A']" cannot be assigned to parameter "b" of type "bool" -  "Literal['A']" is incompatible with "bool" (reportArgumentType) +  "Literal['A']" is not assignable to "bool" (reportArgumentType) generics_paramspec_semantics.py:46:17 - error: Argument of type "(y: int, x: str) -> int" cannot be assigned to parameter "y" of type "(**P@func1) -> int" in function "func1" -  Type "(y: int, x: str) -> int" is incompatible with type "(x: int, y: str) -> int" +  Type "(y: int, x: str) -> int" is not assignable to type "(x: int, y: str) -> int"     Parameter name mismatch: "x" versus "y"     Parameter name mismatch: "y" versus "x" (reportArgumentType) generics_paramspec_semantics.py:61:23 - error: Argument of type "(*, y: int) -> int" cannot be assigned to parameter "y" of type "(**P@func1) -> int" in function "func1" -  Type "(*, y: int) -> int" is incompatible with type "(*, x: int) -> int" +  Type "(*, y: int) -> int" is not assignable to type "(*, x: int) -> int"     Extra parameter "y"     Missing keyword parameter "x" (reportArgumentType) generics_paramspec_semantics.py:98:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:108:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter "args" of type "bool" -  "Literal[1]" is incompatible with "bool" (reportArgumentType) +  "Literal[1]" is not assignable to "bool" (reportArgumentType) generics_paramspec_semantics.py:120:4 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" -  "Literal[1]" is incompatible with "str" (reportArgumentType) +  "Literal[1]" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:127:2 - error: Argument of type "(x: str) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" -  Type "(x: str) -> int" is incompatible with type "(int, **P@expects_int_first) -> int" +  Type "(x: str) -> int" is not assignable to type "(int, **P@expects_int_first) -> int"     Parameter 1: type "int" is incompatible with type "str" -      "int" is incompatible with "str" (reportArgumentType) +      "int" is not assignable to "str" (reportArgumentType) generics_paramspec_semantics.py:132:2 - error: Argument of type "(*, x: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" -  Type "(*, x: int) -> int" is incompatible with type "(int, **P@expects_int_first) -> int" +  Type "(*, x: int) -> int" is not assignable to type "(int, **P@expects_int_first) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) generics_paramspec_semantics.py:137:2 - error: Argument of type "(**kwargs: int) -> int" cannot be assigned to parameter "x" of type "(int, **P@expects_int_first) -> int" in function "expects_int_first" -  Type "(**kwargs: int) -> int" is incompatible with type "(int, **P@expects_int_first) -> int" +  Type "(**kwargs: int) -> int" is not assignable to type "(int, **P@expects_int_first) -> int"     Function accepts too many positional parameters; expected 0 but received 1 (reportArgumentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_paramspec_specialization.toml b/conformance/results/pyright/generics_paramspec_specialization.toml index 525051f4..af1ab676 100644 --- a/conformance/results/pyright/generics_paramspec_specialization.toml +++ b/conformance/results/pyright/generics_paramspec_specialization.toml @@ -3,13 +3,13 @@ output = """ generics_paramspec_specialization.py:44:27 - error: Type "int" cannot be assigned to type variable "P1@ClassA"   Type "int" is incompatible with ParamSpec "P1@ClassA" (reportInvalidTypeArguments) generics_paramspec_specialization.py:54:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_paramspec_specialization.py:55:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool" -  "Literal['']" is incompatible with "bool" (reportArgumentType) +  "Literal['']" is not assignable to "bool" (reportArgumentType) generics_paramspec_specialization.py:60:9 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_paramspec_specialization.py:61:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "bool" -  "Literal['']" is incompatible with "bool" (reportArgumentType) +  "Literal['']" is not assignable to "bool" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_scoping.toml b/conformance/results/pyright/generics_scoping.toml index bb679b43..2e352ca7 100644 --- a/conformance/results/pyright/generics_scoping.toml +++ b/conformance/results/pyright/generics_scoping.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ generics_scoping.py:29:10 - error: Argument of type "Literal['a']" cannot be assigned to parameter "x" of type "int" in function "meth_2" -  "Literal['a']" is incompatible with "int" (reportArgumentType) +  "Literal['a']" is not assignable to "int" (reportArgumentType) generics_scoping.py:50:13 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) generics_scoping.py:54:19 - error: Type variable "S" has no meaning in this context (reportGeneralTypeIssues) generics_scoping.py:65:29 - error: TypeVar "T" is already in use by an outer scope (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_self_attributes.toml b/conformance/results/pyright/generics_self_attributes.toml index 6b439eb2..b5c9fe45 100644 --- a/conformance/results/pyright/generics_self_attributes.toml +++ b/conformance/results/pyright/generics_self_attributes.toml @@ -1,16 +1,14 @@ conformant = "Pass" output = """ generics_self_attributes.py:26:38 - error: Argument of type "LinkedList[int]" cannot be assigned to parameter "next" of type "OrdinalLinkedList | None" in function "__init__" -  Type "LinkedList[int]" is incompatible with type "OrdinalLinkedList | None" -    "LinkedList[int]" is incompatible with "OrdinalLinkedList" -    "LinkedList[int]" is incompatible with "None" (reportArgumentType) +  Type "LinkedList[int]" is not assignable to type "OrdinalLinkedList | None" +    "LinkedList[int]" is not assignable to "OrdinalLinkedList" +    "LinkedList[int]" is not assignable to "None" (reportArgumentType) generics_self_attributes.py:32:8 - error: Cannot assign to attribute "next" for class "OrdinalLinkedList"   Expression of type "LinkedList[int]" cannot be assigned to attribute "next" of class "OrdinalLinkedList" -    Attribute "__set__" is unknown -    Attribute "__set__" is unknown -    Type "LinkedList[int]" is incompatible with type "OrdinalLinkedList | None" -      "LinkedList[int]" is incompatible with "OrdinalLinkedList" -      "LinkedList[int]" is incompatible with "None" (reportAttributeAccessIssue) +    Type "LinkedList[int]" is not assignable to type "OrdinalLinkedList | None" +      "LinkedList[int]" is not assignable to "OrdinalLinkedList" +      "LinkedList[int]" is not assignable to "None" (reportAttributeAccessIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_basic.toml b/conformance/results/pyright/generics_self_basic.toml index a7a67607..6ce2caef 100644 --- a/conformance/results/pyright/generics_self_basic.toml +++ b/conformance/results/pyright/generics_self_basic.toml @@ -1,9 +1,9 @@ conformant = "Pass" output = """ -generics_self_basic.py:20:16 - error: Expression of type "Shape" is incompatible with return type "Self@Shape" -  Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) -generics_self_basic.py:33:16 - error: Expression of type "Shape" is incompatible with return type "Self@Shape" -  Type "Shape" is incompatible with type "Self@Shape" (reportReturnType) +generics_self_basic.py:20:16 - error: Type "Shape" is not assignable to return type "Self@Shape" +  Type "Shape" is not assignable to type "Self@Shape" (reportReturnType) +generics_self_basic.py:33:16 - error: Type "Shape" is not assignable to return type "Self@Shape" +  Type "Shape" is not assignable to type "Self@Shape" (reportReturnType) generics_self_basic.py:67:31 - error: Expected no type arguments for class "Self" (reportInvalidTypeArguments) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_self_protocols.toml b/conformance/results/pyright/generics_self_protocols.toml index 9f77ef79..aa645530 100644 --- a/conformance/results/pyright/generics_self_protocols.toml +++ b/conformance/results/pyright/generics_self_protocols.toml @@ -3,15 +3,15 @@ output = """ generics_self_protocols.py:61:19 - error: Argument of type "BadReturnType" cannot be assigned to parameter "shape" of type "ShapeProtocol" in function "accepts_shape"   "BadReturnType" is incompatible with protocol "ShapeProtocol"     "set_scale" is an incompatible type -      Type "(scale: float) -> int" is incompatible with type "(scale: float) -> BadReturnType" +      Type "(scale: float) -> int" is not assignable to type "(scale: float) -> BadReturnType"         Function return type "int" is incompatible with type "BadReturnType" -          "int" is incompatible with "BadReturnType" (reportArgumentType) +          "int" is not assignable to "BadReturnType" (reportArgumentType) generics_self_protocols.py:64:19 - error: Argument of type "ReturnDifferentClass" cannot be assigned to parameter "shape" of type "ShapeProtocol" in function "accepts_shape"   "ReturnDifferentClass" is incompatible with protocol "ShapeProtocol"     "set_scale" is an incompatible type -      Type "(scale: float) -> ReturnConcreteShape" is incompatible with type "(scale: float) -> ReturnDifferentClass" +      Type "(scale: float) -> ReturnConcreteShape" is not assignable to type "(scale: float) -> ReturnDifferentClass"         Function return type "ReturnConcreteShape" is incompatible with type "ReturnDifferentClass" -          "ReturnConcreteShape" is incompatible with "ReturnDifferentClass" (reportArgumentType) +          "ReturnConcreteShape" is not assignable to "ReturnDifferentClass" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_self_usage.toml b/conformance/results/pyright/generics_self_usage.toml index 5e7184ba..95f5ac1a 100644 --- a/conformance/results/pyright/generics_self_usage.toml +++ b/conformance/results/pyright/generics_self_usage.toml @@ -6,8 +6,8 @@ generics_self_usage.py:76:6 - error: "Self" is not valid in this context (report generics_self_usage.py:82:44 - warning: TypeVar "TFoo2" appears only once in generic function signature   Use "Foo2" instead (reportInvalidTypeVarUse) generics_self_usage.py:82:54 - error: "Self" cannot be used in a function with a `self` or `cls` parameter that has a type annotation other than "Self" (reportGeneralTypeIssues) -generics_self_usage.py:86:16 - error: Expression of type "Foo3" is incompatible with return type "Self@Foo3" -  Type "Foo3" is incompatible with type "Self@Foo3" (reportReturnType) +generics_self_usage.py:86:16 - error: Type "Foo3" is not assignable to return type "Self@Foo3" +  Type "Foo3" is not assignable to type "Self@Foo3" (reportReturnType) generics_self_usage.py:101:15 - error: "Self" is not valid in this context (reportGeneralTypeIssues) generics_self_usage.py:103:12 - error: "Self" is not valid in this context (reportGeneralTypeIssues) generics_self_usage.py:106:30 - error: "Self" is not valid in this context (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_syntax_declarations.toml b/conformance/results/pyright/generics_syntax_declarations.toml index 93995d62..4321bdb3 100644 --- a/conformance/results/pyright/generics_syntax_declarations.toml +++ b/conformance/results/pyright/generics_syntax_declarations.toml @@ -5,7 +5,7 @@ generics_syntax_declarations.py:27:20 - error: Type arguments are not allowed wi generics_syntax_declarations.py:34:11 - error: Cannot access attribute "is_integer" for class "str*"   Attribute "is_integer" is unknown (reportAttributeAccessIssue) generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) -generics_syntax_declarations.py:50:17 - error: List expression not allowed in type annotation +generics_syntax_declarations.py:50:17 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) generics_syntax_declarations.py:50:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) generics_syntax_declarations.py:62:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index d8bd2bd9..b23985d5 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -2,64 +2,60 @@ conformant = "Pass" output = """ generics_syntax_infer_variance.py:15:51 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) generics_syntax_infer_variance.py:17:55 - error: TypeVar cannot be both covariant and contravariant (reportGeneralTypeIssues) -generics_syntax_infer_variance.py:29:35 - error: Expression of type "ShouldBeCovariant1[float]" is incompatible with declared type "ShouldBeCovariant1[int]" -  "ShouldBeCovariant1[float]" is incompatible with "ShouldBeCovariant1[int]" +generics_syntax_infer_variance.py:29:35 - error: Type "ShouldBeCovariant1[float]" is not assignable to declared type "ShouldBeCovariant1[int]" +  "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:37:35 - error: Expression of type "ShouldBeCovariant2[float]" is incompatible with declared type "ShouldBeCovariant2[int]" -  "ShouldBeCovariant2[float]" is incompatible with "ShouldBeCovariant2[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:37:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]" +  "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:46:35 - error: Expression of type "ShouldBeCovariant3[float]" is incompatible with declared type "ShouldBeCovariant3[int]" -  "ShouldBeCovariant3[float]" is incompatible with "ShouldBeCovariant3[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:46:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]" +  "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:55:34 - error: Expression of type "ShouldBeCovariant4[float]" is incompatible with declared type "ShouldBeCovariant4[int]" -  "ShouldBeCovariant4[float]" is incompatible with "ShouldBeCovariant4[int]" -    Type parameter "T@ShouldBeCovariant4" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:68:34 - error: Expression of type "ShouldBeCovariant5[float]" is incompatible with declared type "ShouldBeCovariant5[int]" -  "ShouldBeCovariant5[float]" is incompatible with "ShouldBeCovariant5[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:75:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]" +  "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:79:34 - error: Expression of type "ShouldBeCovariant6[float]" is incompatible with declared type "ShouldBeCovariant6[int]" -  "ShouldBeCovariant6[float]" is incompatible with "ShouldBeCovariant6[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:86:34 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]" +  "ShouldBeCovariant6[float]" is not assignable to "ShouldBeCovariant6[int]"     Type parameter "T@ShouldBeCovariant6" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_syntax_infer_variance.py:95:38 - error: Expression of type "ShouldBeInvariant1[int]" is incompatible with declared type "ShouldBeInvariant1[float]" -  "ShouldBeInvariant1[int]" is incompatible with "ShouldBeInvariant1[float]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:102:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]" +  "ShouldBeInvariant1[int]" is not assignable to "ShouldBeInvariant1[float]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:96:36 - error: Expression of type "ShouldBeInvariant1[float]" is incompatible with declared type "ShouldBeInvariant1[int]" -  "ShouldBeInvariant1[float]" is incompatible with "ShouldBeInvariant1[int]" +generics_syntax_infer_variance.py:103:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]" +  "ShouldBeInvariant1[float]" is not assignable to "ShouldBeInvariant1[int]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:110:38 - error: Expression of type "ShouldBeInvariant2[int]" is incompatible with declared type "ShouldBeInvariant2[float]" -  "ShouldBeInvariant2[int]" is incompatible with "ShouldBeInvariant2[float]" +generics_syntax_infer_variance.py:117:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]" +  "ShouldBeInvariant2[int]" is not assignable to "ShouldBeInvariant2[float]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:111:36 - error: Expression of type "ShouldBeInvariant2[float]" is incompatible with declared type "ShouldBeInvariant2[int]" -  "ShouldBeInvariant2[float]" is incompatible with "ShouldBeInvariant2[int]" +generics_syntax_infer_variance.py:118:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]" +  "ShouldBeInvariant2[float]" is not assignable to "ShouldBeInvariant2[int]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:118:43 - error: Expression of type "ShouldBeInvariant3[int, str]" is incompatible with declared type "ShouldBeInvariant3[float, str]" -  "ShouldBeInvariant3[int, str]" is incompatible with "ShouldBeInvariant3[float, str]" +generics_syntax_infer_variance.py:125:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]" +  "ShouldBeInvariant3[int, str]" is not assignable to "ShouldBeInvariant3[float, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:119:41 - error: Expression of type "ShouldBeInvariant3[float, str]" is incompatible with declared type "ShouldBeInvariant3[int, str]" -  "ShouldBeInvariant3[float, str]" is incompatible with "ShouldBeInvariant3[int, str]" +generics_syntax_infer_variance.py:126:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]" +  "ShouldBeInvariant3[float, str]" is not assignable to "ShouldBeInvariant3[int, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:120:43 - error: Expression of type "ShouldBeInvariant3[str, int]" is incompatible with declared type "ShouldBeInvariant3[str, float]" -  "ShouldBeInvariant3[str, int]" is incompatible with "ShouldBeInvariant3[str, float]" +generics_syntax_infer_variance.py:127:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]" +  "ShouldBeInvariant3[str, int]" is not assignable to "ShouldBeInvariant3[str, float]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:121:41 - error: Expression of type "ShouldBeInvariant3[str, float]" is incompatible with declared type "ShouldBeInvariant3[str, int]" -  "ShouldBeInvariant3[str, float]" is incompatible with "ShouldBeInvariant3[str, int]" +generics_syntax_infer_variance.py:128:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]" +  "ShouldBeInvariant3[str, float]" is not assignable to "ShouldBeInvariant3[str, int]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_syntax_infer_variance.py:129:38 - error: Expression of type "ShouldBeInvariant4[int]" is incompatible with declared type "ShouldBeInvariant4[float]" -  "ShouldBeInvariant4[int]" is incompatible with "ShouldBeInvariant4[float]" +generics_syntax_infer_variance.py:136:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]" +  "ShouldBeInvariant4[int]" is not assignable to "ShouldBeInvariant4[float]"     Type parameter "T@ShouldBeInvariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:137:38 - error: Expression of type "ShouldBeInvariant5[int]" is incompatible with declared type "ShouldBeInvariant5[float]" -  "ShouldBeInvariant5[int]" is incompatible with "ShouldBeInvariant5[float]" +generics_syntax_infer_variance.py:144:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]" +  "ShouldBeInvariant5[int]" is not assignable to "ShouldBeInvariant5[float]"     Type parameter "T@ShouldBeInvariant5" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_syntax_infer_variance.py:148:45 - error: Expression of type "ShouldBeContravariant1[int]" is incompatible with declared type "ShouldBeContravariant1[float]" -  "ShouldBeContravariant1[int]" is incompatible with "ShouldBeContravariant1[float]" +generics_syntax_infer_variance.py:155:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]" +  "ShouldBeContravariant1[int]" is not assignable to "ShouldBeContravariant1[float]"     Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) +      "float" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_type_erasure.toml b/conformance/results/pyright/generics_type_erasure.toml index caf122a4..cbbc0d1c 100644 --- a/conformance/results/pyright/generics_type_erasure.toml +++ b/conformance/results/pyright/generics_type_erasure.toml @@ -1,13 +1,13 @@ conformant = "Pass" output = """ generics_type_erasure.py:38:16 - error: Argument of type "Literal['']" cannot be assigned to parameter "label" of type "int | None" in function "__init__" -  Type "Literal['']" is incompatible with type "int | None" -    "Literal['']" is incompatible with "int" -    "Literal['']" is incompatible with "None" (reportArgumentType) +  Type "Literal['']" is not assignable to type "int | None" +    "Literal['']" is not assignable to "int" +    "Literal['']" is not assignable to "None" (reportArgumentType) generics_type_erasure.py:40:16 - error: Argument of type "Literal[0]" cannot be assigned to parameter "label" of type "str | None" in function "__init__" -  Type "Literal[0]" is incompatible with type "str | None" -    "Literal[0]" is incompatible with "str" -    "Literal[0]" is incompatible with "None" (reportArgumentType) +  Type "Literal[0]" is not assignable to type "str | None" +    "Literal[0]" is not assignable to "str" +    "Literal[0]" is not assignable to "None" (reportArgumentType) generics_type_erasure.py:42:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:43:11 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) generics_type_erasure.py:44:6 - error: Access to generic instance variable through class is ambiguous (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_typevartuple_args.toml b/conformance/results/pyright/generics_typevartuple_args.toml index 6e0ee4b2..04a4cc5b 100644 --- a/conformance/results/pyright/generics_typevartuple_args.toml +++ b/conformance/results/pyright/generics_typevartuple_args.toml @@ -1,22 +1,23 @@ conformant = "Pass" output = """ generics_typevartuple_args.py:33:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le" -  "Literal['']" is incompatible with "Env" (reportArgumentType) +  "Literal['']" is not assignable to "Env" (reportArgumentType) generics_typevartuple_args.py:34:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le" -  "Literal['']" is incompatible with "Env" (reportArgumentType) +  "Literal['']" is not assignable to "Env" (reportArgumentType) generics_typevartuple_args.py:48:10 - error: Argument of type "Literal['2']" cannot be assigned to parameter of type "int" in function "func1" -  "Literal['2']" is incompatible with "int" (reportArgumentType) +  "Literal['2']" is not assignable to "int" (reportArgumentType) generics_typevartuple_args.py:57:10 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" in function "func2" -  "Literal[1]" is incompatible with "str" (reportArgumentType) -generics_typevartuple_args.py:58:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) -generics_typevartuple_args.py:59:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) -generics_typevartuple_args.py:67:1 - error: Argument missing for parameter "args[1]" (reportCallIssue) +  "Literal[1]" is not assignable to "str" (reportArgumentType) +generics_typevartuple_args.py:59:7 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" in function "func2" +  "Literal['']" is not assignable to "int" (reportArgumentType) generics_typevartuple_args.py:75:13 - error: Argument of type "tuple[Literal[1], Literal[2]]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4" -  "tuple[Literal[1], Literal[2]]" is incompatible with "tuple[int]" +  "tuple[Literal[1], Literal[2]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received 2 (reportArgumentType) generics_typevartuple_args.py:76:14 - error: Argument of type "tuple[Literal['1']]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4" -  "Literal['1']" is incompatible with "int" (reportArgumentType) +  "Literal['1']" is not assignable to "int" (reportArgumentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 58: Expected 1 errors +Line 67: Expected 1 errors """ diff --git a/conformance/results/pyright/generics_typevartuple_basic.toml b/conformance/results/pyright/generics_typevartuple_basic.toml index 03878ccf..862827ae 100644 --- a/conformance/results/pyright/generics_typevartuple_basic.toml +++ b/conformance/results/pyright/generics_typevartuple_basic.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ generics_typevartuple_basic.py:42:34 - error: Argument of type "Height" cannot be assigned to parameter "shape" of type "tuple[*Shape@Array]" in function "__init__" -  "Height" is incompatible with "tuple[*Shape@Array]" (reportArgumentType) -generics_typevartuple_basic.py:43:35 - error: Expression of type "Array[Batch, Width]" is incompatible with declared type "Array[Batch, Height, Width]" -  "Array[Batch, Width]" is incompatible with "Array[Batch, Height, Width]" +  "Height" is not assignable to "tuple[*Shape@Array]" (reportArgumentType) +generics_typevartuple_basic.py:43:35 - error: Type "Array[Batch, Width]" is not assignable to declared type "Array[Batch, Height, Width]" +  "Array[Batch, Width]" is not assignable to "Array[Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Batch, Width]" is not the same as "*tuple[Batch, Height, Width]" (reportAssignmentType) -generics_typevartuple_basic.py:44:41 - error: Expression of type "Array[Time, Batch, Width, Height]" is incompatible with declared type "Array[Time, Batch, Height, Width]" -  "Array[Time, Batch, Width, Height]" is incompatible with "Array[Time, Batch, Height, Width]" +generics_typevartuple_basic.py:44:41 - error: Type "Array[Time, Batch, Width, Height]" is not assignable to declared type "Array[Time, Batch, Height, Width]" +  "Array[Time, Batch, Width, Height]" is not assignable to "Array[Time, Batch, Height, Width]"     Type parameter "Shape@Array" is invariant, but "*tuple[Time, Batch, Width, Height]" is not the same as "*tuple[Time, Batch, Height, Width]" (reportAssignmentType) generics_typevartuple_basic.py:52:22 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) generics_typevartuple_basic.py:53:37 - error: Expected unpacked TypeVarTuple; use Unpack[Shape] or *Shape (reportInvalidTypeForm) @@ -17,15 +17,15 @@ generics_typevartuple_basic.py:66:27 - error: TypeVarTuple cannot have value con generics_typevartuple_basic.py:66:32 - error: TypeVarTuple cannot have value constraints (reportGeneralTypeIssues) generics_typevartuple_basic.py:67:27 - error: "bound" is unknown parameter to TypeVarTuple (reportGeneralTypeIssues) generics_typevartuple_basic.py:89:14 - error: Argument of type "tuple[Literal['0']]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2" -  "Literal['0']" is incompatible with "int" (reportArgumentType) +  "Literal['0']" is not assignable to "int" (reportArgumentType) generics_typevartuple_basic.py:90:15 - error: Argument of type "tuple[Literal[0]]" cannot be assigned to parameter "arg2" of type "tuple[*Ts@func2]" in function "func2" -  "tuple[Literal[0]]" is incompatible with "tuple[int, int]" +  "tuple[Literal[0]]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 1 (reportArgumentType) generics_typevartuple_basic.py:99:17 - error: Argument of type "Array[Width]" cannot be assigned to parameter "y" of type "Array[*Shape@multiply]" in function "multiply" -  "Array[Width]" is incompatible with "Array[Height]" +  "Array[Width]" is not assignable to "Array[Height]"     Type parameter "Shape@Array" is invariant, but "*tuple[Width]" is not the same as "*tuple[Height]" (reportArgumentType) generics_typevartuple_basic.py:100:17 - error: Argument of type "Array[Height, Width]" cannot be assigned to parameter "y" of type "Array[*Shape@multiply]" in function "multiply" -  "Array[Height, Width]" is incompatible with "Array[Height]" +  "Array[Height, Width]" is not assignable to "Array[Height]"     Type parameter "Shape@Array" is invariant, but "*tuple[Height, Width]" is not the same as "*tuple[Height]" (reportArgumentType) generics_typevartuple_basic.py:106:14 - error: Generic class can have at most one TypeVarTuple type parameter but received multiple ("Ts1", "Ts2") (reportGeneralTypeIssues) generics_typevartuple_basic.py:106:29 - error: Type argument list can have at most one unpacked TypeVarTuple or tuple (reportInvalidTypeForm) diff --git a/conformance/results/pyright/generics_typevartuple_callable.toml b/conformance/results/pyright/generics_typevartuple_callable.toml index 7c22ef0e..fb569c88 100644 --- a/conformance/results/pyright/generics_typevartuple_callable.toml +++ b/conformance/results/pyright/generics_typevartuple_callable.toml @@ -1,8 +1,8 @@ conformant = "Pass" output = """ generics_typevartuple_callable.py:26:28 - error: Argument of type "tuple[Literal[''], Literal[0]]" cannot be assigned to parameter "args" of type "tuple[*Ts@__init__]" in function "__init__" -  "Literal['']" is incompatible with "int" -  "Literal[0]" is incompatible with "str" (reportArgumentType) +  "Literal['']" is not assignable to "int" +  "Literal[0]" is not assignable to "str" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_typevartuple_unpack.toml b/conformance/results/pyright/generics_typevartuple_unpack.toml index 22576b79..a6484a5a 100644 --- a/conformance/results/pyright/generics_typevartuple_unpack.toml +++ b/conformance/results/pyright/generics_typevartuple_unpack.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ generics_typevartuple_unpack.py:30:28 - error: Argument of type "Array[Batch]" cannot be assigned to parameter "x" of type "Array[Batch, *tuple[Any, ...], Channels]" in function "process_batch_channels" -  "Array[Batch]" is incompatible with "Array[Batch, *tuple[Any, ...], Channels]" +  "Array[Batch]" is not assignable to "Array[Batch, *tuple[Any, ...], Channels]"     Type parameter "Ts@Array" is invariant, but "*tuple[Batch]" is not the same as "*tuple[Batch, *tuple[Any, ...], Channels]" (reportArgumentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_upper_bound.toml b/conformance/results/pyright/generics_upper_bound.toml index 280be61a..ed479279 100644 --- a/conformance/results/pyright/generics_upper_bound.toml +++ b/conformance/results/pyright/generics_upper_bound.toml @@ -2,11 +2,11 @@ conformant = "Pass" output = """ generics_upper_bound.py:24:38 - error: TypeVar bound type cannot be generic (reportGeneralTypeIssues) generics_upper_bound.py:51:8 - error: Argument of type "Literal[3]" cannot be assigned to parameter "x" of type "ST@longer" in function "longer" -  Type "Literal[3]" is incompatible with type "Sized" +  Type "Literal[3]" is not assignable to type "Sized"     "Literal[3]" is incompatible with protocol "Sized"       "__len__" is not present (reportArgumentType) generics_upper_bound.py:51:11 - error: Argument of type "Literal[3]" cannot be assigned to parameter "y" of type "ST@longer" in function "longer" -  Type "Literal[3]" is incompatible with type "Sized" +  Type "Literal[3]" is not assignable to type "Sized"     "Literal[3]" is incompatible with protocol "Sized"       "__len__" is not present (reportArgumentType) generics_upper_bound.py:56:44 - error: TypeVar cannot be both bound and constrained (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/generics_variance_inference.toml b/conformance/results/pyright/generics_variance_inference.toml index e2b3de34..5c0f32e2 100644 --- a/conformance/results/pyright/generics_variance_inference.toml +++ b/conformance/results/pyright/generics_variance_inference.toml @@ -1,85 +1,88 @@ conformant = "Pass" output = """ -generics_variance_inference.py:24:33 - error: Expression of type "ClassA[float, int, int]" is incompatible with declared type "ClassA[int, int, int]" -  "ClassA[float, int, int]" is incompatible with "ClassA[int, int, int]" +generics_variance_inference.py:24:33 - error: Type "ClassA[float, int, int]" is not assignable to declared type "ClassA[int, int, int]" +  "ClassA[float, int, int]" is not assignable to "ClassA[int, int, int]"     Type parameter "T1@ClassA" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:25:37 - error: Expression of type "ClassA[float, int, int]" is incompatible with declared type "ClassA[float, float, int]" -  "ClassA[float, int, int]" is incompatible with "ClassA[float, float, int]" +generics_variance_inference.py:25:37 - error: Type "ClassA[float, int, int]" is not assignable to declared type "ClassA[float, float, int]" +  "ClassA[float, int, int]" is not assignable to "ClassA[float, float, int]"     Type parameter "T2@ClassA" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:28:33 - error: Expression of type "ClassA[int, float, float]" is incompatible with declared type "ClassA[int, int, int]" -  "ClassA[int, float, float]" is incompatible with "ClassA[int, int, int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:28:33 - error: Type "ClassA[int, float, float]" is not assignable to declared type "ClassA[int, int, int]" +  "ClassA[int, float, float]" is not assignable to "ClassA[int, int, int]"     Type parameter "T3@ClassA" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:41:35 - error: Expression of type "ShouldBeCovariant1[float]" is incompatible with declared type "ShouldBeCovariant1[int]" -  "ShouldBeCovariant1[float]" is incompatible with "ShouldBeCovariant1[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:41:35 - error: Type "ShouldBeCovariant1[float]" is not assignable to declared type "ShouldBeCovariant1[int]" +  "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]"     Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:49:35 - error: Expression of type "ShouldBeCovariant2[float]" is incompatible with declared type "ShouldBeCovariant2[int]" -  "ShouldBeCovariant2[float]" is incompatible with "ShouldBeCovariant2[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:49:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]" +  "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]"     Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:58:35 - error: Expression of type "ShouldBeCovariant3[float]" is incompatible with declared type "ShouldBeCovariant3[int]" -  "ShouldBeCovariant3[float]" is incompatible with "ShouldBeCovariant3[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:58:35 - error: Type "ShouldBeCovariant3[float]" is not assignable to declared type "ShouldBeCovariant3[int]" +  "ShouldBeCovariant3[float]" is not assignable to "ShouldBeCovariant3[int]"     Type parameter "T@ShouldBeCovariant3" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:67:34 - error: Expression of type "ShouldBeCovariant4[float]" is incompatible with declared type "ShouldBeCovariant4[int]" -  "ShouldBeCovariant4[float]" is incompatible with "ShouldBeCovariant4[int]" -    Type parameter "T@ShouldBeCovariant4" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:80:34 - error: Expression of type "ShouldBeCovariant5[float]" is incompatible with declared type "ShouldBeCovariant5[int]" -  "ShouldBeCovariant5[float]" is incompatible with "ShouldBeCovariant5[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:66:36 - error: Type "ShouldBeCovariant4[int]" is not assignable to declared type "ShouldBeCovariant4[float]" +  "ShouldBeCovariant4[int]" is not assignable to "ShouldBeCovariant4[float]" +    Type parameter "T@ShouldBeCovariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) +generics_variance_inference.py:67:34 - error: Type "ShouldBeCovariant4[float]" is not assignable to declared type "ShouldBeCovariant4[int]" +  "ShouldBeCovariant4[float]" is not assignable to "ShouldBeCovariant4[int]" +    Type parameter "T@ShouldBeCovariant4" is invariant, but "float" is not the same as "int" (reportAssignmentType) +generics_variance_inference.py:80:34 - error: Type "ShouldBeCovariant5[float]" is not assignable to declared type "ShouldBeCovariant5[int]" +  "ShouldBeCovariant5[float]" is not assignable to "ShouldBeCovariant5[int]"     Type parameter "T@ShouldBeCovariant5" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:96:38 - error: Expression of type "ShouldBeInvariant1[int]" is incompatible with declared type "ShouldBeInvariant1[float]" -  "ShouldBeInvariant1[int]" is incompatible with "ShouldBeInvariant1[float]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:96:38 - error: Type "ShouldBeInvariant1[int]" is not assignable to declared type "ShouldBeInvariant1[float]" +  "ShouldBeInvariant1[int]" is not assignable to "ShouldBeInvariant1[float]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:97:36 - error: Expression of type "ShouldBeInvariant1[float]" is incompatible with declared type "ShouldBeInvariant1[int]" -  "ShouldBeInvariant1[float]" is incompatible with "ShouldBeInvariant1[int]" +generics_variance_inference.py:97:36 - error: Type "ShouldBeInvariant1[float]" is not assignable to declared type "ShouldBeInvariant1[int]" +  "ShouldBeInvariant1[float]" is not assignable to "ShouldBeInvariant1[int]"     Type parameter "T@ShouldBeInvariant1" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:111:38 - error: Expression of type "ShouldBeInvariant2[int]" is incompatible with declared type "ShouldBeInvariant2[float]" -  "ShouldBeInvariant2[int]" is incompatible with "ShouldBeInvariant2[float]" +generics_variance_inference.py:111:38 - error: Type "ShouldBeInvariant2[int]" is not assignable to declared type "ShouldBeInvariant2[float]" +  "ShouldBeInvariant2[int]" is not assignable to "ShouldBeInvariant2[float]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:112:36 - error: Expression of type "ShouldBeInvariant2[float]" is incompatible with declared type "ShouldBeInvariant2[int]" -  "ShouldBeInvariant2[float]" is incompatible with "ShouldBeInvariant2[int]" +generics_variance_inference.py:112:36 - error: Type "ShouldBeInvariant2[float]" is not assignable to declared type "ShouldBeInvariant2[int]" +  "ShouldBeInvariant2[float]" is not assignable to "ShouldBeInvariant2[int]"     Type parameter "T@ShouldBeInvariant2" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:119:43 - error: Expression of type "ShouldBeInvariant3[int, str]" is incompatible with declared type "ShouldBeInvariant3[float, str]" -  "ShouldBeInvariant3[int, str]" is incompatible with "ShouldBeInvariant3[float, str]" +generics_variance_inference.py:119:43 - error: Type "ShouldBeInvariant3[int, str]" is not assignable to declared type "ShouldBeInvariant3[float, str]" +  "ShouldBeInvariant3[int, str]" is not assignable to "ShouldBeInvariant3[float, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:120:41 - error: Expression of type "ShouldBeInvariant3[float, str]" is incompatible with declared type "ShouldBeInvariant3[int, str]" -  "ShouldBeInvariant3[float, str]" is incompatible with "ShouldBeInvariant3[int, str]" +generics_variance_inference.py:120:41 - error: Type "ShouldBeInvariant3[float, str]" is not assignable to declared type "ShouldBeInvariant3[int, str]" +  "ShouldBeInvariant3[float, str]" is not assignable to "ShouldBeInvariant3[int, str]"     Type parameter "K@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:121:43 - error: Expression of type "ShouldBeInvariant3[str, int]" is incompatible with declared type "ShouldBeInvariant3[str, float]" -  "ShouldBeInvariant3[str, int]" is incompatible with "ShouldBeInvariant3[str, float]" +generics_variance_inference.py:121:43 - error: Type "ShouldBeInvariant3[str, int]" is not assignable to declared type "ShouldBeInvariant3[str, float]" +  "ShouldBeInvariant3[str, int]" is not assignable to "ShouldBeInvariant3[str, float]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:122:41 - error: Expression of type "ShouldBeInvariant3[str, float]" is incompatible with declared type "ShouldBeInvariant3[str, int]" -  "ShouldBeInvariant3[str, float]" is incompatible with "ShouldBeInvariant3[str, int]" +generics_variance_inference.py:122:41 - error: Type "ShouldBeInvariant3[str, float]" is not assignable to declared type "ShouldBeInvariant3[str, int]" +  "ShouldBeInvariant3[str, float]" is not assignable to "ShouldBeInvariant3[str, int]"     Type parameter "V@ShouldBeInvariant3" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:130:38 - error: Expression of type "ShouldBeInvariant4[int]" is incompatible with declared type "ShouldBeInvariant4[float]" -  "ShouldBeInvariant4[int]" is incompatible with "ShouldBeInvariant4[float]" +generics_variance_inference.py:130:38 - error: Type "ShouldBeInvariant4[int]" is not assignable to declared type "ShouldBeInvariant4[float]" +  "ShouldBeInvariant4[int]" is not assignable to "ShouldBeInvariant4[float]"     Type parameter "T@ShouldBeInvariant4" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:138:38 - error: Expression of type "ShouldBeInvariant5[int]" is incompatible with declared type "ShouldBeInvariant5[float]" -  "ShouldBeInvariant5[int]" is incompatible with "ShouldBeInvariant5[float]" +generics_variance_inference.py:138:38 - error: Type "ShouldBeInvariant5[int]" is not assignable to declared type "ShouldBeInvariant5[float]" +  "ShouldBeInvariant5[int]" is not assignable to "ShouldBeInvariant5[float]"     Type parameter "T@ShouldBeInvariant5" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:149:45 - error: Expression of type "ShouldBeContravariant1[int]" is incompatible with declared type "ShouldBeContravariant1[float]" -  "ShouldBeContravariant1[int]" is incompatible with "ShouldBeContravariant1[float]" +generics_variance_inference.py:149:45 - error: Type "ShouldBeContravariant1[int]" is not assignable to declared type "ShouldBeContravariant1[float]" +  "ShouldBeContravariant1[int]" is not assignable to "ShouldBeContravariant1[float]"     Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:169:31 - error: Expression of type "ShouldBeInvariant6[float]" is incompatible with declared type "ShouldBeInvariant6[int]" -  "ShouldBeInvariant6[float]" is incompatible with "ShouldBeInvariant6[int]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:169:31 - error: Type "ShouldBeInvariant6[float]" is not assignable to declared type "ShouldBeInvariant6[int]" +  "ShouldBeInvariant6[float]" is not assignable to "ShouldBeInvariant6[int]"     Type parameter "T@ShouldBeInvariant6" is invariant, but "float" is not the same as "int" (reportAssignmentType) -generics_variance_inference.py:170:33 - error: Expression of type "ShouldBeInvariant6[int]" is incompatible with declared type "ShouldBeInvariant6[float]" -  "ShouldBeInvariant6[int]" is incompatible with "ShouldBeInvariant6[float]" +generics_variance_inference.py:170:33 - error: Type "ShouldBeInvariant6[int]" is not assignable to declared type "ShouldBeInvariant6[float]" +  "ShouldBeInvariant6[int]" is not assignable to "ShouldBeInvariant6[float]"     Type parameter "T@ShouldBeInvariant6" is invariant, but "int" is not the same as "float" (reportAssignmentType) -generics_variance_inference.py:181:31 - error: Expression of type "ShouldBeCovariant6[float]" is incompatible with declared type "ShouldBeCovariant6[int]" -  "ShouldBeCovariant6[float]" is incompatible with "ShouldBeCovariant6[int]" +generics_variance_inference.py:181:31 - error: Type "ShouldBeCovariant6[float]" is not assignable to declared type "ShouldBeCovariant6[int]" +  "ShouldBeCovariant6[float]" is not assignable to "ShouldBeCovariant6[int]"     Type parameter "T@ShouldBeCovariant6" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -generics_variance_inference.py:194:37 - error: Expression of type "ShouldBeContravariant2[int]" is incompatible with declared type "ShouldBeContravariant2[float]" -  "ShouldBeContravariant2[int]" is incompatible with "ShouldBeContravariant2[float]" +      "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:194:37 - error: Type "ShouldBeContravariant2[int]" is not assignable to declared type "ShouldBeContravariant2[float]" +  "ShouldBeContravariant2[int]" is not assignable to "ShouldBeContravariant2[float]"     Type parameter "T@ShouldBeContravariant2" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) +      "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 66: Unexpected errors ['generics_variance_inference.py:66:36 - error: Type "ShouldBeCovariant4[int]" is not assignable to declared type "ShouldBeCovariant4[float]"'] """ diff --git a/conformance/results/pyright/literals_literalstring.toml b/conformance/results/pyright/literals_literalstring.toml index 7c1778de..2146bdb4 100644 --- a/conformance/results/pyright/literals_literalstring.toml +++ b/conformance/results/pyright/literals_literalstring.toml @@ -2,22 +2,22 @@ conformant = "Pass" output = """ literals_literalstring.py:36:29 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_literalstring.py:37:22 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_literalstring.py:43:23 - error: Expression of type "Literal['two']" is incompatible with declared type "Literal['']" -  "Literal['two']" is incompatible with type "Literal['']" (reportAssignmentType) -literals_literalstring.py:66:25 - error: Expression of type "str" is incompatible with declared type "LiteralString" -  "str" is incompatible with "LiteralString" (reportAssignmentType) -literals_literalstring.py:74:25 - error: Expression of type "Literal[3]" is incompatible with declared type "LiteralString" -  "Literal[3]" is incompatible with "LiteralString" (reportAssignmentType) -literals_literalstring.py:75:25 - error: Expression of type "Literal[b"test"]" is incompatible with declared type "LiteralString" -  "Literal[b"test"]" is incompatible with "LiteralString" (reportAssignmentType) +literals_literalstring.py:43:23 - error: Type "Literal['two']" is not assignable to declared type "Literal['']" +  "Literal['two']" is not assignable to type "Literal['']" (reportAssignmentType) +literals_literalstring.py:66:25 - error: Type "str" is not assignable to declared type "LiteralString" +  "str" is not assignable to "LiteralString" (reportAssignmentType) +literals_literalstring.py:74:25 - error: Type "Literal[3]" is not assignable to declared type "LiteralString" +  "Literal[3]" is not assignable to "LiteralString" (reportAssignmentType) +literals_literalstring.py:75:25 - error: Type "Literal[b"test"]" is not assignable to declared type "LiteralString" +  "Literal[b"test"]" is not assignable to "LiteralString" (reportAssignmentType) literals_literalstring.py:120:22 - error: Argument of type "str" cannot be assigned to parameter "s" of type "TLiteral@literal_identity" in function "literal_identity" -  Type "str" is incompatible with type "LiteralString" -    "str" is incompatible with "LiteralString" (reportArgumentType) +  Type "str" is not assignable to type "LiteralString" +    "str" is not assignable to "LiteralString" (reportArgumentType) literals_literalstring.py:134:51 - error: Argument of type "str" cannot be assigned to parameter "value" of type "T@Container" in function "__init__" -  Type "str" is incompatible with type "LiteralString" -    "str" is incompatible with "LiteralString" (reportArgumentType) -literals_literalstring.py:171:21 - error: Expression of type "list[LiteralString]" is incompatible with declared type "list[str]" -  "list[LiteralString]" is incompatible with "list[str]" +  Type "str" is not assignable to type "LiteralString" +    "str" is not assignable to "LiteralString" (reportArgumentType) +literals_literalstring.py:171:21 - error: Type "list[LiteralString]" is not assignable to declared type "list[str]" +  "list[LiteralString]" is not assignable to "list[str]"     Type parameter "_T@list" is invariant, but "LiteralString" is not the same as "str"     Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) """ diff --git a/conformance/results/pyright/literals_parameterizations.toml b/conformance/results/pyright/literals_parameterizations.toml index 16811ca1..bad4ec5e 100644 --- a/conformance/results/pyright/literals_parameterizations.toml +++ b/conformance/results/pyright/literals_parameterizations.toml @@ -1,31 +1,31 @@ conformant = "Pass" output = """ -literals_parameterizations.py:41:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:41:15 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:41:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:42:15 - error: Call expression not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:42:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:43:15 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:43:15 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:43:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:44:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:44:15 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:44:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:45:15 - error: Unary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:45:15 - error: Unary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:45:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:46:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:47:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:48:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:49:15 - error: Variable not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:49:15 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:50:16 - error: Type variable "T" has no meaning in this context (reportGeneralTypeIssues) literals_parameterizations.py:50:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:51:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:52:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) +literals_parameterizations.py:53:16 - error: "..." is not allowed in this context (reportInvalidTypeForm) literals_parameterizations.py:53:16 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:56:28 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) +literals_parameterizations.py:56:28 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) literals_parameterizations.py:56:28 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) literals_parameterizations.py:60:4 - error: "Literal" cannot be used in this context without a type argument (reportInvalidTypeForm) literals_parameterizations.py:61:12 - error: Type arguments for "Literal" must be None, a literal value (int, bool, str, or bytes), or an enum value (reportInvalidTypeForm) -literals_parameterizations.py:65:32 - error: Expression of type "Literal[Color.RED]" is incompatible with declared type "Literal['Color.RED']" -  "Literal[Color.RED]" is incompatible with type "Literal['Color.RED']" (reportAssignmentType) +literals_parameterizations.py:65:32 - error: Type "Literal[Color.RED]" is not assignable to declared type "Literal['Color.RED']" +  "Literal[Color.RED]" is not assignable to "Literal['Color.RED']" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/literals_semantics.toml b/conformance/results/pyright/literals_semantics.toml index 2606d3f0..7d8b8af5 100644 --- a/conformance/results/pyright/literals_semantics.toml +++ b/conformance/results/pyright/literals_semantics.toml @@ -1,12 +1,17 @@ conformant = "Pass" output = """ -literals_semantics.py:10:18 - error: Expression of type "Literal[4]" is incompatible with declared type "Literal[3]" -  "Literal[4]" is incompatible with type "Literal[3]" (reportAssignmentType) -literals_semantics.py:24:26 - error: Expression of type "Literal[0]" is incompatible with declared type "Literal[False]" -  "Literal[0]" is incompatible with type "Literal[False]" (reportAssignmentType) -literals_semantics.py:25:22 - error: Expression of type "Literal[False]" is incompatible with declared type "Literal[0]" -  "Literal[False]" is incompatible with type "Literal[0]" (reportAssignmentType) -literals_semantics.py:33:10 - error: Expression of type "Literal[6, 7, 8]" is incompatible with declared type "Literal[3, 4, 5]" (reportAssignmentType) +literals_semantics.py:10:18 - error: Type "Literal[4]" is not assignable to declared type "Literal[3]" +  "Literal[4]" is not assignable to type "Literal[3]" (reportAssignmentType) +literals_semantics.py:24:26 - error: Type "Literal[0]" is not assignable to declared type "Literal[False]" +  "Literal[0]" is not assignable to "Literal[False]" (reportAssignmentType) +literals_semantics.py:25:22 - error: Type "Literal[False]" is not assignable to declared type "Literal[0]" +  "Literal[False]" is not assignable to "Literal[0]" (reportAssignmentType) +literals_semantics.py:33:10 - error: Type "Literal[6, 7, 8]" is not assignable to declared type "Literal[3, 4, 5]" +  Type "Literal[6, 7, 8]" is not assignable to type "Literal[3, 4, 5]" +    Type "Literal[6]" is not assignable to type "Literal[3, 4, 5]" +      "Literal[6]" is not assignable to type "Literal[3]" +      "Literal[6]" is not assignable to type "Literal[4]" +      "Literal[6]" is not assignable to type "Literal[5]" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/namedtuples_define_class.toml b/conformance/results/pyright/namedtuples_define_class.toml index 2da523d9..19f9aadc 100644 --- a/conformance/results/pyright/namedtuples_define_class.toml +++ b/conformance/results/pyright/namedtuples_define_class.toml @@ -5,15 +5,15 @@ namedtuples_define_class.py:33:7 - error: Index -4 is out of range for type Poin namedtuples_define_class.py:44:6 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_class.py:45:6 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_class.py:46:15 - error: Argument of type "Literal['']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) namedtuples_define_class.py:47:24 - error: Argument of type "Literal[3]" cannot be assigned to parameter "units" of type "str" in function "__new__" -  "Literal[3]" is incompatible with "str" (reportArgumentType) +  "Literal[3]" is not assignable to "str" (reportArgumentType) namedtuples_define_class.py:48:22 - error: Expected 3 positional arguments (reportCallIssue) namedtuples_define_class.py:49:23 - error: No parameter named "other" (reportCallIssue) namedtuples_define_class.py:59:5 - error: Fields without default values cannot appear after fields with default values (reportGeneralTypeIssues) namedtuples_define_class.py:79:5 - error: Cannot override "x" because parent class "Point" is a named tuple (reportIncompatibleVariableOverride) namedtuples_define_class.py:98:19 - error: Argument of type "float" cannot be assigned to parameter "value" of type "str" in function "__new__" -  "float" is incompatible with "str" (reportArgumentType) +  "float" is not assignable to "str" (reportArgumentType) namedtuples_define_class.py:105:7 - error: Multiple inheritance with NamedTuple is not supported (reportGeneralTypeIssues) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/namedtuples_define_functional.toml b/conformance/results/pyright/namedtuples_define_functional.toml index c76f18e8..07c43204 100644 --- a/conformance/results/pyright/namedtuples_define_functional.toml +++ b/conformance/results/pyright/namedtuples_define_functional.toml @@ -6,12 +6,12 @@ namedtuples_define_functional.py:26:21 - error: Expected 2 positional arguments namedtuples_define_functional.py:31:8 - error: Argument missing for parameter "y" (reportCallIssue) namedtuples_define_functional.py:31:18 - error: No parameter named "z" (reportCallIssue) namedtuples_define_functional.py:36:18 - error: Argument of type "Literal['1']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['1']" is incompatible with "int" (reportArgumentType) +  "Literal['1']" is not assignable to "int" (reportArgumentType) namedtuples_define_functional.py:37:21 - error: Expected 2 positional arguments (reportCallIssue) namedtuples_define_functional.py:42:18 - error: Argument of type "Literal['1']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['1']" is incompatible with "int" (reportArgumentType) +  "Literal['1']" is not assignable to "int" (reportArgumentType) namedtuples_define_functional.py:43:17 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__new__" -  "float" is incompatible with "int" (reportArgumentType) +  "float" is not assignable to "int" (reportArgumentType) namedtuples_define_functional.py:52:31 - error: Names within a named tuple must be unique (reportGeneralTypeIssues) namedtuples_define_functional.py:53:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) namedtuples_define_functional.py:54:33 - error: Field names cannot be a keyword (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/namedtuples_type_compat.toml b/conformance/results/pyright/namedtuples_type_compat.toml index aa8f69e6..c31192fc 100644 --- a/conformance/results/pyright/namedtuples_type_compat.toml +++ b/conformance/results/pyright/namedtuples_type_compat.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ -namedtuples_type_compat.py:22:23 - error: Expression of type "Point" is incompatible with declared type "tuple[int, int]" -  "Point" is incompatible with "tuple[int, int]" +namedtuples_type_compat.py:22:23 - error: Type "Point" is not assignable to declared type "tuple[int, int]" +  "Point" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 3 (reportAssignmentType) -namedtuples_type_compat.py:23:28 - error: Expression of type "Point" is incompatible with declared type "tuple[int, str, str]" -  "Point" is incompatible with "tuple[int, str, str]" +namedtuples_type_compat.py:23:28 - error: Type "Point" is not assignable to declared type "tuple[int, str, str]" +  "Point" is not assignable to "tuple[int, str, str]"     Tuple entry 2 is incorrect type -      "int" is incompatible with "str" (reportAssignmentType) +      "int" is not assignable to "str" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/namedtuples_usage.toml b/conformance/results/pyright/namedtuples_usage.toml index 693e8c38..76f53162 100644 --- a/conformance/results/pyright/namedtuples_usage.toml +++ b/conformance/results/pyright/namedtuples_usage.toml @@ -3,12 +3,10 @@ output = """ namedtuples_usage.py:34:7 - error: Index 3 is out of range for type Point (reportGeneralTypeIssues) namedtuples_usage.py:35:7 - error: Index -4 is out of range for type Point (reportGeneralTypeIssues) namedtuples_usage.py:40:3 - error: Cannot assign to attribute "x" for class "Point" -  Attribute "x" is read-only -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "x" is read-only (reportAttributeAccessIssue) namedtuples_usage.py:41:1 - error: "__setitem__" method not defined on type "Point" (reportIndexIssue) namedtuples_usage.py:42:7 - error: Cannot delete attribute "x" for class "Point" -  Attribute "x" is read-only -    Attribute "__delete__" is unknown (reportAttributeAccessIssue) +  Attribute "x" is read-only (reportAttributeAccessIssue) namedtuples_usage.py:43:5 - error: "__delitem__" method not defined on type "Point" (reportIndexIssue) namedtuples_usage.py:52:1 - error: Expression with type "Point" cannot be assigned to target tuple   Type "Point" is incompatible with target tuple diff --git a/conformance/results/pyright/narrowing_typeguard.toml b/conformance/results/pyright/narrowing_typeguard.toml index ecab9585..a363ec8f 100644 --- a/conformance/results/pyright/narrowing_typeguard.toml +++ b/conformance/results/pyright/narrowing_typeguard.toml @@ -3,15 +3,15 @@ output = """ narrowing_typeguard.py:102:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeguard.py:107:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeguard.py:128:20 - error: Argument of type "(val: object) -> TypeGuard[int]" cannot be assigned to parameter "f" of type "(object) -> str" in function "takes_callable_str" -  Type "(val: object) -> TypeGuard[int]" is incompatible with type "(object) -> str" +  Type "(val: object) -> TypeGuard[int]" is not assignable to type "(object) -> str"     Function return type "TypeGuard[int]" is incompatible with type "str" -      "TypeGuard[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeGuard[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) narrowing_typeguard.py:148:26 - error: Argument of type "(val: object) -> TypeGuard[int]" cannot be assigned to parameter "f" of type "CallableStrProto" in function "takes_callable_str_proto" -  Type "(val: object) -> TypeGuard[int]" is incompatible with type "(val: object) -> str" +  Type "(val: object) -> TypeGuard[int]" is not assignable to type "(val: object) -> str"     Function return type "TypeGuard[int]" is incompatible with type "str" -      "TypeGuard[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeGuard[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/narrowing_typeis.toml b/conformance/results/pyright/narrowing_typeis.toml index 731a636e..ca6a42a9 100644 --- a/conformance/results/pyright/narrowing_typeis.toml +++ b/conformance/results/pyright/narrowing_typeis.toml @@ -6,31 +6,31 @@ output = """ narrowing_typeis.py:105:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeis.py:110:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) narrowing_typeis.py:132:20 - error: Argument of type "(val: object) -> TypeIs[int]" cannot be assigned to parameter "f" of type "(object) -> str" in function "takes_callable_str" -  Type "(val: object) -> TypeIs[int]" is incompatible with type "(object) -> str" +  Type "(val: object) -> TypeIs[int]" is not assignable to type "(object) -> str"     Function return type "TypeIs[int]" is incompatible with type "str" -      "TypeIs[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeIs[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) narrowing_typeis.py:152:26 - error: Argument of type "(val: object) -> TypeIs[int]" cannot be assigned to parameter "f" of type "CallableStrProto" in function "takes_callable_str_proto" -  Type "(val: object) -> TypeIs[int]" is incompatible with type "(val: object) -> str" +  Type "(val: object) -> TypeIs[int]" is not assignable to type "(val: object) -> str"     Function return type "TypeIs[int]" is incompatible with type "str" -      "TypeIs[int]" is incompatible with "str" -      "bool" is incompatible with "str" (reportArgumentType) +      "TypeIs[int]" is not assignable to "str" +      "bool" is not assignable to "str" (reportArgumentType) narrowing_typeis.py:169:17 - error: Argument of type "(val: object) -> TypeIs[int]" cannot be assigned to parameter "f" of type "(object) -> TypeGuard[int]" in function "takes_typeguard" -  Type "(val: object) -> TypeIs[int]" is incompatible with type "(object) -> TypeGuard[int]" +  Type "(val: object) -> TypeIs[int]" is not assignable to type "(object) -> TypeGuard[int]"     Function return type "TypeIs[int]" is incompatible with type "TypeGuard[int]" -      "TypeIs[int]" is incompatible with "TypeGuard[int]" -      "bool" is incompatible with "TypeGuard[int]" (reportArgumentType) +      "TypeIs[int]" is not assignable to "TypeGuard[int]" +      "bool" is not assignable to "TypeGuard[int]" (reportArgumentType) narrowing_typeis.py:170:14 - error: Argument of type "(val: object) -> TypeGuard[int]" cannot be assigned to parameter "f" of type "(object) -> TypeIs[int]" in function "takes_typeis" -  Type "(val: object) -> TypeGuard[int]" is incompatible with type "(object) -> TypeIs[int]" +  Type "(val: object) -> TypeGuard[int]" is not assignable to type "(object) -> TypeIs[int]"     Function return type "TypeGuard[int]" is incompatible with type "TypeIs[int]" -      "TypeGuard[int]" is incompatible with "TypeIs[int]" -      "bool" is incompatible with "TypeIs[int]" (reportArgumentType) +      "TypeGuard[int]" is not assignable to "TypeIs[int]" +      "bool" is not assignable to "TypeIs[int]" (reportArgumentType) narrowing_typeis.py:191:18 - error: Argument of type "(val: object) -> TypeIs[bool]" cannot be assigned to parameter "f" of type "(object) -> TypeIs[int]" in function "takes_int_typeis" -  Type "(val: object) -> TypeIs[bool]" is incompatible with type "(object) -> TypeIs[int]" +  Type "(val: object) -> TypeIs[bool]" is not assignable to type "(object) -> TypeIs[int]"     Function return type "TypeIs[bool]" is incompatible with type "TypeIs[int]" -      "TypeIs[bool]" is incompatible with "TypeIs[int]" +      "TypeIs[bool]" is not assignable to "TypeIs[int]"         Type parameter "T@TypeIs" is invariant, but "bool" is not the same as "int" -      "bool" is incompatible with "TypeIs[int]" (reportArgumentType) +      "bool" is not assignable to "TypeIs[int]" (reportArgumentType) narrowing_typeis.py:195:27 - error: Return type of TypeIs ("str") is not consistent with value parameter type ("int") (reportGeneralTypeIssues) narrowing_typeis.py:199:45 - error: Return type of TypeIs ("list[int]") is not consistent with value parameter type ("list[object]") (reportGeneralTypeIssues) """ diff --git a/conformance/results/pyright/overloads_basic.toml b/conformance/results/pyright/overloads_basic.toml index a4f03e2f..b4148bcc 100644 --- a/conformance/results/pyright/overloads_basic.toml +++ b/conformance/results/pyright/overloads_basic.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ overloads_basic.py:37:1 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue) overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice" in function "__getitem__" -  "Literal['']" is incompatible with "slice" (reportArgumentType) +  "Literal['']" is not assignable to "slice" (reportArgumentType) overloads_basic.py:63:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) overloads_basic.py:75:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) """ diff --git a/conformance/results/pyright/protocols_class_objects.toml b/conformance/results/pyright/protocols_class_objects.toml index 47e31dab..2c3bfe0f 100644 --- a/conformance/results/pyright/protocols_class_objects.toml +++ b/conformance/results/pyright/protocols_class_objects.toml @@ -2,27 +2,27 @@ conformant = "Pass" output = """ protocols_class_objects.py:29:5 - error: Argument of type "type[Proto]" cannot be assigned to parameter "cls" of type "type[Proto]" in function "fun"   "Proto" is not a concrete class type and cannot be assigned to type "type[Proto]" (reportArgumentType) -protocols_class_objects.py:34:7 - error: Expression of type "type[Proto]" is incompatible with declared type "type[Proto]" +protocols_class_objects.py:34:7 - error: Type "type[Proto]" is not assignable to declared type "type[Proto]"   "Proto" is not a concrete class type and cannot be assigned to type "type[Proto]" (reportAssignmentType) -protocols_class_objects.py:58:16 - error: Expression of type "type[ConcreteA]" is incompatible with declared type "ProtoA1" -  "type[type]" is incompatible with "type[ConcreteA]" -  "type[type]" is incompatible with "type[ConcreteA]" +protocols_class_objects.py:58:16 - error: Type "type[ConcreteA]" is not assignable to declared type "ProtoA1" +  "type[type]" is not assignable to "type[ConcreteA]" +  "type[type]" is not assignable to "type[ConcreteA]"   "method1" is an incompatible type -    Type "(self: ConcreteA, x: int) -> int" is incompatible with type "(x: int) -> int" +    Type "(self: ConcreteA, x: int) -> int" is not assignable to type "(x: int) -> int"       Parameter name mismatch: "x" versus "self"       Parameter 1: type "int" is incompatible with type "ConcreteA" -        "int" is incompatible with "ConcreteA" +        "int" is not assignable to "ConcreteA"       Extra parameter "x" (reportAssignmentType) -protocols_class_objects.py:74:16 - error: Expression of type "type[ConcreteB]" is incompatible with declared type "ProtoB1" +protocols_class_objects.py:74:16 - error: Type "type[ConcreteB]" is not assignable to declared type "ProtoB1"   "prop1" is an incompatible type -    "property" is incompatible with "int" (reportAssignmentType) -protocols_class_objects.py:104:16 - error: Expression of type "type[ConcreteC1]" is incompatible with declared type "ProtoC1" +    "property" is not assignable to "int" (reportAssignmentType) +protocols_class_objects.py:104:16 - error: Type "type[ConcreteC1]" is not assignable to declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:106:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:106:16 - error: Type "type[ConcreteC2]" is not assignable to declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_class_objects.py:107:16 - error: Expression of type "type[ConcreteC2]" is incompatible with declared type "ProtoC2" +protocols_class_objects.py:107:16 - error: Type "type[ConcreteC2]" is not assignable to declared type "ProtoC2"   "attr1" must be defined as a ClassVar to be compatible with protocol (reportAssignmentType) -protocols_class_objects.py:108:16 - error: Expression of type "type[ConcreteC3]" is incompatible with declared type "ProtoC1" +protocols_class_objects.py:108:16 - error: Type "type[ConcreteC3]" is not assignable to declared type "ProtoC1"   "attr1" is defined as a ClassVar in protocol (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index 23536ece..c27a3753 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -4,97 +4,99 @@ protocols_definition.py:30:12 - error: Argument of type "list[int]" cannot be as   "Literal[1]" is incompatible with protocol "SupportsClose"     "close" is not present (reportArgumentType) protocols_definition.py:67:14 - error: Instance or class variables within a Protocol class must be explicitly declared within the class body (reportGeneralTypeIssues) -protocols_definition.py:114:22 - error: Expression of type "Concrete2_Bad1" is incompatible with declared type "Template2" +protocols_definition.py:114:22 - error: Type "Concrete2_Bad1" is not assignable to declared type "Template2"   "Concrete2_Bad1" is incompatible with protocol "Template2"     "val1" is not present (reportAssignmentType) -protocols_definition.py:115:22 - error: Expression of type "Concrete2_Bad2" is incompatible with declared type "Template2" +protocols_definition.py:115:22 - error: Type "Concrete2_Bad2" is not assignable to declared type "Template2"   "Concrete2_Bad2" is incompatible with protocol "Template2"     "val1" is invariant because it is mutable     "val1" is an incompatible type     "val1" is defined as a ClassVar in protocol -      "Sequence[float]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:116:22 - error: Expression of type "Concrete2_Bad3" is incompatible with declared type "Template2" +      "Sequence[float]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:116:22 - error: Type "Concrete2_Bad3" is not assignable to declared type "Template2"   "Concrete2_Bad3" is incompatible with protocol "Template2"     "val1" is invariant because it is mutable     "val1" is an incompatible type     "val1" is defined as a ClassVar in protocol -      "list[int]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:117:22 - error: Expression of type "Concrete2_Bad4" is incompatible with declared type "Template2" +      "list[int]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:117:22 - error: Type "Concrete2_Bad4" is not assignable to declared type "Template2"   "Concrete2_Bad4" is incompatible with protocol "Template2"     "val1" is defined as a ClassVar in protocol (reportAssignmentType) -protocols_definition.py:156:22 - error: Expression of type "Concrete3_Bad1" is incompatible with declared type "Template3" +protocols_definition.py:156:22 - error: Type "Concrete3_Bad1" is not assignable to declared type "Template3"   "Concrete3_Bad1" is incompatible with protocol "Template3"     "val1" is not present (reportAssignmentType) -protocols_definition.py:157:22 - error: Expression of type "Concrete3_Bad2" is incompatible with declared type "Template3" +protocols_definition.py:157:22 - error: Type "Concrete3_Bad2" is not assignable to declared type "Template3"   "Concrete3_Bad2" is incompatible with protocol "Template3"     "val1" is not defined as a ClassVar in protocol (reportAssignmentType) -protocols_definition.py:158:22 - error: Expression of type "Concrete3_Bad3" is incompatible with declared type "Template3" +protocols_definition.py:158:22 - error: Type "Concrete3_Bad3" is not assignable to declared type "Template3"   "Concrete3_Bad3" is incompatible with protocol "Template3"     "val1" is invariant because it is mutable     "val1" is an incompatible type -      "property" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:159:22 - error: Expression of type "Concrete3_Bad4" is incompatible with declared type "Template3" +      "property" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:159:22 - error: Type "Concrete3_Bad4" is not assignable to declared type "Template3"   "Concrete3_Bad4" is incompatible with protocol "Template3"     "val1" is invariant because it is mutable     "val1" is an incompatible type -      "Sequence[float]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:160:22 - error: Expression of type "Concrete3_Bad5" is incompatible with declared type "Template3" +      "Sequence[float]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:160:22 - error: Type "Concrete3_Bad5" is not assignable to declared type "Template3"   "Concrete3_Bad5" is incompatible with protocol "Template3"     "val1" is invariant because it is mutable     "val1" is an incompatible type -      "list[int]" is incompatible with "Sequence[int]" (reportAssignmentType) -protocols_definition.py:218:22 - error: Expression of type "Concrete4_Bad1" is incompatible with declared type "Template4" +      "list[int]" is not assignable to "Sequence[int]" (reportAssignmentType) +protocols_definition.py:218:22 - error: Type "Concrete4_Bad1" is not assignable to declared type "Template4"   "Concrete4_Bad1" is incompatible with protocol "Template4"     "val1" is an incompatible type -      "function" is incompatible with "Sequence[float]" (reportAssignmentType) -protocols_definition.py:219:22 - error: Expression of type "Concrete4_Bad2" is incompatible with declared type "Template4" +      "function" is not assignable to "Sequence[float]" (reportAssignmentType) +protocols_definition.py:219:22 - error: Type "Concrete4_Bad2" is not assignable to declared type "Template4"   "Concrete4_Bad2" is incompatible with protocol "Template4"     "val1" is not present (reportAssignmentType) protocols_definition.py:276:17 - warning: Static methods should not take a "self" or "cls" parameter (reportSelfClsParameterName) -protocols_definition.py:285:22 - error: Expression of type "Concrete5_Bad1" is incompatible with declared type "Template5" +protocols_definition.py:285:22 - error: Type "Concrete5_Bad1" is not assignable to declared type "Template5"   "Concrete5_Bad1" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(a: Unknown, c: Unknown) -> int" is incompatible with type "(a: int, b: int) -> float" +      Type "(a: Unknown, c: Unknown) -> int" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "b" versus "c" (reportAssignmentType) -protocols_definition.py:286:22 - error: Expression of type "Concrete5_Bad2" is incompatible with declared type "Template5" +protocols_definition.py:286:22 - error: Type "Concrete5_Bad2" is not assignable to declared type "Template5"   "Concrete5_Bad2" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(a: int, c: int) -> int" is incompatible with type "(a: int, b: int) -> float" +      Type "(a: int, c: int) -> int" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "b" versus "c" (reportAssignmentType) -protocols_definition.py:287:22 - error: Expression of type "Concrete5_Bad3" is incompatible with declared type "Template5" +protocols_definition.py:287:22 - error: Type "Concrete5_Bad3" is not assignable to declared type "Template5"   "Concrete5_Bad3" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(*, a: int, b: int) -> float" is incompatible with type "(a: int, b: int) -> float" +      Type "(*, a: int, b: int) -> float" is not assignable to type "(a: int, b: int) -> float"         Function accepts too many positional parameters; expected 0 but received 2           Extra parameter "a"           Extra parameter "b" (reportAssignmentType) -protocols_definition.py:288:22 - error: Expression of type "Concrete5_Bad4" is incompatible with declared type "Template5" +protocols_definition.py:288:22 - error: Type "Concrete5_Bad4" is not assignable to declared type "Template5"   "Concrete5_Bad4" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(a: int, b: int, /) -> float" is incompatible with type "(a: int, b: int) -> float" +      Type "(a: int, b: int, /) -> float" is not assignable to type "(a: int, b: int) -> float"         Missing keyword parameter "a"         Missing keyword parameter "b"           Position-only parameter mismatch; parameter "a" is not position-only           Position-only parameter mismatch; parameter "b" is not position-only           Position-only parameter mismatch; expected 2 but received 0 (reportAssignmentType) -protocols_definition.py:289:22 - error: Expression of type "Concrete5_Bad5" is incompatible with declared type "Template5" +protocols_definition.py:289:22 - error: Type "Concrete5_Bad5" is not assignable to declared type "Template5"   "Concrete5_Bad5" is incompatible with protocol "Template5"     "method1" is an incompatible type -      Type "(self: Unknown, a: int, b: int) -> float" is incompatible with type "(a: int, b: int) -> float" +      Type "(self: Unknown, a: int, b: int) -> float" is not assignable to type "(a: int, b: int) -> float"         Parameter name mismatch: "a" versus "self"         Parameter name mismatch: "b" versus "a"         Extra parameter "b" (reportAssignmentType) -protocols_definition.py:339:22 - error: Expression of type "Concrete6_Bad1" is incompatible with declared type "Template6" +protocols_definition.py:339:22 - error: Type "Concrete6_Bad1" is not assignable to declared type "Template6"   "Concrete6_Bad1" is incompatible with protocol "Template6"     "val1" is an incompatible type       Property setter method is missing -        "Template6" is incompatible with "Concrete6_Bad1" (reportAssignmentType) -protocols_definition.py:340:22 - error: Expression of type "Concrete6_Bad2" is incompatible with declared type "Template6" +        "Template6" is not assignable to "Concrete6_Bad1" (reportAssignmentType) +protocols_definition.py:340:22 - error: Type "Concrete6_Bad2" is not assignable to declared type "Template6"   "Concrete6_Bad2" is incompatible with protocol "Template6" -    "val1" is writable in protocol (reportAssignmentType) -protocols_definition.py:341:22 - error: Expression of type "Concrete6_Bad3" is incompatible with declared type "Template6" +    "val1" is writable in protocol +    "val1" is not read-only in protocol (reportAssignmentType) +protocols_definition.py:341:22 - error: Type "Concrete6_Bad3" is not assignable to declared type "Template6"   "Concrete6_Bad3" is incompatible with protocol "Template6" -    "val1" is writable in protocol (reportAssignmentType) +    "val1" is writable in protocol +    "val1" is not read-only in protocol (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_explicit.toml b/conformance/results/pyright/protocols_explicit.toml index 4ee4fca0..cdb92691 100644 --- a/conformance/results/pyright/protocols_explicit.toml +++ b/conformance/results/pyright/protocols_explicit.toml @@ -2,13 +2,12 @@ conformant = "Pass" output = """ protocols_explicit.py:27:16 - error: Method "draw" cannot be called because it is abstract and unimplemented (reportAbstractUsage) protocols_explicit.py:56:32 - error: Cannot assign to attribute "rgb" for class "Point*" -  "str" is incompatible with "int" (reportAttributeAccessIssue) +  "str" is not assignable to "int" (reportAttributeAccessIssue) protocols_explicit.py:60:5 - error: Cannot instantiate abstract class "Point"   "RGB.intensity" is not implemented   "RGB.transparency" is not implemented (reportAbstractUsage) protocols_explicit.py:85:14 - error: Cannot assign to attribute "cm1" for class "Concrete1*" -  Attribute "cm1" cannot be assigned through a class instance because it is a ClassVar -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  Attribute "cm1" cannot be assigned through a class instance because it is a ClassVar (reportAttributeAccessIssue) protocols_explicit.py:135:6 - error: Cannot instantiate abstract class "Concrete5"   "Proto5.method1" is not implemented (reportAbstractUsage) protocols_explicit.py:165:7 - error: Cannot instantiate abstract class "Concrete7A" diff --git a/conformance/results/pyright/protocols_generic.toml b/conformance/results/pyright/protocols_generic.toml index 6e653d43..d15dd1ce 100644 --- a/conformance/results/pyright/protocols_generic.toml +++ b/conformance/results/pyright/protocols_generic.toml @@ -1,43 +1,61 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly generates type violation for protocol that uses method-scoped type variables. +""" output = """ -protocols_generic.py:40:24 - error: Expression of type "Concrete1" is incompatible with declared type "Proto1[int, str]" +protocols_generic.py:40:24 - error: Type "Concrete1" is not assignable to declared type "Proto1[int, str]"   "Concrete1" is incompatible with protocol "Proto1[int, str]"     "method1" is an incompatible type -      Type "(x: str) -> str" is incompatible with type "(x: S@Proto1) -> S@Proto1" +      Type "(x: str) -> str" is not assignable to type "(x: S@Proto1) -> S@Proto1"         Parameter 1: type "S@Proto1" is incompatible with type "str" -          "int" is incompatible with "str" +          "int" is not assignable to "str"         Function return type "str" is incompatible with type "S@Proto1" -          Type "int | str" is incompatible with type "int" +          Type "int | str" is not assignable to type "int"     "__iter__" is an incompatible type ... (reportAssignmentType) protocols_generic.py:44:30 - error: Only one Generic[...] or Protocol[...] base class allowed (reportGeneralTypeIssues) -protocols_generic.py:56:20 - error: Expression of type "Box[float]" is incompatible with declared type "Box[int]" -  "Box[float]" is incompatible with "Box[int]" +protocols_generic.py:56:20 - error: Type "Box[float]" is not assignable to declared type "Box[int]" +  "Box[float]" is not assignable to "Box[int]"     Type parameter "T_co@Box" is covariant, but "float" is not a subtype of "int" -      "float" is incompatible with "int" (reportAssignmentType) -protocols_generic.py:66:25 - error: Expression of type "Sender[int]" is incompatible with declared type "Sender[float]" -  "Sender[int]" is incompatible with "Sender[float]" +      "float" is not assignable to "int" (reportAssignmentType) +protocols_generic.py:66:25 - error: Type "Sender[int]" is not assignable to declared type "Sender[float]" +  "Sender[int]" is not assignable to "Sender[float]"     Type parameter "T_contra@Sender" is contravariant, but "int" is not a supertype of "float" -      "float" is incompatible with "int" (reportAssignmentType) -protocols_generic.py:74:28 - error: Expression of type "AttrProto[int]" is incompatible with declared type "AttrProto[float]" -  "AttrProto[int]" is incompatible with "AttrProto[float]" +      "float" is not assignable to "int" (reportAssignmentType) +protocols_generic.py:74:28 - error: Type "AttrProto[int]" is not assignable to declared type "AttrProto[float]" +  "AttrProto[int]" is not assignable to "AttrProto[float]"     Type parameter "T@AttrProto" is invariant, but "int" is not the same as "float" (reportAssignmentType) -protocols_generic.py:75:26 - error: Expression of type "AttrProto[float]" is incompatible with declared type "AttrProto[int]" -  "AttrProto[float]" is incompatible with "AttrProto[int]" +protocols_generic.py:75:26 - error: Type "AttrProto[float]" is not assignable to declared type "AttrProto[int]" +  "AttrProto[float]" is not assignable to "AttrProto[int]"     Type parameter "T@AttrProto" is invariant, but "float" is not the same as "int" (reportAssignmentType) -protocols_generic.py:146:25 - error: Expression of type "ConcreteHasProperty3" is incompatible with declared type "HasPropertyProto" +protocols_generic.py:145:25 - error: Type "ConcreteHasProperty2" is not assignable to declared type "HasPropertyProto" +  "ConcreteHasProperty2" is incompatible with protocol "HasPropertyProto" +    "m" is an incompatible type +      Type "(item: int, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" +        Parameter 1: type "T@m" is incompatible with type "int" +          "object*" is not assignable to "int" +        Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str" +          Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) +protocols_generic.py:146:25 - error: Type "ConcreteHasProperty3" is not assignable to declared type "HasPropertyProto"   "ConcreteHasProperty3" is incompatible with protocol "HasPropertyProto"     "f" is an incompatible type -      Type "() -> int" is incompatible with type "() -> HasPropertyProto" +      Type "() -> int" is not assignable to type "() -> HasPropertyProto"         Function return type "int" is incompatible with type "HasPropertyProto" -          "int" is incompatible with protocol "HasPropertyProto" (reportAssignmentType) -protocols_generic.py:147:25 - error: Expression of type "ConcreteHasProperty4" is incompatible with declared type "HasPropertyProto" +          "int" is incompatible with protocol "HasPropertyProto" +    "m" is an incompatible type +      Type "(item: int, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" +        Parameter 1: type "T@m" is incompatible with type "int" + ... (reportAssignmentType) +protocols_generic.py:147:25 - error: Type "ConcreteHasProperty4" is not assignable to declared type "HasPropertyProto"   "ConcreteHasProperty4" is incompatible with protocol "HasPropertyProto"     "m" is an incompatible type -      Type "(item: str, callback: (int) -> str) -> str" is incompatible with type "(item: T@m, callback: (T@m) -> str) -> str" +      Type "(item: str, callback: (int) -> str) -> str" is not assignable to type "(item: T@m, callback: (T@m) -> str) -> str" +        Parameter 1: type "T@m" is incompatible with type "str" +          "object*" is not assignable to "str"         Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str" -          Type "(str) -> str" is incompatible with type "(int) -> str" (reportAssignmentType) +          Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 145: Unexpected errors ['protocols_generic.py:145:25 - error: Type "ConcreteHasProperty2" is not assignable to declared type "HasPropertyProto"'] """ diff --git a/conformance/results/pyright/protocols_merging.toml b/conformance/results/pyright/protocols_merging.toml index cb43e377..1baa74a7 100644 --- a/conformance/results/pyright/protocols_merging.toml +++ b/conformance/results/pyright/protocols_merging.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -protocols_merging.py:52:25 - error: Expression of type "SCConcrete2" is incompatible with declared type "SizedAndClosable1" +protocols_merging.py:52:25 - error: Type "SCConcrete2" is not assignable to declared type "SizedAndClosable1"   "SCConcrete2" is incompatible with protocol "SizedAndClosable1"     "__len__" is not present (reportAssignmentType) -protocols_merging.py:53:25 - error: Expression of type "SCConcrete2" is incompatible with declared type "SizedAndClosable2" +protocols_merging.py:53:25 - error: Type "SCConcrete2" is not assignable to declared type "SizedAndClosable2"   "SCConcrete2" is incompatible with protocol "SizedAndClosable2"     "__len__" is not present (reportAssignmentType) -protocols_merging.py:54:25 - error: Expression of type "SCConcrete2" is incompatible with declared type "SizedAndClosable3" -  "SCConcrete2" is incompatible with "SizedAndClosable3" (reportAssignmentType) -protocols_merging.py:67:16 - error: Protocol class "BadProto" cannot derive from non-protocol class "SizedAndClosable3" (reportGeneralTypeIssues) +protocols_merging.py:54:25 - error: Type "SCConcrete2" is not assignable to declared type "SizedAndClosable3" +  "SCConcrete2" is not assignable to "SizedAndClosable3" (reportAssignmentType) +protocols_merging.py:67:16 - error: Protocol class "BadProto" cannot derive from non-Protocol class "SizedAndClosable3" (reportGeneralTypeIssues) protocols_merging.py:82:5 - error: Cannot instantiate abstract class "SizedAndClosable4"   "SizedAndClosable4.close" is not implemented (reportAbstractUsage) -protocols_merging.py:83:24 - error: Expression of type "SCConcrete1" is incompatible with declared type "SizedAndClosable4" -  "SCConcrete1" is incompatible with "SizedAndClosable4" (reportAssignmentType) +protocols_merging.py:83:24 - error: Type "SCConcrete1" is not assignable to declared type "SizedAndClosable4" +  "SCConcrete1" is not assignable to "SizedAndClosable4" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_modules.toml b/conformance/results/pyright/protocols_modules.toml index 646b6ba1..570cd977 100644 --- a/conformance/results/pyright/protocols_modules.toml +++ b/conformance/results/pyright/protocols_modules.toml @@ -1,15 +1,15 @@ conformant = "Pass" output = """ -protocols_modules.py:26:17 - error: Expression of type "Module("_protocols_modules1")" is incompatible with declared type "Options2" +protocols_modules.py:26:17 - error: Type "Module("_protocols_modules1")" is not assignable to declared type "Options2"   "timeout" is invariant because it is mutable   "timeout" is an incompatible type -    "int" is incompatible with "str" (reportAssignmentType) -protocols_modules.py:48:18 - error: Expression of type "Module("_protocols_modules2")" is incompatible with declared type "Reporter2" +    "int" is not assignable to "str" (reportAssignmentType) +protocols_modules.py:48:18 - error: Type "Module("_protocols_modules2")" is not assignable to declared type "Reporter2"   "on_error" is an incompatible type -    Type "(x: int) -> None" is incompatible with type "(x: int) -> int" +    Type "(x: int) -> None" is not assignable to type "(x: int) -> int"       Function return type "None" is incompatible with type "int" -        "None" is incompatible with "int" (reportAssignmentType) -protocols_modules.py:49:18 - error: Expression of type "Module("_protocols_modules2")" is incompatible with declared type "Reporter3" +        "None" is not assignable to "int" (reportAssignmentType) +protocols_modules.py:49:18 - error: Type "Module("_protocols_modules2")" is not assignable to declared type "Reporter3"   "not_implemented" is not present (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/protocols_subtyping.toml b/conformance/results/pyright/protocols_subtyping.toml index a7b394f5..84a70f74 100644 --- a/conformance/results/pyright/protocols_subtyping.toml +++ b/conformance/results/pyright/protocols_subtyping.toml @@ -1,37 +1,37 @@ conformant = "Pass" output = """ -protocols_subtyping.py:16:6 - error: Cannot instantiate protocol class "Proto1" (reportAbstractUsage) -protocols_subtyping.py:38:21 - error: Expression of type "Proto2" is incompatible with declared type "Concrete2" -  "Proto2" is incompatible with "Concrete2" (reportAssignmentType) -protocols_subtyping.py:55:18 - error: Expression of type "Proto2" is incompatible with declared type "Proto3" +protocols_subtyping.py:16:6 - error: Cannot instantiate Protocol class "Proto1" (reportAbstractUsage) +protocols_subtyping.py:38:21 - error: Type "Proto2" is not assignable to declared type "Concrete2" +  "Proto2" is not assignable to "Concrete2" (reportAssignmentType) +protocols_subtyping.py:55:18 - error: Type "Proto2" is not assignable to declared type "Proto3"   "Proto2" is incompatible with protocol "Proto3"     "method2" is not present (reportAssignmentType) -protocols_subtyping.py:79:30 - error: Expression of type "Proto5[int]" is incompatible with declared type "Proto4[int, float]" +protocols_subtyping.py:79:30 - error: Type "Proto5[int]" is not assignable to declared type "Proto4[int, float]"   "Proto5[int]" is incompatible with protocol "Proto4[int, float]"     "method1" is an incompatible type -      Type "(a: int, b: int) -> tuple[int, int]" is incompatible with type "(a: S@Proto4, b: T@Proto4) -> tuple[S@Proto4, T@Proto4]" +      Type "(a: int, b: int) -> tuple[int, int]" is not assignable to type "(a: S@Proto4, b: T@Proto4) -> tuple[S@Proto4, T@Proto4]"         Parameter 2: type "T@Proto4" is incompatible with type "int" -          "float" is incompatible with "int" (reportAssignmentType) -protocols_subtyping.py:80:25 - error: Expression of type "Proto4[int, int]" is incompatible with declared type "Proto5[float]" +          "float" is not assignable to "int" (reportAssignmentType) +protocols_subtyping.py:80:25 - error: Type "Proto4[int, int]" is not assignable to declared type "Proto5[float]"   "Proto4[int, int]" is incompatible with protocol "Proto5[float]"     "method1" is an incompatible type -      Type "(a: int, b: int) -> tuple[int, int]" is incompatible with type "(a: T@Proto5, b: T@Proto5) -> tuple[T@Proto5, T@Proto5]" +      Type "(a: int, b: int) -> tuple[int, int]" is not assignable to type "(a: T@Proto5, b: T@Proto5) -> tuple[T@Proto5, T@Proto5]"         Parameter 1: type "T@Proto5" is incompatible with type "int" -          "float" is incompatible with "int" +          "float" is not assignable to "int"         Parameter 2: type "T@Proto5" is incompatible with type "int" -          "float" is incompatible with "int" (reportAssignmentType) -protocols_subtyping.py:102:30 - error: Expression of type "Proto6[float, float]" is incompatible with declared type "Proto7[int, float]" +          "float" is not assignable to "int" (reportAssignmentType) +protocols_subtyping.py:102:30 - error: Type "Proto6[float, float]" is not assignable to declared type "Proto7[int, float]"   "Proto6[float, float]" is incompatible with protocol "Proto7[int, float]"     "method1" is an incompatible type -      Type "(a: float) -> Sequence[float]" is incompatible with type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]" +      Type "(a: float) -> Sequence[float]" is not assignable to type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]"         Function return type "Sequence[float]" is incompatible with type "Sequence[S_co@Proto7]" -          "Sequence[float]" is incompatible with "Sequence[S_co@Proto7]" (reportAssignmentType) -protocols_subtyping.py:103:33 - error: Expression of type "Proto6[float, float]" is incompatible with declared type "Proto7[float, object]" +          "Sequence[float]" is not assignable to "Sequence[S_co@Proto7]" (reportAssignmentType) +protocols_subtyping.py:103:33 - error: Type "Proto6[float, float]" is not assignable to declared type "Proto7[float, object]"   "Proto6[float, float]" is incompatible with protocol "Proto7[float, object]"     "method1" is an incompatible type -      Type "(a: float) -> Sequence[float]" is incompatible with type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]" +      Type "(a: float) -> Sequence[float]" is not assignable to type "(a: T_contra@Proto7) -> Sequence[S_co@Proto7]"         Parameter 1: type "T_contra@Proto7" is incompatible with type "float" -          "object" is incompatible with "float" (reportAssignmentType) +          "object" is not assignable to "float" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/protocols_variance.toml b/conformance/results/pyright/protocols_variance.toml index 041ce276..108fd9d9 100644 --- a/conformance/results/pyright/protocols_variance.toml +++ b/conformance/results/pyright/protocols_variance.toml @@ -1,14 +1,14 @@ conformant = "Pass" output = """ -protocols_variance.py:21:7 - warning: Type variable "T1" used in generic protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:40:7 - warning: Type variable "T3" used in generic protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:56:7 - warning: Type variable "T1" used in generic protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) -protocols_variance.py:61:7 - warning: Type variable "T1_co" used in generic protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:21:7 - warning: Type variable "T1" used in generic Protocol "AnotherBox" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:40:7 - warning: Type variable "T3" used in generic Protocol "Protocol2" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:56:7 - warning: Type variable "T1" used in generic Protocol "Protocol4" should be contravariant (reportInvalidTypeVarUse) +protocols_variance.py:61:7 - warning: Type variable "T1_co" used in generic Protocol "Protocol5" should be contravariant (reportInvalidTypeVarUse) protocols_variance.py:62:22 - error: Covariant type variable cannot be used in parameter type (reportGeneralTypeIssues) -protocols_variance.py:66:7 - warning: Type variable "T1" used in generic protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) -protocols_variance.py:71:7 - warning: Type variable "T1_contra" used in generic protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:66:7 - warning: Type variable "T1" used in generic Protocol "Protocol6" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:71:7 - warning: Type variable "T1_contra" used in generic Protocol "Protocol7" should be covariant (reportInvalidTypeVarUse) protocols_variance.py:72:21 - error: Contravariant type variable cannot be used in return type (reportGeneralTypeIssues) -protocols_variance.py:104:7 - warning: Type variable "T1" used in generic protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) +protocols_variance.py:104:7 - warning: Type variable "T1" used in generic Protocol "Protocol12" should be covariant (reportInvalidTypeVarUse) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/qualifiers_annotated.toml b/conformance/results/pyright/qualifiers_annotated.toml index 075ec44e..b8c271f0 100644 --- a/conformance/results/pyright/qualifiers_annotated.toml +++ b/conformance/results/pyright/qualifiers_annotated.toml @@ -5,27 +5,32 @@ qualifiers_annotated.py:44:17 - error: Expected class but received "tuple[tuple[ qualifiers_annotated.py:45:17 - error: List expression not allowed for this type argument (reportInvalidTypeForm) qualifiers_annotated.py:45:18 - error: Expected class but received "Generator[type[int], None, None]" (reportGeneralTypeIssues) qualifiers_annotated.py:46:17 - error: Expected class but received "dict[str, Unknown]" (reportGeneralTypeIssues) -qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type annotation (reportInvalidTypeForm) +qualifiers_annotated.py:46:17 - error: Dictionary expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:46:24 - error: "b" is not defined (reportUndefinedVariable) qualifiers_annotated.py:47:17 - error: Call expression not allowed in type expression (reportInvalidTypeForm) -qualifiers_annotated.py:48:17 - error: List expression not allowed in type annotation +qualifiers_annotated.py:48:17 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) qualifiers_annotated.py:48:17 - error: Expected class but received "list[type[int]]" (reportGeneralTypeIssues) qualifiers_annotated.py:48:23 - error: Expected class but received "Literal[0]" (reportGeneralTypeIssues) -qualifiers_annotated.py:49:17 - error: Ternary expression not allowed in type annotation (reportInvalidTypeForm) +qualifiers_annotated.py:49:17 - error: Ternary expression not allowed in type expression (reportInvalidTypeForm) qualifiers_annotated.py:50:17 - error: "var1" is not defined (reportUndefinedVariable) qualifiers_annotated.py:51:17 - error: Expected class but received "Literal[True]" (reportGeneralTypeIssues) qualifiers_annotated.py:52:18 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) -qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type annotation (reportInvalidTypeForm) -qualifiers_annotated.py:54:18 - error: Type annotations cannot use format string literals (f-strings) (reportGeneralTypeIssues) +qualifiers_annotated.py:53:18 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) +qualifiers_annotated.py:54:18 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) qualifiers_annotated.py:64:8 - error: Expected one type argument and one or more annotations for "Annotated" (reportInvalidTypeForm) -qualifiers_annotated.py:76:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) -qualifiers_annotated.py:77:24 - error: Expression of type "type[Annotated]" is incompatible with declared type "type[Any]" (reportAssignmentType) -qualifiers_annotated.py:84:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) -qualifiers_annotated.py:85:7 - error: Argument of type "type[Annotated]" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" (reportArgumentType) +qualifiers_annotated.py:76:24 - error: Type "Annotated" is not assignable to declared type "type[Any]" +  "Annotated" is not assignable to "type[Any]" (reportAssignmentType) +qualifiers_annotated.py:77:24 - error: Type "SmallInt" is not assignable to declared type "type[Any]" +  "Annotated" is not assignable to "type[Any]" (reportAssignmentType) +qualifiers_annotated.py:84:7 - error: Argument of type "Annotated" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" +  Type "Annotated" is not assignable to type "type[T@func4]" (reportArgumentType) +qualifiers_annotated.py:85:7 - error: Argument of type "SmallInt" cannot be assigned to parameter "x" of type "type[T@func4]" in function "func4" +  Type "Annotated" is not assignable to type "type[T@func4]" (reportArgumentType) qualifiers_annotated.py:91:1 - error: "Annotated" cannot be instantiated (reportCallIssue) -qualifiers_annotated.py:92:1 - error: "Annotated" cannot be instantiated (reportCallIssue) -qualifiers_annotated.py:93:1 - error: "Annotated" cannot be instantiated (reportCallIssue) +qualifiers_annotated.py:92:1 - error: Object of type "Annotated" is not callable +  Attribute "__call__" is unknown (reportCallIssue) +qualifiers_annotated.py:93:1 - error: Object of type "Annotated" is not callable (reportCallIssue) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/qualifiers_final_annotation.toml b/conformance/results/pyright/qualifiers_final_annotation.toml index d191ef3e..7918a749 100644 --- a/conformance/results/pyright/qualifiers_final_annotation.toml +++ b/conformance/results/pyright/qualifiers_final_annotation.toml @@ -6,24 +6,20 @@ qualifiers_final_annotation.py:34:5 - error: "ID2" is declared Final, but value qualifiers_final_annotation.py:38:5 - error: "ID3" is declared Final, but value is not assigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:54:14 - error: Cannot assign to attribute "ID5" for class "ClassA*"   Attribute "ID5" cannot be assigned through a class instance because it is a ClassVar -  "ID5" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "ID5" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:62:19 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:63:19 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:63:32 - error: Cannot assign to attribute "id4" for class "ClassA*" -  "Literal[1]" is incompatible with "Final" (reportAttributeAccessIssue) +  "Literal[1]" is not assignable to "Final" (reportAttributeAccessIssue) qualifiers_final_annotation.py:65:14 - error: Cannot assign to attribute "ID7" for class "ClassA*"   Attribute "ID7" cannot be assigned through a class instance because it is a ClassVar -  "ID7" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "ID7" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:67:14 - error: Cannot assign to attribute "ID7" for class "ClassA*"   Attribute "ID7" cannot be assigned through a class instance because it is a ClassVar -  "ID7" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "ID7" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:71:1 - error: "RATE" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:81:8 - error: Cannot assign to attribute "DEFAULT_ID" for class "type[ClassB]" -  "DEFAULT_ID" is declared as Final and cannot be reassigned -    Attribute "__set__" is unknown (reportAttributeAccessIssue) +  "DEFAULT_ID" is declared as Final and cannot be reassigned (reportAttributeAccessIssue) qualifiers_final_annotation.py:94:5 - error: "BORDER_WIDTH" cannot be redeclared because parent class "ClassC" declares it as Final (reportGeneralTypeIssues) qualifiers_final_annotation.py:107:22 - error: "Final" is not allowed in this context (reportInvalidTypeForm) qualifiers_final_annotation.py:108:19 - error: "ClassVar" is not allowed in this context (reportInvalidTypeForm) @@ -32,9 +28,9 @@ qualifiers_final_annotation.py:121:14 - error: "Final" is not allowed in this co qualifiers_final_annotation.py:134:1 - error: Arguments missing for parameters "x", "y" (reportCallIssue) qualifiers_final_annotation.py:134:3 - error: No parameter named "a" (reportCallIssue) qualifiers_final_annotation.py:135:5 - error: Argument of type "Literal['']" cannot be assigned to parameter "x" of type "int" in function "__new__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) qualifiers_final_annotation.py:135:11 - error: Argument of type "Literal['']" cannot be assigned to parameter "y" of type "int" in function "__new__" -  "Literal['']" is incompatible with "int" (reportArgumentType) +  "Literal['']" is not assignable to "int" (reportArgumentType) qualifiers_final_annotation.py:141:5 - error: "ID1" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:145:5 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) qualifiers_final_annotation.py:147:10 - error: "x" is declared as Final and cannot be reassigned (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/specialtypes_never.toml b/conformance/results/pyright/specialtypes_never.toml index b72b75c7..d4e0cc4d 100644 --- a/conformance/results/pyright/specialtypes_never.toml +++ b/conformance/results/pyright/specialtypes_never.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ specialtypes_never.py:19:22 - error: Function with declared return type "NoReturn" cannot return "None" (reportReturnType) -specialtypes_never.py:86:21 - error: Expression of type "list[Never]" is incompatible with declared type "list[int]" -  "list[Never]" is incompatible with "list[int]" +specialtypes_never.py:86:21 - error: Type "list[Never]" is not assignable to declared type "list[int]" +  "list[Never]" is not assignable to "list[int]"     Type parameter "_T@list" is invariant, but "Never" is not the same as "int"     Consider switching from "list" to "Sequence" which is covariant (reportAssignmentType) -specialtypes_never.py:105:12 - error: Expression of type "ClassC[Never]" is incompatible with return type "ClassC[U@func10]" -  "ClassC[Never]" is incompatible with "ClassC[U@func10]" +specialtypes_never.py:105:12 - error: Type "ClassC[Never]" is not assignable to return type "ClassC[U@func10]" +  "ClassC[Never]" is not assignable to "ClassC[U@func10]"     Type parameter "T@ClassC" is invariant, but "Never" is not the same as "U@func10" (reportReturnType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/specialtypes_none.toml b/conformance/results/pyright/specialtypes_none.toml index fe9033f6..94561c88 100644 --- a/conformance/results/pyright/specialtypes_none.toml +++ b/conformance/results/pyright/specialtypes_none.toml @@ -1,12 +1,12 @@ conformant = "Pass" output = """ specialtypes_none.py:21:7 - error: Argument of type "type[None]" cannot be assigned to parameter "val1" of type "None" in function "func1" -  "type[type]" is incompatible with "type[None]" (reportArgumentType) -specialtypes_none.py:27:19 - error: Expression of type "None" is incompatible with declared type "Iterable[Unknown]" +  "type[type]" is not assignable to "type[None]" (reportArgumentType) +specialtypes_none.py:27:19 - error: Type "None" is not assignable to declared type "Iterable[Unknown]"   "None" is incompatible with protocol "Iterable[Unknown]"     "__iter__" is not present (reportAssignmentType) specialtypes_none.py:41:7 - error: Argument of type "None" cannot be assigned to parameter "val1" of type "type[None]" in function "func2" -  Type "None" is incompatible with type "type[None]" (reportArgumentType) +  Type "None" is not assignable to type "type[None]" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/specialtypes_type.toml b/conformance/results/pyright/specialtypes_type.toml index b0b33686..904c541a 100644 --- a/conformance/results/pyright/specialtypes_type.toml +++ b/conformance/results/pyright/specialtypes_type.toml @@ -1,11 +1,11 @@ conformant = "Pass" output = """ specialtypes_type.py:56:7 - error: Argument of type "type[TeamUser]" cannot be assigned to parameter "user_class" of type "type[BasicUser] | type[ProUser]" in function "func4" -  Type "type[TeamUser]" is incompatible with type "type[BasicUser] | type[ProUser]" -    "type[TeamUser]" is incompatible with "type[BasicUser]" -    Type "type[TeamUser]" is incompatible with type "type[BasicUser]" -    "type[TeamUser]" is incompatible with "type[ProUser]" -    Type "type[TeamUser]" is incompatible with type "type[ProUser]" (reportArgumentType) +  Type "type[TeamUser]" is not assignable to type "type[BasicUser] | type[ProUser]" +    "type[TeamUser]" is not assignable to "type[BasicUser]" +    Type "type[TeamUser]" is not assignable to type "type[BasicUser]" +    "type[TeamUser]" is not assignable to "type[ProUser]" +    Type "type[TeamUser]" is not assignable to type "type[ProUser]" (reportArgumentType) specialtypes_type.py:70:7 - error: Argument of type "type[Callable]" cannot be assigned to parameter "x" of type "type[T@func5]" in function "func5" (reportArgumentType) specialtypes_type.py:76:22 - error: Too many type arguments provided for "type"; expected 1 but received 2 (reportInvalidTypeForm) specialtypes_type.py:117:7 - error: Cannot access attribute "unknown" for class "type[object]" diff --git a/conformance/results/pyright/tuples_type_compat.toml b/conformance/results/pyright/tuples_type_compat.toml index 184606a6..02eac297 100644 --- a/conformance/results/pyright/tuples_type_compat.toml +++ b/conformance/results/pyright/tuples_type_compat.toml @@ -1,47 +1,47 @@ conformant = "Pass" output = """ -tuples_type_compat.py:15:27 - error: Expression of type "tuple[float, complex]" is incompatible with declared type "tuple[int, int]" -  "tuple[float, complex]" is incompatible with "tuple[int, int]" +tuples_type_compat.py:15:27 - error: Type "tuple[float, complex]" is not assignable to declared type "tuple[int, int]" +  "tuple[float, complex]" is not assignable to "tuple[int, int]"     Tuple entry 1 is incorrect type -      "float" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:29:10 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int, *tuple[int, ...]]" -  "tuple[int, ...]" is incompatible with "tuple[int, *tuple[int, ...]]" +      "float" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:29:10 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int, *tuple[int, ...]]" +  "tuple[int, ...]" is not assignable to "tuple[int, *tuple[int, ...]]"     Tuple size mismatch; expected 1 or more but received indeterminate (reportAssignmentType) -tuples_type_compat.py:32:10 - error: Expression of type "tuple[int, *tuple[int, ...]]" is incompatible with declared type "tuple[int]" -  "tuple[int, *tuple[int, ...]]" is incompatible with "tuple[int]" +tuples_type_compat.py:32:10 - error: Type "tuple[int, *tuple[int, ...]]" is not assignable to declared type "tuple[int]" +  "tuple[int, *tuple[int, ...]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:33:10 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int]" -  "tuple[int, ...]" is incompatible with "tuple[int]" +tuples_type_compat.py:33:10 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int]" +  "tuple[int, ...]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:43:22 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int]" -  "tuple[int, ...]" is incompatible with "tuple[int]" +tuples_type_compat.py:43:22 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int]" +  "tuple[int, ...]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:62:26 - error: Expression of type "tuple[int, ...]" is incompatible with declared type "tuple[int, int]" -  "tuple[int, ...]" is incompatible with "tuple[int, int]" +tuples_type_compat.py:62:26 - error: Type "tuple[int, ...]" is not assignable to declared type "tuple[int, int]" +  "tuple[int, ...]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received indeterminate (reportAssignmentType) -tuples_type_compat.py:144:6 - error: Expression of type "tuple[Literal[1], Literal[''], Literal['']]" is incompatible with declared type "tuple[int, str]" -  "tuple[Literal[1], Literal[''], Literal['']]" is incompatible with "tuple[int, str]" +tuples_type_compat.py:144:6 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, str]" +  "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to "tuple[int, str]"     Tuple size mismatch; expected 2 but received 3 (reportAssignmentType) -tuples_type_compat.py:149:10 - error: Expression of type "tuple[Literal[1], Literal[1], Literal['']]" is incompatible with declared type "tuple[int, *tuple[str, ...]]" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) -tuples_type_compat.py:150:14 - error: Expression of type "tuple[Literal[1], Literal[''], Literal[1]]" is incompatible with declared type "tuple[int, *tuple[str, ...]]" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) -tuples_type_compat.py:156:14 - error: Expression of type "tuple[Literal[1], Literal[''], Literal['']]" is incompatible with declared type "tuple[int, *tuple[str, ...], int]" -  "Literal['']" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:157:18 - error: Expression of type "tuple[Literal[1], Literal[''], Literal[''], float]" is incompatible with declared type "tuple[int, *tuple[str, ...], int]" -  "float" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:162:7 - error: Expression of type "tuple[Literal[1], Literal[''], Literal[1]]" is incompatible with declared type "tuple[*tuple[str, ...], int]" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) -tuples_type_compat.py:163:15 - error: Expression of type "tuple[Literal[''], Literal[''], float]" is incompatible with declared type "tuple[*tuple[str, ...], int]" -  "float" is incompatible with "int" (reportAssignmentType) -tuples_type_compat.py:168:40 - error: Expression of type "tuple[str, str]" is incompatible with declared type "tuple[str, str, int]" -  "tuple[str, str]" is incompatible with "tuple[str, str, int]" +tuples_type_compat.py:149:10 - error: Type "tuple[Literal[1], Literal[1], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...]]" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) +tuples_type_compat.py:150:14 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[int, *tuple[str, ...]]" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) +tuples_type_compat.py:156:14 - error: Type "tuple[Literal[1], Literal[''], Literal['']]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]" +  "Literal['']" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:157:18 - error: Type "tuple[Literal[1], Literal[''], Literal[''], float]" is not assignable to declared type "tuple[int, *tuple[str, ...], int]" +  "float" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:162:7 - error: Type "tuple[Literal[1], Literal[''], Literal[1]]" is not assignable to declared type "tuple[*tuple[str, ...], int]" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) +tuples_type_compat.py:163:15 - error: Type "tuple[Literal[''], Literal[''], float]" is not assignable to declared type "tuple[*tuple[str, ...], int]" +  "float" is not assignable to "int" (reportAssignmentType) +tuples_type_compat.py:168:40 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, int]" +  "tuple[str, str]" is not assignable to "tuple[str, str, int]"     Tuple size mismatch; expected 3 but received 2 (reportAssignmentType) -tuples_type_compat.py:171:50 - error: Expression of type "tuple[str, str]" is incompatible with declared type "tuple[str, str, str, *tuple[str, ...]]" -  "tuple[str, str]" is incompatible with "tuple[str, str, str, *tuple[str, ...]]" +tuples_type_compat.py:171:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[str, str, str, *tuple[str, ...]]" +  "tuple[str, str]" is not assignable to "tuple[str, str, str, *tuple[str, ...]]"     Tuple size mismatch; expected 3 or more but received 2 (reportAssignmentType) -tuples_type_compat.py:175:50 - error: Expression of type "tuple[str, str]" is incompatible with declared type "tuple[*tuple[str, ...], str, str, str]" -  "tuple[str, str]" is incompatible with "tuple[*tuple[str, ...], str, str, str]" +tuples_type_compat.py:175:50 - error: Type "tuple[str, str]" is not assignable to declared type "tuple[*tuple[str, ...], str, str, str]" +  "tuple[str, str]" is not assignable to "tuple[*tuple[str, ...], str, str, str]"     Tuple size mismatch; expected 3 or more but received 2 (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/tuples_type_form.toml b/conformance/results/pyright/tuples_type_form.toml index 2bc7070a..ca0d3792 100644 --- a/conformance/results/pyright/tuples_type_form.toml +++ b/conformance/results/pyright/tuples_type_form.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -tuples_type_form.py:12:6 - error: Expression of type "tuple[Literal[1], Literal[2]]" is incompatible with declared type "tuple[int]" -  "tuple[Literal[1], Literal[2]]" is incompatible with "tuple[int]" +tuples_type_form.py:12:6 - error: Type "tuple[Literal[1], Literal[2]]" is not assignable to declared type "tuple[int]" +  "tuple[Literal[1], Literal[2]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received 2 (reportAssignmentType) -tuples_type_form.py:14:6 - error: Expression of type "tuple[Literal[1]]" is incompatible with declared type "tuple[int, int]" -  "tuple[Literal[1]]" is incompatible with "tuple[int, int]" +tuples_type_form.py:14:6 - error: Type "tuple[Literal[1]]" is not assignable to declared type "tuple[int, int]" +  "tuple[Literal[1]]" is not assignable to "tuple[int, int]"     Tuple size mismatch; expected 2 but received 1 (reportAssignmentType) -tuples_type_form.py:15:10 - error: Expression of type "tuple[Literal[1], Literal['']]" is incompatible with declared type "tuple[int, int]" -  "Literal['']" is incompatible with "int" (reportAssignmentType) -tuples_type_form.py:25:7 - error: Expression of type "tuple[Literal[1]]" is incompatible with declared type "tuple[()]" -  "tuple[Literal[1]]" is incompatible with "tuple[()]" +tuples_type_form.py:15:10 - error: Type "tuple[Literal[1], Literal['']]" is not assignable to declared type "tuple[int, int]" +  "Literal['']" is not assignable to "int" (reportAssignmentType) +tuples_type_form.py:25:7 - error: Type "tuple[Literal[1]]" is not assignable to declared type "tuple[()]" +  "tuple[Literal[1]]" is not assignable to "tuple[()]"     Tuple size mismatch; expected 0 but received 1 (reportAssignmentType) -tuples_type_form.py:36:17 - error: Expression of type "tuple[Literal[1], Literal[2], Literal[3], Literal['']]" is incompatible with declared type "tuple[int, ...]" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +tuples_type_form.py:36:17 - error: Type "tuple[Literal[1], Literal[2], Literal[3], Literal['']]" is not assignable to declared type "tuple[int, ...]" +  "Literal['']" is not assignable to "int" (reportAssignmentType) tuples_type_form.py:40:22 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) tuples_type_form.py:41:12 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) tuples_type_form.py:42:12 - error: "..." is allowed only as the second of two arguments (reportInvalidTypeForm) diff --git a/conformance/results/pyright/typeddicts_alt_syntax.toml b/conformance/results/pyright/typeddicts_alt_syntax.toml index ed85c45e..8137309e 100644 --- a/conformance/results/pyright/typeddicts_alt_syntax.toml +++ b/conformance/results/pyright/typeddicts_alt_syntax.toml @@ -4,8 +4,8 @@ typeddicts_alt_syntax.py:23:17 - error: Expected dict or keyword parameter as se typeddicts_alt_syntax.py:27:45 - error: Expected string literal for dictionary entry name (reportGeneralTypeIssues) typeddicts_alt_syntax.py:31:1 - error: TypedDict must be assigned to a variable named "WrongName" (reportGeneralTypeIssues) typeddicts_alt_syntax.py:35:78 - error: Extra TypedDict arguments not supported (reportCallIssue) -typeddicts_alt_syntax.py:45:43 - error: Expression of type "dict[str, str]" is incompatible with declared type "Movie2" -  "Literal['']" is incompatible with "int" (reportAssignmentType) +typeddicts_alt_syntax.py:45:43 - error: Type "dict[str, str]" is not assignable to declared type "Movie2" +  "Literal['']" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_operations.toml b/conformance/results/pyright/typeddicts_operations.toml index f98bba88..9eae5451 100644 --- a/conformance/results/pyright/typeddicts_operations.toml +++ b/conformance/results/pyright/typeddicts_operations.toml @@ -1,20 +1,20 @@ conformant = "Pass" output = """ typeddicts_operations.py:22:1 - error: Could not assign item in TypedDict -  "Literal[1982]" is incompatible with "str" (reportGeneralTypeIssues) +  "Literal[1982]" is not assignable to "str" (reportGeneralTypeIssues) typeddicts_operations.py:23:1 - error: Could not assign item in TypedDict -  "Literal['']" is incompatible with "int" (reportGeneralTypeIssues) +  "Literal['']" is not assignable to "int" (reportGeneralTypeIssues) typeddicts_operations.py:24:1 - error: Could not assign item in TypedDict   "other" is not a defined key in "Movie" (reportGeneralTypeIssues) typeddicts_operations.py:26:7 - error: Could not access item in TypedDict   "other" is not a defined key in "Movie" (reportGeneralTypeIssues) -typeddicts_operations.py:28:9 - error: Expression of type "dict[str, str]" is incompatible with declared type "Movie" +typeddicts_operations.py:28:9 - error: Type "dict[str, str]" is not assignable to declared type "Movie"   "year" is required in "Movie" (reportAssignmentType) -typeddicts_operations.py:29:42 - error: Expression of type "dict[str, str | float]" is incompatible with declared type "Movie" -  "float" is incompatible with "int" (reportAssignmentType) -typeddicts_operations.py:32:36 - error: Expression of type "dict[str, str | int]" is incompatible with declared type "Movie" +typeddicts_operations.py:29:42 - error: Type "dict[str, str | float]" is not assignable to declared type "Movie" +  "float" is not assignable to "int" (reportAssignmentType) +typeddicts_operations.py:32:36 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie"   "other" is an undefined item in type "Movie" (reportAssignmentType) -typeddicts_operations.py:37:20 - error: Expression of type "dict[str, str | int]" is incompatible with declared type "Movie" (reportAssignmentType) +typeddicts_operations.py:37:20 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie" (reportAssignmentType) typeddicts_operations.py:47:7 - error: Cannot access attribute "clear" for class "Movie"   Attribute "clear" is unknown (reportAttributeAccessIssue) typeddicts_operations.py:49:5 - error: Could not delete item in TypedDict diff --git a/conformance/results/pyright/typeddicts_readonly_consistency.toml b/conformance/results/pyright/typeddicts_readonly_consistency.toml index c295c477..bb53197c 100644 --- a/conformance/results/pyright/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyright/typeddicts_readonly_consistency.toml @@ -1,20 +1,20 @@ conformant = "Pass" output = """ -typeddicts_readonly_consistency.py:37:14 - error: Expression of type "A1" is incompatible with declared type "B1" +typeddicts_readonly_consistency.py:37:14 - error: Type "A1" is not assignable to declared type "B1"   "y" is missing from "A1" (reportAssignmentType) -typeddicts_readonly_consistency.py:38:14 - error: Expression of type "C1" is incompatible with declared type "B1" +typeddicts_readonly_consistency.py:38:14 - error: Type "C1" is not assignable to declared type "B1"   "y" is not read-only in "B1" (reportAssignmentType) -typeddicts_readonly_consistency.py:40:14 - error: Expression of type "A1" is incompatible with declared type "C1" +typeddicts_readonly_consistency.py:40:14 - error: Type "A1" is not assignable to declared type "C1"   "y" is an incompatible type -    "object" is incompatible with "str" (reportAssignmentType) -typeddicts_readonly_consistency.py:81:14 - error: Expression of type "A2" is incompatible with declared type "B2" +    "object" is not assignable to "str" (reportAssignmentType) +typeddicts_readonly_consistency.py:81:14 - error: Type "A2" is not assignable to declared type "B2"   "x" is not read-only in "B2" (reportAssignmentType) -typeddicts_readonly_consistency.py:82:14 - error: Expression of type "C2" is incompatible with declared type "B2" +typeddicts_readonly_consistency.py:82:14 - error: Type "C2" is not assignable to declared type "B2"   "x" is not required in "B2" (reportAssignmentType) -typeddicts_readonly_consistency.py:84:14 - error: Expression of type "A2" is incompatible with declared type "C2" +typeddicts_readonly_consistency.py:84:14 - error: Type "A2" is not assignable to declared type "C2"   "x" is required in "C2"   "x" is not read-only in "C2" (reportAssignmentType) -typeddicts_readonly_consistency.py:85:14 - error: Expression of type "B2" is incompatible with declared type "C2" +typeddicts_readonly_consistency.py:85:14 - error: Type "B2" is not assignable to declared type "C2"   "x" is required in "C2" (reportAssignmentType) """ conformance_automated = "Pass" diff --git a/conformance/results/pyright/typeddicts_readonly_inheritance.toml b/conformance/results/pyright/typeddicts_readonly_inheritance.toml index a77014bc..d9e432b8 100644 --- a/conformance/results/pyright/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyright/typeddicts_readonly_inheritance.toml @@ -3,16 +3,16 @@ output = """ typeddicts_readonly_inheritance.py:36:1 - error: Could not assign item in TypedDict   "name" is a read-only key in "Album2" (reportTypedDictNotRequiredAccess) typeddicts_readonly_inheritance.py:50:5 - error: "alt" overrides symbol of same name in class "AlbumCollection" -  "list[str]" is incompatible with "list[str | int]" +  "list[str]" is not assignable to "list[str | int]"     Type parameter "_T@list" is invariant, but "str" is not the same as "str | int"     Consider switching from "list" to "Sequence" which is covariant (reportIncompatibleVariableOverride) -typeddicts_readonly_inheritance.py:65:19 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "RequiredName" +typeddicts_readonly_inheritance.py:65:19 - error: Type "dict[Any, Any]" is not assignable to declared type "RequiredName"   "name" is required in "RequiredName" (reportAssignmentType) typeddicts_readonly_inheritance.py:82:1 - error: Could not assign item in TypedDict -  "Literal[3]" is incompatible with "str" (reportGeneralTypeIssues) -typeddicts_readonly_inheritance.py:83:15 - error: Expression of type "dict[str, int]" is incompatible with declared type "User" -  "Literal[3]" is incompatible with "str" (reportAssignmentType) -typeddicts_readonly_inheritance.py:84:5 - error: Expression of type "dict[Any, Any]" is incompatible with declared type "User" +  "Literal[3]" is not assignable to "str" (reportGeneralTypeIssues) +typeddicts_readonly_inheritance.py:83:15 - error: Type "dict[str, int]" is not assignable to declared type "User" +  "Literal[3]" is not assignable to "str" (reportAssignmentType) +typeddicts_readonly_inheritance.py:84:5 - error: Type "dict[Any, Any]" is not assignable to declared type "User"   "ident" is required in "User" (reportAssignmentType) typeddicts_readonly_inheritance.py:94:5 - error: TypedDict item "a" cannot be redefined as ReadOnly (reportGeneralTypeIssues) typeddicts_readonly_inheritance.py:98:5 - error: TypedDict item "a" cannot be redefined as NotRequired (reportGeneralTypeIssues) diff --git a/conformance/results/pyright/typeddicts_readonly_update.toml b/conformance/results/pyright/typeddicts_readonly_update.toml index 405e1acc..65089409 100644 --- a/conformance/results/pyright/typeddicts_readonly_update.toml +++ b/conformance/results/pyright/typeddicts_readonly_update.toml @@ -3,7 +3,7 @@ output = """ typeddicts_readonly_update.py:23:1 - error: No overloads for "update" match the provided arguments (reportCallIssue) typeddicts_readonly_update.py:23:11 - error: Argument of type "A" cannot be assigned to parameter "__m" of type "Partial[A]" in function "update"   "x" is an incompatible type -    Type "int" is incompatible with type "Never" (reportArgumentType) +    Type "int" is not assignable to type "Never" (reportArgumentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_required.toml b/conformance/results/pyright/typeddicts_required.toml index 434466a4..9f041f9f 100644 --- a/conformance/results/pyright/typeddicts_required.toml +++ b/conformance/results/pyright/typeddicts_required.toml @@ -2,7 +2,7 @@ conformant = "Pass" output = """ typeddicts_required.py:12:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:15:18 - error: Cannot assign to attribute "x" for class "NotTypedDict*" -  "int" is incompatible with "Required[int]" (reportAttributeAccessIssue) +  "int" is not assignable to "Required" (reportAttributeAccessIssue) typeddicts_required.py:19:8 - error: "NotRequired" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:62:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) typeddicts_required.py:63:8 - error: "Required" is not allowed in this context (reportInvalidTypeForm) diff --git a/conformance/results/pyright/typeddicts_type_consistency.toml b/conformance/results/pyright/typeddicts_type_consistency.toml index dcda7217..328b8b93 100644 --- a/conformance/results/pyright/typeddicts_type_consistency.toml +++ b/conformance/results/pyright/typeddicts_type_consistency.toml @@ -1,27 +1,27 @@ conformant = "Pass" output = """ -typeddicts_type_consistency.py:21:10 - error: Expression of type "B1" is incompatible with declared type "A1" +typeddicts_type_consistency.py:21:10 - error: Type "B1" is not assignable to declared type "A1"   "x" is an incompatible type -    Type "int" is incompatible with type "int | None" -      "int" is incompatible with "None" (reportAssignmentType) -typeddicts_type_consistency.py:38:10 - error: Expression of type "B2" is incompatible with declared type "A2" +    Type "int" is not assignable to type "int | None" +      "int" is not assignable to "None" (reportAssignmentType) +typeddicts_type_consistency.py:38:10 - error: Type "B2" is not assignable to declared type "A2"   "x" is not required in "A2" (reportAssignmentType) -typeddicts_type_consistency.py:65:6 - error: Expression of type "A3" is incompatible with declared type "B3" +typeddicts_type_consistency.py:65:6 - error: Type "A3" is not assignable to declared type "B3"   "y" is missing from "A3" (reportAssignmentType) -typeddicts_type_consistency.py:69:21 - error: Expression of type "dict[str, int]" is incompatible with declared type "A3" +typeddicts_type_consistency.py:69:21 - error: Type "dict[str, int]" is not assignable to declared type "A3"   "y" is an undefined item in type "A3" (reportAssignmentType) -typeddicts_type_consistency.py:76:22 - error: Expression of type "B3" is incompatible with declared type "dict[str, int]" -  "B3" is incompatible with "dict[str, int]" (reportAssignmentType) -typeddicts_type_consistency.py:77:25 - error: Expression of type "B3" is incompatible with declared type "dict[str, object]" -  "B3" is incompatible with "dict[str, object]" (reportAssignmentType) -typeddicts_type_consistency.py:78:22 - error: Expression of type "B3" is incompatible with declared type "dict[Any, Any]" -  "B3" is incompatible with "dict[Any, Any]" (reportAssignmentType) -typeddicts_type_consistency.py:82:25 - error: Expression of type "B3" is incompatible with declared type "Mapping[str, int]" -  "B3" is incompatible with "Mapping[str, int]" +typeddicts_type_consistency.py:76:22 - error: Type "B3" is not assignable to declared type "dict[str, int]" +  "B3" is not assignable to "dict[str, int]" (reportAssignmentType) +typeddicts_type_consistency.py:77:25 - error: Type "B3" is not assignable to declared type "dict[str, object]" +  "B3" is not assignable to "dict[str, object]" (reportAssignmentType) +typeddicts_type_consistency.py:78:22 - error: Type "B3" is not assignable to declared type "dict[Any, Any]" +  "B3" is not assignable to "dict[Any, Any]" (reportAssignmentType) +typeddicts_type_consistency.py:82:25 - error: Type "B3" is not assignable to declared type "Mapping[str, int]" +  "B3" is not assignable to "Mapping[str, int]"     Type parameter "_VT_co@Mapping" is covariant, but "object" is not a subtype of "int" -      "object" is incompatible with "int" (reportAssignmentType) -typeddicts_type_consistency.py:126:56 - error: Expression of type "dict[str, dict[str, dict[str, int]]]" is incompatible with declared type "Outer1" -  "Literal[1]" is incompatible with "str" (reportAssignmentType) +      "object" is not assignable to "int" (reportAssignmentType) +typeddicts_type_consistency.py:126:56 - error: Type "dict[str, dict[str, dict[str, int]]]" is not assignable to declared type "Outer1" +  "Literal[1]" is not assignable to "str" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/typeddicts_usage.toml b/conformance/results/pyright/typeddicts_usage.toml index 447d0ad0..ce846f1d 100644 --- a/conformance/results/pyright/typeddicts_usage.toml +++ b/conformance/results/pyright/typeddicts_usage.toml @@ -3,8 +3,8 @@ output = """ typeddicts_usage.py:23:1 - error: Could not assign item in TypedDict   "director" is not a defined key in "Movie" (reportGeneralTypeIssues) typeddicts_usage.py:24:1 - error: Could not assign item in TypedDict -  "Literal['1982']" is incompatible with "int" (reportGeneralTypeIssues) -typeddicts_usage.py:28:18 - error: Expression of type "dict[str, str | int]" is incompatible with declared type "Movie" +  "Literal['1982']" is not assignable to "int" (reportGeneralTypeIssues) +typeddicts_usage.py:28:18 - error: Type "dict[str, str | int]" is not assignable to declared type "Movie"   "title" is an undefined item in type "Movie" (reportAssignmentType) typeddicts_usage.py:35:22 - error: Second argument to "isinstance" must be a class or tuple of classes   TypedDict class not allowed for instance or class checks (reportArgumentType) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 7cda8a2f..a90f554c 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.374" -test_duration = 1.5 +version = "pyright 1.1.384" +test_duration = 1.3 diff --git a/conformance/results/pytype/aliases_explicit.toml b/conformance/results/pytype/aliases_explicit.toml index 48f40da9..27f65cc6 100644 --- a/conformance/results/pytype/aliases_explicit.toml +++ b/conformance/results/pytype/aliases_explicit.toml @@ -7,24 +7,96 @@ Does not report some illegal annotation forms as invalid type aliases. Does not report invalid specialization of already-specialized generic type alias. """ output = """ -File "aliases_explicit.py", line 41, in : Invalid type annotation '[str, str]' [invalid-annotation] -File "aliases_explicit.py", line 41, in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] -File "aliases_explicit.py", line 57, in good_type_aliases: Callable[Concatenate, Any] [assert-type] -File "aliases_explicit.py", line 60, in good_type_aliases: Callable[[Any], None] [assert-type] -File "aliases_explicit.py", line 67, in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] -File "aliases_explicit.py", line 68, in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] -File "aliases_explicit.py", line 69, in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] -File "aliases_explicit.py", line 70, in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] -File "aliases_explicit.py", line 71, in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] -File "aliases_explicit.py", line 80, in : Invalid type annotation '[int, str]' for BadTypeAlias2 [invalid-annotation] -File "aliases_explicit.py", line 81, in : Invalid type annotation '((int, str),)' for BadTypeAlias3 [invalid-annotation] -File "aliases_explicit.py", line 82, in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] -File "aliases_explicit.py", line 83, in : Invalid type annotation "{'a': 'b'}" for BadTypeAlias5 [invalid-annotation] -File "aliases_explicit.py", line 87, in : Invalid type annotation '3' for BadTypeAlias9 [invalid-annotation] -File "aliases_explicit.py", line 88, in : Invalid type annotation 'True' for BadTypeAlias10 [invalid-annotation] -File "aliases_explicit.py", line 89, in : Invalid type annotation '1' for BadTypeAlias11 [invalid-annotation] -File "aliases_explicit.py", line 91, in : Invalid type annotation '' for BadTypeAlias13 [invalid-annotation] -File "aliases_explicit.py", line 102, in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] +aliases_explicit.py:41:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:41:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type] + + assert_type(p9, Callable[[int, str, str], None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[[Any], None] [assert-type] + + assert_type(p12, Callable[..., None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] + + p1: GoodTypeAlias2[int], # E: type alias is not generic + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:68:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] + + p2: GoodTypeAlias3[int], # E: type alias is already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:69:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] + + p3: GoodTypeAlias4[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:70:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] + + p4: GoodTypeAlias8[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:71:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] + + p5: GoodTypeAlias9[int, int], # E: bad type argument for ParamSpec + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:80:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for BadTypeAlias2 [invalid-annotation] + +BadTypeAlias2: TA = [int, str] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for BadTypeAlias3 [invalid-annotation] + +BadTypeAlias3: TA = ((int, str),) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] + +BadTypeAlias4: TA = [int for i in range(1)] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for BadTypeAlias5 [invalid-annotation] + +BadTypeAlias5: TA = {"a": "b"} # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for BadTypeAlias9 [invalid-annotation] + +BadTypeAlias9: TA = var1 # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:88:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for BadTypeAlias10 [invalid-annotation] + +BadTypeAlias10: TA = True # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:89:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for BadTypeAlias11 [invalid-annotation] + +BadTypeAlias11: TA = 1 # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias13 [invalid-annotation] + +BadTypeAlias13: TA = f"{'int'}" # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_explicit.py:102:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] + +x4: ListOrSetAlias[int] # E: already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -35,7 +107,7 @@ Line 86: Expected 1 errors Line 90: Expected 1 errors Line 100: Expected 1 errors Line 101: Expected 1 errors -Line 41: Unexpected errors ['File "aliases_explicit.py", line 41, in : Invalid type annotation \\'[str, str]\\' [invalid-annotation]', 'File "aliases_explicit.py", line 41, in : Invalid type annotation \\'Callable[Concatenate[int, P], R][[str, str], None]\\' [invalid-annotation]'] -Line 57: Unexpected errors ['File "aliases_explicit.py", line 57, in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] -Line 60: Unexpected errors ['File "aliases_explicit.py", line 60, in good_type_aliases: Callable[[Any], None] [assert-type]'] +Line 41: Unexpected errors ["aliases_explicit.py:41:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_explicit.py:41:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] +Line 57: Unexpected errors ['aliases_explicit.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] +Line 60: Unexpected errors ['aliases_explicit.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] """ diff --git a/conformance/results/pytype/aliases_implicit.toml b/conformance/results/pytype/aliases_implicit.toml index 26f6b5aa..64e38336 100644 --- a/conformance/results/pytype/aliases_implicit.toml +++ b/conformance/results/pytype/aliases_implicit.toml @@ -7,23 +7,315 @@ Allows some illegal annotation forms to be interpreted as valid type aliases. Does not report invalid specialization of already-specialized generic type alias. """ output = """ -File "aliases_implicit.py", line 54, in : Invalid type annotation '[str, str]' [invalid-annotation] -File "aliases_implicit.py", line 54, in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] -File "aliases_implicit.py", line 68, in good_type_aliases: Callable[Concatenate, Any] [assert-type] -File "aliases_implicit.py", line 72, in good_type_aliases: Callable[[Any], None] [assert-type] -File "aliases_implicit.py", line 76, in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] -File "aliases_implicit.py", line 77, in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] -File "aliases_implicit.py", line 78, in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] -File "aliases_implicit.py", line 79, in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] -File "aliases_implicit.py", line 80, in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation 'True' for p10 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '' for p4 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '3' for p9 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '1' for p11 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation] -File "aliases_implicit.py", line 105, in : Invalid type annotation "{'a': 'b'}" for p5 [invalid-annotation] -File "aliases_implicit.py", line 135, in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] +aliases_implicit.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation] + + p9: GoodTypeAlias9[[str, str], None], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type] + + assert_type(p9, Callable[[int, str, str], None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:72:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in good_type_aliases: Callable[[Any], None] [assert-type] + + assert_type(p13, Callable[..., None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:76:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Optional[int][int]' [invalid-annotation] + + p1: GoodTypeAlias2[int], # E: type alias is not generic + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:77:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] + + p2: GoodTypeAlias3[int], # E: type alias is already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] + + p3: GoodTypeAlias4[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:79:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[int, T], T][int, int]' [invalid-annotation] + + p4: GoodTypeAlias8[int, int], # E: too many type arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][int, int]' [invalid-annotation] + + p5: GoodTypeAlias9[int, int], # E: bad type argument for ParamSpec + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for p5 [invalid-annotation] + +def bad_type_aliases( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: BadTypeAlias1, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: BadTypeAlias2, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: BadTypeAlias3, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: BadTypeAlias4, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: BadTypeAlias5, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: BadTypeAlias6, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: BadTypeAlias7, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: BadTypeAlias8, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: BadTypeAlias9, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: BadTypeAlias10, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: BadTypeAlias11, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: BadTypeAlias12, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: BadTypeAlias13, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: BadTypeAlias14, # E: Invalid type annotation +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +aliases_implicit.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Union[list, set][int]' [invalid-annotation] + +x4: ListOrSetAlias[int] # E: already specialized + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -43,8 +335,8 @@ Line 117: Expected 1 errors Line 118: Expected 1 errors Line 119: Expected 1 errors Line 133: Expected 1 errors -Line 54: Unexpected errors ['File "aliases_implicit.py", line 54, in : Invalid type annotation \\'[str, str]\\' [invalid-annotation]', 'File "aliases_implicit.py", line 54, in : Invalid type annotation \\'Callable[Concatenate[int, P], R][[str, str], None]\\' [invalid-annotation]'] -Line 68: Unexpected errors ['File "aliases_implicit.py", line 68, in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] -Line 72: Unexpected errors ['File "aliases_implicit.py", line 72, in good_type_aliases: Callable[[Any], None] [assert-type]'] -Line 105: Unexpected errors ['File "aliases_implicit.py", line 105, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'3\\' for p9 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation \\'((int, str),)\\' for p3 [invalid-annotation]', 'File "aliases_implicit.py", line 105, in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] +Line 54: Unexpected errors ["aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] +Line 68: Unexpected errors ['aliases_implicit.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] +Line 72: Unexpected errors ['aliases_implicit.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] +Line 105: Unexpected errors ["aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation]", 'aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] """ diff --git a/conformance/results/pytype/aliases_newtype.toml b/conformance/results/pytype/aliases_newtype.toml index fc07d9bc..996e1777 100644 --- a/conformance/results/pytype/aliases_newtype.toml +++ b/conformance/results/pytype/aliases_newtype.toml @@ -9,10 +9,26 @@ Does not reject use of NewType with TypedDict class. Does not reject use of NewType with Any. """ output = """ -File "aliases_newtype.py", line 11, in : Function UserId.__init__ was called with the wrong arguments [wrong-arg-types] -File "aliases_newtype.py", line 12, in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] -File "aliases_newtype.py", line 38, in : class GoodNewType1 is not indexable [not-indexable] -File "aliases_newtype.py", line 60, in : Function typing.NewType expects 2 arg(s), got 3 [wrong-arg-count] +aliases_newtype.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function UserId.__init__ was called with the wrong arguments [wrong-arg-types] + +UserId("user") # E: incorrect type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_newtype.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] + +u1: UserId = 42 # E: incorrect type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_newtype.py:38:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class GoodNewType1 is not indexable [not-indexable] + +nt1: GoodNewType1[int] # E: NewType cannot be generic + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_newtype.py:60:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.NewType expects 2 arg(s), got 3 [wrong-arg-count] + +BadNewType6 = NewType("BadNewType6", int, int) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/aliases_recursive.toml b/conformance/results/pytype/aliases_recursive.toml index e6541891..10e318a6 100644 --- a/conformance/results/pytype/aliases_recursive.toml +++ b/conformance/results/pytype/aliases_recursive.toml @@ -5,35 +5,111 @@ Does not properly handle `|` for unions in some recursive type alias definitions Does not detect cyclical references in recursive type alias definition. """ output = """ -File "aliases_recursive.py", line 19, in : Type annotation for j4 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 20, in : Type annotation for j5 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 38, in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 39, in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 50, in : Type annotation for m7 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 51, in : Type annotation for m8 does not match type of assignment [annotation-type-mismatch] -File "aliases_recursive.py", line 58, in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands] -File "aliases_recursive.py", line 59, in : Invalid type annotation 'list[str]' [invalid-annotation] -File "aliases_recursive.py", line 62, in : Invalid type annotation 'list[str]' [invalid-annotation] -File "aliases_recursive.py", line 62, in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] -File "aliases_recursive.py", line 63, in : Invalid type annotation 'list[str]' [invalid-annotation] -File "aliases_recursive.py", line 63, in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] -File "aliases_recursive.py", line 65, in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands] -File "aliases_recursive.py", line 67, in : Invalid type annotation 'list[str, int]' [invalid-annotation] -File "aliases_recursive.py", line 67, in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] -File "aliases_recursive.py", line 68, in : Invalid type annotation 'list[str, float]' [invalid-annotation] -File "aliases_recursive.py", line 68, in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation] -File "aliases_recursive.py", line 69, in : Invalid type annotation 'list[str, int]' [invalid-annotation] -File "aliases_recursive.py", line 69, in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] +aliases_recursive.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for j4 does not match type of assignment [annotation-type-mismatch] + +j4: Json = {"a": 1, "b": 3j} # E: incompatible type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for j5 does not match type of assignment [annotation-type-mismatch] + +j5: Json = [2, 3j] # E: incompatible type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] + +t6: RecursiveTuple = (1, ("1", 1), (1, (1, [2]))) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t6 does not match type of assignment [annotation-type-mismatch] + +t6: RecursiveTuple = (1, [1]) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for m7 does not match type of assignment [annotation-type-mismatch] + +m7: RecursiveMapping = {"1": [1]} # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for m8 does not match type of assignment [annotation-type-mismatch] + +m8: RecursiveMapping = {"1": "1", "2": 1, "3": [1, 2]} # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:58:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands] + +GenericTypeAlias1 = list["GenericTypeAlias1[T1]" | T1] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:59:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] + +SpecializedTypeAlias1 = GenericTypeAlias1[str] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:62:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] + +g2: GenericTypeAlias1[str] = ["hi", "bye", [""], [["hi"]]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] + +g2: GenericTypeAlias1[str] = ["hi", "bye", [""], [["hi"]]] # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation] + +g3: GenericTypeAlias1[str] = ["hi", [2.4]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:63:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation] + +g3: GenericTypeAlias1[str] = ["hi", [2.4]] # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:65:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands] + +GenericTypeAlias2 = list["GenericTypeAlias2[T1, T2]" | T1 | T2] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:67:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation] + +g4: GenericTypeAlias2[str, int] = [[3, ["hi"]], "hi"] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] + +g4: GenericTypeAlias2[str, int] = [[3, ["hi"]], "hi"] # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, float]' [invalid-annotation] + +g5: GenericTypeAlias2[str, float] = [[3, ["hi", 3.4, [3.4]]], "hi"] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:68:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation] + +g5: GenericTypeAlias2[str, float] = [[3, ["hi", 3.4, [3.4]]], "hi"] # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +aliases_recursive.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation] + +g6: GenericTypeAlias2[str, int] = [[3, ["hi", 3, [3.4]]], "hi"] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_recursive.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation] + +g6: GenericTypeAlias2[str, int] = [[3, ["hi", 3, [3.4]]], "hi"] # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 52: Expected 1 errors Line 72: Expected 1 errors Line 75: Expected 1 errors -Line 58: Unexpected errors ['File "aliases_recursive.py", line 58, in : unsupported operand type(s) for |: \\'\\'GenericTypeAlias1[T1]\\': str\\' and \\'T1: TypeVar\\' [unsupported-operands]'] -Line 59: Unexpected errors ['File "aliases_recursive.py", line 59, in : Invalid type annotation \\'list[str]\\' [invalid-annotation]'] -Line 62: Unexpected errors ['File "aliases_recursive.py", line 62, in : Invalid type annotation \\'list[str]\\' [invalid-annotation]', 'File "aliases_recursive.py", line 62, in : Invalid type annotation \\'GenericTypeAlias1[str]\\' [invalid-annotation]'] -Line 65: Unexpected errors ['File "aliases_recursive.py", line 65, in : unsupported operand type(s) for |: \\'\\'GenericTypeAlias2[T1, T2]\\': str\\' and \\'T1: TypeVar\\' [unsupported-operands]'] -Line 67: Unexpected errors ['File "aliases_recursive.py", line 67, in : Invalid type annotation \\'list[str, int]\\' [invalid-annotation]', 'File "aliases_recursive.py", line 67, in : Invalid type annotation \\'GenericTypeAlias2[str, int]\\' [invalid-annotation]'] -Line 68: Unexpected errors ['File "aliases_recursive.py", line 68, in : Invalid type annotation \\'list[str, float]\\' [invalid-annotation]', 'File "aliases_recursive.py", line 68, in : Invalid type annotation \\'GenericTypeAlias2[str, float]\\' [invalid-annotation]'] +Line 58: Unexpected errors ["aliases_recursive.py:58:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias1[T1]': str' and 'T1: TypeVar' [unsupported-operands]"] +Line 59: Unexpected errors ["aliases_recursive.py:59:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation]"] +Line 62: Unexpected errors ["aliases_recursive.py:62:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str]' [invalid-annotation]", "aliases_recursive.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias1[str]' [invalid-annotation]"] +Line 65: Unexpected errors ["aliases_recursive.py:65:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unsupported operand type(s) for |: ''GenericTypeAlias2[T1, T2]': str' and 'T1: TypeVar' [unsupported-operands]"] +Line 67: Unexpected errors ["aliases_recursive.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str, int]' [invalid-annotation]", "aliases_recursive.py:67:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, int]' [invalid-annotation]"] +Line 68: Unexpected errors ["aliases_recursive.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'list[str, float]' [invalid-annotation]", "aliases_recursive.py:68:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'GenericTypeAlias2[str, float]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/aliases_typealiastype.toml b/conformance/results/pytype/aliases_typealiastype.toml index f2c6d241..9e13b035 100644 --- a/conformance/results/pytype/aliases_typealiastype.toml +++ b/conformance/results/pytype/aliases_typealiastype.toml @@ -3,19 +3,59 @@ notes = """ Support for TypeAliasType is not implemented. """ output = """ -File "aliases_typealiastype.py", line 5, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "aliases_typealiastype.py", line 5, in : Can't find module 'typing.TypeAliasType'. [import-error] -File "aliases_typealiastype.py", line 11, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "aliases_typealiastype.py", line 19, in : Name 'GoodAlias4' is not defined [name-error] -File "aliases_typealiastype.py", line 22, in : Name 'GoodAlias5' is not defined [name-error] -File "aliases_typealiastype.py", line 22, in : Invalid type annotation '' [invalid-annotation] -File "aliases_typealiastype.py", line 46, in : Name 'BadAlias4' is not defined [name-error] -File "aliases_typealiastype.py", line 47, in : Name 'BadAlias5' is not defined [name-error] -File "aliases_typealiastype.py", line 48, in : Name 'BadAlias7' is not defined [name-error] +aliases_typealiastype.py:5:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Callable, Generic, ParamSpec, TypeAliasType, TypeVar, TypeVarTuple +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:11:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +GoodAlias1 = TypeAliasType("GoodAlias1", int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:19:51: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'GoodAlias4' is not defined [name-error] + +GoodAlias4 = TypeAliasType("GoodAlias4", T | list[GoodAlias4[T]], type_params=(T,)) + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:22:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'GoodAlias5' is not defined [name-error] + + Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:22:66: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + + Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:32:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'other_attrib' on TypeAliasType [attribute-error] + +print(GoodAlias1.other_attrib) # E: unknown attribute + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:46:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias4' is not defined [name-error] + +BadAlias4 = TypeAliasType("BadAlias4", BadAlias4) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:47:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias5' is not defined [name-error] + +BadAlias5 = TypeAliasType("BadAlias5", T | BadAlias5[str], type_params=(T,)) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +aliases_typealiastype.py:48:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'BadAlias7' is not defined [name-error] + +BadAlias6 = TypeAliasType("BadAlias6", BadAlias7) # E: circular dependency + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + """ 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 @@ -33,8 +73,9 @@ Line 61: Expected 1 errors Line 62: Expected 1 errors Line 63: Expected 1 errors Line 64: Expected 1 errors -Line 5: Unexpected errors ['File "aliases_typealiastype.py", line 5, in : typing.TypeVarTuple not supported yet [not-supported-yet]', 'File "aliases_typealiastype.py", line 5, in : Can\\'t find module \\'typing.TypeAliasType\\'. [import-error]'] -Line 11: Unexpected errors ['File "aliases_typealiastype.py", line 11, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 19: Unexpected errors ['File "aliases_typealiastype.py", line 19, in : Name \\'GoodAlias4\\' is not defined [name-error]'] -Line 22: Unexpected errors ['File "aliases_typealiastype.py", line 22, in : Name \\'GoodAlias5\\' is not defined [name-error]', 'File "aliases_typealiastype.py", line 22, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 5: Unexpected errors ['aliases_typealiastype.py:5:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['aliases_typealiastype.py:11:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["aliases_typealiastype.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 19: Unexpected errors ["aliases_typealiastype.py:19:51: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias4' is not defined [name-error]"] +Line 22: Unexpected errors ["aliases_typealiastype.py:22:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias5' is not defined [name-error]", "aliases_typealiastype.py:22:66: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/aliases_variance.toml b/conformance/results/pytype/aliases_variance.toml index 2bb30ee5..89093dfe 100644 --- a/conformance/results/pytype/aliases_variance.toml +++ b/conformance/results/pytype/aliases_variance.toml @@ -3,8 +3,16 @@ notes = """ Does not detect variance incompatibility. """ output = """ -File "aliases_variance.py", line 9, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "aliases_variance.py", line 10, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] +aliases_variance.py:9:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +aliases_variance.py:10:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -12,6 +20,6 @@ Line 24: Expected 1 errors Line 28: Expected 1 errors Line 32: Expected 1 errors Line 44: Expected 1 errors -Line 9: Unexpected errors ['File "aliases_variance.py", line 9, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "aliases_variance.py", line 10, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['aliases_variance.py:9:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['aliases_variance.py:10:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/annotations_forward_refs.toml b/conformance/results/pytype/annotations_forward_refs.toml index 016f08a2..b493b07e 100644 --- a/conformance/results/pytype/annotations_forward_refs.toml +++ b/conformance/results/pytype/annotations_forward_refs.toml @@ -6,27 +6,420 @@ Evaluates incorrect type for class variable annotated with quoted type expressio Does not treat triple-quoted forward reference annotation as implicitly parenthesized. """ output = """ -File "annotations_forward_refs.py", line 22, in : Name 'ClassA' is not defined [name-error] -File "annotations_forward_refs.py", line 23, in : Name 'ClassA' is not defined [name-error] -File "annotations_forward_refs.py", line 24, in : unsupported operand type(s) for |: ''ClassA': str' and 'int: Type[int]' [unsupported-operands] -File "annotations_forward_refs.py", line 25, in : Missing parameter 'y' in call to function int.__or__ [missing-parameter] -File "annotations_forward_refs.py", line 40, in : invalid syntax [python-compiler-error] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '{}' for p5 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation 'True' for p10 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '' for p15 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '' for p4 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '1' for p9 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '1' for p11 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '-1' for p12 [invalid-annotation] -File "annotations_forward_refs.py", line 40, in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] -File "annotations_forward_refs.py", line 66, in ClassB: Name 'ClassB' is not defined [name-error] -File "annotations_forward_refs.py", line 80, in ClassD: Name 'ClassF' is not defined [name-error] -File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation '' for str [invalid-annotation] -File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation '' for x [invalid-annotation] -File "annotations_forward_refs.py", line 89, in ClassD: Invalid type annotation '' for y [invalid-annotation] -File "annotations_forward_refs.py", line 96, in : Any [assert-type] -File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error] +annotations_forward_refs.py:22:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'ClassA' is not defined [name-error] + +bad1: ClassA # E: Runtime error: requires quotes + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:23:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'ClassA' is not defined [name-error] + +bad2: list[ClassA] # E: Runtime error: requires quotes + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:24:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''ClassA': str' and 'int: Type[int]' [unsupported-operands] + +bad3: "ClassA" | int # E: Runtime error + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:25:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function int.__or__ [missing-parameter] + +bad4: int | "ClassA" # E: Runtime error + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p15 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: "eval(''.join(map(chr, [105, 110, 116])))", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: "[int, str]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: "(int, str)", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: "[int for i in range(1)]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: "{}", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: "(lambda : int)()", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: "[int][0]", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: "int if 1 < 3 else str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: "var1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: "True", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: "1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: "-1", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: "int or str", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: 'f"int"', # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: "types", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:66:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassB: Name 'ClassB' is not defined [name-error] + + def method1(self) -> ClassB: # E: Runtime error + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:80:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Name 'ClassF' is not defined [name-error] + + ClassF: "ClassF" # E: circular reference + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation] + + str: "str" = "" # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:87:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation] + + x: "int" = 0 # OK + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +annotations_forward_refs.py:89:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation '' for y [invalid-annotation] + + y: int = 0 # E: Refers to local int, which isn't a legal type expression + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +annotations_forward_refs.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(ClassD.x, int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_forward_refs.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unexpected indent [python-compiler-error] + +value: ""\" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + int | +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + str | +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + list[int] +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m +""\" +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -45,9 +438,9 @@ Line 52: Expected 1 errors Line 53: Expected 1 errors Line 54: Expected 1 errors Line 55: Expected 1 errors -Line 40: Unexpected errors ['File "annotations_forward_refs.py", line 40, in : invalid syntax [python-compiler-error]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'{}\\' for p5 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p15 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p9 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'-1\\' for p12 [invalid-annotation]', 'File "annotations_forward_refs.py", line 40, in : Invalid type annotation \\'(int, str)\\' for p3 [invalid-annotation]'] -Line 82: Unexpected errors ['File "annotations_forward_refs.py", line 82, in ClassD: Invalid type annotation \\'\\' for str [invalid-annotation]'] -Line 87: Unexpected errors ['File "annotations_forward_refs.py", line 87, in ClassD: Invalid type annotation \\'\\' for x [invalid-annotation]'] -Line 96: Unexpected errors ['File "annotations_forward_refs.py", line 96, in : Any [assert-type]'] -Line 103: Unexpected errors ['File "annotations_forward_refs.py", line 103, in : unexpected indent [python-compiler-error]'] +Line 40: Unexpected errors ["annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] +Line 82: Unexpected errors ["annotations_forward_refs.py:82:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation]"] +Line 87: Unexpected errors ["annotations_forward_refs.py:87:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation]"] +Line 96: Unexpected errors ['annotations_forward_refs.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 103: Unexpected errors ['annotations_forward_refs.py:103:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : unexpected indent [python-compiler-error]'] """ diff --git a/conformance/results/pytype/annotations_generators.toml b/conformance/results/pytype/annotations_generators.toml index 4be5d012..50bb6423 100644 --- a/conformance/results/pytype/annotations_generators.toml +++ b/conformance/results/pytype/annotations_generators.toml @@ -5,17 +5,71 @@ Reports invalid error when return type of generator is annotated as a compatible Does not report type violation in `yield from` statement. """ output = """ -File "annotations_generators.py", line 54, in generator2: bad return type [bad-return-type] -File "annotations_generators.py", line 57, in generator2: bad return type [bad-return-type] -File "annotations_generators.py", line 57, in generator2: bad return type [bad-return-type] -File "annotations_generators.py", line 66, in generator3: bad return type [bad-return-type] -File "annotations_generators.py", line 75, in generator5: bad return type [bad-return-type] -File "annotations_generators.py", line 86, in : Bad return type 'int' for generator function generator8 [bad-yield-annotation] -File "annotations_generators.py", line 91, in : Bad return type 'int' for async generator function generator9 [bad-yield-annotation] -File "annotations_generators.py", line 100, in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] -File "annotations_generators.py", line 109, in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] -File "annotations_generators.py", line 118, in generator18: bad return type [bad-return-type] -File "annotations_generators.py", line 119, in generator18: bad return type [bad-return-type] +annotations_generators.py:54:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] + + return False # E: incompatible return type + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] + + yield 3 # E: incompatible yield type + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:57:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator2: bad return type [bad-return-type] + + yield 3 # E: incompatible yield type + \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:66:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator3: bad return type [bad-return-type] + + yield 3 # E: Incompatible yield type + \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator5: bad return type [bad-return-type] + + yield B() # E: incompatible yield type + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:86:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'int' for generator function generator8 [bad-yield-annotation] + +def generator8() -> int: # E: incompatible return type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield None # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'int' for async generator function generator9 [bad-yield-annotation] + +async def generator9() -> int: # E: incompatible return type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield None # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation] + +def generator15() -> IntIterator: # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield 0 +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation] + +async def generator16() -> AsyncIntIterator: # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + yield 0 +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] + + yield from generator17() # E: incompatible generator type + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +annotations_generators.py:119:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in generator18: bad return type [bad-return-type] + + yield from [1] # E: incompatible generator type + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -23,6 +77,6 @@ Line 51: Expected 1 errors Line 87: Expected 1 errors Line 92: Expected 1 errors Line 135: Expected 1 errors -Line 100: Unexpected errors ['File "annotations_generators.py", line 100, in : Bad return type \\'IntIterator\\' for generator function generator15 [bad-yield-annotation]'] -Line 109: Unexpected errors ['File "annotations_generators.py", line 109, in : Bad return type \\'AsyncIntIterator\\' for async generator function generator16 [bad-yield-annotation]'] +Line 100: Unexpected errors ["annotations_generators.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'IntIterator' for generator function generator15 [bad-yield-annotation]"] +Line 109: Unexpected errors ["annotations_generators.py:109:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Bad return type 'AsyncIntIterator' for async generator function generator16 [bad-yield-annotation]"] """ diff --git a/conformance/results/pytype/annotations_methods.toml b/conformance/results/pytype/annotations_methods.toml index f86e1867..4a773d05 100644 --- a/conformance/results/pytype/annotations_methods.toml +++ b/conformance/results/pytype/annotations_methods.toml @@ -3,7 +3,11 @@ notes = """ Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings. """ output = """ -File "annotations_methods.py", line 42, in : B [assert-type] +annotations_methods.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : B [assert-type] + +assert_type(A.copy(B()), A) # E? +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/annotations_typeexpr.toml b/conformance/results/pytype/annotations_typeexpr.toml index bfefd545..87fa1060 100644 --- a/conformance/results/pytype/annotations_typeexpr.toml +++ b/conformance/results/pytype/annotations_typeexpr.toml @@ -8,15 +8,357 @@ Does not reject f-string in type annotation. Does not reject module in type annotation. """ output = """ -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '{}' for p5 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation 'True' for p10 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '' for p15 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '' for p4 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '3' for p9 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '1' for p11 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '-1' for p12 [invalid-annotation] -File "annotations_typeexpr.py", line 87, in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p15 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation] + +def invalid_annotations( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p1: eval("".join(map(chr, [105, 110, 116]))), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p2: [int, str], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p3: (int, str), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p4: [int for i in range(1)], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p5: {}, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p6: (lambda: int)(), # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p7: [int][0], # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p8: int if 1 < 3 else str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p9: var1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p10: True, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p11: 1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p12: -1, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p13: int or str, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p14: f"int", # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + p15: types, # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +): +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -35,5 +377,5 @@ Line 99: Expected 1 errors Line 100: Expected 1 errors Line 101: Expected 1 errors Line 102: Expected 1 errors -Line 87: Unexpected errors ['File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'{}\\' for p5 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'[int, str]\\' for p2 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'True\\' for p10 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'\\' for p15 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'\\' for p4 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'3\\' for p9 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'1\\' for p11 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'-1\\' for p12 [invalid-annotation]', 'File "annotations_typeexpr.py", line 87, in : Invalid type annotation \\'(int, str)\\' for p3 [invalid-annotation]'] +Line 87: Unexpected errors ["annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] """ diff --git a/conformance/results/pytype/callables_kwargs.toml b/conformance/results/pytype/callables_kwargs.toml index 3723069b..ae052884 100644 --- a/conformance/results/pytype/callables_kwargs.toml +++ b/conformance/results/pytype/callables_kwargs.toml @@ -3,20 +3,76 @@ notes = """ Does not understand Unpack in the context of **kwargs annotation. """ output = """ -File "callables_kwargs.py", line 10, in : typing.Unpack not supported yet [not-supported-yet] -File "callables_kwargs.py", line 24, in func1: Unpack[TD2] [assert-type] -File "callables_kwargs.py", line 32, in func1: Unpack[TD2] [assert-type] -File "callables_kwargs.py", line 35, in func1: Unpack[TD2] [assert-type] -File "callables_kwargs.py", line 41, in func2: Dict[str, Unpack[TD1]] [assert-type] -File "callables_kwargs.py", line 47, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 49, in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter] -File "callables_kwargs.py", line 51, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 52, in func3: Function func1 expects 0 arg(s), got 3 [wrong-arg-count] -File "callables_kwargs.py", line 58, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 61, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 63, in func3: Function func1 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 64, in func3: Function func2 was called with the wrong arguments [wrong-arg-types] -File "callables_kwargs.py", line 65, in func3: Function func2 was called with the wrong arguments [wrong-arg-types] +callables_kwargs.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import Protocol, TypeVar, TypedDict, NotRequired, Required, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:24:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] + + assert_type(v1, int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:32:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] + + assert_type(v2, str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Unpack[TD2] [assert-type] + + assert_type(v3, str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type] + + assert_type(kwargs, TD1) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:47:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(v1=1, v2="", v3="5") # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:49:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter] + + td2 = TD2(v1=2, v3="4") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(v1=1, v2="", v3="5", v4=5) # E: v4 is not in TD2 + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 expects 0 arg(s), got 3 [wrong-arg-count] + + func1(1, "", "5") # E: args not passed by position + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(**my_dict) # E: untyped dict + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:61:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(**d1) # E?: OK or Type error (spec allows either) + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:63:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types] + + func1(v1=2, **td2) # E: v1 is already specified + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:64:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func2 was called with the wrong arguments [wrong-arg-types] + + func2(1, **td2) # E: v1 is already specified + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_kwargs.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Function func2 was called with the wrong arguments [wrong-arg-types] + + func2(v1=1, **td2) # E: v1 is already specified + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -26,11 +82,11 @@ Line 102: Expected 1 errors Line 103: Expected 1 errors Line 111: Expected 1 errors Line 122: Expected 1 errors -Line 10: Unexpected errors ['File "callables_kwargs.py", line 10, in : typing.Unpack not supported yet [not-supported-yet]'] -Line 24: Unexpected errors ['File "callables_kwargs.py", line 24, in func1: Unpack[TD2] [assert-type]'] -Line 32: Unexpected errors ['File "callables_kwargs.py", line 32, in func1: Unpack[TD2] [assert-type]'] -Line 35: Unexpected errors ['File "callables_kwargs.py", line 35, in func1: Unpack[TD2] [assert-type]'] -Line 41: Unexpected errors ['File "callables_kwargs.py", line 41, in func2: Dict[str, Unpack[TD1]] [assert-type]'] -Line 47: Unexpected errors ['File "callables_kwargs.py", line 47, in func3: Function func1 was called with the wrong arguments [wrong-arg-types]'] -Line 49: Unexpected errors ['File "callables_kwargs.py", line 49, in func3: Missing parameter \\'v2\\' in call to function TD2.__init__ [missing-parameter]'] +Line 10: Unexpected errors ['callables_kwargs.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] +Line 24: Unexpected errors ['callables_kwargs.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] +Line 32: Unexpected errors ['callables_kwargs.py:32:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] +Line 35: Unexpected errors ['callables_kwargs.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] +Line 41: Unexpected errors ['callables_kwargs.py:41:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type]'] +Line 47: Unexpected errors ['callables_kwargs.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types]'] +Line 49: Unexpected errors ["callables_kwargs.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter]"] """ diff --git a/conformance/results/pytype/callables_protocol.toml b/conformance/results/pytype/callables_protocol.toml index c80c657f..1f20354f 100644 --- a/conformance/results/pytype/callables_protocol.toml +++ b/conformance/results/pytype/callables_protocol.toml @@ -3,15 +3,43 @@ notes = """ Does not properly handle type compatibility checks with callback protocols. """ output = """ -File "callables_protocol.py", line 9, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "callables_protocol.py", line 10, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "callables_protocol.py", line 121, in : Type annotation for cb6 does not match type of assignment [annotation-type-mismatch] -File "callables_protocol.py", line 173, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "callables_protocol.py", line 188, in decorator1: bad return type [bad-return-type] +callables_protocol.py:9:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +InputT = TypeVar("InputT", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:10:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +OutputT = TypeVar("OutputT", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for cb6 does not match type of assignment [annotation-type-mismatch] + +cb6: NotProto6 = cb6_bad1 # E: NotProto6 isn't a protocol class +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +callables_protocol.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +R = TypeVar("R", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:188:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in decorator1: bad return type [bad-return-type] + + return converted + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 191, in current file -File "callables_protocol.py", line 197, in : No attribute 'other_attribute2' on Proto9[Any, str] [attribute-error] -File "callables_protocol.py", line 199, in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types] +callables_protocol.py:197:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'other_attribute2' on Proto9[Any, str] [attribute-error] + +print(cb9_good.other_attribute2) # E: unknown attribute + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_protocol.py:199:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types] + +cb9_good(x=3) +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -30,9 +58,9 @@ Line 238: Expected 1 errors Line 260: Expected 1 errors Line 284: Expected 1 errors Line 311: Expected 1 errors -Line 9: Unexpected errors ['File "callables_protocol.py", line 9, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "callables_protocol.py", line 10, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 173: Unexpected errors ['File "callables_protocol.py", line 173, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 188: Unexpected errors ['File "callables_protocol.py", line 188, in decorator1: bad return type [bad-return-type]'] -Line 199: Unexpected errors ['File "callables_protocol.py", line 199, in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types]'] +Line 9: Unexpected errors ['callables_protocol.py:9:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['callables_protocol.py:10:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 173: Unexpected errors ['callables_protocol.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 188: Unexpected errors ['callables_protocol.py:188:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in decorator1: bad return type [bad-return-type]'] +Line 199: Unexpected errors ['callables_protocol.py:199:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Proto9.__call__ was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/callables_subtyping.toml b/conformance/results/pytype/callables_subtyping.toml index 43e7ac96..9d940c4a 100644 --- a/conformance/results/pytype/callables_subtyping.toml +++ b/conformance/results/pytype/callables_subtyping.toml @@ -34,17 +34,41 @@ Line 240: Expected 1 errors Line 243: Expected 1 errors Line 273: Expected 1 errors Line 297: Expected 1 errors -Line 211: Unexpected errors ['File "callables_subtyping.py", line 211, in : Invalid type annotation \\'Callable[[P], None][P]\\' [invalid-annotation]'] -Line 213: Unexpected errors ['File "callables_subtyping.py", line 213, in func7: Invalid type annotation \\'TypeAliasWithP[P]\\' [invalid-annotation]'] -Line 255: Unexpected errors ['File "callables_subtyping.py", line 255, in __call__: @typing.overload-decorated \\'Overloaded9.__call__\\' object is not callable [not-callable]'] -Line 284: Unexpected errors ['File "callables_subtyping.py", line 284, in __call__: @typing.overload-decorated \\'Overloaded10.__call__\\' object is not callable [not-callable]'] +Line 211: Unexpected errors ["callables_subtyping.py:211:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation]"] +Line 213: Unexpected errors ["callables_subtyping.py:213:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation]"] +Line 255: Unexpected errors ["callables_subtyping.py:255:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable]"] +Line 284: Unexpected errors ["callables_subtyping.py:284:44: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable]"] """ output = """ -File "callables_subtyping.py", line 26, in func1: Type annotation for f6 does not match type of assignment [annotation-type-mismatch] -File "callables_subtyping.py", line 29, in func1: Type annotation for f8 does not match type of assignment [annotation-type-mismatch] -File "callables_subtyping.py", line 211, in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation] -File "callables_subtyping.py", line 213, in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation] -File "callables_subtyping.py", line 255, in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable] -File "callables_subtyping.py", line 284, in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable] +callables_subtyping.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for f6 does not match type of assignment [annotation-type-mismatch] + + f6: Callable[[float], float] = cb3 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +callables_subtyping.py:29:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for f8 does not match type of assignment [annotation-type-mismatch] + + f8: Callable[[int], int] = cb2 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +callables_subtyping.py:211:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Callable[[P], None][P]' [invalid-annotation] + +def func7(proto: ProtocolWithP[P], ta: TypeAliasWithP[P]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +callables_subtyping.py:213:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Invalid type annotation 'TypeAliasWithP[P]' [invalid-annotation] + + f1: TypeAliasWithP[P] = proto # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +callables_subtyping.py:255:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __call__: @typing.overload-decorated 'Overloaded9.__call__' object is not callable [not-callable] + + def __call__(self, x: str) -> str: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +callables_subtyping.py:284:44: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __call__: @typing.overload-decorated 'Overloaded10.__call__' object is not callable [not-callable] + + def __call__(self, x: str) -> complex: ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" diff --git a/conformance/results/pytype/classes_classvar.toml b/conformance/results/pytype/classes_classvar.toml index c79f592c..d042ebf8 100644 --- a/conformance/results/pytype/classes_classvar.toml +++ b/conformance/results/pytype/classes_classvar.toml @@ -12,19 +12,104 @@ Does not reject use of ClassVar in type alias definition. Does not reject assignment of ClassVar through instance of class. """ output = """ -File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "classes_classvar.py", line 38, in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] -File "classes_classvar.py", line 38, in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] -File "classes_classvar.py", line 39, in ClassA: class ClassVar is not indexable [not-indexable] -File "classes_classvar.py", line 39, in ClassA: Invalid type annotation 'CV[3]' [invalid-annotation] -File "classes_classvar.py", line 40, in ClassA: Name 'var' is not defined [name-error] -File "classes_classvar.py", line 52, in ClassA: Type annotation for bad8 does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type] -File "classes_classvar.py", line 78, in : ClassVar [assert-type] -File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] -File "classes_classvar.py", line 134, in : Type annotation for a does not match type of assignment [annotation-type-mismatch] +classes_classvar.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import ( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Annotated, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Any, +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + Callable, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + ClassVar, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + Final, +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + Generic, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + ParamSpec, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Protocol, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeAlias, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeVar, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeVarTuple, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + assert_type, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + cast, +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_classvar.py:29:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] + + bad1: ClassVar[int, str] = cast(Any, 0) # E: too many arguments + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:38:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'ClassVar[int, str]' [invalid-annotation] + + bad1: ClassVar[int, str] = cast(Any, 0) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:39:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: class ClassVar is not indexable [not-indexable] + + bad2: CV[3] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:39:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation 'CV[3]' [invalid-annotation] + + bad2: CV[3] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:40:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Name 'var' is not defined [name-error] + + bad3: CV[var] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +classes_classvar.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Name 'var' is not defined [name-error] + + bad3: CV[var] = cast(Any, 0) # E: invalid type + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:52:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for bad8 does not match type of assignment [annotation-type-mismatch] + + bad8: ClassVar[list[str]] = {} # E: type violation in initialization + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +classes_classvar.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch] + + good4: ClassVar = 3.1 + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:68:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] + + return 3 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_classvar.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ClassVar [assert-type] + +assert_type(ClassA.good4, float) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_classvar.py:124:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch] + + z: CV = [""] + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_classvar.py:134:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a does not match type of assignment [annotation-type-mismatch] + +a: ProtoA = ProtoAImpl() # E: y is not a ClassVar +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -40,10 +125,10 @@ Line 67: Expected 1 errors Line 71: Expected 1 errors Line 72: Expected 1 errors Line 105: Expected 1 errors -Line 7: Unexpected errors ['File "classes_classvar.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 29: Unexpected errors ['File "classes_classvar.py", line 29, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 60: Unexpected errors ['File "classes_classvar.py", line 60, in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] -Line 68: Unexpected errors ['File "classes_classvar.py", line 68, in method2: bad return type [bad-return-type]'] -Line 78: Unexpected errors ['File "classes_classvar.py", line 78, in : ClassVar [assert-type]'] -Line 124: Unexpected errors ['File "classes_classvar.py", line 124, in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] +Line 7: Unexpected errors ['classes_classvar.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 29: Unexpected errors ['classes_classvar.py:29:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 60: Unexpected errors ['classes_classvar.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassA: Type annotation for good4 does not match type of assignment [annotation-type-mismatch]'] +Line 68: Unexpected errors ['classes_classvar.py:68:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 78: Unexpected errors ['classes_classvar.py:78:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ClassVar [assert-type]'] +Line 124: Unexpected errors ['classes_classvar.py:124:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ProtoA: Type annotation for z does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/classes_override.toml b/conformance/results/pytype/classes_override.toml index 8395e920..b3daac6b 100644 --- a/conformance/results/pytype/classes_override.toml +++ b/conformance/results/pytype/classes_override.toml @@ -3,13 +3,47 @@ notes = """ Does not yet support the @override decorator. """ output = """ -File "classes_override.py", line 7, in : typing.override not supported yet [not-supported-yet] -File "classes_override.py", line 30, in method2: bad return type [bad-return-type] -File "classes_override.py", line 50, in method2: bad return type [bad-return-type] -File "classes_override.py", line 53, in ChildA: Attribute 'method3' not found on any parent class [override-error] -File "classes_override.py", line 57, in ChildA: Attribute 'method4' not found on any parent class [override-error] -File "classes_override.py", line 66, in method4: bad return type [bad-return-type] -File "classes_override.py", line 101, in ChildB: Attribute 'method1' not found on any parent class [override-error] +classes_override.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] + +from typing import Any, Callable, overload, override +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_override.py:30:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_override.py:50:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_override.py:53:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildA: Attribute 'method3' not found on any parent class [override-error] + + def method3(self) -> int: # E: no matching signature in ancestor + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 1 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_override.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildA: Attribute 'method4' not found on any parent class [override-error] + + def method4(self, x: int) -> int: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +classes_override.py:66:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +classes_override.py:101:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ChildB: Attribute 'method1' not found on any parent class [override-error] + + def method1(self) -> None: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -17,10 +51,10 @@ Line 79: Expected 1 errors Line 84: Expected 1 errors Line 89: Expected 1 errors Lines 56, 65: Expected error (tag 'method4') -Line 7: Unexpected errors ['File "classes_override.py", line 7, in : typing.override not supported yet [not-supported-yet]'] -Line 30: Unexpected errors ['File "classes_override.py", line 30, in method2: bad return type [bad-return-type]'] -Line 50: Unexpected errors ['File "classes_override.py", line 50, in method2: bad return type [bad-return-type]'] -Line 57: Unexpected errors ['File "classes_override.py", line 57, in ChildA: Attribute \\'method4\\' not found on any parent class [override-error]'] -Line 66: Unexpected errors ['File "classes_override.py", line 66, in method4: bad return type [bad-return-type]'] -Line 101: Unexpected errors ['File "classes_override.py", line 101, in ChildB: Attribute \\'method1\\' not found on any parent class [override-error]'] +Line 7: Unexpected errors ['classes_override.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] +Line 30: Unexpected errors ['classes_override.py:30:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 50: Unexpected errors ['classes_override.py:50:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: bad return type [bad-return-type]'] +Line 57: Unexpected errors ["classes_override.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ChildA: Attribute 'method4' not found on any parent class [override-error]"] +Line 66: Unexpected errors ['classes_override.py:66:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] +Line 101: Unexpected errors ["classes_override.py:101:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ChildB: Attribute 'method1' not found on any parent class [override-error]"] """ diff --git a/conformance/results/pytype/constructors_call_init.toml b/conformance/results/pytype/constructors_call_init.toml index 0b800099..b52f3b5b 100644 --- a/conformance/results/pytype/constructors_call_init.toml +++ b/conformance/results/pytype/constructors_call_init.toml @@ -12,27 +12,79 @@ Line 21: Expected 1 errors Line 42: Expected 1 errors Line 56: Expected 1 errors Line 107: Expected 1 errors -Line 51: Unexpected errors ['File "constructors_call_init.py", line 51, in __init__: Invalid type annotation \\'Class4[int]\\' for self [invalid-annotation]'] -Line 72: Unexpected errors ['File "constructors_call_init.py", line 72, in : Class5 [assert-type]'] -Line 74: Unexpected errors ['File "constructors_call_init.py", line 74, in : Class5 [assert-type]'] -Line 88: Unexpected errors ['File "constructors_call_init.py", line 88, in Class6: Invalid type annotation \\'V2\\' [invalid-annotation]', 'File "constructors_call_init.py", line 88, in Class6: Invalid type annotation \\'V1\\' [invalid-annotation]', 'File "constructors_call_init.py", line 88, in __init__: Invalid type annotation \\'Class6[V1, V2]\\' for self [invalid-annotation]'] -Line 91: Unexpected errors ['File "constructors_call_init.py", line 91, in : Class6 [assert-type]'] -Line 96: Unexpected errors ['File "constructors_call_init.py", line 96, in Class7: Invalid type annotation \\'V2\\' [invalid-annotation]', 'File "constructors_call_init.py", line 96, in Class7: Invalid type annotation \\'V1\\' [invalid-annotation]', 'File "constructors_call_init.py", line 96, in __init__: Invalid type annotation \\'Class7[V2, V1]\\' for self [invalid-annotation]'] -Line 99: Unexpected errors ['File "constructors_call_init.py", line 99, in : Class7 [assert-type]'] -Line 108: Unexpected errors ['File "constructors_call_init.py", line 108, in __init__: Invalid type annotation \\'Class8[T2, T1]\\' for self [invalid-annotation]'] +Line 51: Unexpected errors ["constructors_call_init.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation]"] +Line 72: Unexpected errors ['constructors_call_init.py:72:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class5 [assert-type]'] +Line 74: Unexpected errors ['constructors_call_init.py:74:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class5 [assert-type]'] +Line 88: Unexpected errors ["constructors_call_init.py:88:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class6: Invalid type annotation 'V2' [invalid-annotation]", "constructors_call_init.py:88:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class6: Invalid type annotation 'V1' [invalid-annotation]", "constructors_call_init.py:88:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation]"] +Line 91: Unexpected errors ['constructors_call_init.py:91:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class6 [assert-type]'] +Line 96: Unexpected errors ["constructors_call_init.py:96:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class7: Invalid type annotation 'V2' [invalid-annotation]", "constructors_call_init.py:96:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Class7: Invalid type annotation 'V1' [invalid-annotation]", "constructors_call_init.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation]"] +Line 99: Unexpected errors ['constructors_call_init.py:99:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] +Line 108: Unexpected errors ["constructors_call_init.py:108:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation]"] """ output = """ -File "constructors_call_init.py", line 51, in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation] -File "constructors_call_init.py", line 72, in : Class5 [assert-type] -File "constructors_call_init.py", line 74, in : Class5 [assert-type] -File "constructors_call_init.py", line 88, in Class6: Invalid type annotation 'V2' [invalid-annotation] -File "constructors_call_init.py", line 88, in Class6: Invalid type annotation 'V1' [invalid-annotation] -File "constructors_call_init.py", line 88, in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation] -File "constructors_call_init.py", line 91, in : Class6 [assert-type] -File "constructors_call_init.py", line 96, in Class7: Invalid type annotation 'V2' [invalid-annotation] -File "constructors_call_init.py", line 96, in Class7: Invalid type annotation 'V1' [invalid-annotation] -File "constructors_call_init.py", line 96, in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation] -File "constructors_call_init.py", line 99, in : Class7 [assert-type] -File "constructors_call_init.py", line 108, in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation] -File "constructors_call_init.py", line 130, in : Function Class11.__init__ expects 1 arg(s), got 2 [wrong-arg-count] +constructors_call_init.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class4[int]' for self [invalid-annotation] + + def __init__(self: "Class4[int]") -> None: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_init.py:72:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class5 [assert-type] + +assert_type(Class5(0), Class5[list[int]]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class5 [assert-type] + +assert_type(Class5(""), Class5[set[str]]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class6: Invalid type annotation 'V2' [invalid-annotation] + + def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class6: Invalid type annotation 'V1' [invalid-annotation] + + def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:88:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class6[V1, V2]' for self [invalid-annotation] + + def __init__(self: "Class6[V1, V2]", value1: V1, value2: V2) -> None: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_init.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class6 [assert-type] + +assert_type(Class6(0, ""), Class6[int, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:96:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class7: Invalid type annotation 'V2' [invalid-annotation] + + def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:96:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Class7: Invalid type annotation 'V1' [invalid-annotation] + + def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class7[V2, V1]' for self [invalid-annotation] + + def __init__(self: "Class7[V2, V1]", value1: V1, value2: V2) -> None: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_init.py:99:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] + +assert_type(Class7(0, ""), Class7[str, int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:108:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'Class8[T2, T1]' for self [invalid-annotation] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_call_init.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Class11.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Class11(1) # E +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_call_metaclass.toml b/conformance/results/pytype/constructors_call_metaclass.toml index 377ea284..3fe225c4 100644 --- a/conformance/results/pytype/constructors_call_metaclass.toml +++ b/conformance/results/pytype/constructors_call_metaclass.toml @@ -4,14 +4,38 @@ Does not honor metaclass __call__ method when evaluating constructor call. """ conformance_automated = "Fail" errors_diff = """ -Line 23: Unexpected errors ['File "constructors_call_metaclass.py", line 23, in : Missing parameter \\'x\\' in call to function Class1.__new__ [missing-parameter]', 'File "constructors_call_metaclass.py", line 23, in : Any [assert-type]'] -Line 36: Unexpected errors ['File "constructors_call_metaclass.py", line 36, in : Missing parameter \\'x\\' in call to function Class2.__new__ [missing-parameter]', 'File "constructors_call_metaclass.py", line 36, in : Any [assert-type]'] +Line 23: Unexpected errors ["constructors_call_metaclass.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter]", 'constructors_call_metaclass.py:23:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 36: Unexpected errors ["constructors_call_metaclass.py:36:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter]", 'constructors_call_metaclass.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ output = """ -File "constructors_call_metaclass.py", line 23, in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter] -File "constructors_call_metaclass.py", line 23, in : Any [assert-type] -File "constructors_call_metaclass.py", line 36, in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] -File "constructors_call_metaclass.py", line 36, in : Any [assert-type] -File "constructors_call_metaclass.py", line 51, in : Missing parameter 'x' in call to function Class3.__new__ [missing-parameter] -File "constructors_call_metaclass.py", line 65, in : Missing parameter 'x' in call to function Class4.__new__ [missing-parameter] +constructors_call_metaclass.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class1.__new__ [missing-parameter] + +assert_type(Class1(), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Class1(), NoReturn) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:36:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] + +assert_type(Class2(), int | Meta2) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Class2(), int | Meta2) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class3.__new__ [missing-parameter] + +Class3() # E: Missing argument for 'x' parameter in __new__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_metaclass.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class4.__new__ [missing-parameter] + +Class4() # E: Missing argument for 'x' parameter in __new__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_call_new.toml b/conformance/results/pytype/constructors_call_new.toml index 022364fe..970a8bbe 100644 --- a/conformance/results/pytype/constructors_call_new.toml +++ b/conformance/results/pytype/constructors_call_new.toml @@ -7,19 +7,43 @@ Does not skip evaluation of __init__ based on __new__ return type. conformance_automated = "Fail" errors_diff = """ Line 21: Expected 1 errors -Line 76: Unexpected errors ['File "constructors_call_new.py", line 76, in : Any [assert-type]'] -Line 89: Unexpected errors ['File "constructors_call_new.py", line 89, in : Missing parameter \\'x\\' in call to function Class6.__init__ [missing-parameter]'] -Line 113: Unexpected errors ['File "constructors_call_new.py", line 113, in __new__: bad return type [bad-return-type]'] -Line 125: Unexpected errors ['File "constructors_call_new.py", line 125, in __new__: bad return type [bad-return-type]'] -Line 140: Unexpected errors ['File "constructors_call_new.py", line 140, in __new__: bad return type [bad-return-type]'] +Line 76: Unexpected errors ['constructors_call_new.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 89: Unexpected errors ["constructors_call_new.py:89:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter]"] +Line 113: Unexpected errors ['constructors_call_new.py:113:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 125: Unexpected errors ['constructors_call_new.py:125:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 140: Unexpected errors ['constructors_call_new.py:140:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] """ output = """ -File "constructors_call_new.py", line 76, in : Any [assert-type] -File "constructors_call_new.py", line 89, in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter] -File "constructors_call_new.py", line 113, in __new__: bad return type [bad-return-type] -File "constructors_call_new.py", line 125, in __new__: bad return type [bad-return-type] -File "constructors_call_new.py", line 140, in __new__: bad return type [bad-return-type] +constructors_call_new.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + + assert_type(Class5(), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_new.py:89:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Class6.__init__ [missing-parameter] + +assert_type(Class6(), int | Class6) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_call_new.py:113:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, *args, **kwargs) -> "Class8[list[T]]": ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_new.py:125:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, *args, **kwargs) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +constructors_call_new.py:140:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls: "type[Class11[int]]") -> "Class11[int]": ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 143, in current file -File "constructors_call_new.py", line 145, in : Function Class11.__new__ was called with the wrong arguments [wrong-arg-types] +constructors_call_new.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Class11.__new__ was called with the wrong arguments [wrong-arg-types] + +Class11[str]() # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_call_type.toml b/conformance/results/pytype/constructors_call_type.toml index 7c07a5f5..9af05589 100644 --- a/conformance/results/pytype/constructors_call_type.toml +++ b/conformance/results/pytype/constructors_call_type.toml @@ -9,18 +9,46 @@ Line 64: Expected 1 errors Line 72: Expected 1 errors Line 81: Expected 1 errors Line 82: Expected 1 errors -Line 25: Unexpected errors ['File "constructors_call_type.py", line 25, in __new__: Missing parameter \\'cls\\' in call to function object.__new__ [missing-parameter]', 'File "constructors_call_type.py", line 25, in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args]'] -Line 62: Unexpected errors ['File "constructors_call_type.py", line 62, in : Invalid type annotation \\'T\\' [invalid-annotation]'] +Line 25: Unexpected errors ["constructors_call_type.py:25:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter]", 'constructors_call_type.py:25:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args]'] +Line 62: Unexpected errors ["constructors_call_type.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]"] """ output = """ -File "constructors_call_type.py", line 25, in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter] +constructors_call_type.py:25:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: Missing parameter 'cls' in call to function object.__new__ [missing-parameter] + + return super().__new__(*args, **kwargs) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 30, in func1 -File "constructors_call_type.py", line 25, in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args] +constructors_call_type.py:25:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: Invalid keyword arguments (x, y) to function object.__new__ [wrong-keyword-args] + + return super().__new__(*args, **kwargs) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 29, in func1 -File "constructors_call_type.py", line 40, in func2: Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] -File "constructors_call_type.py", line 50, in func3: Missing parameter 'x' in call to function Class3.__init__ [missing-parameter] -File "constructors_call_type.py", line 59, in func4: Function Class4.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_call_type.py", line 62, in : Invalid type annotation 'T' [invalid-annotation] +constructors_call_type.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Missing parameter 'x' in call to function Class2.__new__ [missing-parameter] + + cls() # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +constructors_call_type.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Missing parameter 'x' in call to function Class3.__init__ [missing-parameter] + + cls() # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +constructors_call_type.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: Function Class4.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + + cls(1) # E + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +constructors_call_type.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def func5(cls: type[T]): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + cls() # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + cls(1) # E +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/constructors_callable.toml b/conformance/results/pytype/constructors_callable.toml index e1199f52..0074fa18 100644 --- a/conformance/results/pytype/constructors_callable.toml +++ b/conformance/results/pytype/constructors_callable.toml @@ -10,69 +10,221 @@ errors_diff = """ Line 51: Expected 1 errors Line 127: Expected 1 errors Line 144: Expected 1 errors -Line 36: Unexpected errors ['File "constructors_callable.py", line 36, in : Callable[[Any], Class1] [reveal-type]'] -Line 49: Unexpected errors ['File "constructors_callable.py", line 49, in : Callable[[Any], Class2] [reveal-type]'] -Line 50: Unexpected errors ['File "constructors_callable.py", line 50, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 50, in : Any [assert-type]'] -Line 57: Unexpected errors ['File "constructors_callable.py", line 57, in __new__: bad return type [bad-return-type]'] -Line 63: Unexpected errors ['File "constructors_callable.py", line 63, in : Callable[[Any], Class3] [reveal-type]'] -Line 73: Unexpected errors ['File "constructors_callable.py", line 73, in __new__: bad return type [bad-return-type]'] -Line 77: Unexpected errors ['File "constructors_callable.py", line 77, in : Callable[[Any], Class4] [reveal-type]'] -Line 78: Unexpected errors ['File "constructors_callable.py", line 78, in : nothing [assert-type]'] -Line 97: Unexpected errors ['File "constructors_callable.py", line 97, in : Callable[[Any], Class5] [reveal-type]'] -Line 100: Unexpected errors ['File "constructors_callable.py", line 100, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 100, in : Any [assert-type]'] -Line 105: Unexpected errors ['File "constructors_callable.py", line 105, in : Invalid keyword argument x to function [wrong-keyword-args]', 'File "constructors_callable.py", line 105, in : Any [assert-type]'] -Line 125: Unexpected errors ['File "constructors_callable.py", line 125, in : Callable[[Any], Class6] [reveal-type]'] -Line 126: Unexpected errors ['File "constructors_callable.py", line 126, in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'File "constructors_callable.py", line 126, in : Any [assert-type]'] -Line 142: Unexpected errors ['File "constructors_callable.py", line 142, in : Callable[[Any], Class6Any] [reveal-type]'] -Line 143: Unexpected errors ['File "constructors_callable.py", line 143, in : Function expects 1 arg(s), got 0 [wrong-arg-count]'] -Line 161: Unexpected errors ['File "constructors_callable.py", line 161, in : Callable[[Any], Class7] [reveal-type]'] -Line 164: Unexpected errors ['File "constructors_callable.py", line 164, in : Class7 [assert-type]'] -Line 165: Unexpected errors ['File "constructors_callable.py", line 165, in : Class7 [assert-type]'] -Line 182: Unexpected errors ['File "constructors_callable.py", line 182, in : Callable[[Any], Class8[nothing]] [reveal-type]'] -Line 183: Unexpected errors ['File "constructors_callable.py", line 183, in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'File "constructors_callable.py", line 183, in : Any [assert-type]'] -Line 193: Unexpected errors ['File "constructors_callable.py", line 193, in : Callable[[Any], Class9] [reveal-type]'] -Line 194: Unexpected errors ['File "constructors_callable.py", line 194, in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'File "constructors_callable.py", line 194, in : Any [assert-type]'] +Line 36: Unexpected errors ['constructors_callable.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class1] [reveal-type]'] +Line 49: Unexpected errors ['constructors_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class2] [reveal-type]'] +Line 50: Unexpected errors ['constructors_callable.py:50:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:50:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 57: Unexpected errors ['constructors_callable.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 63: Unexpected errors ['constructors_callable.py:63:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class3] [reveal-type]'] +Line 73: Unexpected errors ['constructors_callable.py:73:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 77: Unexpected errors ['constructors_callable.py:77:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class4] [reveal-type]'] +Line 78: Unexpected errors ['constructors_callable.py:78:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : nothing [assert-type]'] +Line 97: Unexpected errors ['constructors_callable.py:97:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class5] [reveal-type]'] +Line 100: Unexpected errors ['constructors_callable.py:100:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:100:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 105: Unexpected errors ['constructors_callable.py:105:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument x to function [wrong-keyword-args]', 'constructors_callable.py:105:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 125: Unexpected errors ['constructors_callable.py:125:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class6] [reveal-type]'] +Line 126: Unexpected errors ['constructors_callable.py:126:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]', 'constructors_callable.py:126:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 142: Unexpected errors ['constructors_callable.py:142:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class6Any] [reveal-type]'] +Line 143: Unexpected errors ['constructors_callable.py:143:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count]'] +Line 161: Unexpected errors ['constructors_callable.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class7] [reveal-type]'] +Line 164: Unexpected errors ['constructors_callable.py:164:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] +Line 165: Unexpected errors ['constructors_callable.py:165:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class7 [assert-type]'] +Line 182: Unexpected errors ['constructors_callable.py:182:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class8[nothing]] [reveal-type]'] +Line 183: Unexpected errors ['constructors_callable.py:183:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'constructors_callable.py:183:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 193: Unexpected errors ['constructors_callable.py:193:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Class9] [reveal-type]'] +Line 194: Unexpected errors ['constructors_callable.py:194:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count]', 'constructors_callable.py:194:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ output = """ -File "constructors_callable.py", line 36, in : Callable[[Any], Class1] [reveal-type] -File "constructors_callable.py", line 38, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 39, in : Invalid keyword argument y to function [wrong-keyword-args] -File "constructors_callable.py", line 49, in : Callable[[Any], Class2] [reveal-type] -File "constructors_callable.py", line 50, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 50, in : Any [assert-type] -File "constructors_callable.py", line 57, in __new__: bad return type [bad-return-type] +constructors_callable.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class1] [reveal-type] + +reveal_type(r1) # `def (x: int) -> Class1` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +r1() # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:39:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] + +r1(y=1) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class2] [reveal-type] + +reveal_type(r2) # `def () -> Class2` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:50:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +assert_type(r2(), Class2) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r2(), Class2) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, *args, **kwargs) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 64, in current file -File "constructors_callable.py", line 63, in : Callable[[Any], Class3] [reveal-type] -File "constructors_callable.py", line 65, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 66, in : Invalid keyword argument y to function [wrong-keyword-args] -File "constructors_callable.py", line 67, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 73, in __new__: bad return type [bad-return-type] +constructors_callable.py:63:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class3] [reveal-type] + +reveal_type(r3) # `def (x: int) -> Class3` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +r3() # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] + +r3(y=1) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +r3(1, 2) # E +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + def __new__(cls, x: int) -> int: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 78, in current file -File "constructors_callable.py", line 77, in : Callable[[Any], Class4] [reveal-type] -File "constructors_callable.py", line 78, in : nothing [assert-type] -File "constructors_callable.py", line 79, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 80, in : Invalid keyword argument y to function [wrong-keyword-args] -File "constructors_callable.py", line 97, in : Callable[[Any], Class5] [reveal-type] -File "constructors_callable.py", line 100, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 100, in : Any [assert-type] -File "constructors_callable.py", line 105, in : Invalid keyword argument x to function [wrong-keyword-args] -File "constructors_callable.py", line 105, in : Any [assert-type] -File "constructors_callable.py", line 125, in : Callable[[Any], Class6] [reveal-type] -File "constructors_callable.py", line 126, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 126, in : Any [assert-type] -File "constructors_callable.py", line 142, in : Callable[[Any], Class6Any] [reveal-type] -File "constructors_callable.py", line 143, in : Function expects 1 arg(s), got 0 [wrong-arg-count] -File "constructors_callable.py", line 161, in : Callable[[Any], Class7] [reveal-type] -File "constructors_callable.py", line 164, in : Class7 [assert-type] -File "constructors_callable.py", line 165, in : Class7 [assert-type] -File "constructors_callable.py", line 182, in : Callable[[Any], Class8[nothing]] [reveal-type] -File "constructors_callable.py", line 183, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 183, in : Any [assert-type] -File "constructors_callable.py", line 184, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 193, in : Callable[[Any], Class9] [reveal-type] -File "constructors_callable.py", line 194, in : Function expects 1 arg(s), got 2 [wrong-arg-count] -File "constructors_callable.py", line 194, in : Any [assert-type] -File "constructors_callable.py", line 195, in : Function expects 1 arg(s), got 2 [wrong-arg-count] +constructors_callable.py:77:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class4] [reveal-type] + +reveal_type(r4) # `def (x: int) -> int` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : nothing [assert-type] + +assert_type(r4(1), int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:79:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +r4() # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:80:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument y to function [wrong-keyword-args] + +r4(y=1) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:97:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class5] [reveal-type] + +reveal_type(r5) # `def (*args: Any, **kwargs: Any) -> NoReturn` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:100:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + + assert_type(r5(), NoReturn) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:100:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + + assert_type(r5(), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:105:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument x to function [wrong-keyword-args] + + assert_type(r5(1, x=1), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:105:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + + assert_type(r5(1, x=1), NoReturn) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:125:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class6] [reveal-type] + +reveal_type(r6) # `def () -> Class6Proxy` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:126:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +assert_type(r6(), Class6Proxy) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +constructors_callable.py:126:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r6(), Class6Proxy) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:142:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class6Any] [reveal-type] + +reveal_type(r6_any) # `def () -> Any` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:143:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 0 [wrong-arg-count] + +assert_type(r6_any(), Any) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class7] [reveal-type] + +reveal_type( +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + r7 +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m +) # overload of `def (x: int) -> Class7[int]` and `def (x: str) -> Class7[str]` +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +constructors_callable.py:164:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] + +assert_type(r7(0), Class7[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:165:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class7 [assert-type] + +assert_type(r7(""), Class7[str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:182:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class8[nothing]] [reveal-type] + +reveal_type(r8) # `def [T] (x: T, y: list[T]) -> Class8[T]` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:183:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +assert_type(r8([""], [""]), Class8[str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:183:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r8([""], [""]), Class8[str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:184:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +r8([1], [""]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:193:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Class9] [reveal-type] + +reveal_type(r9) # `def [T] (x: list[T], y: list[T]) -> Class9` +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:194:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +assert_type(r9([""], [""]), Class9) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:194:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(r9([""], [""]), Class9) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +constructors_callable.py:195:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function expects 1 arg(s), got 2 [wrong-arg-count] + +r9([1], [""]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/dataclasses_descriptors.toml b/conformance/results/pytype/dataclasses_descriptors.toml index f27186cc..04f11550 100644 --- a/conformance/results/pytype/dataclasses_descriptors.toml +++ b/conformance/results/pytype/dataclasses_descriptors.toml @@ -3,36 +3,76 @@ notes = """ Does not understand descriptor objects in dataclass. """ output = """ -File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:24:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 38, in current file -File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:24:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 37, in current file -File "dataclasses_descriptors.py", line 35, in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:35:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types] + +dc1 = DC1(3) + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 68, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 67, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 66, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 63, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 62, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 61, in current file -File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type] +dataclasses_descriptors.py:51:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __get__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 24: Unexpected errors ['File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 24, in __get__: bad return type [bad-return-type]'] -Line 35: Unexpected errors ['File "dataclasses_descriptors.py", line 35, in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 51: Unexpected errors ['File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]', 'File "dataclasses_descriptors.py", line 51, in __get__: bad return type [bad-return-type]'] +Line 24: Unexpected errors ['dataclasses_descriptors.py:24:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:24:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]'] +Line 35: Unexpected errors ['dataclasses_descriptors.py:35:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC1.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 51: Unexpected errors ['dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]', 'dataclasses_descriptors.py:51:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __get__: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/dataclasses_final.toml b/conformance/results/pytype/dataclasses_final.toml index 3e6e604f..7d9d915f 100644 --- a/conformance/results/pytype/dataclasses_final.toml +++ b/conformance/results/pytype/dataclasses_final.toml @@ -6,12 +6,28 @@ errors_diff = """ Line 27: Expected 1 errors Line 35: Expected 1 errors Line 37: Expected 1 errors -Line 18: Unexpected errors ['File "dataclasses_final.py", line 18, in D: Invalid use of typing.Final [final-error]', 'File "dataclasses_final.py", line 18, in D: Invalid type annotation \\'ClassVar[Final[int]]\\' [invalid-annotation]'] +Line 18: Unexpected errors ['dataclasses_final.py:18:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in D: Invalid use of typing.Final [final-error]', "dataclasses_final.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation]"] """ output = """ -File "dataclasses_final.py", line 18, in D: Invalid use of typing.Final [final-error] -File "dataclasses_final.py", line 18, in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation] -File "dataclasses_final.py", line 36, in : Assigning to attribute final_with_default, which was annotated with Final [final-error] -File "dataclasses_final.py", line 38, in : Assigning to attribute final_with_default, which was annotated with Final [final-error] +dataclasses_final.py:18:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in D: Invalid use of typing.Final [final-error] + + final_classvar: ClassVar[Final[int]] = 4 + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_final.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in D: Invalid type annotation 'ClassVar[Final[int]]' [invalid-annotation] + + final_classvar: ClassVar[Final[int]] = 4 + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_final.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute final_with_default, which was annotated with Final [final-error] + +d.final_with_default = "baz" # E: can't assign to final attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_final.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute final_with_default, which was annotated with Final [final-error] + +D.final_with_default = "baz" # E: can't assign to final attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" diff --git a/conformance/results/pytype/dataclasses_kwonly.toml b/conformance/results/pytype/dataclasses_kwonly.toml index 76a22f8a..4166e703 100644 --- a/conformance/results/pytype/dataclasses_kwonly.toml +++ b/conformance/results/pytype/dataclasses_kwonly.toml @@ -4,18 +4,46 @@ Incorrectly reports error when kw_only field has default value. Incorrectly rejects kw_only field with default before positional field. """ output = """ -File "dataclasses_kwonly.py", line 23, in : Function DC1.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_kwonly.py", line 38, in : Function DC2.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_kwonly.py", line 47, in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] -File "dataclasses_kwonly.py", line 50, in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] -File "dataclasses_kwonly.py", line 53, in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] -File "dataclasses_kwonly.py", line 56, in : In method __init__, non-default argument c follows default argument [invalid-function-definition] -File "dataclasses_kwonly.py", line 61, in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument] +dataclasses_kwonly.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC1.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +DC1("hi", 1) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +DC2("hi", 1) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] + +DC3("hi") +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] + +DC3("hi", b=1) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter] + +DC3("hi", 1) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:56:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument c follows default argument [invalid-function-definition] + +@dataclass + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_kwonly.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument] + +DC4("", 0.2, b=3) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 47: Unexpected errors ['File "dataclasses_kwonly.py", line 47, in : Missing parameter \\'a\\' in call to function DC3.__init__ [missing-parameter]'] -Line 50: Unexpected errors ['File "dataclasses_kwonly.py", line 50, in : Missing parameter \\'a\\' in call to function DC3.__init__ [missing-parameter]'] -Line 56: Unexpected errors ['File "dataclasses_kwonly.py", line 56, in : In method __init__, non-default argument c follows default argument [invalid-function-definition]'] -Line 61: Unexpected errors ['File "dataclasses_kwonly.py", line 61, in : function DC4.__init__ got multiple values for keyword argument \\'b\\' [duplicate-keyword-argument]'] +Line 47: Unexpected errors ["dataclasses_kwonly.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter]"] +Line 50: Unexpected errors ["dataclasses_kwonly.py:50:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'a' in call to function DC3.__init__ [missing-parameter]"] +Line 56: Unexpected errors ['dataclasses_kwonly.py:56:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : In method __init__, non-default argument c follows default argument [invalid-function-definition]'] +Line 61: Unexpected errors ["dataclasses_kwonly.py:61:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : function DC4.__init__ got multiple values for keyword argument 'b' [duplicate-keyword-argument]"] """ diff --git a/conformance/results/pytype/dataclasses_postinit.toml b/conformance/results/pytype/dataclasses_postinit.toml index cf8fa072..286e7a3d 100644 --- a/conformance/results/pytype/dataclasses_postinit.toml +++ b/conformance/results/pytype/dataclasses_postinit.toml @@ -4,13 +4,27 @@ Does not validate `__post_init__` method. Reports incorrect error for incompatible `__post_init__` method override. """ output = """ -File "dataclasses_postinit.py", line 28, in : No attribute 'x' on DC1 [attribute-error] -File "dataclasses_postinit.py", line 29, in : No attribute 'y' on DC1 [attribute-error] -File "dataclasses_postinit.py", line 54, in DC4: Overriding method signature mismatch [signature-mismatch] +dataclasses_postinit.py:28:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'x' on DC1 [attribute-error] + +print(dc1.x) # E: cannot access InitVar + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +dataclasses_postinit.py:29:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'y' on DC1 [attribute-error] + +print(dc1.y) # E: cannot access InitVar + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +dataclasses_postinit.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC4: Overriding method signature mismatch [signature-mismatch] + + def __post_init__(self, _name: str, _age: int): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 36: Expected 1 errors -Line 54: Unexpected errors ['File "dataclasses_postinit.py", line 54, in DC4: Overriding method signature mismatch [signature-mismatch]'] +Line 54: Unexpected errors ['dataclasses_postinit.py:54:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in DC4: Overriding method signature mismatch [signature-mismatch]'] """ diff --git a/conformance/results/pytype/dataclasses_slots.toml b/conformance/results/pytype/dataclasses_slots.toml index e9c80134..be10aba0 100644 --- a/conformance/results/pytype/dataclasses_slots.toml +++ b/conformance/results/pytype/dataclasses_slots.toml @@ -5,16 +5,32 @@ Does not reject write to instance variable that is not defined in __slots__. Incorrectly reports error when accessing `__slots__` when `slots=True`. """ output = """ -File "dataclasses_slots.py", line 56, in : No attribute '__slots__' on Type[DC5] [attribute-error] -File "dataclasses_slots.py", line 57, in : No attribute '__slots__' on DC5 [attribute-error] -File "dataclasses_slots.py", line 66, in : No attribute '__slots__' on Type[DC6] [attribute-error] -File "dataclasses_slots.py", line 69, in : No attribute '__slots__' on DC6 [attribute-error] +dataclasses_slots.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error] + +DC5.__slots__ +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_slots.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on DC5 [attribute-error] + +DC5(1).__slots__ +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_slots.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC6] [attribute-error] + +DC6.__slots__ # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_slots.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on DC6 [attribute-error] + +DC6(1).__slots__ # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 25: Expected 1 errors Line 38: Expected 1 errors Lines 10, 11: Expected error (tag 'DC1') -Line 56: Unexpected errors ['File "dataclasses_slots.py", line 56, in : No attribute \\'__slots__\\' on Type[DC5] [attribute-error]'] -Line 57: Unexpected errors ['File "dataclasses_slots.py", line 57, in : No attribute \\'__slots__\\' on DC5 [attribute-error]'] +Line 56: Unexpected errors ["dataclasses_slots.py:56:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error]"] +Line 57: Unexpected errors ["dataclasses_slots.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on DC5 [attribute-error]"] """ diff --git a/conformance/results/pytype/dataclasses_transform_class.toml b/conformance/results/pytype/dataclasses_transform_class.toml index 8d25adeb..5bbaceed 100644 --- a/conformance/results/pytype/dataclasses_transform_class.toml +++ b/conformance/results/pytype/dataclasses_transform_class.toml @@ -3,11 +3,43 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] -File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +dataclasses_transform_class.py:23:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + kw_only_default=True, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + field_specifiers=(ModelField, model_field), +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:60:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] + +c1_1 = Customer1(id=3, name="Sue", other_name="Susan") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:85:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + kw_only_default=True, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + field_specifiers=(ModelField, model_field), +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:106:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args] + +gc_1 = GenericCustomer(id=3) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_class.py:109:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(frozen_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -17,9 +49,9 @@ Line 66: Expected 1 errors Line 72: Expected 1 errors Line 82: Expected 1 errors Line 122: Expected 1 errors -Line 23: Unexpected errors ['File "dataclasses_transform_class.py", line 23, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 60: Unexpected errors ['File "dataclasses_transform_class.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 85: Unexpected errors ['File "dataclasses_transform_class.py", line 85, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 106: Unexpected errors ['File "dataclasses_transform_class.py", line 106, in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] -Line 109: Unexpected errors ['File "dataclasses_transform_class.py", line 109, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 23: Unexpected errors ['dataclasses_transform_class.py:23:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['dataclasses_transform_class.py:60:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 85: Unexpected errors ['dataclasses_transform_class.py:85:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 106: Unexpected errors ['dataclasses_transform_class.py:106:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument id to function GenericCustomer.__init__ [wrong-keyword-args]'] +Line 109: Unexpected errors ['dataclasses_transform_class.py:109:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_converter.toml b/conformance/results/pytype/dataclasses_transform_converter.toml index a6701084..14fa83e8 100644 --- a/conformance/results/pytype/dataclasses_transform_converter.toml +++ b/conformance/results/pytype/dataclasses_transform_converter.toml @@ -6,46 +6,118 @@ conformance_automated = "Fail" errors_diff = """ Line 49: Expected 1 errors Line 118: Expected 1 errors -Line 26: Unexpected errors ['File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]', 'File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type]'] -Line 29: Unexpected errors ['File "dataclasses_transform_converter.py", line 29, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 112: Unexpected errors ['File "dataclasses_transform_converter.py", line 112, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 114: Unexpected errors ['File "dataclasses_transform_converter.py", line 114, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] -Line 115: Unexpected errors ['File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] -Line 116: Unexpected errors ['File "dataclasses_transform_converter.py", line 116, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] -Line 121: Unexpected errors ['File "dataclasses_transform_converter.py", line 121, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 26: Unexpected errors ['dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]', 'dataclasses_transform_converter.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in model_field: bad return type [bad-return-type]'] +Line 29: Unexpected errors ['dataclasses_transform_converter.py:29:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch]'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch]'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types]'] """ output = """ -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 99, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 104, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 102, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 98, in current file line 100, in DC2 -File "dataclasses_transform_converter.py", line 26, in model_field: bad return type [bad-return-type] +dataclasses_transform_converter.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in model_field: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 47, in current file line 49, in DC1 -File "dataclasses_transform_converter.py", line 29, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_converter.py", line 48, in DC1: Function model_field was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 107, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 108, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 109, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 112, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 114, in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 115, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 116, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 119, in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_converter.py", line 121, in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 130, in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] -File "dataclasses_transform_converter.py", line 133, in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] +dataclasses_transform_converter.py:29:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(field_specifiers=(model_field,)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:48:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC1: Function model_field was called with the wrong arguments [wrong-arg-types] + + field1: int = model_field(converter=bad_converter1) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:107:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +DC2(1, "f1", "f2", b"f3", []) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:108:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +DC2("f0", "f1", "f2", 1, []) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +DC2("f0", "f1", "f2", "f3", 3j) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:112:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +dc1 = DC2("f0", "f1", "f2", b"f6", []) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:114:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field0 does not match type of assignment [annotation-type-mismatch] + +dc1.field0 = "f1" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:115:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] + +dc1.field3 = "f6" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:116:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] + +dc1.field3 = b"f6" +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for field3 does not match type of assignment [annotation-type-mismatch] + +dc1.field3 = 1 # E +\u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC2.__init__ was called with the wrong arguments [wrong-arg-types] + +dc2 = DC2("f0", "f1", "f2", "f6", "1", (("a", "1"), ("b", "2"))) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:130:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] + + field1: int = model_field(converter=converter_simple, default=1) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_converter.py:133:19: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC3: Function model_field was called with the wrong arguments [wrong-arg-types] + + field3: int = model_field(converter=converter_simple, default_factory=int) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/dataclasses_transform_field.toml b/conformance/results/pytype/dataclasses_transform_field.toml index 26f330eb..62c34fde 100644 --- a/conformance/results/pytype/dataclasses_transform_field.toml +++ b/conformance/results/pytype/dataclasses_transform_field.toml @@ -3,13 +3,21 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_field.py", line 48, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_field.py", line 50, in create_model: bad return type [bad-return-type] +dataclasses_transform_field.py:48:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, field_specifiers=(field1, field2)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_field.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 64: Expected 1 errors Line 75: Expected 1 errors -Line 48: Unexpected errors ['File "dataclasses_transform_field.py", line 48, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 50: Unexpected errors ['File "dataclasses_transform_field.py", line 50, in create_model: bad return type [bad-return-type]'] +Line 48: Unexpected errors ['dataclasses_transform_field.py:48:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 50: Unexpected errors ['dataclasses_transform_field.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_func.toml b/conformance/results/pytype/dataclasses_transform_func.toml index 89a1ae2e..1479e2bc 100644 --- a/conformance/results/pytype/dataclasses_transform_func.toml +++ b/conformance/results/pytype/dataclasses_transform_func.toml @@ -3,30 +3,74 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_func.py", line 13, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_func.py", line 19, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type] +dataclasses_transform_func.py:13:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, order_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:19:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, order_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 89, in current file -File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type] -File "dataclasses_transform_func.py", line 50, in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 53, in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "dataclasses_transform_func.py", line 57, in : Type annotation for name does not match type of assignment [annotation-type-mismatch] -File "dataclasses_transform_func.py", line 65, in : Invalid keyword arguments (id, name, salary) to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 67, in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args] -File "dataclasses_transform_func.py", line 71, in : Function Customer2.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "dataclasses_transform_func.py", line 76, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +dataclasses_transform_func.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in create_model: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:50:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args] + +c1_1 = Customer1(id=3, name="Sue") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:53:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +c1_2 = Customer1(3, "Sue") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for name does not match type of assignment [annotation-type-mismatch] + +c1_2.name = 3 # E +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:65:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name, salary) to function Customer1.__init__ [wrong-keyword-args] + +c1_3 = Customer1(id=3, name="Sue", salary=40000) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:67:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args] + +c2_1 = Customer2(id=0, name="John") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:71:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Customer2.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +c2_2 = Customer2(0, "John") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_func.py:76:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(kw_only_default=True, order_default=True, frozen_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 61: Expected 1 errors Line 97: Expected 1 errors Lines 89, 90: Expected error (tag 'Customer3Subclass') -Line 13: Unexpected errors ['File "dataclasses_transform_func.py", line 13, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['File "dataclasses_transform_func.py", line 19, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 30: Unexpected errors ['File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type]', 'File "dataclasses_transform_func.py", line 30, in create_model: bad return type [bad-return-type]'] -Line 50: Unexpected errors ['File "dataclasses_transform_func.py", line 50, in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args]'] -Line 53: Unexpected errors ['File "dataclasses_transform_func.py", line 53, in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 67: Unexpected errors ['File "dataclasses_transform_func.py", line 67, in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args]'] -Line 76: Unexpected errors ['File "dataclasses_transform_func.py", line 76, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['dataclasses_transform_func.py:13:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ['dataclasses_transform_func.py:19:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 30: Unexpected errors ['dataclasses_transform_func.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]', 'dataclasses_transform_func.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in create_model: bad return type [bad-return-type]'] +Line 50: Unexpected errors ['dataclasses_transform_func.py:50:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword arguments (id, name) to function Customer1.__init__ [wrong-keyword-args]'] +Line 53: Unexpected errors ['dataclasses_transform_func.py:53:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Customer1.__init__ expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 67: Unexpected errors ['dataclasses_transform_func.py:67:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword arguments (id, name) to function Customer2.__init__ [wrong-keyword-args]'] +Line 76: Unexpected errors ['dataclasses_transform_func.py:76:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_transform_meta.toml b/conformance/results/pytype/dataclasses_transform_meta.toml index bf816841..93cf0058 100644 --- a/conformance/results/pytype/dataclasses_transform_meta.toml +++ b/conformance/results/pytype/dataclasses_transform_meta.toml @@ -3,9 +3,27 @@ notes = """ Does not understand @dataclass_transform. """ output = """ -File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet] -File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] -File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet] +dataclasses_transform_meta.py:21:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + kw_only_default=True, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + field_specifiers=(ModelField, model_field), +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_transform_meta.py:60:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args] + +c1_1 = Customer1(id=3, name="Sue", other_name="Susan") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_transform_meta.py:86:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet] + +@dataclass_transform(frozen_default=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -15,7 +33,7 @@ Line 66: Expected 1 errors Line 73: Expected 1 errors Line 83: Expected 1 errors Line 103: Expected 1 errors -Line 21: Unexpected errors ['File "dataclasses_transform_meta.py", line 21, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] -Line 60: Unexpected errors ['File "dataclasses_transform_meta.py", line 60, in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] -Line 86: Unexpected errors ['File "dataclasses_transform_meta.py", line 86, in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 21: Unexpected errors ['dataclasses_transform_meta.py:21:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] +Line 60: Unexpected errors ['dataclasses_transform_meta.py:60:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid keyword argument other_name to function Customer1.__init__ [wrong-keyword-args]'] +Line 86: Unexpected errors ['dataclasses_transform_meta.py:86:2: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Arguments to dataclass_transform not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/dataclasses_usage.toml b/conformance/results/pytype/dataclasses_usage.toml index 6690e24d..cc9e6e71 100644 --- a/conformance/results/pytype/dataclasses_usage.toml +++ b/conformance/results/pytype/dataclasses_usage.toml @@ -1,16 +1,60 @@ conformant = "Pass" output = """ -File "dataclasses_usage.py", line 50, in : Missing parameter 'unit_price' in call to function InventoryItem.__init__ [missing-parameter] -File "dataclasses_usage.py", line 51, in : Function InventoryItem.__init__ was called with the wrong arguments [wrong-arg-types] -File "dataclasses_usage.py", line 52, in : Function InventoryItem.__init__ expects 3 arg(s), got 5 [wrong-arg-count] -File "dataclasses_usage.py", line 58, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] -File "dataclasses_usage.py", line 64, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] -File "dataclasses_usage.py", line 70, in : In method __init__, non-default argument b follows default argument [invalid-function-definition] -File "dataclasses_usage.py", line 83, in : Function DC4.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_usage.py", line 88, in DC5: Type annotation for a does not match type of assignment [annotation-type-mismatch] -File "dataclasses_usage.py", line 127, in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] -File "dataclasses_usage.py", line 130, in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] -File "dataclasses_usage.py", line 179, in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] +dataclasses_usage.py:50:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'unit_price' in call to function InventoryItem.__init__ [missing-parameter] + +v2 = InventoryItem("name") # E: missing unit_price + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:51:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function InventoryItem.__init__ was called with the wrong arguments [wrong-arg-types] + +v3 = InventoryItem("name", "price") # E: incorrect type for unit_price + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:52:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function InventoryItem.__init__ expects 3 arg(s), got 5 [wrong-arg-count] + +v4 = InventoryItem("name", 3.1, 3, 4) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:58:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] + +@dataclass # E[DC1] + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:64:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] + +@dataclass # E[DC2] + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:70:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : In method __init__, non-default argument b follows default argument [invalid-function-definition] + +@dataclass # E[DC3] + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:83:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC4.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +v6 = DC4(0, 1) # E: too many parameters + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:88:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in DC5: Type annotation for a does not match type of assignment [annotation-type-mismatch] + + a: int = field(default_factory=str) # E: type mismatch + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +dataclasses_usage.py:127:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC7.__init__ expects 2 arg(s), got 3 [wrong-arg-count] + +DC7(3, 4) # E +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function DC8.__init__ [missing-parameter] + +DC8(a) # E +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +dataclasses_usage.py:179:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function DC13.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +DC13(3) # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/directives_assert_type.toml b/conformance/results/pytype/directives_assert_type.toml index a77a3f9e..288cc655 100644 --- a/conformance/results/pytype/directives_assert_type.toml +++ b/conformance/results/pytype/directives_assert_type.toml @@ -3,11 +3,31 @@ notes = """ Incorrectly allows assert(x, int) where x is a Literal. """ output = """ -File "directives_assert_type.py", line 27, in func1: Union[int, str] [assert-type] -File "directives_assert_type.py", line 28, in func1: Any [assert-type] -File "directives_assert_type.py", line 31, in func1: Function assert_type expects 2 arg(s), got 0 [wrong-arg-count] -File "directives_assert_type.py", line 32, in func1: str [assert-type] -File "directives_assert_type.py", line 33, in func1: Function assert_type expects 2 arg(s), got 3 [wrong-arg-count] +directives_assert_type.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [assert-type] + + assert_type(a, int) # E: Type mismatch + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Any [assert-type] + + assert_type(c, int) # E: Type mismatch + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Function assert_type expects 2 arg(s), got 0 [wrong-arg-count] + + assert_type() # E: not enough arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:32:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: str [assert-type] + + assert_type("", int) # E: wrong argument type + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_assert_type.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Function assert_type expects 2 arg(s), got 3 [wrong-arg-count] + + assert_type(a, int | str, a) # E: too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/directives_cast.toml b/conformance/results/pytype/directives_cast.toml index 28cc3470..edb229b9 100644 --- a/conformance/results/pytype/directives_cast.toml +++ b/conformance/results/pytype/directives_cast.toml @@ -3,8 +3,16 @@ notes = """ Does not reject a call to "cast" with additional arguments. """ output = """ -File "directives_cast.py", line 15, in : Missing parameter 'typ' in call to function typing.cast [missing-parameter] -File "directives_cast.py", line 16, in : Invalid type annotation '1' for typing.cast [invalid-annotation] +directives_cast.py:15:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'typ' in call to function typing.cast [missing-parameter] + +bad1 = cast() # E: Too few arguments + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +directives_cast.py:16:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for typing.cast [invalid-annotation] + +bad2 = cast(1, "") # E: Bad first argument type + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/directives_deprecated.toml b/conformance/results/pytype/directives_deprecated.toml index 8928ce99..26c18993 100644 --- a/conformance/results/pytype/directives_deprecated.toml +++ b/conformance/results/pytype/directives_deprecated.toml @@ -15,13 +15,29 @@ Line 48: Expected 1 errors Line 58: Expected 1 errors Line 69: Expected 1 errors Line 98: Expected 1 errors -Line 10: Unexpected errors ['File "directives_deprecated.py", line 10, in : typing.override not supported yet [not-supported-yet]'] -Line 11: Unexpected errors ['File "directives_deprecated.py", line 11, in : typing_extensions.deprecated not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['File "directives_deprecated.py", line 19, in : Can\\'t find module \\'_directives_deprecated_library\\'. [import-error]'] +Line 10: Unexpected errors ['directives_deprecated.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.override not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['directives_deprecated.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.deprecated not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ["directives_deprecated.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_directives_deprecated_library'. [import-error]"] """ output = """ -File "directives_deprecated.py", line 10, in : typing.override not supported yet [not-supported-yet] -File "directives_deprecated.py", line 11, in : typing_extensions.deprecated not supported yet [not-supported-yet] -File "directives_deprecated.py", line 18, in : Can't find module '_directives_deprecated_library'. [import-error] -File "directives_deprecated.py", line 19, in : Can't find module '_directives_deprecated_library'. [import-error] +directives_deprecated.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.override not supported yet [not-supported-yet] + +from typing import Protocol, override +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_deprecated.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.deprecated not supported yet [not-supported-yet] + +from typing_extensions import deprecated +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_deprecated.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_directives_deprecated_library'. [import-error] + +from _directives_deprecated_library import Ham # E: Use of deprecated class Ham +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_deprecated.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_directives_deprecated_library'. [import-error] + +import _directives_deprecated_library as library +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/directives_no_type_check.toml b/conformance/results/pytype/directives_no_type_check.toml index b90eb6f6..22229130 100644 --- a/conformance/results/pytype/directives_no_type_check.toml +++ b/conformance/results/pytype/directives_no_type_check.toml @@ -3,11 +3,31 @@ notes = """ Does not honor @no_type_check decorator. """ output = """ -File "directives_no_type_check.py", line 15, in ClassA: Type annotation for x does not match type of assignment [annotation-type-mismatch] -File "directives_no_type_check.py", line 25, in func1: unsupported operand type(s) for +: int and str [unsupported-operands] -File "directives_no_type_check.py", line 26, in func1: bad return type [bad-return-type] -File "directives_no_type_check.py", line 29, in : Function func1 was called with the wrong arguments [wrong-arg-types] -File "directives_no_type_check.py", line 32, in : Missing parameter 'a' in call to function func1 [missing-parameter] +directives_no_type_check.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Type annotation for x does not match type of assignment [annotation-type-mismatch] + + x: int = "" # E?: No error should be reported + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +directives_no_type_check.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: unsupported operand type(s) for +: int and str [unsupported-operands] + + c = a + b # E?: No error should be reported + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +directives_no_type_check.py:26:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] + + return 1 # E?: No error should be reported + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +directives_no_type_check.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func1 was called with the wrong arguments [wrong-arg-types] + +func1(b"invalid", b"arguments") # E?: No error should be reported +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_no_type_check.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'a' in call to function func1 [missing-parameter] + +func1() # E: incorrect arguments for parameters +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/directives_reveal_type.toml b/conformance/results/pytype/directives_reveal_type.toml index 38e08038..a18c7d07 100644 --- a/conformance/results/pytype/directives_reveal_type.toml +++ b/conformance/results/pytype/directives_reveal_type.toml @@ -4,17 +4,37 @@ Does not reject call to reveal_type with zero arguments. Does not reject call to reveal_type with too many arguments. """ output = """ -File "directives_reveal_type.py", line 14, in func1: Union[int, str] [reveal-type] -File "directives_reveal_type.py", line 15, in func1: List[int] [reveal-type] -File "directives_reveal_type.py", line 16, in func1: Any [reveal-type] -File "directives_reveal_type.py", line 17, in func1: ForwardReference [reveal-type] -File "directives_reveal_type.py", line 20, in func1: Union[int, str] [reveal-type] +directives_reveal_type.py:14:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [reveal-type] + + reveal_type(a) # Revealed type is "int | str" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: List[int] [reveal-type] + + reveal_type(b) # Revealed type is "list[int]" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:16:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Any [reveal-type] + + reveal_type(c) # Revealed type is "Any" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: ForwardReference [reveal-type] + + reveal_type(d) # Revealed type is "ForwardReference" + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +directives_reveal_type.py:20:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Union[int, str] [reveal-type] + + reveal_type(a, a) # E: Too many arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors -Line 14: Unexpected errors ['File "directives_reveal_type.py", line 14, in func1: Union[int, str] [reveal-type]'] -Line 15: Unexpected errors ['File "directives_reveal_type.py", line 15, in func1: List[int] [reveal-type]'] -Line 16: Unexpected errors ['File "directives_reveal_type.py", line 16, in func1: Any [reveal-type]'] -Line 17: Unexpected errors ['File "directives_reveal_type.py", line 17, in func1: ForwardReference [reveal-type]'] +Line 14: Unexpected errors ['directives_reveal_type.py:14:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Union[int, str] [reveal-type]'] +Line 15: Unexpected errors ['directives_reveal_type.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: List[int] [reveal-type]'] +Line 16: Unexpected errors ['directives_reveal_type.py:16:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Any [reveal-type]'] +Line 17: Unexpected errors ['directives_reveal_type.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: ForwardReference [reveal-type]'] """ diff --git a/conformance/results/pytype/directives_type_ignore.toml b/conformance/results/pytype/directives_type_ignore.toml index 70b1732e..0fd58338 100644 --- a/conformance/results/pytype/directives_type_ignore.toml +++ b/conformance/results/pytype/directives_type_ignore.toml @@ -3,10 +3,19 @@ notes = """ Does not honor "# type: ignore" comment if comment includes additional text. """ output = """ -File "directives_type_ignore.py", line 11, in : Type annotation for y does not match type of assignment [annotation-type-mismatch] -File "directives_type_ignore.py", line 11: Stray type comment: ignore - additional stuff [ignored-type-comment] +directives_type_ignore.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch] + +y: int = "" # type: ignore - additional stuff +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +directives_type_ignore.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: : Stray type comment: ignore - additional stuff [ignored-type-comment] + +y: int = "" # type: ignore - additional stuff\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +y: int = "" # type: ignore - additional stuff +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['File "directives_type_ignore.py", line 11, in : Type annotation for y does not match type of assignment [annotation-type-mismatch]', 'File "directives_type_ignore.py", line 11: Stray type comment: ignore - additional stuff [ignored-type-comment]'] +Line 11: Unexpected errors ['directives_type_ignore.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch]', 'directives_type_ignore.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: : Stray type comment: ignore - additional stuff [ignored-type-comment]'] """ diff --git a/conformance/results/pytype/directives_version_platform.toml b/conformance/results/pytype/directives_version_platform.toml index 6d9473c7..dd6558f4 100644 --- a/conformance/results/pytype/directives_version_platform.toml +++ b/conformance/results/pytype/directives_version_platform.toml @@ -4,9 +4,21 @@ Does not understand three-element form of sys.version checks. Does not understand os.name checks. """ output = """ -File "directives_version_platform.py", line 27, in : Type annotation for val3 does not match type of assignment [annotation-type-mismatch] -File "directives_version_platform.py", line 40, in : Type annotation for val7 does not match type of assignment [annotation-type-mismatch] -File "directives_version_platform.py", line 45, in : Type annotation for val8 does not match type of assignment [annotation-type-mismatch] +directives_version_platform.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val3 does not match type of assignment [annotation-type-mismatch] + + val3: int = "" # E?: May not generate an error (support for three-element sys.version is optional) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +directives_version_platform.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val7 does not match type of assignment [annotation-type-mismatch] + + val7: int = "" # E?: May not generate an error (support for os.name is optional) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +directives_version_platform.py:45:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for val8 does not match type of assignment [annotation-type-mismatch] + + val8: int = "" # E?: May not generate an error (support for os.name is optional) + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/enums_definition.toml b/conformance/results/pytype/enums_definition.toml index 29c66d61..bc2a8230 100644 --- a/conformance/results/pytype/enums_definition.toml +++ b/conformance/results/pytype/enums_definition.toml @@ -5,6 +5,10 @@ Does not support some functional forms for Enum class definitions (optional). errors_diff = """ """ output = """ -File "enums_definition.py", line 24, in : Function unsolveable.__new__ was called with the wrong arguments [wrong-arg-types] +enums_definition.py:24:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function unsolveable.__new__ was called with the wrong arguments [wrong-arg-types] + +Color2 = Enum("Color2", "RED", "GREEN", "BLUE") # E? + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" diff --git a/conformance/results/pytype/enums_member_values.toml b/conformance/results/pytype/enums_member_values.toml index c562dce2..bf932576 100644 --- a/conformance/results/pytype/enums_member_values.toml +++ b/conformance/results/pytype/enums_member_values.toml @@ -8,11 +8,67 @@ Does not evaluate literal types for auto values (optional). conformance_automated = "Fail" errors_diff = """ Line 78: Expected 1 errors -Line 41: Unexpected errors ['File "enums_member_values.py", line 41, in : Missing parameter \\'mass\\' in call to function Planet.__init__ [missing-parameter]', 'File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 41: Unexpected errors ["enums_member_values.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter]", 'enums_member_values.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types]'] """ output = """ -File "enums_member_values.py", line 41, in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter] -File "enums_member_values.py", line 41, in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types] -File "enums_member_values.py", line 85, in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] -File "enums_member_values.py", line 96, in : Any [assert-type] +enums_member_values.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'mass' in call to function Planet.__init__ [missing-parameter] + +class Planet(Enum): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def __init__(self, value: int, mass: float, radius: float): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self._value_ = value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.mass = mass +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.radius = radius +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + MERCURY = (1, 3.303e23, 2.4397e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + VENUS = (2, 4.869e24, 6.0518e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + EARTH = (3, 5.976e24, 6.37814e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + MARS = (6.421e23, 3.3972e6) # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + JUPITER = 5 # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_member_values.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Planet.__init__ was called with the wrong arguments [wrong-arg-types] + +class Planet(Enum): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def __init__(self, value: int, mass: float, radius: float): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self._value_ = value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.mass = mass +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.radius = radius +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + MERCURY = (1, 3.303e23, 2.4397e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + VENUS = (2, 4.869e24, 6.0518e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + EARTH = (3, 5.976e24, 6.37814e6) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + MARS = (6.421e23, 3.3972e6) # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + JUPITER = 5 # E?: Type checker error (optional) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_member_values.py:85:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Type annotation for _value_ does not match type of assignment [annotation-type-mismatch] + + self._value_ = value # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_member_values.py:96:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(ColumnType.DORIC.value, int) # E? +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/enums_members.toml b/conformance/results/pytype/enums_members.toml index 00070042..2f5eb964 100644 --- a/conformance/results/pytype/enums_members.toml +++ b/conformance/results/pytype/enums_members.toml @@ -9,32 +9,126 @@ errors_diff = """ Line 50: Expected 1 errors Line 116: Expected 1 errors Line 129: Expected 1 errors -Line 7: Unexpected errors ['File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet]', 'File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet]'] -Line 35: Unexpected errors ['File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type]'] -Line 36: Unexpected errors ['File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type]'] -Line 107: Unexpected errors ['File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 108: Unexpected errors ['File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 110: Unexpected errors ['File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] -Line 128: Unexpected errors ['File "enums_members.py", line 128, in method: Example2 [reveal-type]'] +Line 7: Unexpected errors ['enums_members.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : enum.nonmember not supported yet [not-supported-yet]', 'enums_members.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : enum.member not supported yet [not-supported-yet]'] +Line 35: Unexpected errors ['enums_members.py:35:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : _enums_members.Pet2 [assert-type]'] +Line 36: Unexpected errors ['enums_members.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : _enums_members.Pet2 [assert-type]'] +Line 107: Unexpected errors ['enums_members.py:107:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 108: Unexpected errors ['enums_members.py:108:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 110: Unexpected errors ['enums_members.py:110:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count]'] +Line 128: Unexpected errors ['enums_members.py:128:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: Example2 [reveal-type]'] """ output = """ -File "enums_members.py", line 7, in : enum.nonmember not supported yet [not-supported-yet] -File "enums_members.py", line 7, in : enum.member not supported yet [not-supported-yet] -File "enums_members.py", line 15, in : Function Pet.__init__ was called with the wrong arguments [wrong-arg-types] -File "enums_members.py", line 35, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 36, in : _enums_members.Pet2 [assert-type] -File "enums_members.py", line 82, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 82, in : Callable[[Any], Any] [assert-type] -File "enums_members.py", line 83, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 83, in : Callable[[int], int] [assert-type] -File "enums_members.py", line 84, in : property [assert-type] -File "enums_members.py", line 84, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 85, in : Invalid type annotation 'Literal' [invalid-annotation] -File "enums_members.py", line 85, in : Callable[[Any], None] [assert-type] -File "enums_members.py", line 107, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 108, in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 110, in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] -File "enums_members.py", line 128, in method: Example2 [reveal-type] -File "enums_members.py", line 146, in : Pet5 [assert-type] -File "enums_members.py", line 147, in : Pet5 [assert-type] +enums_members.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : enum.nonmember not supported yet [not-supported-yet] + +from enum import Enum, member, nonmember +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : enum.member not supported yet [not-supported-yet] + +from enum import Enum, member, nonmember +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:15:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Pet.__init__ was called with the wrong arguments [wrong-arg-types] + +class Pet(Enum): # E?: Uninitialized attributes (pyre) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + genus: str # Non-member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + species: str # Non-member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + CAT = 1 # Member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + DOG = 2 # Member attribute +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def __init__(self, genus: str, species: str) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.genus = genus +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.species = species +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:35:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : _enums_members.Pet2 [assert-type] + +assert_type(Pet2.genus, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : _enums_members.Pet2 [assert-type] + +assert_type(Pet2.species, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:82:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.converter, Literal[Pet4.converter]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Any] [assert-type] + +assert_type(Pet4.converter, Literal[Pet4.converter]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:83:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.transform, Literal[Pet4.transform]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[int], int] [assert-type] + +assert_type(Pet4.transform, Literal[Pet4.transform]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : property [assert-type] + +assert_type(Pet4.species, Literal[Pet4.species]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:84:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.species, Literal[Pet4.species]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:85:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +assert_type(Pet4.speak, Literal[Pet4.speak]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:85:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], None] [assert-type] + +assert_type(Pet4.speak, Literal[Pet4.speak]) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:107:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] + + a = member(1) # Member attribute + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:108:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.nonmember expects 0 arg(s), got 1 [wrong-arg-count] + + b = nonmember(2) # Non-member attribute + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:110:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Example: Function enum.member expects 0 arg(s), got 1 [wrong-arg-count] + + @member + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +enums_members.py:128:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: Example2 [reveal-type] + + reveal_type(Example2.__B) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Pet5 [assert-type] + +assert_type(Pet5.DOG, int) # E?: Literal[2] is also acceptable +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +enums_members.py:147:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Pet5 [assert-type] + +assert_type(Pet5.FISH, int) # E?: Literal[3] is also acceptable +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/exceptions_context_managers.toml b/conformance/results/pytype/exceptions_context_managers.toml index 5abf283a..4d195209 100644 --- a/conformance/results/pytype/exceptions_context_managers.toml +++ b/conformance/results/pytype/exceptions_context_managers.toml @@ -4,10 +4,18 @@ Does not support code flow analysis. """ conformance_automated = "Fail" errors_diff = """ -Line 50: Unexpected errors ['File "exceptions_context_managers.py", line 50, in suppress1: str [assert-type]'] -Line 57: Unexpected errors ['File "exceptions_context_managers.py", line 57, in suppress2: str [assert-type]'] +Line 50: Unexpected errors ['exceptions_context_managers.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in suppress1: str [assert-type]'] +Line 57: Unexpected errors ['exceptions_context_managers.py:57:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in suppress2: str [assert-type]'] """ output = """ -File "exceptions_context_managers.py", line 50, in suppress1: str [assert-type] -File "exceptions_context_managers.py", line 57, in suppress2: str [assert-type] +exceptions_context_managers.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in suppress1: str [assert-type] + + assert_type(x, int | str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +exceptions_context_managers.py:57:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in suppress2: str [assert-type] + + assert_type(x, int | str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ diff --git a/conformance/results/pytype/generics_base_class.toml b/conformance/results/pytype/generics_base_class.toml index b108aa62..096f7d00 100644 --- a/conformance/results/pytype/generics_base_class.toml +++ b/conformance/results/pytype/generics_base_class.toml @@ -4,10 +4,28 @@ False negative on passing SymbolTable to dict[str, list[object]]. Does not reject illegal use of Generic. """ output = """ -File "generics_base_class.py", line 29, in : Invalid type annotation 'T' [invalid-annotation] -File "generics_base_class.py", line 49, in : Invalid type annotation 'LinkedList[int, int]' [invalid-annotation] -File "generics_base_class.py", line 61, in : Invalid type annotation 'MyDict[int, int]' [invalid-annotation] -File "generics_base_class.py", line 68, in : Invalid type annotation 'Generic' [invalid-annotation] +generics_base_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def func1(y: Generic[T]): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + x: Generic # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:49:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'LinkedList[int, int]' [invalid-annotation] + +linked_list_invalid: LinkedList[int, int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:61:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'MyDict[int, int]' [invalid-annotation] + +my_dict_invalid: MyDict[int, int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class BadClass1(Generic[T, T]): # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/generics_basic.toml b/conformance/results/pytype/generics_basic.toml index 2089cc5d..5ab2769b 100644 --- a/conformance/results/pytype/generics_basic.toml +++ b/conformance/results/pytype/generics_basic.toml @@ -4,27 +4,79 @@ False positives in examples using constrained type variables. False negative for generic metaclass. """ output = """ -File "generics_basic.py", line 34, in concat: bad return type [bad-return-type] +generics_basic.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in concat: bad return type [bad-return-type] + + return x + y + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 67, in test_concat_subtype -File "generics_basic.py", line 40, in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 41, in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 49, in : Invalid TypeVar: the number of constraints must be 0 or more than 1 [invalid-typevar] -File "generics_basic.py", line 55, in Test: Invalid TypeVar: constraint cannot contain TypeVars [invalid-typevar] -File "generics_basic.py", line 67, in test_concat_subtype: MyStr [assert-type] -File "generics_basic.py", line 68, in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 68, in test_concat_subtype: Any [assert-type] -File "generics_basic.py", line 69, in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] -File "generics_basic.py", line 121, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_basic.py", line 157, in test_my_map: unsupported operand type(s) for item retrieval: MyMap1[str, int] and int [unsupported-operands] -File "generics_basic.py", line 158, in test_my_map: unsupported operand type(s) for item retrieval: MyMap2[int, str] and int [unsupported-operands] -File "generics_basic.py", line 182, in test_my_iterable_any: Iterator[nothing] [assert-type] +generics_basic.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] + + concat(s, b) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat: Function concat was called with the wrong arguments [wrong-arg-types] + + concat(b, s) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:49:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: the number of constraints must be 0 or more than 1 [invalid-typevar] + +BadConstraint1 = TypeVar("BadConstraint1", str) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:55:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Test: Invalid TypeVar: constraint cannot contain TypeVars [invalid-typevar] + + BadConstraint2 = TypeVar("BadConstraint2", str, list[T]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:67:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: MyStr [assert-type] + + assert_type(concat(m, m), str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] + + assert_type(concat(m, s), str) + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Any [assert-type] + + assert_type(concat(m, s), str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types] + + concat(m, b) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:121:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Pair2(Generic[T, T]): # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:157:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_map: unsupported operand type(s) for item retrieval: MyMap1[str, int] and int [unsupported-operands] + + m1[0] # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +generics_basic.py:158:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_map: unsupported operand type(s) for item retrieval: MyMap2[int, str] and int [unsupported-operands] + + m2[0] # E + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +generics_basic.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type] + + assert_type(iter(m), Iterator[Any]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 191: Expected 1 errors -Line 34: Unexpected errors ['File "generics_basic.py", line 34, in concat: bad return type [bad-return-type]'] -Line 67: Unexpected errors ['File "generics_basic.py", line 67, in test_concat_subtype: MyStr [assert-type]'] -Line 68: Unexpected errors ['File "generics_basic.py", line 68, in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types]', 'File "generics_basic.py", line 68, in test_concat_subtype: Any [assert-type]'] -Line 182: Unexpected errors ['File "generics_basic.py", line 182, in test_my_iterable_any: Iterator[nothing] [assert-type]'] +Line 34: Unexpected errors ['generics_basic.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in concat: bad return type [bad-return-type]'] +Line 67: Unexpected errors ['generics_basic.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: MyStr [assert-type]'] +Line 68: Unexpected errors ['generics_basic.py:68:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types]', 'generics_basic.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Any [assert-type]'] +Line 182: Unexpected errors ['generics_basic.py:182:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type]'] """ diff --git a/conformance/results/pytype/generics_defaults.toml b/conformance/results/pytype/generics_defaults.toml index 64fb88a2..f5258ae4 100644 --- a/conformance/results/pytype/generics_defaults.toml +++ b/conformance/results/pytype/generics_defaults.toml @@ -1,98 +1,329 @@ conformant = "Unsupported" output = """ -File "generics_defaults.py", line 7, in : typing.Unpack not supported yet [not-supported-yet] -File "generics_defaults.py", line 8, in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet] -File "generics_defaults.py", line 11, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 12, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 13, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 24, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 27, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 30, in : class NoNonDefaults is not indexable [not-indexable] -File "generics_defaults.py", line 31, in : class NoNonDefaults is not indexable [not-indexable] -File "generics_defaults.py", line 32, in : class NoNonDefaults is not indexable [not-indexable] -File "generics_defaults.py", line 35, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 38, in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] -File "generics_defaults.py", line 39, in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] -File "generics_defaults.py", line 42, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 45, in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 47, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 50, in : Invalid type annotation 'AllTheDefaults[int]' [invalid-annotation] -File "generics_defaults.py", line 53, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 56, in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation] -File "generics_defaults.py", line 57, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 60, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation] -File "generics_defaults.py", line 61, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 64, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 65, in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] -File "generics_defaults.py", line 73, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 76, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 79, in : class Class_ParamSpec is not indexable [not-indexable] -File "generics_defaults.py", line 80, in : class Class_ParamSpec is not indexable [not-indexable] -File "generics_defaults.py", line 81, in : class Class_ParamSpec is not indexable [not-indexable] -File "generics_defaults.py", line 91, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 94, in : class Class_TypeVarTuple is not indexable [not-indexable] -File "generics_defaults.py", line 95, in : class Class_TypeVarTuple is not indexable [not-indexable] -File "generics_defaults.py", line 96, in : class Class_TypeVarTuple is not indexable [not-indexable] -File "generics_defaults.py", line 103, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 104, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 110, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 111, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 121, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 127, in : Any [assert-type] -File "generics_defaults.py", line 135, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 138, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 145, in : wrong arguments [invalid-typevar] -File "generics_defaults.py", line 148, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 151, in : class Foo6 is not indexable [not-indexable] -File "generics_defaults.py", line 152, in : class Foo6 is not indexable [not-indexable] -File "generics_defaults.py", line 159, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults.py", line 166, in : class Foo7 is not indexable [not-indexable] -File "generics_defaults.py", line 166, in : Callable[[Any], Self] [assert-type] -File "generics_defaults.py", line 167, in : Any [assert-type] +generics_defaults.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import Any, Callable, Generic, Self, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet] + +from typing_extensions import TypeVar, ParamSpec, TypeVarTuple +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:11:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultStrT = TypeVar("DefaultStrT", default=str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:12:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultIntT = TypeVar("DefaultIntT", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:13:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultBoolT = TypeVar("DefaultBoolT", default=bool) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:24:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class NonDefaultFollowsDefault(Generic[DefaultStrT, T]): ... # E: non-default TypeVars cannot follow ones with defaults + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:27:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class NoNonDefaults(Generic[DefaultStrT, DefaultIntT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:30:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults, type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:31:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:31:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:32:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str, int], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:32:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class NoNonDefaults is not indexable [not-indexable] + +assert_type(NoNonDefaults[str, int], type[NoNonDefaults[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:35:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class OneDefault(Generic[T, DefaultBoolT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:38:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] + +assert_type(OneDefault[float], type[OneDefault[float, bool]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:39:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation] + +assert_type(OneDefault[float](), OneDefault[float, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:42:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class AllTheDefaults(Generic[T1, T2, DefaultStrT, DefaultIntT, DefaultBoolT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:45:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation] + +assert_type(AllTheDefaults, type[AllTheDefaults[Any, Any, str, int, bool]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:47:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + AllTheDefaults[int, complex], type[AllTheDefaults[int, complex, str, int, bool]] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:50:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int]' [invalid-annotation] + +AllTheDefaults[int] # E: expected 2 arguments to AllTheDefaults +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:53:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + AllTheDefaults[int, complex], type[AllTheDefaults[int, complex, str, int, bool]] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:56:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation] + + AllTheDefaults[int, complex, str], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:57:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + type[AllTheDefaults[int, complex, str, int, bool]], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation] + + AllTheDefaults[int, complex, str, int], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:61:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + type[AllTheDefaults[int, complex, str, int, bool]], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:64:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + AllTheDefaults[int, complex, str, int, bool], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:65:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation] + + type[AllTheDefaults[int, complex, str, int, bool]], + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:73:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultP = ParamSpec("DefaultP", default=[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:76:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Class_ParamSpec(Generic[DefaultP]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:79:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec, type[Class_ParamSpec[str, int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:80:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec(), Class_ParamSpec[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:81:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec[[bool, bool]](), Class_ParamSpec[bool, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:81:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_ParamSpec is not indexable [not-indexable] + +assert_type(Class_ParamSpec[[bool, bool]](), Class_ParamSpec[bool, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:91:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Class_TypeVarTuple(Generic[*DefaultTs]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:94:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple, type[Class_TypeVarTuple[*tuple[str, int]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:95:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple(), Class_TypeVarTuple[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:96:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple[int, bool](), Class_TypeVarTuple[int, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:96:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable] + +assert_type(Class_TypeVarTuple[int, bool](), Class_TypeVarTuple[int, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Ok", bound=float, default=int) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:104:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid", bound=str, default=int) # E: the bound and default are incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:110:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Ok", float, str, default=float) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:111:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid", float, str, default=int) # E: expected one of float or str got int +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:121:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +T4 = TypeVar("T4", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:127:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(func1(0), int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:135:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +T5 = TypeVar("T5", default=bool) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:138:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo5(Generic[*Ts, T5]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:145:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +P = ParamSpec("P", default=[float, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:148:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo6(Generic[*Ts, P]): ... # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:151:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:151:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str], type[Foo6[int, str, [float, bool]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:152:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:152:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo6 is not indexable [not-indexable] + +assert_type(Foo6[int, str, [bytes]], type[Foo6[int, str, [bytes]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:159:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo7(Generic[DefaultIntT]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:166:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] + +assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:166:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo7 is not indexable [not-indexable] + +assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:166:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Callable[[Any], Self] [assert-type] + +assert_type(Foo7.meth, Callable[[Foo7[int]], Foo7[int]]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Foo7.attr, int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['File "generics_defaults.py", line 7, in : typing.Unpack not supported yet [not-supported-yet]'] -Line 8: Unexpected errors ['File "generics_defaults.py", line 8, in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet]'] -Line 11: Unexpected errors ['File "generics_defaults.py", line 11, in : wrong arguments [invalid-typevar]'] -Line 12: Unexpected errors ['File "generics_defaults.py", line 12, in : wrong arguments [invalid-typevar]'] -Line 13: Unexpected errors ['File "generics_defaults.py", line 13, in : wrong arguments [invalid-typevar]'] -Line 27: Unexpected errors ['File "generics_defaults.py", line 27, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 30: Unexpected errors ['File "generics_defaults.py", line 30, in : class NoNonDefaults is not indexable [not-indexable]'] -Line 31: Unexpected errors ['File "generics_defaults.py", line 31, in : class NoNonDefaults is not indexable [not-indexable]'] -Line 32: Unexpected errors ['File "generics_defaults.py", line 32, in : class NoNonDefaults is not indexable [not-indexable]'] -Line 35: Unexpected errors ['File "generics_defaults.py", line 35, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 38: Unexpected errors ['File "generics_defaults.py", line 38, in : Invalid type annotation \\'OneDefault[float, bool]\\' [invalid-annotation]'] -Line 39: Unexpected errors ['File "generics_defaults.py", line 39, in : Invalid type annotation \\'OneDefault[float, bool]\\' [invalid-annotation]'] -Line 42: Unexpected errors ['File "generics_defaults.py", line 42, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 45: Unexpected errors ['File "generics_defaults.py", line 45, in : Invalid type annotation \\'AllTheDefaults[Any, Any, str, int, bool]\\' [invalid-annotation]'] -Line 47: Unexpected errors ['File "generics_defaults.py", line 47, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 53: Unexpected errors ['File "generics_defaults.py", line 53, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 56: Unexpected errors ['File "generics_defaults.py", line 56, in : Invalid type annotation \\'AllTheDefaults[int, complex, str]\\' [invalid-annotation]'] -Line 57: Unexpected errors ['File "generics_defaults.py", line 57, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 60: Unexpected errors ['File "generics_defaults.py", line 60, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int]\\' [invalid-annotation]'] -Line 61: Unexpected errors ['File "generics_defaults.py", line 61, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 64: Unexpected errors ['File "generics_defaults.py", line 64, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 65: Unexpected errors ['File "generics_defaults.py", line 65, in : Invalid type annotation \\'AllTheDefaults[int, complex, str, int, bool]\\' [invalid-annotation]'] -Line 73: Unexpected errors ['File "generics_defaults.py", line 73, in : wrong arguments [invalid-typevar]'] -Line 76: Unexpected errors ['File "generics_defaults.py", line 76, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 79: Unexpected errors ['File "generics_defaults.py", line 79, in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 80: Unexpected errors ['File "generics_defaults.py", line 80, in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 81: Unexpected errors ['File "generics_defaults.py", line 81, in : class Class_ParamSpec is not indexable [not-indexable]'] -Line 91: Unexpected errors ['File "generics_defaults.py", line 91, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 94: Unexpected errors ['File "generics_defaults.py", line 94, in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 95: Unexpected errors ['File "generics_defaults.py", line 95, in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 96: Unexpected errors ['File "generics_defaults.py", line 96, in : class Class_TypeVarTuple is not indexable [not-indexable]'] -Line 103: Unexpected errors ['File "generics_defaults.py", line 103, in : wrong arguments [invalid-typevar]'] -Line 110: Unexpected errors ['File "generics_defaults.py", line 110, in : wrong arguments [invalid-typevar]'] -Line 121: Unexpected errors ['File "generics_defaults.py", line 121, in : wrong arguments [invalid-typevar]'] -Line 127: Unexpected errors ['File "generics_defaults.py", line 127, in : Any [assert-type]'] -Line 135: Unexpected errors ['File "generics_defaults.py", line 135, in : wrong arguments [invalid-typevar]'] -Line 145: Unexpected errors ['File "generics_defaults.py", line 145, in : wrong arguments [invalid-typevar]'] -Line 148: Unexpected errors ['File "generics_defaults.py", line 148, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 151: Unexpected errors ['File "generics_defaults.py", line 151, in : class Foo6 is not indexable [not-indexable]'] -Line 152: Unexpected errors ['File "generics_defaults.py", line 152, in : class Foo6 is not indexable [not-indexable]'] -Line 159: Unexpected errors ['File "generics_defaults.py", line 159, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 166: Unexpected errors ['File "generics_defaults.py", line 166, in : class Foo7 is not indexable [not-indexable]', 'File "generics_defaults.py", line 166, in : Callable[[Any], Self] [assert-type]'] -Line 167: Unexpected errors ['File "generics_defaults.py", line 167, in : Any [assert-type]'] +Line 7: Unexpected errors ['generics_defaults.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] +Line 8: Unexpected errors ['generics_defaults.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.TypeVarTuple not supported yet [not-supported-yet]'] +Line 11: Unexpected errors ['generics_defaults.py:11:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 12: Unexpected errors ['generics_defaults.py:12:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 13: Unexpected errors ['generics_defaults.py:13:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 27: Unexpected errors ["generics_defaults.py:27:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 30: Unexpected errors ['generics_defaults.py:30:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] +Line 31: Unexpected errors ['generics_defaults.py:31:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]', 'generics_defaults.py:31:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] +Line 32: Unexpected errors ['generics_defaults.py:32:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]', 'generics_defaults.py:32:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class NoNonDefaults is not indexable [not-indexable]'] +Line 35: Unexpected errors ["generics_defaults.py:35:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 38: Unexpected errors ["generics_defaults.py:38:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation]"] +Line 39: Unexpected errors ["generics_defaults.py:39:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'OneDefault[float, bool]' [invalid-annotation]"] +Line 42: Unexpected errors ["generics_defaults.py:42:22: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 45: Unexpected errors ["generics_defaults.py:45:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[Any, Any, str, int, bool]' [invalid-annotation]"] +Line 47: Unexpected errors ["generics_defaults.py:47:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 53: Unexpected errors ["generics_defaults.py:53:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 56: Unexpected errors ["generics_defaults.py:56:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str]' [invalid-annotation]"] +Line 57: Unexpected errors ["generics_defaults.py:57:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 60: Unexpected errors ["generics_defaults.py:60:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int]' [invalid-annotation]"] +Line 61: Unexpected errors ["generics_defaults.py:61:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 64: Unexpected errors ["generics_defaults.py:64:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 65: Unexpected errors ["generics_defaults.py:65:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'AllTheDefaults[int, complex, str, int, bool]' [invalid-annotation]"] +Line 73: Unexpected errors ['generics_defaults.py:73:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 76: Unexpected errors ["generics_defaults.py:76:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 79: Unexpected errors ['generics_defaults.py:79:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] +Line 80: Unexpected errors ['generics_defaults.py:80:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] +Line 81: Unexpected errors ['generics_defaults.py:81:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]', 'generics_defaults.py:81:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_ParamSpec is not indexable [not-indexable]'] +Line 91: Unexpected errors ["generics_defaults.py:91:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 94: Unexpected errors ['generics_defaults.py:94:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] +Line 95: Unexpected errors ['generics_defaults.py:95:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] +Line 96: Unexpected errors ['generics_defaults.py:96:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]', 'generics_defaults.py:96:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Class_TypeVarTuple is not indexable [not-indexable]'] +Line 103: Unexpected errors ['generics_defaults.py:103:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 110: Unexpected errors ['generics_defaults.py:110:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 121: Unexpected errors ['generics_defaults.py:121:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 127: Unexpected errors ['generics_defaults.py:127:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 135: Unexpected errors ['generics_defaults.py:135:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 145: Unexpected errors ['generics_defaults.py:145:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 148: Unexpected errors ["generics_defaults.py:148:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 151: Unexpected errors ['generics_defaults.py:151:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:151:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] +Line 152: Unexpected errors ['generics_defaults.py:152:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]', 'generics_defaults.py:152:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo6 is not indexable [not-indexable]'] +Line 159: Unexpected errors ["generics_defaults.py:159:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 166: Unexpected errors ['generics_defaults.py:166:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:166:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo7 is not indexable [not-indexable]', 'generics_defaults.py:166:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Callable[[Any], Self] [assert-type]'] +Line 167: Unexpected errors ['generics_defaults.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/generics_defaults_referential.toml b/conformance/results/pytype/generics_defaults_referential.toml index 133bd794..2a72e507 100644 --- a/conformance/results/pytype/generics_defaults_referential.toml +++ b/conformance/results/pytype/generics_defaults_referential.toml @@ -1,65 +1,217 @@ conformant = "Unsupported" output = """ -File "generics_defaults_referential.py", line 14, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 15, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 16, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 17, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 20, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 23, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 24, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 25, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 26, in : class slice is not indexable [not-indexable] -File "generics_defaults_referential.py", line 28, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 31, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 35, in : class Foo is not indexable [not-indexable] -File "generics_defaults_referential.py", line 36, in : class Foo is not indexable [not-indexable] -File "generics_defaults_referential.py", line 37, in : class Foo is not indexable [not-indexable] -File "generics_defaults_referential.py", line 43, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 46, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 49, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 50, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 53, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 60, in Foo3: Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 66, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 67, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 68, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 74, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 77, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 78, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 87, in : wrong arguments [invalid-typevar] -File "generics_defaults_referential.py", line 90, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_referential.py", line 94, in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation] -File "generics_defaults_referential.py", line 95, in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] -File "generics_defaults_referential.py", line 96, in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] -File "generics_defaults_referential.py", line 97, in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] -File "generics_defaults_referential.py", line 98, in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] +generics_defaults_referential.py:14:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultStrT = TypeVar("DefaultStrT", default=str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:15:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +StartT = TypeVar("StartT", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:16:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +StopT = TypeVar("StopT", default=StartT) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:17:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +StepT = TypeVar("StepT", default=int | None) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:20:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class slice(Generic[StartT, StopT, StepT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:23:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice, type[slice[int, int, int | None]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:24:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice(), slice[int, int, int | None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:25:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str](), slice[str, str, int | None]) + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:25:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str](), slice[str, str, int | None]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:26:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str, bool, complex](), slice[str, bool, complex]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:26:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class slice is not indexable [not-indexable] + +assert_type(slice[str, bool, complex](), slice[str, bool, complex]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:28:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +T2 = TypeVar("T2", default=DefaultStrT) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:31:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo(Generic[DefaultStrT, T2]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:35:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +assert_type(Foo(1, ""), Foo[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +Foo[int](1, "") # E: Foo[int, str] cannot be assigned to self: Foo[int, int] in Foo.__init__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +Foo[int]("", 1) # E: Foo[str, int] cannot be assigned to self: Foo[int, int] in Foo.__init__ +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +S2 = TypeVar("S2", default=S1) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:46:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Foo2(Generic[S1, S2]): ... # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:49:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +Start2T = TypeVar("Start2T", default="StopT") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:50:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +Stop2T = TypeVar("Stop2T", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:53:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class slice2(Generic[Start2T, Stop2T, StepT]): ... # E: bad ordering + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:60:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Foo3: Invalid type annotation 'Generic' [invalid-annotation] + + class Bar2(Generic[S2]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Ok1", default=X1, bound=float) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:67:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("AlsoOk1", default=X1, bound=int) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:68:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid1", default=X1, bound=str) # E: int is not a subtype of str +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("Invalid2", float, str, default=Y1) # E: upper bound int is incompatible with constraints float or str +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:77:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("AlsoOk2", int, str, bool, default=Y2) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:78:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +TypeVar("AlsoInvalid2", bool, complex, default=Y2) # E: {bool, complex} is not a superset of {int, str} +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:87:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +ListDefaultT = TypeVar("ListDefaultT", default=list[Z1]) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:90:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Bar(Generic[Z1, ListDefaultT]): # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:94:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation] + +assert_type(Bar, type[Bar[Any, list[Any]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:95:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] + +assert_type(Bar[int], type[Bar[int, list[int]]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:96:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] + +assert_type(Bar[int](0, []), Bar[int, list[int]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:97:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] + +assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:97:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] + +assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:98:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] + +assert_type(Bar[int, str](0, ""), Bar[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_referential.py:98:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation] + +assert_type(Bar[int, str](0, ""), Bar[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 14: Unexpected errors ['File "generics_defaults_referential.py", line 14, in : wrong arguments [invalid-typevar]'] -Line 15: Unexpected errors ['File "generics_defaults_referential.py", line 15, in : wrong arguments [invalid-typevar]'] -Line 16: Unexpected errors ['File "generics_defaults_referential.py", line 16, in : wrong arguments [invalid-typevar]'] -Line 17: Unexpected errors ['File "generics_defaults_referential.py", line 17, in : wrong arguments [invalid-typevar]'] -Line 20: Unexpected errors ['File "generics_defaults_referential.py", line 20, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 23: Unexpected errors ['File "generics_defaults_referential.py", line 23, in : class slice is not indexable [not-indexable]'] -Line 24: Unexpected errors ['File "generics_defaults_referential.py", line 24, in : class slice is not indexable [not-indexable]'] -Line 25: Unexpected errors ['File "generics_defaults_referential.py", line 25, in : class slice is not indexable [not-indexable]'] -Line 26: Unexpected errors ['File "generics_defaults_referential.py", line 26, in : class slice is not indexable [not-indexable]'] -Line 28: Unexpected errors ['File "generics_defaults_referential.py", line 28, in : wrong arguments [invalid-typevar]'] -Line 31: Unexpected errors ['File "generics_defaults_referential.py", line 31, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 35: Unexpected errors ['File "generics_defaults_referential.py", line 35, in : class Foo is not indexable [not-indexable]'] -Line 43: Unexpected errors ['File "generics_defaults_referential.py", line 43, in : wrong arguments [invalid-typevar]'] -Line 46: Unexpected errors ['File "generics_defaults_referential.py", line 46, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 49: Unexpected errors ['File "generics_defaults_referential.py", line 49, in : wrong arguments [invalid-typevar]'] -Line 50: Unexpected errors ['File "generics_defaults_referential.py", line 50, in : wrong arguments [invalid-typevar]'] -Line 66: Unexpected errors ['File "generics_defaults_referential.py", line 66, in : wrong arguments [invalid-typevar]'] -Line 67: Unexpected errors ['File "generics_defaults_referential.py", line 67, in : wrong arguments [invalid-typevar]'] -Line 77: Unexpected errors ['File "generics_defaults_referential.py", line 77, in : wrong arguments [invalid-typevar]'] -Line 87: Unexpected errors ['File "generics_defaults_referential.py", line 87, in : wrong arguments [invalid-typevar]'] -Line 90: Unexpected errors ['File "generics_defaults_referential.py", line 90, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 94: Unexpected errors ['File "generics_defaults_referential.py", line 94, in : Invalid type annotation \\'Bar[Any, list]\\' [invalid-annotation]'] -Line 95: Unexpected errors ['File "generics_defaults_referential.py", line 95, in : Invalid type annotation \\'Bar[int, List[int]]\\' [invalid-annotation]'] -Line 96: Unexpected errors ['File "generics_defaults_referential.py", line 96, in : Invalid type annotation \\'Bar[int, List[int]]\\' [invalid-annotation]'] -Line 97: Unexpected errors ['File "generics_defaults_referential.py", line 97, in : Invalid type annotation \\'Bar[int, List[str]]\\' [invalid-annotation]'] -Line 98: Unexpected errors ['File "generics_defaults_referential.py", line 98, in : Invalid type annotation \\'Bar[int, str]\\' [invalid-annotation]'] +Line 14: Unexpected errors ['generics_defaults_referential.py:14:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 15: Unexpected errors ['generics_defaults_referential.py:15:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 16: Unexpected errors ['generics_defaults_referential.py:16:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 17: Unexpected errors ['generics_defaults_referential.py:17:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 20: Unexpected errors ["generics_defaults_referential.py:20:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 23: Unexpected errors ['generics_defaults_referential.py:23:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 24: Unexpected errors ['generics_defaults_referential.py:24:22: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 25: Unexpected errors ['generics_defaults_referential.py:25:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]', 'generics_defaults_referential.py:25:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 26: Unexpected errors ['generics_defaults_referential.py:26:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]', 'generics_defaults_referential.py:26:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class slice is not indexable [not-indexable]'] +Line 28: Unexpected errors ['generics_defaults_referential.py:28:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 31: Unexpected errors ["generics_defaults_referential.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 35: Unexpected errors ['generics_defaults_referential.py:35:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Foo is not indexable [not-indexable]'] +Line 43: Unexpected errors ['generics_defaults_referential.py:43:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 46: Unexpected errors ["generics_defaults_referential.py:46:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 49: Unexpected errors ['generics_defaults_referential.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 50: Unexpected errors ['generics_defaults_referential.py:50:10: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 66: Unexpected errors ['generics_defaults_referential.py:66:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 67: Unexpected errors ['generics_defaults_referential.py:67:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 77: Unexpected errors ['generics_defaults_referential.py:77:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 87: Unexpected errors ['generics_defaults_referential.py:87:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 90: Unexpected errors ["generics_defaults_referential.py:90:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 94: Unexpected errors ["generics_defaults_referential.py:94:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation]"] +Line 95: Unexpected errors ["generics_defaults_referential.py:95:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] +Line 96: Unexpected errors ["generics_defaults_referential.py:96:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] +Line 97: Unexpected errors ["generics_defaults_referential.py:97:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]", "generics_defaults_referential.py:97:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]"] +Line 98: Unexpected errors ["generics_defaults_referential.py:98:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]", "generics_defaults_referential.py:98:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_defaults_specialization.toml b/conformance/results/pytype/generics_defaults_specialization.toml index 2256fad5..2b77a0a3 100644 --- a/conformance/results/pytype/generics_defaults_specialization.toml +++ b/conformance/results/pytype/generics_defaults_specialization.toml @@ -1,35 +1,104 @@ conformant = "Unsupported" output = """ -File "generics_defaults_specialization.py", line 15, in : wrong arguments [invalid-typevar] -File "generics_defaults_specialization.py", line 16, in : wrong arguments [invalid-typevar] -File "generics_defaults_specialization.py", line 25, in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation] -File "generics_defaults_specialization.py", line 26, in func1: SomethingWithNoDefaults[int, Any] [assert-type] -File "generics_defaults_specialization.py", line 27, in func1: SomethingWithNoDefaults[int, Any] [assert-type] -File "generics_defaults_specialization.py", line 30, in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool, int]' [invalid-annotation] -File "generics_defaults_specialization.py", line 38, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_specialization.py", line 42, in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation] -File "generics_defaults_specialization.py", line 45, in : class Bar is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 46, in : class Bar is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 47, in : class Bar is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 53, in : Any [assert-type] -File "generics_defaults_specialization.py", line 55, in : class Foo is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 58, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_defaults_specialization.py", line 65, in : class Baz is not indexable [not-indexable] -File "generics_defaults_specialization.py", line 65, in : Invalid type annotation 'Baz[int, str]' [invalid-annotation] +generics_defaults_specialization.py:15:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultIntT = TypeVar("DefaultIntT", default=int) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:16:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : wrong arguments [invalid-typevar] + +DefaultStrT = TypeVar("DefaultStrT", default=str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:25:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation] + +def func1(p1: MyAlias, p2: MyAlias[bool]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:26:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type] + + assert_type(p1, SomethingWithNoDefaults[int, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type] + + assert_type(p2, SomethingWithNoDefaults[int, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool, int]' [invalid-annotation] + +MyAlias[bool, int] # E: too many arguments passed to MyAlias +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:38:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class SubclassMe(Generic[T1, DefaultStrT]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:42:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation] + +class Bar(SubclassMe[int, DefaultStrT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:45:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar, type[Bar[str]]) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:46:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar(), Bar[str]) + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:47:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar[bool](), Bar[bool]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:47:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Bar is not indexable [not-indexable] + +assert_type(Bar[bool](), Bar[bool]) + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(Foo().x, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Foo is not indexable [not-indexable] + +Foo[str] # E: Foo cannot be further subscripted +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:58:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Baz(Generic[DefaultIntT, DefaultStrT]): ... + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Baz is not indexable [not-indexable] + +v1: Baz[int, str] = Spam() + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_defaults_specialization.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Baz[int, str]' [invalid-annotation] + +v1: Baz[int, str] = Spam() +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 15: Unexpected errors ['File "generics_defaults_specialization.py", line 15, in : wrong arguments [invalid-typevar]'] -Line 16: Unexpected errors ['File "generics_defaults_specialization.py", line 16, in : wrong arguments [invalid-typevar]'] -Line 25: Unexpected errors ['File "generics_defaults_specialization.py", line 25, in : Invalid type annotation \\'SomethingWithNoDefaults[int, Any][bool]\\' [invalid-annotation]'] -Line 26: Unexpected errors ['File "generics_defaults_specialization.py", line 26, in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] -Line 27: Unexpected errors ['File "generics_defaults_specialization.py", line 27, in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] -Line 38: Unexpected errors ['File "generics_defaults_specialization.py", line 38, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 42: Unexpected errors ['File "generics_defaults_specialization.py", line 42, in : Invalid type annotation \\'SubclassMe[int, Any]\\' [invalid-annotation]'] -Line 45: Unexpected errors ['File "generics_defaults_specialization.py", line 45, in : class Bar is not indexable [not-indexable]'] -Line 46: Unexpected errors ['File "generics_defaults_specialization.py", line 46, in : class Bar is not indexable [not-indexable]'] -Line 47: Unexpected errors ['File "generics_defaults_specialization.py", line 47, in : class Bar is not indexable [not-indexable]'] -Line 53: Unexpected errors ['File "generics_defaults_specialization.py", line 53, in : Any [assert-type]'] -Line 58: Unexpected errors ['File "generics_defaults_specialization.py", line 58, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 65: Unexpected errors ['File "generics_defaults_specialization.py", line 65, in : class Baz is not indexable [not-indexable]', 'File "generics_defaults_specialization.py", line 65, in : Invalid type annotation \\'Baz[int, str]\\' [invalid-annotation]'] +Line 15: Unexpected errors ['generics_defaults_specialization.py:15:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 16: Unexpected errors ['generics_defaults_specialization.py:16:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] +Line 25: Unexpected errors ["generics_defaults_specialization.py:25:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'SomethingWithNoDefaults[int, Any][bool]' [invalid-annotation]"] +Line 26: Unexpected errors ['generics_defaults_specialization.py:26:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] +Line 27: Unexpected errors ['generics_defaults_specialization.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: SomethingWithNoDefaults[int, Any] [assert-type]'] +Line 38: Unexpected errors ["generics_defaults_specialization.py:38:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 42: Unexpected errors ["generics_defaults_specialization.py:42:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'SubclassMe[int, Any]' [invalid-annotation]"] +Line 45: Unexpected errors ['generics_defaults_specialization.py:45:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] +Line 46: Unexpected errors ['generics_defaults_specialization.py:46:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] +Line 47: Unexpected errors ['generics_defaults_specialization.py:47:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]', 'generics_defaults_specialization.py:47:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Bar is not indexable [not-indexable]'] +Line 53: Unexpected errors ['generics_defaults_specialization.py:53:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 58: Unexpected errors ["generics_defaults_specialization.py:58:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 65: Unexpected errors ['generics_defaults_specialization.py:65:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Baz is not indexable [not-indexable]', "generics_defaults_specialization.py:65:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Baz[int, str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_paramspec_specialization.toml b/conformance/results/pytype/generics_paramspec_specialization.toml index e4e920c9..cbe272e9 100644 --- a/conformance/results/pytype/generics_paramspec_specialization.toml +++ b/conformance/results/pytype/generics_paramspec_specialization.toml @@ -5,27 +5,75 @@ Does not reject invalid specialization of class with both TypeVar and ParamSpec. Reports error for valid method call involving ParamSpec. """ output = """ -File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation '[int, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "generics_paramspec_specialization.py", line 36, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "generics_paramspec_specialization.py", line 40, in : Invalid type annotation '[]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 52, in : Invalid type annotation '[int, str, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 53, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 54, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 55, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 58, in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation] -File "generics_paramspec_specialization.py", line 59, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 60, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_paramspec_specialization.py", line 61, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] +generics_paramspec_specialization.py:32:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, bool]' [invalid-annotation] + +def func22(x: ClassB[int, [int, bool], ...]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:32:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +def func22(x: ClassB[int, [int, bool], ...]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:36:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +def func23(x: ClassA[int, ...]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:40:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[]' [invalid-annotation] + +def func24(x: ClassB[int, [], []]) -> str: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:52:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str, bool]' [invalid-annotation] + +def func30(x: ClassC[[int, str, bool]]) -> None: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:53:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", True) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f("", "", True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:55:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:58:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation] + +def func31(x: ClassC[int, str, bool]) -> None: # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", True) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f("", "", True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_paramspec_specialization.py:61:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count] + + x.f(0, "", "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 44: Expected 1 errors -Line 32: Unexpected errors ['File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation \\'[int, bool]\\' [invalid-annotation]', 'File "generics_paramspec_specialization.py", line 32, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] -Line 36: Unexpected errors ['File "generics_paramspec_specialization.py", line 36, in : Invalid type annotation \\'Ellipsis\\' [invalid-annotation]'] -Line 40: Unexpected errors ['File "generics_paramspec_specialization.py", line 40, in : Invalid type annotation \\'[]\\' [invalid-annotation]'] -Line 52: Unexpected errors ['File "generics_paramspec_specialization.py", line 52, in : Invalid type annotation \\'[int, str, bool]\\' [invalid-annotation]'] -Line 53: Unexpected errors ['File "generics_paramspec_specialization.py", line 53, in func30: Function expects 1 arg(s), got 3 [wrong-arg-count]'] -Line 58: Unexpected errors ['File "generics_paramspec_specialization.py", line 58, in : Invalid type annotation \\'ClassC[int, str, bool]\\' [invalid-annotation]'] -Line 59: Unexpected errors ['File "generics_paramspec_specialization.py", line 59, in func31: Function expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 32: Unexpected errors ["generics_paramspec_specialization.py:32:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, bool]' [invalid-annotation]", "generics_paramspec_specialization.py:32:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation]"] +Line 36: Unexpected errors ["generics_paramspec_specialization.py:36:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation]"] +Line 40: Unexpected errors ["generics_paramspec_specialization.py:40:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[]' [invalid-annotation]"] +Line 52: Unexpected errors ["generics_paramspec_specialization.py:52:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str, bool]' [invalid-annotation]"] +Line 53: Unexpected errors ['generics_paramspec_specialization.py:53:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func30: Function expects 1 arg(s), got 3 [wrong-arg-count]'] +Line 58: Unexpected errors ["generics_paramspec_specialization.py:58:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'ClassC[int, str, bool]' [invalid-annotation]"] +Line 59: Unexpected errors ['generics_paramspec_specialization.py:59:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func31: Function expects 1 arg(s), got 3 [wrong-arg-count]'] """ diff --git a/conformance/results/pytype/generics_scoping.toml b/conformance/results/pytype/generics_scoping.toml index ec46810e..d9f7e61d 100644 --- a/conformance/results/pytype/generics_scoping.toml +++ b/conformance/results/pytype/generics_scoping.toml @@ -4,15 +4,85 @@ Fails to reject type alias within generic class that uses class's type variable. Fails to reject unbound type variable in constructor call in global scope. """ output = """ -File "generics_scoping.py", line 29, in : Function MyClass.meth_2 was called with the wrong arguments [wrong-arg-types] -File "generics_scoping.py", line 50, in fun_3: Invalid type annotation 'List[S]' for z [invalid-annotation] -File "generics_scoping.py", line 54, in Bar: Invalid type annotation 'List[S]' for an_attr [invalid-annotation] -File "generics_scoping.py", line 63, in fun_4: Invalid type annotation 'T' [invalid-annotation] -File "generics_scoping.py", line 74, in : Invalid type annotation 'Outer' [invalid-annotation] -File "generics_scoping.py", line 78, in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] -File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation 'T' [invalid-annotation] -File "generics_scoping.py", line 94, in : Invalid type annotation 'T' for global_var1 [invalid-annotation] -File "generics_scoping.py", line 95, in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] +generics_scoping.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function MyClass.meth_2 was called with the wrong arguments [wrong-arg-types] + +a.meth_2('a') # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in fun_3: Invalid type annotation 'List[S]' for z [invalid-annotation] + + z: list[S] = [] # E + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +generics_scoping.py:54:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Bar: Invalid type annotation 'List[S]' for an_attr [invalid-annotation] + + an_attr: list[S] = [] # E + \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:63:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in fun_4: Invalid type annotation 'T' [invalid-annotation] + + a_list: list[T] = [] # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_scoping.py:74:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Outer' [invalid-annotation] + +class Outer(Generic[T]): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + class Bad(Iterable[T]): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + class AlsoBad: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + x: list[T] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def __init__(self, x: list[T]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.x = x +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + class Inner(Iterable[S]): # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + attr: Inner[T] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + alias: TypeAlias = list[T] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def __init__(self, attr: Inner[T]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.attr = attr +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in AlsoBad: Invalid type annotation 'List[T]' for x [invalid-annotation] + + x: list[T] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:80:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in AlsoBad: Invalid type annotation 'T' [invalid-annotation] + + def __init__(self, x: list[T]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + self.x = x +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:94:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' for global_var1 [invalid-annotation] + +global_var1: T # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_scoping.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] + +global_var2: list[T] = [] # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -20,7 +90,7 @@ Line 65: Expected 1 errors Line 75: Expected 1 errors Line 87: Expected 1 errors Line 96: Expected 1 errors -Line 63: Unexpected errors ['File "generics_scoping.py", line 63, in fun_4: Invalid type annotation \\'T\\' [invalid-annotation]'] -Line 74: Unexpected errors ['File "generics_scoping.py", line 74, in : Invalid type annotation \\'Outer\\' [invalid-annotation]'] -Line 80: Unexpected errors ['File "generics_scoping.py", line 80, in AlsoBad: Invalid type annotation \\'T\\' [invalid-annotation]'] +Line 63: Unexpected errors ["generics_scoping.py:63:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in fun_4: Invalid type annotation 'T' [invalid-annotation]"] +Line 74: Unexpected errors ["generics_scoping.py:74:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Outer' [invalid-annotation]"] +Line 80: Unexpected errors ["generics_scoping.py:80:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in AlsoBad: Invalid type annotation 'T' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_self_advanced.toml b/conformance/results/pytype/generics_self_advanced.toml index 253ce01a..9a818632 100644 --- a/conformance/results/pytype/generics_self_advanced.toml +++ b/conformance/results/pytype/generics_self_advanced.toml @@ -3,37 +3,89 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type] +generics_self_advanced.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prop1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 19, in current file -File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type] +generics_self_advanced.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prop1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 18, in current file -File "generics_self_advanced.py", line 19, in : ParentA [assert-type] -File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type] +generics_self_advanced.py:19:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : ParentA [assert-type] + +assert_type(ChildA().prop1, ChildA) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:29:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 38, in method2 -File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type] -File "generics_self_advanced.py", line 35, in method2: ChildB [assert-type] -File "generics_self_advanced.py", line 36, in method2: List[ChildB] [assert-type] -File "generics_self_advanced.py", line 37, in method2: ChildB [assert-type] -File "generics_self_advanced.py", line 38, in method2: ChildB [assert-type] -File "generics_self_advanced.py", line 42, in method3: Type[ChildB] [assert-type] -File "generics_self_advanced.py", line 43, in method3: List[ChildB] [assert-type] -File "generics_self_advanced.py", line 44, in method3: ChildB [assert-type] -File "generics_self_advanced.py", line 45, in method3: ChildB [assert-type] +generics_self_advanced.py:29:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] + + assert_type(self, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: List[ChildB] [assert-type] + + assert_type(self.a, list[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:37:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] + + assert_type(self.a[0], Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:38:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: ChildB [assert-type] + + assert_type(self.method1(), Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:42:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: Type[ChildB] [assert-type] + + assert_type(cls, type[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:43:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: List[ChildB] [assert-type] + + assert_type(cls.a, list[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:44:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: ChildB [assert-type] + + assert_type(cls.a[0], Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_advanced.py:45:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: ChildB [assert-type] + + assert_type(cls.method1(), Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 12: Unexpected errors ['File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type]', 'File "generics_self_advanced.py", line 12, in prop1: bad return type [bad-return-type]'] -Line 19: Unexpected errors ['File "generics_self_advanced.py", line 19, in : ParentA [assert-type]'] -Line 29: Unexpected errors ['File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type]', 'File "generics_self_advanced.py", line 29, in method1: bad return type [bad-return-type]'] -Line 35: Unexpected errors ['File "generics_self_advanced.py", line 35, in method2: ChildB [assert-type]'] -Line 36: Unexpected errors ['File "generics_self_advanced.py", line 36, in method2: List[ChildB] [assert-type]'] -Line 37: Unexpected errors ['File "generics_self_advanced.py", line 37, in method2: ChildB [assert-type]'] -Line 38: Unexpected errors ['File "generics_self_advanced.py", line 38, in method2: ChildB [assert-type]'] -Line 42: Unexpected errors ['File "generics_self_advanced.py", line 42, in method3: Type[ChildB] [assert-type]'] -Line 43: Unexpected errors ['File "generics_self_advanced.py", line 43, in method3: List[ChildB] [assert-type]'] -Line 44: Unexpected errors ['File "generics_self_advanced.py", line 44, in method3: ChildB [assert-type]'] -Line 45: Unexpected errors ['File "generics_self_advanced.py", line 45, in method3: ChildB [assert-type]'] +Line 12: Unexpected errors ['generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prop1: bad return type [bad-return-type]', 'generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prop1: bad return type [bad-return-type]'] +Line 19: Unexpected errors ['generics_self_advanced.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ParentA [assert-type]'] +Line 29: Unexpected errors ['generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]', 'generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] +Line 35: Unexpected errors ['generics_self_advanced.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] +Line 36: Unexpected errors ['generics_self_advanced.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: List[ChildB] [assert-type]'] +Line 37: Unexpected errors ['generics_self_advanced.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] +Line 38: Unexpected errors ['generics_self_advanced.py:38:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] +Line 42: Unexpected errors ['generics_self_advanced.py:42:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: Type[ChildB] [assert-type]'] +Line 43: Unexpected errors ['generics_self_advanced.py:43:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: List[ChildB] [assert-type]'] +Line 44: Unexpected errors ['generics_self_advanced.py:44:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] +Line 45: Unexpected errors ['generics_self_advanced.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] """ diff --git a/conformance/results/pytype/generics_self_attributes.toml b/conformance/results/pytype/generics_self_attributes.toml index 94024945..8079a601 100644 --- a/conformance/results/pytype/generics_self_attributes.toml +++ b/conformance/results/pytype/generics_self_attributes.toml @@ -3,7 +3,11 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_attributes.py", line 26, in : Function OrdinalLinkedList.__init__ was called with the wrong arguments [wrong-arg-types] +generics_self_attributes.py:26:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function OrdinalLinkedList.__init__ was called with the wrong arguments [wrong-arg-types] + +xs = OrdinalLinkedList(value=1, next=LinkedList[int](value=2)) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/generics_self_basic.toml b/conformance/results/pytype/generics_self_basic.toml index 717547ba..0eb9ab43 100644 --- a/conformance/results/pytype/generics_self_basic.toml +++ b/conformance/results/pytype/generics_self_basic.toml @@ -3,32 +3,68 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_basic.py", line 14, in set_scale: Shape [assert-type] -File "generics_self_basic.py", line 14, in set_scale: Circle [assert-type] +generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_scale: Shape [assert-type] + + assert_type(self, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_scale: Circle [assert-type] + + assert_type(self, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 52, in current file -File "generics_self_basic.py", line 27, in from_config: Type[Shape] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Shape] [assert-type] + + assert_type(cls, type[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 54, in current file -File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Circle] [assert-type] + + assert_type(cls, type[Self]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 55, in current file -File "generics_self_basic.py", line 40, in difference: Shape [assert-type] -File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] +generics_self_basic.py:40:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in difference: Shape [assert-type] + + assert_type(other, Self) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] + + def set_value(self, value: T) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 75, in object_with_concrete_type -File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] +generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] + + def set_value(self, value: T) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + Called from (traceback): line 74, in object_with_concrete_type -File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type] -File "generics_self_basic.py", line 67, in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] +generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set_value: bad return type [bad-return-type] + + def set_value(self, value: T) -> Self: ... +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +generics_self_basic.py:67:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] + + def foo(self, other: Self[int]) -> None: # E + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 20: Expected 1 errors Line 33: Expected 1 errors -Line 14: Unexpected errors ['File "generics_self_basic.py", line 14, in set_scale: Shape [assert-type]', 'File "generics_self_basic.py", line 14, in set_scale: Circle [assert-type]'] -Line 27: Unexpected errors ['File "generics_self_basic.py", line 27, in from_config: Type[Shape] [assert-type]', 'File "generics_self_basic.py", line 27, in from_config: Type[Circle] [assert-type]'] -Line 40: Unexpected errors ['File "generics_self_basic.py", line 40, in difference: Shape [assert-type]'] -Line 64: Unexpected errors ['File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]', 'File "generics_self_basic.py", line 64, in set_value: bad return type [bad-return-type]'] +Line 14: Unexpected errors ['generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Shape [assert-type]', 'generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Circle [assert-type]'] +Line 27: Unexpected errors ['generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Shape] [assert-type]', 'generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Circle] [assert-type]'] +Line 40: Unexpected errors ['generics_self_basic.py:40:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in difference: Shape [assert-type]'] +Line 64: Unexpected errors ['generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_self_usage.toml b/conformance/results/pytype/generics_self_usage.toml index d0a2b4aa..84de50ae 100644 --- a/conformance/results/pytype/generics_self_usage.toml +++ b/conformance/results/pytype/generics_self_usage.toml @@ -3,18 +3,68 @@ notes = """ Does not understand `Self` type. """ output = """ -File "generics_self_usage.py", line 58, in foo: Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 73, in : Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 76, in : Invalid type annotation 'Self' for bar [invalid-annotation] -File "generics_self_usage.py", line 82, in has_existing_self_annotation: bad return type [bad-return-type] -File "generics_self_usage.py", line 86, in return_concrete_type: bad return type [bad-return-type] +generics_self_usage.py:58:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in foo: Invalid type annotation 'Self' [invalid-annotation] + + def nested(z: int, inner_self: Self) -> Self: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + print(z) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + print(inner_self.x) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return inner_self +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Self' [invalid-annotation] + +def foo(bar: Self) -> Self: ... # E: not within a class +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:76:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Self' for bar [invalid-annotation] + +bar: Self # E: not within a class +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in has_existing_self_annotation: bad return type [bad-return-type] + + def has_existing_self_annotation(self: TFoo2) -> Self: ... # E +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + +generics_self_usage.py:86:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in return_concrete_type: bad return type [bad-return-type] + + return Foo3() # E (see FooChild below for rationale) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + Called from (traceback): line 92, in child_method -File "generics_self_usage.py", line 103, in : Invalid base class: Self [base-class-error] -File "generics_self_usage.py", line 111, in Base: Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 116, in Base: Invalid type annotation 'Self' [invalid-annotation] -File "generics_self_usage.py", line 122, in __new__: bad return type [bad-return-type] -File "generics_self_usage.py", line 126, in __mul__: bad return type [bad-return-type] +generics_self_usage.py:103:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Self [base-class-error] + +class Baz2(Self): ... # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:111:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Base: Invalid type annotation 'Self' [invalid-annotation] + + def make() -> Self: # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:116:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Base: Invalid type annotation 'Self' [invalid-annotation] + + def return_parameter(foo: Self) -> Self: # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_self_usage.py:122:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __new__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_self_usage.py:126:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __mul__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -22,7 +72,7 @@ Line 101: Expected 1 errors Line 106: Expected 1 errors Line 121: Expected 1 errors Line 125: Expected 1 errors -Line 58: Unexpected errors ['File "generics_self_usage.py", line 58, in foo: Invalid type annotation \\'Self\\' [invalid-annotation]'] -Line 122: Unexpected errors ['File "generics_self_usage.py", line 122, in __new__: bad return type [bad-return-type]'] -Line 126: Unexpected errors ['File "generics_self_usage.py", line 126, in __mul__: bad return type [bad-return-type]'] +Line 58: Unexpected errors ["generics_self_usage.py:58:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in foo: Invalid type annotation 'Self' [invalid-annotation]"] +Line 122: Unexpected errors ['generics_self_usage.py:122:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __new__: bad return type [bad-return-type]'] +Line 126: Unexpected errors ['generics_self_usage.py:126:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __mul__: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_syntax_infer_variance.toml b/conformance/results/pytype/generics_syntax_infer_variance.toml index ba30a289..05c5d9be 100644 --- a/conformance/results/pytype/generics_syntax_infer_variance.toml +++ b/conformance/results/pytype/generics_syntax_infer_variance.toml @@ -3,7 +3,7 @@ notes = """ Type parameter syntax not yet support. """ output = """ -SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 125) +SyntaxError: Type parameter lists are only supported in Python 3.12 and greater (, line 132) """ conformance_automated = "Fail" errors_diff = """ @@ -12,18 +12,17 @@ Line 17: Expected 1 errors Line 29: Expected 1 errors Line 37: Expected 1 errors Line 46: Expected 1 errors -Line 55: Expected 1 errors -Line 68: Expected 1 errors -Line 79: Expected 1 errors -Line 95: Expected 1 errors -Line 96: Expected 1 errors -Line 110: Expected 1 errors -Line 111: Expected 1 errors +Line 75: Expected 1 errors +Line 86: Expected 1 errors +Line 102: Expected 1 errors +Line 103: Expected 1 errors +Line 117: Expected 1 errors Line 118: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors -Line 121: Expected 1 errors -Line 129: Expected 1 errors -Line 137: Expected 1 errors -Line 148: Expected 1 errors +Line 125: Expected 1 errors +Line 126: Expected 1 errors +Line 127: Expected 1 errors +Line 128: Expected 1 errors +Line 136: Expected 1 errors +Line 144: Expected 1 errors +Line 155: Expected 1 errors """ diff --git a/conformance/results/pytype/generics_typevartuple_args.toml b/conformance/results/pytype/generics_typevartuple_args.toml index f74bb069..91227fe9 100644 --- a/conformance/results/pytype/generics_typevartuple_args.toml +++ b/conformance/results/pytype/generics_typevartuple_args.toml @@ -3,28 +3,110 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_args.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_args.py", line 13, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_args.py", line 16, in : No attribute '__iter__' on TypeVarTuple [attribute-error] -File "generics_typevartuple_args.py", line 16, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 17, in args_to_tuple: bad return type [bad-return-type] +generics_typevartuple_args.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:13:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:16:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error] + +def args_to_tuple(*args: *Ts) -> tuple[*Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:16:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def args_to_tuple(*args: *Ts) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in args_to_tuple: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 20, in current file -File "generics_typevartuple_args.py", line 20, in : Tuple[Any] [assert-type] -File "generics_typevartuple_args.py", line 27, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 27, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 27, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 28, in exec_le: bad return type [bad-return-type] +generics_typevartuple_args.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(args_to_tuple(1, "a"), tuple[int, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:27:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:27:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:27:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in exec_le: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 31, in current file -File "generics_typevartuple_args.py", line 31, in : Tuple[Any] [assert-type] -File "generics_typevartuple_args.py", line 32, in : Tuple[Any] [assert-type] -File "generics_typevartuple_args.py", line 42, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 51, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 51, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 62, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_args.py", line 70, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_args.py", line 75, in : Function func4 was called with the wrong arguments [wrong-arg-types] +generics_typevartuple_args.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(exec_le("", Env()), tuple[()]) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(exec_le("", 0, "", Env()), tuple[int, str]) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func1(*args: * tuple[int, ...]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:51:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func3(*args: * tuple[int, str]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:70:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func4(*args: tuple[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_args.py:75:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func4 was called with the wrong arguments [wrong-arg-types] + +func4((0,), (1, 2)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -36,17 +118,17 @@ Line 58: Expected 1 errors Line 59: Expected 1 errors Line 67: Expected 1 errors Line 76: Expected 1 errors -Line 10: Unexpected errors ['File "generics_typevartuple_args.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['File "generics_typevartuple_args.py", line 13, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ['File "generics_typevartuple_args.py", line 16, in : No attribute \\'__iter__\\' on TypeVarTuple [attribute-error]', 'File "generics_typevartuple_args.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "generics_typevartuple_args.py", line 17, in args_to_tuple: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['File "generics_typevartuple_args.py", line 20, in : Tuple[Any] [assert-type]'] -Line 27: Unexpected errors ['File "generics_typevartuple_args.py", line 27, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]', 'File "generics_typevartuple_args.py", line 27, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_args.py", line 27, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 28: Unexpected errors ['File "generics_typevartuple_args.py", line 28, in exec_le: bad return type [bad-return-type]'] -Line 31: Unexpected errors ['File "generics_typevartuple_args.py", line 31, in : Tuple[Any] [assert-type]'] -Line 32: Unexpected errors ['File "generics_typevartuple_args.py", line 32, in : Tuple[Any] [assert-type]'] -Line 42: Unexpected errors ['File "generics_typevartuple_args.py", line 42, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]'] -Line 51: Unexpected errors ['File "generics_typevartuple_args.py", line 51, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]', 'File "generics_typevartuple_args.py", line 51, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 62: Unexpected errors ['File "generics_typevartuple_args.py", line 62, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]'] -Line 70: Unexpected errors ['File "generics_typevartuple_args.py", line 70, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 10: Unexpected errors ['generics_typevartuple_args.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['generics_typevartuple_args.py:13:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["generics_typevartuple_args.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_args.py:16:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ['generics_typevartuple_args.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in args_to_tuple: bad return type [bad-return-type]'] +Line 20: Unexpected errors ['generics_typevartuple_args.py:20:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 27: Unexpected errors ["generics_typevartuple_args.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:27:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_args.py:27:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 28: Unexpected errors ['generics_typevartuple_args.py:28:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in exec_le: bad return type [bad-return-type]'] +Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 42: Unexpected errors ["generics_typevartuple_args.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] +Line 51: Unexpected errors ["generics_typevartuple_args.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:51:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 62: Unexpected errors ["generics_typevartuple_args.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] +Line 70: Unexpected errors ["generics_typevartuple_args.py:70:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_basic.toml b/conformance/results/pytype/generics_typevartuple_basic.toml index 3116b579..8bd98126 100644 --- a/conformance/results/pytype/generics_typevartuple_basic.toml +++ b/conformance/results/pytype/generics_typevartuple_basic.toml @@ -3,78 +3,304 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_basic.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_basic.py", line 9, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 12, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 16, in : No attribute '__iter__' on TypeVarTuple [attribute-error] -File "generics_typevartuple_basic.py", line 16, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 17, in func1: bad return type [bad-return-type] -File "generics_typevartuple_basic.py", line 20, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 23, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 24, in Array: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 25, in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 27, in Array: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 36, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 36, in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 36, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 37, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 37, in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 37, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 38, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 38, in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 38, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 42, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 42, in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 42, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 43, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 43, in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 43, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 44, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 44, in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 44, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 52, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 53, in ClassA: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 54, in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] -File "generics_typevartuple_basic.py", line 56, in ClassA: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 59, in ClassA: Invalid type annotation '' for args [invalid-annotation] -File "generics_typevartuple_basic.py", line 65, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 66, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 4 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 67, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] -File "generics_typevartuple_basic.py", line 75, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_basic.py", line 76, in func2: bad return type [bad-return-type] +generics_typevartuple_basic.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Generic, NewType, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:9:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:12:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array1(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:16:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error] + +def func1(*args: *Ts) -> tuple[*Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:16:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func1(*args: *Ts) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:20:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:24:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] + + def __init__(self, shape: tuple[*Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] + + self._shape: tuple[*Shape] = shape + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:27:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] + + def get_shape(self) -> tuple[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:36:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] + +v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:36:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v1: Array[Height, Width] = Array((Height(1), Width(2))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:37:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] + +v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:37:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v2: Array[Batch, Height, Width] = Array((Batch(1), Height(1), Width(1))) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v3: Array[Time, Batch, Height, Width] = Array( + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] + +v3: Array[Time, Batch, Height, Width] = Array( +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:38:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v3: Array[Time, Batch, Height, Width] = Array( + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + (Time(1), Batch(1), Height(1), Width(1)) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) # OK +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:42:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v4: Array[Height, Width] = Array(Height(1)) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation] + +v4: Array[Height, Width] = Array(Height(1)) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:42:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v4: Array[Height, Width] = Array(Height(1)) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation] + +v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:43:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v5: Array[Batch, Height, Width] = Array((Batch(1), Width(1))) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:44:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation] + +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:44:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types] + +v6: Array[Time, Batch, Height, Width] = Array( # E[v6] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + (Time(1), Batch(1), Width(1), Height(1)) # E[v6] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:52:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class ClassA(Generic[Shape]): # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:53:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' [invalid-annotation] + + def __init__(self, shape: tuple[Shape]): # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation] + + self._shape: tuple[*Shape] = shape + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:56:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' [invalid-annotation] + + def get_shape(self) -> tuple[Shape]: # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:59:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassA: Invalid type annotation '' for args [invalid-annotation] + + def method1(*args: Shape) -> None: # E: not unpacked + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:65:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +Ts1 = TypeVarTuple("Ts1", covariant=True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:66:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 4 [wrong-arg-count] + +Ts2 = TypeVarTuple("Ts2", int, float) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:67:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 3 [wrong-arg-count] + +Ts3 = TypeVarTuple("Ts3", bound=int) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:75:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:75:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:75:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 84, in current file -File "generics_typevartuple_basic.py", line 84, in : Tuple[Any] [assert-type] -File "generics_typevartuple_basic.py", line 90, in : Function func2 was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_basic.py", line 93, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 94, in multiply: bad return type [bad-return-type] -File "generics_typevartuple_basic.py", line 97, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_basic.py", line 106, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_basic.py", line 106, in : Function list.extend was called with the wrong arguments [wrong-arg-types] +generics_typevartuple_basic.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(func2((0,), (1,)), tuple[int]) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:90:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] + +func2((0, 0), (0,)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:93:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:93:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:93:53: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def multiply(x: Array[*Shape], y: Array[*Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in multiply: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:97:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:97:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:97:49: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func3(x: Array[Height], y: Array[Width], z: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:106:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array3(Generic[*Ts1, *Ts2]): # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_basic.py:106:22: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +class Array3(Generic[*Ts1, *Ts2]): # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 89: Expected 1 errors Line 99: Expected 1 errors Line 100: Expected 1 errors -Line 7: Unexpected errors ['File "generics_typevartuple_basic.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 9: Unexpected errors ['File "generics_typevartuple_basic.py", line 9, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 12: Unexpected errors ['File "generics_typevartuple_basic.py", line 12, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 16: Unexpected errors ['File "generics_typevartuple_basic.py", line 16, in : No attribute \\'__iter__\\' on TypeVarTuple [attribute-error]', 'File "generics_typevartuple_basic.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "generics_typevartuple_basic.py", line 17, in func1: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['File "generics_typevartuple_basic.py", line 20, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 23: Unexpected errors ['File "generics_typevartuple_basic.py", line 23, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 24: Unexpected errors ['File "generics_typevartuple_basic.py", line 24, in Array: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 25: Unexpected errors ['File "generics_typevartuple_basic.py", line 25, in __init__: Invalid type annotation \\'tuple[*Shape,]\\' [invalid-annotation]'] -Line 27: Unexpected errors ['File "generics_typevartuple_basic.py", line 27, in Array: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 36: Unexpected errors ['File "generics_typevartuple_basic.py", line 36, in : class Array is not indexable [not-indexable]', 'File "generics_typevartuple_basic.py", line 36, in : Invalid type annotation \\'Array[Height, Width]\\' [invalid-annotation]', 'File "generics_typevartuple_basic.py", line 36, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 37: Unexpected errors ['File "generics_typevartuple_basic.py", line 37, in : class Array is not indexable [not-indexable]', 'File "generics_typevartuple_basic.py", line 37, in : Invalid type annotation \\'Array[Batch, Height, Width]\\' [invalid-annotation]', 'File "generics_typevartuple_basic.py", line 37, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 38: Unexpected errors ['File "generics_typevartuple_basic.py", line 38, in : class Array is not indexable [not-indexable]', 'File "generics_typevartuple_basic.py", line 38, in : Invalid type annotation \\'Array[Time, Batch, Height, Width]\\' [invalid-annotation]', 'File "generics_typevartuple_basic.py", line 38, in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 54: Unexpected errors ['File "generics_typevartuple_basic.py", line 54, in __init__: Invalid type annotation \\'tuple[*Shape,]\\' [invalid-annotation]'] -Line 75: Unexpected errors ['File "generics_typevartuple_basic.py", line 75, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 76: Unexpected errors ['File "generics_typevartuple_basic.py", line 76, in func2: bad return type [bad-return-type]'] -Line 84: Unexpected errors ['File "generics_typevartuple_basic.py", line 84, in : Tuple[Any] [assert-type]'] -Line 93: Unexpected errors ['File "generics_typevartuple_basic.py", line 93, in : class Array is not indexable [not-indexable]'] -Line 94: Unexpected errors ['File "generics_typevartuple_basic.py", line 94, in multiply: bad return type [bad-return-type]'] -Line 97: Unexpected errors ['File "generics_typevartuple_basic.py", line 97, in : class Array is not indexable [not-indexable]'] +Line 7: Unexpected errors ['generics_typevartuple_basic.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['generics_typevartuple_basic.py:9:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 12: Unexpected errors ["generics_typevartuple_basic.py:12:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 16: Unexpected errors ["generics_typevartuple_basic.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_basic.py:16:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ['generics_typevartuple_basic.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 20: Unexpected errors ['generics_typevartuple_basic.py:20:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 23: Unexpected errors ["generics_typevartuple_basic.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 24: Unexpected errors ["generics_typevartuple_basic.py:24:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 25: Unexpected errors ["generics_typevartuple_basic.py:25:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] +Line 27: Unexpected errors ["generics_typevartuple_basic.py:27:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:36:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:37:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:38:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 54: Unexpected errors ["generics_typevartuple_basic.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] +Line 75: Unexpected errors ["generics_typevartuple_basic.py:75:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 76: Unexpected errors ['generics_typevartuple_basic.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:53: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 94: Unexpected errors ['generics_typevartuple_basic.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in multiply: bad return type [bad-return-type]'] +Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:49: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_callable.toml b/conformance/results/pytype/generics_typevartuple_callable.toml index 1d934a26..6abb2179 100644 --- a/conformance/results/pytype/generics_typevartuple_callable.toml +++ b/conformance/results/pytype/generics_typevartuple_callable.toml @@ -3,44 +3,126 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_callable.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_callable.py", line 12, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 25, in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_callable.py", line 26, in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 30, in func2: bad return type [bad-return-type] +generics_typevartuple_callable.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Callable, TypeVar, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:12:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:17:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] + + def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:17:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] + + def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:25:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] + +Process(target=func1, args=(0, "")) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:26:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types] + +Process(target=func1, args=("", 0)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:29:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:30:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 42, in current file -File "generics_typevartuple_callable.py", line 34, in callback1: bad return type [bad-return-type] -File "generics_typevartuple_callable.py", line 38, in callback2: bad return type [bad-return-type] -File "generics_typevartuple_callable.py", line 41, in : Function func2 was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_callable.py", line 41, in : Any [assert-type] -File "generics_typevartuple_callable.py", line 42, in : Tuple[Any] [assert-type] -File "generics_typevartuple_callable.py", line 45, in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] -File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_callable.py", line 46, in func3: bad return type [bad-return-type] +generics_typevartuple_callable.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in callback1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in callback2: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:41:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] + +assert_type(func2(callback1), tuple[str, int, complex]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(func2(callback1), tuple[str, int, complex]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(func2(callback2), tuple[str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter] + +def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:45:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:45:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_callable.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 49, in current file -File "generics_typevartuple_callable.py", line 49, in : Tuple[Any] [assert-type] +generics_typevartuple_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(func3(1, "", 3j, 3.4), tuple[float, str, complex]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 10: Unexpected errors ['File "generics_typevartuple_callable.py", line 10, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 12: Unexpected errors ['File "generics_typevartuple_callable.py", line 12, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ['File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 17, in Process: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 25: Unexpected errors ['File "generics_typevartuple_callable.py", line 25, in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 29: Unexpected errors ['File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 29, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 30: Unexpected errors ['File "generics_typevartuple_callable.py", line 30, in func2: bad return type [bad-return-type]'] -Line 34: Unexpected errors ['File "generics_typevartuple_callable.py", line 34, in callback1: bad return type [bad-return-type]'] -Line 38: Unexpected errors ['File "generics_typevartuple_callable.py", line 38, in callback2: bad return type [bad-return-type]'] -Line 41: Unexpected errors ['File "generics_typevartuple_callable.py", line 41, in : Function func2 was called with the wrong arguments [wrong-arg-types]', 'File "generics_typevartuple_callable.py", line 41, in : Any [assert-type]'] -Line 42: Unexpected errors ['File "generics_typevartuple_callable.py", line 42, in : Tuple[Any] [assert-type]'] -Line 45: Unexpected errors ['File "generics_typevartuple_callable.py", line 45, in : Missing parameter \\'self\\' in call to function tuple.__iter__ [missing-parameter]', 'File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_callable.py", line 45, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "generics_typevartuple_callable.py", line 46, in func3: bad return type [bad-return-type]'] -Line 49: Unexpected errors ['File "generics_typevartuple_callable.py", line 49, in : Tuple[Any] [assert-type]'] +Line 10: Unexpected errors ['generics_typevartuple_callable.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 12: Unexpected errors ['generics_typevartuple_callable.py:12:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 17: Unexpected errors ["generics_typevartuple_callable.py:17:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:17:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]"] +Line 25: Unexpected errors ['generics_typevartuple_callable.py:25:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 29: Unexpected errors ["generics_typevartuple_callable.py:29:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 30: Unexpected errors ['generics_typevartuple_callable.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] +Line 34: Unexpected errors ['generics_typevartuple_callable.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback1: bad return type [bad-return-type]'] +Line 38: Unexpected errors ['generics_typevartuple_callable.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback2: bad return type [bad-return-type]'] +Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types]', 'generics_typevartuple_callable.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 45: Unexpected errors ["generics_typevartuple_callable.py:45:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_callable.py:45:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:45:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 46: Unexpected errors ['generics_typevartuple_callable.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: bad return type [bad-return-type]'] +Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_concat.toml b/conformance/results/pytype/generics_typevartuple_concat.toml index 2ec72d80..38a84f71 100644 --- a/conformance/results/pytype/generics_typevartuple_concat.toml +++ b/conformance/results/pytype/generics_typevartuple_concat.toml @@ -3,48 +3,153 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_concat.py", line 9, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_concat.py", line 17, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_concat.py", line 18, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_concat.py", line 22, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_concat.py", line 26, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 27, in add_batch_axis: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 30, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 31, in del_batch_axis: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 34, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 35, in add_batch_channels: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 38, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 40, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 42, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 44, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation 'T' [invalid-annotation] -File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_concat.py", line 48, in prefix_tuple: bad return type [bad-return-type] -File "generics_typevartuple_concat.py", line 51, in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_concat.py", line 52, in : Any [assert-type] -File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Generic, NewType, TypeVar, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:17:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:18:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:22:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:26:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:26:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_axis(x: Array[*Shape]) -> Array[Batch, *Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in add_batch_axis: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:30:23: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:30:48: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def del_batch_axis(x: Array[Batch, *Shape]) -> Array[*Shape]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in del_batch_axis: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:34:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_channels(x: Array[*Shape]) -> Array[Batch, *Shape, Channels]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:34:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def add_batch_channels(x: Array[*Shape]) -> Array[Batch, *Shape, Channels]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in add_batch_channels: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:38:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(a: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:40:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(b, Array[Batch, Height, Width]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:42:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(c, Array[Height, Width]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:44:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(d, Array[Batch, Height, Width, Channels]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:47:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:47:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:48:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in prefix_tuple: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types] + +z = prefix_tuple(x=0, y=(True, "a")) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(z, tuple[int, bool, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:55:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_concat.py:55:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 9: Unexpected errors ['File "generics_typevartuple_concat.py", line 9, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 17: Unexpected errors ['File "generics_typevartuple_concat.py", line 17, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 18: Unexpected errors ['File "generics_typevartuple_concat.py", line 18, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 22: Unexpected errors ['File "generics_typevartuple_concat.py", line 22, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 26: Unexpected errors ['File "generics_typevartuple_concat.py", line 26, in : class Array is not indexable [not-indexable]'] -Line 27: Unexpected errors ['File "generics_typevartuple_concat.py", line 27, in add_batch_axis: bad return type [bad-return-type]'] -Line 30: Unexpected errors ['File "generics_typevartuple_concat.py", line 30, in : class Array is not indexable [not-indexable]'] -Line 31: Unexpected errors ['File "generics_typevartuple_concat.py", line 31, in del_batch_axis: bad return type [bad-return-type]'] -Line 34: Unexpected errors ['File "generics_typevartuple_concat.py", line 34, in : class Array is not indexable [not-indexable]'] -Line 35: Unexpected errors ['File "generics_typevartuple_concat.py", line 35, in add_batch_channels: bad return type [bad-return-type]'] -Line 38: Unexpected errors ['File "generics_typevartuple_concat.py", line 38, in : class Array is not indexable [not-indexable]'] -Line 40: Unexpected errors ['File "generics_typevartuple_concat.py", line 40, in func1: class Array is not indexable [not-indexable]'] -Line 42: Unexpected errors ['File "generics_typevartuple_concat.py", line 42, in func1: class Array is not indexable [not-indexable]'] -Line 44: Unexpected errors ['File "generics_typevartuple_concat.py", line 44, in func1: class Array is not indexable [not-indexable]'] -Line 47: Unexpected errors ['File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation \\'T\\' [invalid-annotation]', 'File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_concat.py", line 47, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 48: Unexpected errors ['File "generics_typevartuple_concat.py", line 48, in prefix_tuple: bad return type [bad-return-type]'] -Line 51: Unexpected errors ['File "generics_typevartuple_concat.py", line 51, in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types]'] -Line 52: Unexpected errors ['File "generics_typevartuple_concat.py", line 52, in : Any [assert-type]'] -Line 55: Unexpected errors ['File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "generics_typevartuple_concat.py", line 55, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 9: Unexpected errors ['generics_typevartuple_concat.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 17: Unexpected errors ['generics_typevartuple_concat.py:17:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 18: Unexpected errors ['generics_typevartuple_concat.py:18:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 22: Unexpected errors ["generics_typevartuple_concat.py:22:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 26: Unexpected errors ['generics_typevartuple_concat.py:26:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:26:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 27: Unexpected errors ['generics_typevartuple_concat.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in add_batch_axis: bad return type [bad-return-type]'] +Line 30: Unexpected errors ['generics_typevartuple_concat.py:30:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:30:48: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 31: Unexpected errors ['generics_typevartuple_concat.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in del_batch_axis: bad return type [bad-return-type]'] +Line 34: Unexpected errors ['generics_typevartuple_concat.py:34:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_concat.py:34:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 35: Unexpected errors ['generics_typevartuple_concat.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in add_batch_channels: bad return type [bad-return-type]'] +Line 38: Unexpected errors ['generics_typevartuple_concat.py:38:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 40: Unexpected errors ['generics_typevartuple_concat.py:40:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 42: Unexpected errors ['generics_typevartuple_concat.py:42:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 44: Unexpected errors ['generics_typevartuple_concat.py:44:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 47: Unexpected errors ["generics_typevartuple_concat.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]", "generics_typevartuple_concat.py:47:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:47:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 48: Unexpected errors ['generics_typevartuple_concat.py:48:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prefix_tuple: bad return type [bad-return-type]'] +Line 51: Unexpected errors ['generics_typevartuple_concat.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types]'] +Line 52: Unexpected errors ['generics_typevartuple_concat.py:52:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] +Line 55: Unexpected errors ["generics_typevartuple_concat.py:55:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:55:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_overloads.toml b/conformance/results/pytype/generics_typevartuple_overloads.toml index 0dd84622..6a56bcbe 100644 --- a/conformance/results/pytype/generics_typevartuple_overloads.toml +++ b/conformance/results/pytype/generics_typevartuple_overloads.toml @@ -3,25 +3,70 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_overloads.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_overloads.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_overloads.py", line 16, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_overloads.py", line 18, in Array: class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 22, in Array: class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 26, in transpose: bad return type [bad-return-type] -File "generics_typevartuple_overloads.py", line 29, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 30, in func1: class Array is not indexable [not-indexable] -File "generics_typevartuple_overloads.py", line 31, in func1: class Array is not indexable [not-indexable] +generics_typevartuple_overloads.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Any, Generic, TypeVar, TypeVarTuple, assert_type, overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:10:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:16:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: class Array is not indexable [not-indexable] + + def transpose(self: "Array[Axis1, Axis2]") -> "Array[Axis2, Axis1]": + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:22:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: class Array is not indexable [not-indexable] + + def transpose(self: "Array[Axis1, Axis2, Axis3]") -> "Array[Axis3, Axis2, Axis1]": + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:26:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in transpose: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(a: Array[Axis1, Axis2], b: Array[Axis1, Axis2, Axis3]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(a: Array[Axis1, Axis2], b: Array[Axis1, Axis2, Axis3]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:30:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(a.transpose(), Array[Axis2, Axis1]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_overloads.py:31:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: class Array is not indexable [not-indexable] + + assert_type(b.transpose(), Array[Axis3, Axis2, Axis1]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['File "generics_typevartuple_overloads.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "generics_typevartuple_overloads.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ['File "generics_typevartuple_overloads.py", line 16, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 18: Unexpected errors ['File "generics_typevartuple_overloads.py", line 18, in Array: class Array is not indexable [not-indexable]'] -Line 22: Unexpected errors ['File "generics_typevartuple_overloads.py", line 22, in Array: class Array is not indexable [not-indexable]'] -Line 26: Unexpected errors ['File "generics_typevartuple_overloads.py", line 26, in transpose: bad return type [bad-return-type]'] -Line 29: Unexpected errors ['File "generics_typevartuple_overloads.py", line 29, in : class Array is not indexable [not-indexable]'] -Line 30: Unexpected errors ['File "generics_typevartuple_overloads.py", line 30, in func1: class Array is not indexable [not-indexable]'] -Line 31: Unexpected errors ['File "generics_typevartuple_overloads.py", line 31, in func1: class Array is not indexable [not-indexable]'] +Line 7: Unexpected errors ['generics_typevartuple_overloads.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['generics_typevartuple_overloads.py:10:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["generics_typevartuple_overloads.py:16:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: class Array is not indexable [not-indexable]'] +Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: class Array is not indexable [not-indexable]'] +Line 26: Unexpected errors ['generics_typevartuple_overloads.py:26:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in transpose: bad return type [bad-return-type]'] +Line 29: Unexpected errors ['generics_typevartuple_overloads.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_overloads.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 30: Unexpected errors ['generics_typevartuple_overloads.py:30:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] +Line 31: Unexpected errors ['generics_typevartuple_overloads.py:31:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_specialization.toml b/conformance/results/pytype/generics_typevartuple_specialization.toml index a9d75caa..992d68c4 100644 --- a/conformance/results/pytype/generics_typevartuple_specialization.toml +++ b/conformance/results/pytype/generics_typevartuple_specialization.toml @@ -3,137 +3,452 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_specialization.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_specialization.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 16, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 24, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 28, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 33, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 41, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 42, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 46, in func3: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 47, in func3: class Array is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 51, in func4: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 55, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 59, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 63, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 64, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 67, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 68, in func5_0: class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 69, in func5_0: class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 76, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 80, in : class Array2 is not indexable [not-indexable] -File "generics_typevartuple_specialization.py", line 89, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 93, in func6: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 94, in func6: Tuple[Any] [assert-type] -File "generics_typevartuple_specialization.py", line 95, in func6: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 98, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 99, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_specialization.py", line 101, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 102, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 103, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 109, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 110, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 117, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 118, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 119, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 120, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 121, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 121, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_specialization.py", line 122, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 122, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "generics_typevartuple_specialization.py", line 125, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 127, in : Invalid type annotation 'Tuple[Any][int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation 'T2' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation 'T1' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 131, in func7: bad return type [bad-return-type] -File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 135, in func8: Tuple[Tuple[Any], Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 136, in func8: Tuple[Tuple[Any], Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 137, in func8: Tuple[Tuple[Any], Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 140, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'T3' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'T2' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation 'T1' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 144, in func9: bad return type [bad-return-type] -File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 148, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 149, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] -File "generics_typevartuple_specialization.py", line 152, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 153, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 156, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 157, in func11: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 158, in func11: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 159, in func11: Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 162, in : Invalid type annotation '' [invalid-annotation] -File "generics_typevartuple_specialization.py", line 163, in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Any, Generic, NewType, TypeVar, TypeVarTuple, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:10:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:16:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:24:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def takes_any_array2(arr: Array[*tuple[Any, ...]]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:28:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func1(x: Array[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:33:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func2(y: Array[Time, Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTuple = tuple[int, *Ts] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:42:25: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +NamedArray = tuple[str, Array[*Ts]] + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:45:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation] + +def func3(a: IntTuple[float, bool], b: NamedArray[Height]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:45:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation] + +def func3(a: IntTuple[float, bool], b: NamedArray[Height]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Tuple[Any] [assert-type] + + assert_type(a, tuple[int, float, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:47:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: class Array is not indexable [not-indexable] + + assert_type(b, tuple[str, Array[Height]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: Tuple[Any] [assert-type] + + assert_type(a, tuple[int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:55:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:59:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array2(Generic[DType, *Shape]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:63:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +FloatArray = Array2[float, *Shape] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:64:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +Array1D = Array2[DType, Any] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:67:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +def func5_0(a: Array1D, b: Array1D[int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:68:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5_0: class Array2 is not indexable [not-indexable] + + assert_type(a, Array2[Any, Any]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:69:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5_0: class Array2 is not indexable [not-indexable] + + assert_type(b, Array2[int, Any]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:76:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +def func5_1(x: FloatArray[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:80:46: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array2 is not indexable [not-indexable] + +def takes_float_array_with_specific_shape(y: FloatArray[Height, Width]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:89:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +VariadicTuple = tuple[T, *Ts] + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:92:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation] + +def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:92:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation] + +def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:93:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] + + assert_type(a, tuple[str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] + + assert_type(b, tuple[float]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:95:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Invalid type annotation '' [invalid-annotation] + + assert_type(c, tuple[Any, *tuple[Any, ...]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:98:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts1 = TypeVarTuple("Ts1") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:99:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts2 = TypeVarTuple("Ts2") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:101:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTupleVar = tuple[int, *Ts1] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:102:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +IntFloatTupleVar = IntTupleVar[float, *Ts2] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:103:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +IntFloatsTupleVar = IntTupleVar[*tuple[float, ...]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTupleGeneric[*Ts] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:110:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +IntTupleGeneric[*tuple[float, ...]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:117:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA1 = tuple[*Ts, T1, T2] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:118:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA2 = tuple[T1, T2, *Ts] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:119:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA3 = tuple[T1, *Ts, T2, T3] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:120:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA4 = tuple[T1, T2, *tuple[int, ...]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA5 = tuple[T1, *Ts, T2, *Ts] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:121:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +TA5 = tuple[T1, *Ts, T2, *Ts] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:122:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:122:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:125:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA7 = tuple[*Ts, T1, T2] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:127:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][int]' [invalid-annotation] + +v1: TA7[int] # E: requires at least two type arguments + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T2' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T1' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:130:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:131:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:134:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation] + +def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:134:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] + +def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:134:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] + +def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] + + assert_type(func7(a), tuple[tuple[()], str, bool]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:136:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] + + assert_type(func7(b), tuple[tuple[str], bool, float]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:137:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] + + assert_type(func7(c), tuple[tuple[str, bool], float, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:140:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA8 = tuple[T1, *Ts, T2, T3] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T3' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T2' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T1' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:143:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:144:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:147:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] + +def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:147:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] + +def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] + + assert_type(func9(a), tuple[tuple[()], str, bool, float]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:149:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] + + assert_type(func9(b), tuple[tuple[bool], str, float, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:152:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA9 = tuple[*Ts, T1] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:153:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +TA10 = TA9[*tuple[int, ...]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:156:24: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:156:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:157:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] + + assert_type(a, tuple[*tuple[int, ...], int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:158:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] + + assert_type(b, tuple[*tuple[int, ...], str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:159:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func11: Invalid type annotation '' [invalid-annotation] + + assert_type(c, tuple[*tuple[int, ...], str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:162:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +TA11 = tuple[T, *Ts1] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_specialization.py:163:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] + +TA12 = TA11[*Ts2] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 7: Unexpected errors ['File "generics_typevartuple_specialization.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 10: Unexpected errors ['File "generics_typevartuple_specialization.py", line 10, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ['File "generics_typevartuple_specialization.py", line 16, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 24: Unexpected errors ['File "generics_typevartuple_specialization.py", line 24, in : class Array is not indexable [not-indexable]'] -Line 28: Unexpected errors ['File "generics_typevartuple_specialization.py", line 28, in : class Array is not indexable [not-indexable]'] -Line 33: Unexpected errors ['File "generics_typevartuple_specialization.py", line 33, in : class Array is not indexable [not-indexable]'] -Line 41: Unexpected errors ['File "generics_typevartuple_specialization.py", line 41, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 42: Unexpected errors ['File "generics_typevartuple_specialization.py", line 42, in : class Array is not indexable [not-indexable]'] -Line 45: Unexpected errors ['File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation \\'Tuple[str, Array][Height]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 45, in : Invalid type annotation \\'Tuple[Any][float, bool]\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "generics_typevartuple_specialization.py", line 46, in func3: Tuple[Any] [assert-type]'] -Line 47: Unexpected errors ['File "generics_typevartuple_specialization.py", line 47, in func3: class Array is not indexable [not-indexable]'] -Line 51: Unexpected errors ['File "generics_typevartuple_specialization.py", line 51, in func4: Tuple[Any] [assert-type]'] -Line 55: Unexpected errors ['File "generics_typevartuple_specialization.py", line 55, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 59: Unexpected errors ['File "generics_typevartuple_specialization.py", line 59, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 63: Unexpected errors ['File "generics_typevartuple_specialization.py", line 63, in : class Array2 is not indexable [not-indexable]'] -Line 64: Unexpected errors ['File "generics_typevartuple_specialization.py", line 64, in : class Array2 is not indexable [not-indexable]'] -Line 67: Unexpected errors ['File "generics_typevartuple_specialization.py", line 67, in : class Array2 is not indexable [not-indexable]'] -Line 68: Unexpected errors ['File "generics_typevartuple_specialization.py", line 68, in func5_0: class Array2 is not indexable [not-indexable]'] -Line 69: Unexpected errors ['File "generics_typevartuple_specialization.py", line 69, in func5_0: class Array2 is not indexable [not-indexable]'] -Line 76: Unexpected errors ['File "generics_typevartuple_specialization.py", line 76, in : class Array2 is not indexable [not-indexable]'] -Line 80: Unexpected errors ['File "generics_typevartuple_specialization.py", line 80, in : class Array2 is not indexable [not-indexable]'] -Line 89: Unexpected errors ['File "generics_typevartuple_specialization.py", line 89, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 92: Unexpected errors ['File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation \\'Tuple[Any][str, int]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 92, in : Invalid type annotation \\'Tuple[Any][float]\\' [invalid-annotation]'] -Line 93: Unexpected errors ['File "generics_typevartuple_specialization.py", line 93, in func6: Tuple[Any] [assert-type]'] -Line 94: Unexpected errors ['File "generics_typevartuple_specialization.py", line 94, in func6: Tuple[Any] [assert-type]'] -Line 95: Unexpected errors ['File "generics_typevartuple_specialization.py", line 95, in func6: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 98: Unexpected errors ['File "generics_typevartuple_specialization.py", line 98, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 99: Unexpected errors ['File "generics_typevartuple_specialization.py", line 99, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 101: Unexpected errors ['File "generics_typevartuple_specialization.py", line 101, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 102: Unexpected errors ['File "generics_typevartuple_specialization.py", line 102, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 103: Unexpected errors ['File "generics_typevartuple_specialization.py", line 103, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 117: Unexpected errors ['File "generics_typevartuple_specialization.py", line 117, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 118: Unexpected errors ['File "generics_typevartuple_specialization.py", line 118, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 119: Unexpected errors ['File "generics_typevartuple_specialization.py", line 119, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 120: Unexpected errors ['File "generics_typevartuple_specialization.py", line 120, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 125: Unexpected errors ['File "generics_typevartuple_specialization.py", line 125, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 130: Unexpected errors ['File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'T2\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'T1\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 130, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 131: Unexpected errors ['File "generics_typevartuple_specialization.py", line 131, in func7: bad return type [bad-return-type]'] -Line 134: Unexpected errors ['File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation \\'Tuple[Any][str, bool]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation \\'Tuple[Any][str, bool, float]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 134, in : Invalid type annotation \\'Tuple[Any][str, bool, float, int]\\' [invalid-annotation]'] -Line 135: Unexpected errors ['File "generics_typevartuple_specialization.py", line 135, in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 136: Unexpected errors ['File "generics_typevartuple_specialization.py", line 136, in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 137: Unexpected errors ['File "generics_typevartuple_specialization.py", line 137, in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 140: Unexpected errors ['File "generics_typevartuple_specialization.py", line 140, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 143: Unexpected errors ['File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'T3\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'T2\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'T1\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 143, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 144: Unexpected errors ['File "generics_typevartuple_specialization.py", line 144, in func9: bad return type [bad-return-type]'] -Line 147: Unexpected errors ['File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation \\'Tuple[Any][str, bool, float]\\' [invalid-annotation]', 'File "generics_typevartuple_specialization.py", line 147, in : Invalid type annotation \\'Tuple[Any][str, bool, float, int]\\' [invalid-annotation]'] -Line 148: Unexpected errors ['File "generics_typevartuple_specialization.py", line 148, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 149: Unexpected errors ['File "generics_typevartuple_specialization.py", line 149, in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 152: Unexpected errors ['File "generics_typevartuple_specialization.py", line 152, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 153: Unexpected errors ['File "generics_typevartuple_specialization.py", line 153, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 156: Unexpected errors ['File "generics_typevartuple_specialization.py", line 156, in : Invalid type annotation \\'Tuple[Any][]\\' [invalid-annotation]'] -Line 157: Unexpected errors ['File "generics_typevartuple_specialization.py", line 157, in func11: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 158: Unexpected errors ['File "generics_typevartuple_specialization.py", line 158, in func11: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 159: Unexpected errors ['File "generics_typevartuple_specialization.py", line 159, in func11: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 162: Unexpected errors ['File "generics_typevartuple_specialization.py", line 162, in : Invalid type annotation \\'\\' [invalid-annotation]'] +Line 7: Unexpected errors ['generics_typevartuple_specialization.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 10: Unexpected errors ['generics_typevartuple_specialization.py:10:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 16: Unexpected errors ["generics_typevartuple_specialization.py:16:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 28: Unexpected errors ['generics_typevartuple_specialization.py:28:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 33: Unexpected errors ['generics_typevartuple_specialization.py:33:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 41: Unexpected errors ["generics_typevartuple_specialization.py:41:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 42: Unexpected errors ['generics_typevartuple_specialization.py:42:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation]", "generics_typevartuple_specialization.py:45:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation]"] +Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Tuple[Any] [assert-type]'] +Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: class Array is not indexable [not-indexable]'] +Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: Tuple[Any] [assert-type]'] +Line 55: Unexpected errors ['generics_typevartuple_specialization.py:55:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 59: Unexpected errors ["generics_typevartuple_specialization.py:59:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 63: Unexpected errors ['generics_typevartuple_specialization.py:63:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 64: Unexpected errors ['generics_typevartuple_specialization.py:64:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 67: Unexpected errors ['generics_typevartuple_specialization.py:67:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] +Line 69: Unexpected errors ['generics_typevartuple_specialization.py:69:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] +Line 76: Unexpected errors ['generics_typevartuple_specialization.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 80: Unexpected errors ['generics_typevartuple_specialization.py:80:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] +Line 89: Unexpected errors ["generics_typevartuple_specialization.py:89:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 92: Unexpected errors ["generics_typevartuple_specialization.py:92:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation]", "generics_typevartuple_specialization.py:92:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation]"] +Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] +Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] +Line 95: Unexpected errors ["generics_typevartuple_specialization.py:95:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Invalid type annotation '' [invalid-annotation]"] +Line 98: Unexpected errors ['generics_typevartuple_specialization.py:98:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 99: Unexpected errors ['generics_typevartuple_specialization.py:99:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 101: Unexpected errors ["generics_typevartuple_specialization.py:101:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 102: Unexpected errors ["generics_typevartuple_specialization.py:102:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 103: Unexpected errors ["generics_typevartuple_specialization.py:103:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 117: Unexpected errors ["generics_typevartuple_specialization.py:117:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 118: Unexpected errors ["generics_typevartuple_specialization.py:118:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 119: Unexpected errors ["generics_typevartuple_specialization.py:119:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 120: Unexpected errors ["generics_typevartuple_specialization.py:120:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 125: Unexpected errors ["generics_typevartuple_specialization.py:125:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 130: Unexpected errors ["generics_typevartuple_specialization.py:130:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:130:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 131: Unexpected errors ['generics_typevartuple_specialization.py:131:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: bad return type [bad-return-type]'] +Line 134: Unexpected errors ["generics_typevartuple_specialization.py:134:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] +Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] +Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] +Line 140: Unexpected errors ["generics_typevartuple_specialization.py:140:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 143: Unexpected errors ["generics_typevartuple_specialization.py:143:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T3' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:143:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 144: Unexpected errors ['generics_typevartuple_specialization.py:144:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: bad return type [bad-return-type]'] +Line 147: Unexpected errors ["generics_typevartuple_specialization.py:147:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:147:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] +Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] +Line 152: Unexpected errors ["generics_typevartuple_specialization.py:152:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 153: Unexpected errors ["generics_typevartuple_specialization.py:153:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 156: Unexpected errors ["generics_typevartuple_specialization.py:156:24: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:156:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 157: Unexpected errors ["generics_typevartuple_specialization.py:157:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] +Line 158: Unexpected errors ["generics_typevartuple_specialization.py:158:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] +Line 159: Unexpected errors ["generics_typevartuple_specialization.py:159:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] +Line 162: Unexpected errors ["generics_typevartuple_specialization.py:162:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_unpack.toml b/conformance/results/pytype/generics_typevartuple_unpack.toml index 8a58f520..b19a7582 100644 --- a/conformance/results/pytype/generics_typevartuple_unpack.toml +++ b/conformance/results/pytype/generics_typevartuple_unpack.toml @@ -3,26 +3,72 @@ notes = """ Does not support TypeVarTuple. """ output = """ -File "generics_typevartuple_unpack.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "generics_typevartuple_unpack.py", line 14, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_unpack.py", line 17, in : Invalid type annotation 'Generic' [invalid-annotation] -File "generics_typevartuple_unpack.py", line 21, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 26, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 33, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "generics_typevartuple_unpack.py", line 36, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 40, in : class Array is not indexable [not-indexable] -File "generics_typevartuple_unpack.py", line 44, in : class Array is not indexable [not-indexable] +generics_typevartuple_unpack.py:7:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import Any, Generic, NewType, TypeVarTuple +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:17:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Array(Generic[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:21:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def process_batch_channels(x: Array[Batch, *tuple[Any, ...], Channels]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:26:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + + x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:26:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + + x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:26:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + + x: Array[Batch, Height, Width, Channels], y: Array[Batch, Channels], z: Array[Batch] + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:33:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Shape = TypeVarTuple("Shape") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:36:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def expect_variadic_array(x: Array[Batch, *Shape]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:40:29: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def expect_precise_array(x: Array[Batch, Height, Width, Channels]) -> None: + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_typevartuple_unpack.py:44:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : class Array is not indexable [not-indexable] + +def func4(y: Array[*tuple[Any, ...]]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 30: Expected 1 errors -Line 7: Unexpected errors ['File "generics_typevartuple_unpack.py", line 7, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 14: Unexpected errors ['File "generics_typevartuple_unpack.py", line 14, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ['File "generics_typevartuple_unpack.py", line 17, in : Invalid type annotation \\'Generic\\' [invalid-annotation]'] -Line 21: Unexpected errors ['File "generics_typevartuple_unpack.py", line 21, in : class Array is not indexable [not-indexable]'] -Line 26: Unexpected errors ['File "generics_typevartuple_unpack.py", line 26, in : class Array is not indexable [not-indexable]'] -Line 33: Unexpected errors ['File "generics_typevartuple_unpack.py", line 33, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 36: Unexpected errors ['File "generics_typevartuple_unpack.py", line 36, in : class Array is not indexable [not-indexable]'] -Line 40: Unexpected errors ['File "generics_typevartuple_unpack.py", line 40, in : class Array is not indexable [not-indexable]'] -Line 44: Unexpected errors ['File "generics_typevartuple_unpack.py", line 44, in : class Array is not indexable [not-indexable]'] +Line 7: Unexpected errors ['generics_typevartuple_unpack.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 14: Unexpected errors ['generics_typevartuple_unpack.py:14:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 17: Unexpected errors ["generics_typevartuple_unpack.py:17:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] +Line 21: Unexpected errors ['generics_typevartuple_unpack.py:21:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 26: Unexpected errors ['generics_typevartuple_unpack.py:26:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_unpack.py:26:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_unpack.py:26:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 33: Unexpected errors ['generics_typevartuple_unpack.py:33:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 36: Unexpected errors ['generics_typevartuple_unpack.py:36:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 40: Unexpected errors ['generics_typevartuple_unpack.py:40:29: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] +Line 44: Unexpected errors ['generics_typevartuple_unpack.py:44:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] """ diff --git a/conformance/results/pytype/generics_upper_bound.toml b/conformance/results/pytype/generics_upper_bound.toml index a999a23b..756776a8 100644 --- a/conformance/results/pytype/generics_upper_bound.toml +++ b/conformance/results/pytype/generics_upper_bound.toml @@ -3,15 +3,39 @@ notes = """ Does not properly support assert_type. """ output = """ -File "generics_upper_bound.py", line 24, in Test: Invalid TypeVar: bound cannot contain TypeVars [invalid-typevar] -File "generics_upper_bound.py", line 37, in : list [assert-type] -File "generics_upper_bound.py", line 38, in : set [assert-type] -File "generics_upper_bound.py", line 43, in : Union[list, set] [assert-type] -File "generics_upper_bound.py", line 51, in : Function longer was called with the wrong arguments [wrong-arg-types] -File "generics_upper_bound.py", line 56, in : Invalid TypeVar: constraints and a bound are mutually exclusive [invalid-typevar] +generics_upper_bound.py:24:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Test: Invalid TypeVar: bound cannot contain TypeVars [invalid-typevar] + + T_Bad1 = TypeVar("T_Bad1", bound=list[T]) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : list [assert-type] + +assert_type(longer([1], [1, 2]), list[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:38:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : set [assert-type] + +assert_type(longer({1}, {1, 2}), set[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[list, set] [assert-type] + +assert_type(longer([1], {1, 2}), list[int] | set[int]) # E? +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function longer was called with the wrong arguments [wrong-arg-types] + +longer(3, 3) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_upper_bound.py:56:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: constraints and a bound are mutually exclusive [invalid-typevar] + +T_Bad2 = TypeVar("T_Bad2", str, int, bound="int") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 37: Unexpected errors ['File "generics_upper_bound.py", line 37, in : list [assert-type]'] -Line 38: Unexpected errors ['File "generics_upper_bound.py", line 38, in : set [assert-type]'] +Line 37: Unexpected errors ['generics_upper_bound.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : list [assert-type]'] +Line 38: Unexpected errors ['generics_upper_bound.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : set [assert-type]'] """ diff --git a/conformance/results/pytype/generics_variance.toml b/conformance/results/pytype/generics_variance.toml index 92664946..46ec8ed4 100644 --- a/conformance/results/pytype/generics_variance.toml +++ b/conformance/results/pytype/generics_variance.toml @@ -3,12 +3,36 @@ notes = """ Does not support covariant or contravariant TypeVars. """ output = """ -File "generics_variance.py", line 14, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 14, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 18, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 19, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "generics_variance.py", line 27, in __iter__: bad return type [bad-return-type] -File "generics_variance.py", line 52, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] +generics_variance.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +X1 = TypeVar("X1", covariant=True, contravariant=True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:14:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +X1 = TypeVar("X1", covariant=True, contravariant=True) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:18:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:19:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_variance.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __iter__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +generics_variance.py:52:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +B_co = TypeVar("B_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -24,8 +48,8 @@ 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') -Line 18: Unexpected errors ['File "generics_variance.py", line 18, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 19: Unexpected errors ['File "generics_variance.py", line 19, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 27: Unexpected errors ['File "generics_variance.py", line 27, in __iter__: bad return type [bad-return-type]'] -Line 52: Unexpected errors ['File "generics_variance.py", line 52, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 18: Unexpected errors ['generics_variance.py:18:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 19: Unexpected errors ['generics_variance.py:19:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 27: Unexpected errors ['generics_variance.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __iter__: bad return type [bad-return-type]'] +Line 52: Unexpected errors ['generics_variance.py:52:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/historical_positional.toml b/conformance/results/pytype/historical_positional.toml index 2c02fbd8..563658c0 100644 --- a/conformance/results/pytype/historical_positional.toml +++ b/conformance/results/pytype/historical_positional.toml @@ -4,7 +4,11 @@ Does not apply rules for pre-3.8 positional-only parameters in some cases. Does not reject positional-only parameter after non-positional-only parameter. """ output = """ -File "historical_positional.py", line 43, in : Invalid keyword argument __x to function A.m1 [wrong-keyword-args] +historical_positional.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument __x to function A.m1 [wrong-keyword-args] + +a.m1(__x=3) # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/literals_interactions.toml b/conformance/results/pytype/literals_interactions.toml index abe6af20..a9a4375b 100644 --- a/conformance/results/pytype/literals_interactions.toml +++ b/conformance/results/pytype/literals_interactions.toml @@ -7,23 +7,67 @@ Does not narrow based on `x is Literal` type guard pattern. Does not narrow based on `x == Literal` type guard pattern. """ output = """ -File "literals_interactions.py", line 11, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_interactions.py", line 46, in open: bad return type [bad-return-type] +literals_interactions.py:11:76: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(v: tuple[int, str, list[bool]], a: Literal[0], b: Literal[5], c: Literal[-5]): + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + Called from (traceback): line 51, in current file -File "literals_interactions.py", line 46, in open: bad return type [bad-return-type] +literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + Called from (traceback): line 50, in current file -File "literals_interactions.py", line 46, in open: bad return type [bad-return-type] +literals_interactions.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in open: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + Called from (traceback): line 49, in current file -File "literals_interactions.py", line 61, in __add__: bad return type [bad-return-type] -File "literals_interactions.py", line 64, in __matmul__: bad return type [bad-return-type] -File "literals_interactions.py", line 67, in transpose: bad return type [bad-return-type] -File "literals_interactions.py", line 72, in func2: Matrix[Any, int] [assert-type] -File "literals_interactions.py", line 93, in parse_status1: Union[Status, str] [assert-type] -File "literals_interactions.py", line 106, in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types] -File "literals_interactions.py", line 109, in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types] +literals_interactions.py:61:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __add__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_interactions.py:64:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __matmul__: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_interactions.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in transpose: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_interactions.py:72:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Matrix[Any, int] [assert-type] + + assert_type(c, Matrix[Literal[2], Literal[7]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:93:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status1: Union[Status, str] [assert-type] + + assert_type(s, str) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:106:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types] + + return expects_bad_status(status) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_interactions.py:109:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types] + + expects_pending_status(status) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -31,13 +75,13 @@ Line 15: Expected 1 errors Line 16: Expected 1 errors Line 17: Expected 1 errors Line 18: Expected 1 errors -Line 11: Unexpected errors ['File "literals_interactions.py", line 11, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "literals_interactions.py", line 46, in open: bad return type [bad-return-type]', 'File "literals_interactions.py", line 46, in open: bad return type [bad-return-type]', 'File "literals_interactions.py", line 46, in open: bad return type [bad-return-type]'] -Line 61: Unexpected errors ['File "literals_interactions.py", line 61, in __add__: bad return type [bad-return-type]'] -Line 64: Unexpected errors ['File "literals_interactions.py", line 64, in __matmul__: bad return type [bad-return-type]'] -Line 67: Unexpected errors ['File "literals_interactions.py", line 67, in transpose: bad return type [bad-return-type]'] -Line 72: Unexpected errors ['File "literals_interactions.py", line 72, in func2: Matrix[Any, int] [assert-type]'] -Line 93: Unexpected errors ['File "literals_interactions.py", line 93, in parse_status1: Union[Status, str] [assert-type]'] -Line 106: Unexpected errors ['File "literals_interactions.py", line 106, in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types]'] -Line 109: Unexpected errors ['File "literals_interactions.py", line 109, in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types]'] +Line 11: Unexpected errors ["literals_interactions.py:11:76: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 46: Unexpected errors ['literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]', 'literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]', 'literals_interactions.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in open: bad return type [bad-return-type]'] +Line 61: Unexpected errors ['literals_interactions.py:61:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __add__: bad return type [bad-return-type]'] +Line 64: Unexpected errors ['literals_interactions.py:64:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __matmul__: bad return type [bad-return-type]'] +Line 67: Unexpected errors ['literals_interactions.py:67:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in transpose: bad return type [bad-return-type]'] +Line 72: Unexpected errors ['literals_interactions.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Matrix[Any, int] [assert-type]'] +Line 93: Unexpected errors ['literals_interactions.py:93:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status1: Union[Status, str] [assert-type]'] +Line 106: Unexpected errors ['literals_interactions.py:106:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status2: Function expects_bad_status was called with the wrong arguments [wrong-arg-types]'] +Line 109: Unexpected errors ['literals_interactions.py:109:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in parse_status2: Function expects_pending_status was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/literals_literalstring.toml b/conformance/results/pytype/literals_literalstring.toml index 32d16477..1a86e0b8 100644 --- a/conformance/results/pytype/literals_literalstring.toml +++ b/conformance/results/pytype/literals_literalstring.toml @@ -3,20 +3,78 @@ notes = """ Does not understand `LiteralString` special form. """ output = """ -File "literals_literalstring.py", line 8, in : typing.LiteralString not supported yet [not-supported-yet] -File "literals_literalstring.py", line 24, in my_function: bad return type [bad-return-type] -File "literals_literalstring.py", line 36, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_literalstring.py", line 37, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_literalstring.py", line 43, in func1: Type annotation for x2 does not match type of assignment [annotation-type-mismatch] -File "literals_literalstring.py", line 74, in func2: Type annotation for x3 does not match type of assignment [annotation-type-mismatch] -File "literals_literalstring.py", line 75, in func2: Type annotation for x4 does not match type of assignment [annotation-type-mismatch] -File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type] +literals_literalstring.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.LiteralString not supported yet [not-supported-yet] + +from typing import ( +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Any, +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + Generic, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + Literal, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + LiteralString, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + Sequence, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + TypeVar, +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + assert_type, +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + overload, +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m +) +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +literals_literalstring.py:24:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in my_function: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +literals_literalstring.py:36:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad_union: Literal["hello", LiteralString] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_literalstring.py:37:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad_nesting: Literal[LiteralString] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_literalstring.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for x2 does not match type of assignment [annotation-type-mismatch] + + x2: Literal[""] = b # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_literalstring.py:74:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x3 does not match type of assignment [annotation-type-mismatch] + + x3: LiteralString = 3 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_literalstring.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x4 does not match type of assignment [annotation-type-mismatch] + + x4: LiteralString = b"test" # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_literalstring.py:162:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 166, in current file -File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type] +literals_literalstring.py:162:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 165, in current file -File "literals_literalstring.py", line 167, in : B [assert-type] +literals_literalstring.py:167:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : B [assert-type] + +assert_type(func8(str(1)), A) # Third overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -24,8 +82,8 @@ Line 66: Expected 1 errors Line 120: Expected 1 errors Line 134: Expected 1 errors Line 171: Expected 1 errors -Line 8: Unexpected errors ['File "literals_literalstring.py", line 8, in : typing.LiteralString not supported yet [not-supported-yet]'] -Line 24: Unexpected errors ['File "literals_literalstring.py", line 24, in my_function: bad return type [bad-return-type]'] -Line 162: Unexpected errors ['File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type]', 'File "literals_literalstring.py", line 162, in func8: bad return type [bad-return-type]'] -Line 167: Unexpected errors ['File "literals_literalstring.py", line 167, in : B [assert-type]'] +Line 8: Unexpected errors ['literals_literalstring.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.LiteralString not supported yet [not-supported-yet]'] +Line 24: Unexpected errors ['literals_literalstring.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in my_function: bad return type [bad-return-type]'] +Line 162: Unexpected errors ['literals_literalstring.py:162:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: bad return type [bad-return-type]', 'literals_literalstring.py:162:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: bad return type [bad-return-type]'] +Line 167: Unexpected errors ['literals_literalstring.py:167:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : B [assert-type]'] """ diff --git a/conformance/results/pytype/literals_parameterizations.toml b/conformance/results/pytype/literals_parameterizations.toml index 1cc9d9b3..a1751be5 100644 --- a/conformance/results/pytype/literals_parameterizations.toml +++ b/conformance/results/pytype/literals_parameterizations.toml @@ -3,22 +3,91 @@ notes = """ Does not understand `Literal` type annotation. """ output = """ -File "literals_parameterizations.py", line 17, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 18, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 19, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 33, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 35, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 42, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 43, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 44, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 47, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 48, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 50, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 51, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 53, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 61, in : Invalid type annotation 'Literal[my_function]' [invalid-annotation] -File "literals_parameterizations.py", line 61, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_parameterizations.py", line 65, in func2: Type annotation for x1 does not match type of assignment [annotation-type-mismatch] +literals_parameterizations.py:17:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good1: Literal[26] + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:18:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good2: Literal[0x1A] + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:19:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good3: Literal[-4] + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:33:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +AllModes = Literal[ReadOnlyMode, WriteAndTruncateMode, WriteNoTruncateMode, AppendMode] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:35:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good11: Literal[Literal[Literal[1, 2, 3], "foo"], 5, None] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +good11: Literal[Literal[Literal[1, 2, 3], "foo"], 5, None] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:42:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad2: Literal["foo".replace("o", "b")] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:43:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad3: Literal[4 + 3j] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:44:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad4: Literal[~5] # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:47:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad7: Literal[{"a": "b", "c": "d"}] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:48:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad8: Literal[int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:50:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad10: Literal[T] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:51:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad11: Literal[3.14] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:53:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +bad13: Literal[...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal[my_function]' [invalid-annotation] + +y: Literal[my_function] = my_function # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +literals_parameterizations.py:61:4: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +y: Literal[my_function] = my_function # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_parameterizations.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for x1 does not match type of assignment [annotation-type-mismatch] + + x1: Literal["Color.RED"] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -29,9 +98,9 @@ Line 49: Expected 1 errors Line 52: Expected 1 errors Line 56: Expected 1 errors Line 60: Expected 1 errors -Line 17: Unexpected errors ['File "literals_parameterizations.py", line 17, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 18: Unexpected errors ['File "literals_parameterizations.py", line 18, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 19: Unexpected errors ['File "literals_parameterizations.py", line 19, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 33: Unexpected errors ['File "literals_parameterizations.py", line 33, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 35: Unexpected errors ['File "literals_parameterizations.py", line 35, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] +Line 17: Unexpected errors ["literals_parameterizations.py:17:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 18: Unexpected errors ["literals_parameterizations.py:18:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 19: Unexpected errors ["literals_parameterizations.py:19:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 33: Unexpected errors ["literals_parameterizations.py:33:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 35: Unexpected errors ["literals_parameterizations.py:35:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_parameterizations.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/literals_semantics.toml b/conformance/results/pytype/literals_semantics.toml index afe67097..e443c950 100644 --- a/conformance/results/pytype/literals_semantics.toml +++ b/conformance/results/pytype/literals_semantics.toml @@ -3,22 +3,60 @@ notes = """ Does not understand `Literal` type annotation. """ output = """ -File "literals_semantics.py", line 10, in : Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "literals_semantics.py", line 12, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_semantics.py", line 12, in : Invalid type annotation 'L[-3]' [invalid-annotation] -File "literals_semantics.py", line 16, in : Invalid type annotation 'Literal' [invalid-annotation] -File "literals_semantics.py", line 17, in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] -File "literals_semantics.py", line 18, in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] -File "literals_semantics.py", line 19, in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] +literals_semantics.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + +v2: Literal[3] = 4 # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:12:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +v3: L[-3] = -3 + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'L[-3]' [invalid-annotation] + +v3: L[-3] = -3 +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:16:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:16:48: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Literal' [invalid-annotation] + +def func1(a: Literal[20], b: Literal[0x14], c: Literal[0b10100]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +literals_semantics.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] + + x1: Literal[0x14] = a + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:18:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] + + x2: Literal[0x14] = b + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +literals_semantics.py:19:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation] + + x3: Literal[0x14] = c + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 24: Expected 1 errors Line 25: Expected 1 errors Line 33: Expected 1 errors -Line 12: Unexpected errors ['File "literals_semantics.py", line 12, in : Invalid type annotation \\'Literal\\' [invalid-annotation]', 'File "literals_semantics.py", line 12, in : Invalid type annotation \\'L[-3]\\' [invalid-annotation]'] -Line 16: Unexpected errors ['File "literals_semantics.py", line 16, in : Invalid type annotation \\'Literal\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "literals_semantics.py", line 17, in func1: Invalid type annotation \\'Literal[20]\\' [invalid-annotation]'] -Line 18: Unexpected errors ['File "literals_semantics.py", line 18, in func1: Invalid type annotation \\'Literal[20]\\' [invalid-annotation]'] -Line 19: Unexpected errors ['File "literals_semantics.py", line 19, in func1: Invalid type annotation \\'Literal[20]\\' [invalid-annotation]'] +Line 12: Unexpected errors ["literals_semantics.py:12:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:12:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'L[-3]' [invalid-annotation]"] +Line 16: Unexpected errors ["literals_semantics.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:16:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]", "literals_semantics.py:16:48: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Literal' [invalid-annotation]"] +Line 17: Unexpected errors ["literals_semantics.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] +Line 18: Unexpected errors ["literals_semantics.py:18:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] +Line 19: Unexpected errors ["literals_semantics.py:19:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation 'Literal[20]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/namedtuples_define_class.toml b/conformance/results/pytype/namedtuples_define_class.toml index 354819a9..bad1600d 100644 --- a/conformance/results/pytype/namedtuples_define_class.toml +++ b/conformance/results/pytype/namedtuples_define_class.toml @@ -9,17 +9,61 @@ Does not reject incorrect argument type passed to specialized generic named tupl Does not reject attempt to use NamedTuple with multiple inheritance. """ output = """ -File "namedtuples_define_class.py", line 27, in : Union[int, str] [assert-type] -File "namedtuples_define_class.py", line 28, in : Union[int, str] [assert-type] -File "namedtuples_define_class.py", line 29, in : Tuple[Union[int, str], ...] [assert-type] -File "namedtuples_define_class.py", line 30, in : Tuple[Union[int, str], ...] [assert-type] -File "namedtuples_define_class.py", line 44, in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] -File "namedtuples_define_class.py", line 45, in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] -File "namedtuples_define_class.py", line 46, in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_class.py", line 47, in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_class.py", line 48, in : Function Point.__new__ expects 3 arg(s), got 5 [wrong-arg-count] -File "namedtuples_define_class.py", line 49, in : Invalid keyword argument other to function Point.__new__ [wrong-keyword-args] -File "namedtuples_define_class.py", line 95, in : Any [assert-type] +namedtuples_define_class.py:27:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p1[-2], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p1[-3], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] + +assert_type(p1[0:2], tuple[int, int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] + +assert_type(p1[0:], tuple[int, int, str]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:44:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] + +p5 = Point(1) # E + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:45:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point.__new__ [missing-parameter] + +p6 = Point(x=1) # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] + +p7 = Point(1, "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:47:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ was called with the wrong arguments [wrong-arg-types] + +p8 = Point(1, 2, units=3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:48:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point.__new__ expects 3 arg(s), got 5 [wrong-arg-count] + +p9 = Point(1, 2, "", "") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:49:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument other to function Point.__new__ [wrong-keyword-args] + +p10 = Point(1, 2, "", other="") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_class.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(pr1[1], float) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -29,9 +73,9 @@ Line 59: Expected 1 errors Line 79: Expected 1 errors Line 98: Expected 1 errors Line 105: Expected 1 errors -Line 27: Unexpected errors ['File "namedtuples_define_class.py", line 27, in : Union[int, str] [assert-type]'] -Line 28: Unexpected errors ['File "namedtuples_define_class.py", line 28, in : Union[int, str] [assert-type]'] -Line 29: Unexpected errors ['File "namedtuples_define_class.py", line 29, in : Tuple[Union[int, str], ...] [assert-type]'] -Line 30: Unexpected errors ['File "namedtuples_define_class.py", line 30, in : Tuple[Union[int, str], ...] [assert-type]'] -Line 95: Unexpected errors ['File "namedtuples_define_class.py", line 95, in : Any [assert-type]'] +Line 27: Unexpected errors ['namedtuples_define_class.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] +Line 28: Unexpected errors ['namedtuples_define_class.py:28:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] +Line 29: Unexpected errors ['namedtuples_define_class.py:29:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] +Line 30: Unexpected errors ['namedtuples_define_class.py:30:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] +Line 95: Unexpected errors ['namedtuples_define_class.py:95:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/namedtuples_define_functional.toml b/conformance/results/pytype/namedtuples_define_functional.toml index ab1f06c0..f18a771b 100644 --- a/conformance/results/pytype/namedtuples_define_functional.toml +++ b/conformance/results/pytype/namedtuples_define_functional.toml @@ -4,21 +4,69 @@ Does not handle illegal named tuple names the same as runtime. Does not support defaults in functional form. """ output = """ -File "namedtuples_define_functional.py", line 16, in : Missing parameter 'y' in call to function Point1.__new__ [missing-parameter] -File "namedtuples_define_functional.py", line 21, in : Missing parameter 'x' in call to function Point2.__new__ [missing-parameter] -File "namedtuples_define_functional.py", line 26, in : Function Point3.__new__ expects 3 arg(s), got 4 [wrong-arg-count] -File "namedtuples_define_functional.py", line 31, in : Invalid keyword argument z to function Point4.__new__ [wrong-keyword-args] -File "namedtuples_define_functional.py", line 36, in : Function Point5.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_functional.py", line 37, in : Function Point5.__new__ expects 3 arg(s), got 4 [wrong-arg-count] -File "namedtuples_define_functional.py", line 42, in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_functional.py", line 43, in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] -File "namedtuples_define_functional.py", line 52, in : collections.namedtuple argument 'a' is not a valid typename or field name. [invalid-namedtuple-arg] -File "namedtuples_define_functional.py", line 53, in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] -File "namedtuples_define_functional.py", line 54, in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] -File "namedtuples_define_functional.py", line 63, in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types] +namedtuples_define_functional.py:16:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'y' in call to function Point1.__new__ [missing-parameter] + +p1_3 = Point1(2.3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:21:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Missing parameter 'x' in call to function Point2.__new__ [missing-parameter] + +p2_3 = Point2() # E + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:26:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point3.__new__ expects 3 arg(s), got 4 [wrong-arg-count] + +p3_3 = Point3(1, 2, 3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:31:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument z to function Point4.__new__ [wrong-keyword-args] + +p4_3 = Point4(1, z=3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:36:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point5.__new__ was called with the wrong arguments [wrong-arg-types] + +p5_3 = Point5(2, "1") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:37:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point5.__new__ expects 3 arg(s), got 4 [wrong-arg-count] + +p5_4 = Point5(1, 2, 3) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:42:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] + +p6_3 = Point6(2, "1") # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:43:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function Point6.__new__ was called with the wrong arguments [wrong-arg-types] + +p6_4 = Point6(x=1.1, y=2) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:52:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'a' is not a valid typename or field name. [invalid-namedtuple-arg] + +NT1 = namedtuple("NT1", ["a", "a"]) # E?: duplicate field name + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:53:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] + +NT2 = namedtuple("NT2", ["abc", "def"]) # E?: illegal field name + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:54:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : collections.namedtuple argument 'def' is not a valid typename or field name. [invalid-namedtuple-arg] + +NT3 = namedtuple("NT3", ["abc", "def"], rename=False) # E?: illegal field name + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_define_functional.py:63:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types] + +NT5 = namedtuple("NT5", "a b c", defaults=(1, 2)) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 66: Expected 1 errors -Line 63: Unexpected errors ['File "namedtuples_define_functional.py", line 63, in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types]'] +Line 63: Unexpected errors ['namedtuples_define_functional.py:63:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function collections.namedtuple was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/namedtuples_type_compat.toml b/conformance/results/pytype/namedtuples_type_compat.toml index 240a9034..a649efd7 100644 --- a/conformance/results/pytype/namedtuples_type_compat.toml +++ b/conformance/results/pytype/namedtuples_type_compat.toml @@ -1,7 +1,15 @@ conformant = "Pass" output = """ -File "namedtuples_type_compat.py", line 22, in : Type annotation for v3 does not match type of assignment [annotation-type-mismatch] -File "namedtuples_type_compat.py", line 23, in : Type annotation for v4 does not match type of assignment [annotation-type-mismatch] +namedtuples_type_compat.py:22:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3 does not match type of assignment [annotation-type-mismatch] + +v3: tuple[int, int] = p # E: too few elements +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +namedtuples_type_compat.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4 does not match type of assignment [annotation-type-mismatch] + +v4: tuple[int, str, str] = p # E: incompatible element type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/namedtuples_usage.toml b/conformance/results/pytype/namedtuples_usage.toml index d1a376f6..91aabf28 100644 --- a/conformance/results/pytype/namedtuples_usage.toml +++ b/conformance/results/pytype/namedtuples_usage.toml @@ -6,12 +6,36 @@ Does not reject attempt to overwrite named tuple entry by name. Does not reject attempt to delete named tuple entry by name. """ output = """ -File "namedtuples_usage.py", line 31, in : Union[int, str] [assert-type] -File "namedtuples_usage.py", line 32, in : Union[int, str] [assert-type] -File "namedtuples_usage.py", line 41, in : unsupported operand type(s) for item assignment: Point [unsupported-operands] -File "namedtuples_usage.py", line 43, in : unsupported operand type(s) for item deletion: Point [unsupported-operands] -File "namedtuples_usage.py", line 52, in : Cannot unpack 3 values into 2 variables [bad-unpacking] -File "namedtuples_usage.py", line 53, in : Cannot unpack 3 values into 4 variables [bad-unpacking] +namedtuples_usage.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p[-2], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Union[int, str] [assert-type] + +assert_type(p[-3], int) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item assignment: Point [unsupported-operands] + +p[0] = 3 # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:43:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item deletion: Point [unsupported-operands] + +del p[0] # E + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot unpack 3 values into 2 variables [bad-unpacking] + +x2, y2 = p # E: too few values to unpack +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +namedtuples_usage.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot unpack 3 values into 4 variables [bad-unpacking] + +x3, y3, unit3, other = p # E: too many values to unpack +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -19,6 +43,6 @@ Line 34: Expected 1 errors Line 35: Expected 1 errors Line 40: Expected 1 errors Line 42: Expected 1 errors -Line 31: Unexpected errors ['File "namedtuples_usage.py", line 31, in : Union[int, str] [assert-type]'] -Line 32: Unexpected errors ['File "namedtuples_usage.py", line 32, in : Union[int, str] [assert-type]'] +Line 31: Unexpected errors ['namedtuples_usage.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] +Line 32: Unexpected errors ['namedtuples_usage.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] """ diff --git a/conformance/results/pytype/narrowing_typeguard.toml b/conformance/results/pytype/narrowing_typeguard.toml index a95dd8d5..da2f78df 100644 --- a/conformance/results/pytype/narrowing_typeguard.toml +++ b/conformance/results/pytype/narrowing_typeguard.toml @@ -3,8 +3,16 @@ notes = """ Does not reject TypeGuard method with too few parameters. """ output = """ -File "narrowing_typeguard.py", line 128, in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeguard.py", line 148, in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] +narrowing_typeguard.py:128:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] + +takes_callable_str(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeguard.py:148:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] + +takes_callable_str_proto(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/narrowing_typeis.toml b/conformance/results/pytype/narrowing_typeis.toml index 3af03cc8..e5f70078 100644 --- a/conformance/results/pytype/narrowing_typeis.toml +++ b/conformance/results/pytype/narrowing_typeis.toml @@ -5,12 +5,38 @@ Does not reject covariant use of TypeIs. Does not reject TypeIs where return type is not consistent with input type due to variance. """ output = """ -File "narrowing_typeis.py", line 19, in func1: Tuple[str, ...] [assert-type] -File "narrowing_typeis.py", line 132, in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 152, in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 169, in : Function takes_typeguard was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 170, in : Function takes_typeis was called with the wrong arguments [wrong-arg-types] -File "narrowing_typeis.py", line 195, in : TypeIs[str] is not consistent with input type int [invalid-function-definition] +narrowing_typeis.py:19:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Tuple[str, ...] [assert-type] + + assert_type(names, tuple[str, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] + +takes_callable_str(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:152:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_callable_str_proto was called with the wrong arguments [wrong-arg-types] + +takes_callable_str_proto(simple_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:169:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_typeguard was called with the wrong arguments [wrong-arg-types] + +takes_typeguard(is_int_typeis) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:170:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_typeis was called with the wrong arguments [wrong-arg-types] + +takes_typeis(is_int_typeguard) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +narrowing_typeis.py:195:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : TypeIs[str] is not consistent with input type int [invalid-function-definition] + +def bad_typeis(x: int) -> TypeIs[str]: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return isinstance(x, str) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -18,5 +44,5 @@ Line 105: Expected 1 errors Line 110: Expected 1 errors Line 191: Expected 1 errors Line 199: Expected 1 errors -Line 19: Unexpected errors ['File "narrowing_typeis.py", line 19, in func1: Tuple[str, ...] [assert-type]'] +Line 19: Unexpected errors ['narrowing_typeis.py:19:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[str, ...] [assert-type]'] """ diff --git a/conformance/results/pytype/overloads_basic.toml b/conformance/results/pytype/overloads_basic.toml index 8d90cba2..06e69b8c 100644 --- a/conformance/results/pytype/overloads_basic.toml +++ b/conformance/results/pytype/overloads_basic.toml @@ -4,14 +4,26 @@ Does not reject a function with a single @overload signature. Does not reject a function with @overload signature but no implementation. """ output = """ -File "overloads_basic.py", line 31, in __getitem__: bad return type [bad-return-type] -File "overloads_basic.py", line 37, in : unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands] -File "overloads_basic.py", line 58, in map: bad return type [bad-return-type] +overloads_basic.py:31:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __getitem__: bad return type [bad-return-type] + + return b"" + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +overloads_basic.py:37:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for item retrieval: Bytes and str [unsupported-operands] + +b[""] # E: no matching overload +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +overloads_basic.py:58:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in map: bad return type [bad-return-type] + + pass + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Lines 62, 63: Expected error (tag 'func1') Lines 74, 75: Expected error (tag 'func2') -Line 31: Unexpected errors ['File "overloads_basic.py", line 31, in __getitem__: bad return type [bad-return-type]'] -Line 58: Unexpected errors ['File "overloads_basic.py", line 58, in map: bad return type [bad-return-type]'] +Line 31: Unexpected errors ['overloads_basic.py:31:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __getitem__: bad return type [bad-return-type]'] +Line 58: Unexpected errors ['overloads_basic.py:58:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in map: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/protocols_class_objects.toml b/conformance/results/pytype/protocols_class_objects.toml index 47965b7e..f294b700 100644 --- a/conformance/results/pytype/protocols_class_objects.toml +++ b/conformance/results/pytype/protocols_class_objects.toml @@ -5,8 +5,18 @@ Incorrectly reports some class objects as incompatible with a protocol. Fails to report some class objects as incompatible with a protocol. """ output = """ -File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type] -File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types] +protocols_class_objects.py:50:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +protocols_class_objects.py:100:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types] + +class ConcreteC3(metaclass=CMeta): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -18,6 +28,6 @@ Line 104: Expected 1 errors Line 106: Expected 1 errors Line 107: Expected 1 errors Line 108: Expected 1 errors -Line 50: Unexpected errors ['File "protocols_class_objects.py", line 50, in method1: bad return type [bad-return-type]'] -Line 100: Unexpected errors ['File "protocols_class_objects.py", line 100, in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types]'] +Line 50: Unexpected errors ['protocols_class_objects.py:50:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] +Line 100: Unexpected errors ['protocols_class_objects.py:100:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function CMeta.__init__ was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/protocols_definition.toml b/conformance/results/pytype/protocols_definition.toml index a50220bb..0c6fb35e 100644 --- a/conformance/results/pytype/protocols_definition.toml +++ b/conformance/results/pytype/protocols_definition.toml @@ -16,14 +16,46 @@ 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 = """ -File "protocols_definition.py", line 30, in : Function close_all was called with the wrong arguments [wrong-arg-types] -File "protocols_definition.py", line 45, in third: bad return type [bad-return-type] -File "protocols_definition.py", line 114, in : Type annotation for v2_bad1 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 115, in : Type annotation for v2_bad2 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 156, in : Type annotation for v3_bad1 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 159, in : Type annotation for v3_bad4 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 218, in : Type annotation for v4_bad1 does not match type of assignment [annotation-type-mismatch] -File "protocols_definition.py", line 219, in : Type annotation for v4_bad2 does not match type of assignment [annotation-type-mismatch] +protocols_definition.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function close_all was called with the wrong arguments [wrong-arg-types] + +close_all([1]) # E: 'int' has no 'close' method +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:45:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in third: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +protocols_definition.py:114:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2_bad1 does not match type of assignment [annotation-type-mismatch] + +v2_bad1: Template2 = Concrete2_Bad1() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:115:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v2_bad2 does not match type of assignment [annotation-type-mismatch] + +v2_bad2: Template2 = Concrete2_Bad2() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3_bad1 does not match type of assignment [annotation-type-mismatch] + +v3_bad1: Template3 = Concrete3_Bad1() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v3_bad4 does not match type of assignment [annotation-type-mismatch] + +v3_bad4: Template3 = Concrete3_Bad4() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:218:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4_bad1 does not match type of assignment [annotation-type-mismatch] + +v4_bad1: Template4 = Concrete4_Bad1() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_definition.py:219:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for v4_bad2 does not match type of assignment [annotation-type-mismatch] + +v4_bad2: Template4 = Concrete4_Bad2() # E +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -41,5 +73,5 @@ Line 289: Expected 1 errors Line 339: Expected 1 errors Line 340: Expected 1 errors Line 341: Expected 1 errors -Line 45: Unexpected errors ['File "protocols_definition.py", line 45, in third: bad return type [bad-return-type]'] +Line 45: Unexpected errors ['protocols_definition.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in third: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/protocols_explicit.toml b/conformance/results/pytype/protocols_explicit.toml index 8432b87e..5dbd6b44 100644 --- a/conformance/results/pytype/protocols_explicit.toml +++ b/conformance/results/pytype/protocols_explicit.toml @@ -7,11 +7,23 @@ Does not reject instantiation of class that derives from protocol but doesn't im Does not report instantiation of class that derives from protocol but doesn't implement method. """ output = """ -File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type] +protocols_explicit.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in draw: bad return type [bad-return-type] + + ... + \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + Called from (traceback): line 27, in draw -File "protocols_explicit.py", line 60, in : Can't instantiate Point with abstract methods intensity [not-instantiable] -File "protocols_explicit.py", line 165, in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] +protocols_explicit.py:60:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate Point with abstract methods intensity [not-instantiable] + +p = Point(0, 0, "") # E: Cannot instantiate abstract class + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_explicit.py:165:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate Concrete7A with abstract methods method1 [not-instantiable] + +c7a = Concrete7A() # E: cannot instantiate abstract class + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -20,5 +32,5 @@ Line 56: Expected 1 errors Line 90: Expected 1 errors Line 110: Expected 1 errors Line 135: Expected 1 errors -Line 14: Unexpected errors ['File "protocols_explicit.py", line 14, in draw: bad return type [bad-return-type]'] +Line 14: Unexpected errors ['protocols_explicit.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in draw: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/protocols_generic.toml b/conformance/results/pytype/protocols_generic.toml index c2d3728a..2ab4a937 100644 --- a/conformance/results/pytype/protocols_generic.toml +++ b/conformance/results/pytype/protocols_generic.toml @@ -5,21 +5,55 @@ Does not correctly enforce invariance in protocol type compatibility tests. Does not detect protocol mismatch when method-scoped TypeVar is used in protocol. """ output = """ -File "protocols_generic.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_generic.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_generic.py", line 40, in : Type annotation for p2 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 44, in : Invalid type annotation 'Proto2' [invalid-annotation] -File "protocols_generic.py", line 56, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 65, in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 75, in func3: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_generic.py", line 146, in : Type annotation for hp3 does not match type of assignment [annotation-type-mismatch] +protocols_generic.py:12:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_generic.py:13:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_generic.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for p2 does not match type of assignment [annotation-type-mismatch] + +p2: Proto1[int, str] = Concrete1() # E: incompatible type +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Proto2' [invalid-annotation] + +class Proto2(Protocol[T_co], Generic[T_co]): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +protocols_generic.py:56:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: Box[int] = box_float # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:65:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] + + v1: Sender[int] = sender_float # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:75:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: AttrProto[int] = attr_float # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_generic.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for hp3 does not match type of assignment [annotation-type-mismatch] + +hp3: HasPropertyProto = ConcreteHasProperty3() # E +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 66: Expected 1 errors Line 74: Expected 1 errors Line 147: Expected 1 errors -Line 12: Unexpected errors ['File "protocols_generic.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['File "protocols_generic.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 65: Unexpected errors ['File "protocols_generic.py", line 65, in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 12: Unexpected errors ['protocols_generic.py:12:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['protocols_generic.py:13:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 65: Unexpected errors ['protocols_generic.py:65:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/protocols_merging.toml b/conformance/results/pytype/protocols_merging.toml index bf9e4eab..a3102a96 100644 --- a/conformance/results/pytype/protocols_merging.toml +++ b/conformance/results/pytype/protocols_merging.toml @@ -4,11 +4,31 @@ Does not reject a protocol class that derives from a non-protocol class. Does not report attempt to instantiate abstract class downgraded from protocol class. """ output = """ -File "protocols_merging.py", line 52, in : Type annotation for s6 does not match type of assignment [annotation-type-mismatch] -File "protocols_merging.py", line 53, in : Type annotation for s7 does not match type of assignment [annotation-type-mismatch] -File "protocols_merging.py", line 54, in : Type annotation for s8 does not match type of assignment [annotation-type-mismatch] -File "protocols_merging.py", line 82, in : Can't instantiate SizedAndClosable4 with abstract methods close [not-instantiable] -File "protocols_merging.py", line 83, in : Type annotation for y does not match type of assignment [annotation-type-mismatch] +protocols_merging.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s6 does not match type of assignment [annotation-type-mismatch] + +s6: SizedAndClosable1 = SCConcrete2() # E: doesn't implement close +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_merging.py:53:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s7 does not match type of assignment [annotation-type-mismatch] + +s7: SizedAndClosable2 = SCConcrete2() # E: doesn't implement close +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_merging.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for s8 does not match type of assignment [annotation-type-mismatch] + +s8: SizedAndClosable3 = SCConcrete2() # E: SizedAndClosable3 is not a protocol +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_merging.py:82:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't instantiate SizedAndClosable4 with abstract methods close [not-instantiable] + +x = SizedAndClosable4() # E: cannot instantiate abstract class + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_merging.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for y does not match type of assignment [annotation-type-mismatch] + +y: SizedAndClosable4 = SCConcrete1() # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/protocols_modules.toml b/conformance/results/pytype/protocols_modules.toml index 1c5af906..77c9ae31 100644 --- a/conformance/results/pytype/protocols_modules.toml +++ b/conformance/results/pytype/protocols_modules.toml @@ -3,14 +3,22 @@ notes = """ Does not report incompatibilities for protocol methods. """ output = """ -File "protocols_modules.py", line 10, in : Can't find module '_protocols_modules1'. [import-error] -File "protocols_modules.py", line 11, in : Can't find module '_protocols_modules2'. [import-error] +protocols_modules.py:10:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_protocols_modules1'. [import-error] + +import _protocols_modules1 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_modules.py:11:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Can't find module '_protocols_modules2'. [import-error] + +import _protocols_modules2 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 26: Expected 1 errors Line 48: Expected 1 errors Line 49: Expected 1 errors -Line 10: Unexpected errors ['File "protocols_modules.py", line 10, in : Can\\'t find module \\'_protocols_modules1\\'. [import-error]'] -Line 11: Unexpected errors ['File "protocols_modules.py", line 11, in : Can\\'t find module \\'_protocols_modules2\\'. [import-error]'] +Line 10: Unexpected errors ["protocols_modules.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_protocols_modules1'. [import-error]"] +Line 11: Unexpected errors ["protocols_modules.py:11:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Can't find module '_protocols_modules2'. [import-error]"] """ diff --git a/conformance/results/pytype/protocols_recursive.toml b/conformance/results/pytype/protocols_recursive.toml index 05142931..419fa160 100644 --- a/conformance/results/pytype/protocols_recursive.toml +++ b/conformance/results/pytype/protocols_recursive.toml @@ -3,13 +3,25 @@ notes = """ Incorrectly reports type error for some recursive protocols. """ output = """ -File "protocols_recursive.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_recursive.py", line 12, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_recursive.py", line 81, in : Any [assert-type] +protocols_recursive.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_recursive.py:12:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_recursive.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Any [assert-type] + +assert_type(v1, list[int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 11: Unexpected errors ['File "protocols_recursive.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 12: Unexpected errors ['File "protocols_recursive.py", line 12, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 81: Unexpected errors ['File "protocols_recursive.py", line 81, in : Any [assert-type]'] +Line 11: Unexpected errors ['protocols_recursive.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 12: Unexpected errors ['protocols_recursive.py:12:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 81: Unexpected errors ['protocols_recursive.py:81:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/protocols_self.toml b/conformance/results/pytype/protocols_self.toml index ec7dd2b3..a6a63cb4 100644 --- a/conformance/results/pytype/protocols_self.toml +++ b/conformance/results/pytype/protocols_self.toml @@ -3,15 +3,31 @@ notes = """ Does not properly handle Self type within a protocol. """ output = """ -File "protocols_self.py", line 36, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_self.py", line 37, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_self.py", line 72, in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch] -File "protocols_self.py", line 73, in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch] +protocols_self.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T1_co = TypeVar("T1_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_self.py:37:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T2_co = TypeVar("T2_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_self.py:72:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch] + +a2: P2Parent[str] = C2[str]() # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_self.py:73:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch] + +b2: P2Child[str] = C2[str]() # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 36: Unexpected errors ['File "protocols_self.py", line 36, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 37: Unexpected errors ['File "protocols_self.py", line 37, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 72: Unexpected errors ['File "protocols_self.py", line 72, in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch]'] -Line 73: Unexpected errors ['File "protocols_self.py", line 73, in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch]'] +Line 36: Unexpected errors ['protocols_self.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 37: Unexpected errors ['protocols_self.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 72: Unexpected errors ['protocols_self.py:72:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for a2 does not match type of assignment [annotation-type-mismatch]'] +Line 73: Unexpected errors ['protocols_self.py:73:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for b2 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/protocols_subtyping.toml b/conformance/results/pytype/protocols_subtyping.toml index c364fc59..2908ac1b 100644 --- a/conformance/results/pytype/protocols_subtyping.toml +++ b/conformance/results/pytype/protocols_subtyping.toml @@ -4,10 +4,26 @@ Does not reject attempt to instantiate protocol class. Does not report some protocol type compatibility violations involving contravariance. """ output = """ -File "protocols_subtyping.py", line 38, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_subtyping.py", line 55, in func2: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "protocols_subtyping.py", line 83, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_subtyping.py", line 84, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] +protocols_subtyping.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: Concrete2 = p2 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_subtyping.py:55:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: Proto3 = p2 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +protocols_subtyping.py:83:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +S_co = TypeVar("S_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_subtyping.py:84:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T_contra = TypeVar("T_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -16,6 +32,6 @@ Line 79: Expected 1 errors Line 80: Expected 1 errors Line 102: Expected 1 errors Line 103: Expected 1 errors -Line 83: Unexpected errors ['File "protocols_subtyping.py", line 83, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 84: Unexpected errors ['File "protocols_subtyping.py", line 84, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 83: Unexpected errors ['protocols_subtyping.py:83:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 84: Unexpected errors ['protocols_subtyping.py:84:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/protocols_variance.toml b/conformance/results/pytype/protocols_variance.toml index 9eb9e284..a3089e61 100644 --- a/conformance/results/pytype/protocols_variance.toml +++ b/conformance/results/pytype/protocols_variance.toml @@ -3,9 +3,21 @@ notes = """ Does not detect incorrect TypeVar variance within generic protocols. """ output = """ -File "protocols_variance.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_variance.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] -File "protocols_variance.py", line 15, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] +protocols_variance.py:12:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T1_co = TypeVar("T1_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_variance.py:13:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet] + +T1_contra = TypeVar("T1_contra", contravariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +protocols_variance.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +R = TypeVar("R", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -16,7 +28,7 @@ Line 61: Expected 1 errors Line 66: Expected 1 errors Line 71: Expected 1 errors Line 104: Expected 1 errors -Line 12: Unexpected errors ['File "protocols_variance.py", line 12, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 13: Unexpected errors ['File "protocols_variance.py", line 13, in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] -Line 15: Unexpected errors ['File "protocols_variance.py", line 15, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 12: Unexpected errors ['protocols_variance.py:12:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 13: Unexpected errors ['protocols_variance.py:13:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] +Line 15: Unexpected errors ['protocols_variance.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/qualifiers_annotated.toml b/conformance/results/pytype/qualifiers_annotated.toml index 9a064202..4b5d16f8 100644 --- a/conformance/results/pytype/qualifiers_annotated.toml +++ b/conformance/results/pytype/qualifiers_annotated.toml @@ -6,17 +6,61 @@ Does not reject call of Annotated. Does not allow TypeVar to be used in type alias when wrapped with Annotated. """ output = """ -File "qualifiers_annotated.py", line 43, in : Invalid type annotation '[int, str]' for Bad1 [invalid-annotation] -File "qualifiers_annotated.py", line 44, in : Invalid type annotation '((int, str),)' for Bad2 [invalid-annotation] -File "qualifiers_annotated.py", line 45, in : Invalid type annotation '' for Bad3 [invalid-annotation] -File "qualifiers_annotated.py", line 46, in : Invalid type annotation "{'a': 'b'}" for Bad4 [invalid-annotation] -File "qualifiers_annotated.py", line 50, in : Name 'var1' is not defined [name-error] -File "qualifiers_annotated.py", line 51, in : Invalid type annotation 'True' for Bad9 [invalid-annotation] -File "qualifiers_annotated.py", line 52, in : Invalid type annotation '1' for Bad10 [invalid-annotation] -File "qualifiers_annotated.py", line 54, in : Invalid type annotation '' for Bad12 [invalid-annotation] -File "qualifiers_annotated.py", line 64, in : Invalid type annotation 'Annotated' [invalid-annotation] -File "qualifiers_annotated.py", line 91, in : 'Annotated' object is not callable [not-callable] -File "qualifiers_annotated.py", line 121, in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar] +qualifiers_annotated.py:43:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '[int, str]' for Bad1 [invalid-annotation] + +Bad1: Annotated[[int, str], ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '((int, str),)' for Bad2 [invalid-annotation] + +Bad2: Annotated[((int, str),), ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad3 [invalid-annotation] + +Bad3: Annotated[[int for i in range(1)], ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:46:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation "{'a': 'b'}" for Bad4 [invalid-annotation] + +Bad4: Annotated[{"a": "b"}, ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:50:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Name 'var1' is not defined [name-error] + +Bad8: Annotated[var1, ""] # E: invalid type expression + \u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:51:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'True' for Bad9 [invalid-annotation] + +Bad9: Annotated[True, ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '1' for Bad10 [invalid-annotation] + +Bad10: Annotated[1, ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad12 [invalid-annotation] + +Bad12: Annotated[f"{'int'}", ""] # E: invalid type expression +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:64:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Annotated' [invalid-annotation] + +Bad13: Annotated[int] # E: requires at least two arguments + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : 'Annotated' object is not callable [not-callable] + +Annotated() # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_annotated.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar] + +TA3 = Annotated[T, ""] +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -30,5 +74,5 @@ Line 84: Expected 1 errors Line 85: Expected 1 errors Line 92: Expected 1 errors Line 93: Expected 1 errors -Line 121: Unexpected errors ['File "qualifiers_annotated.py", line 121, in : Invalid TypeVar: TypeVar(\\'T\\') must be stored as \\'T\\', not \\'TA3\\' [invalid-typevar]'] +Line 121: Unexpected errors ["qualifiers_annotated.py:121:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid TypeVar: TypeVar('T') must be stored as 'T', not 'TA3' [invalid-typevar]"] """ diff --git a/conformance/results/pytype/qualifiers_final_annotation.toml b/conformance/results/pytype/qualifiers_final_annotation.toml index 9d3a3d45..59ff384d 100644 --- a/conformance/results/pytype/qualifiers_final_annotation.toml +++ b/conformance/results/pytype/qualifiers_final_annotation.toml @@ -6,24 +6,109 @@ Does not reject modification of global variable declared Final. Does not reject modification of local variable declared Final. """ output = """ -File "qualifiers_final_annotation.py", line 18, in : Invalid type annotation 'Final[str, int]' [invalid-annotation] -File "qualifiers_final_annotation.py", line 18, in : Invalid type annotation 'Final' [invalid-annotation] -File "qualifiers_final_annotation.py", line 54, in __init__: Assigning to attribute ID5, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 65, in method1: Assigning to attribute ID7, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 67, in method1: Assigning to attribute ID7, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 71, in : Assigning to variable RATE, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 81, in : Assigning to attribute DEFAULT_ID, which was annotated with Final [final-error] -File "qualifiers_final_annotation.py", line 93, in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error] -File "qualifiers_final_annotation.py", line 107, in ClassD: Type annotation for VALUE2 does not match type of assignment [annotation-type-mismatch] -File "qualifiers_final_annotation.py", line 107, in ClassD: Invalid use of typing.Final [final-error] -File "qualifiers_final_annotation.py", line 107, in ClassD: Invalid type annotation 'ClassVar[Final]' [invalid-annotation] -File "qualifiers_final_annotation.py", line 108, in ClassD: Type annotation for VALUE3 does not match type of assignment [annotation-type-mismatch] -File "qualifiers_final_annotation.py", line 118, in : Invalid use of typing.Final [final-error] -File "qualifiers_final_annotation.py", line 118, in : Invalid type annotation 'list[Final[int]]' [invalid-annotation] -File "qualifiers_final_annotation.py", line 121, in : Invalid use of typing.Final [final-error] -File "qualifiers_final_annotation.py", line 134, in : Invalid keyword argument a to function N.__new__ [wrong-keyword-args] -File "qualifiers_final_annotation.py", line 135, in : Function N.__new__ was called with the wrong arguments [wrong-arg-types] -File "qualifiers_final_annotation.py", line 145, in func2: Assigning to variable x, which was annotated with Final [final-error] +qualifiers_final_annotation.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Final[str, int]' [invalid-annotation] + +BAD2: Final[str, int] = "" # E: only one type argument allowed +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:18:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Final' [invalid-annotation] + +BAD2: Final[str, int] = "" # E: only one type argument allowed + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:54:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in __init__: Assigning to attribute ID5, which was annotated with Final [final-error] + + self.ID5 = 0 # E: Already initialized + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:65:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: Assigning to attribute ID7, which was annotated with Final [final-error] + + self.ID7 = 0 # E: cannot modify Final value + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method1: Assigning to attribute ID7, which was annotated with Final [final-error] + + self.ID7 += 1 # E: cannot modify Final value + \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:71:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to variable RATE, which was annotated with Final [final-error] + +RATE = 300 # E: Cannot redefine Final value +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Assigning to attribute DEFAULT_ID, which was annotated with Final [final-error] + +ClassB.DEFAULT_ID = 0 # E: Cannot redefined value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:93:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error] + +class ClassCChild(ClassC): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + BORDER_WIDTH = 2.5 # E: Cannot override Final value +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + __private = 0 # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Type annotation for VALUE2 does not match type of assignment [annotation-type-mismatch] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid use of typing.Final [final-error] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid use of typing.Final [final-error] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:107:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Invalid type annotation 'ClassVar[Final]' [invalid-annotation] + + VALUE2: ClassVar[Final] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:108:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in ClassD: Type annotation for VALUE3 does not match type of assignment [annotation-type-mismatch] + + VALUE3: Final[ClassVar] = 1 # E: Final cannot be used with ClassVar + \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:118:4: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid use of typing.Final [final-error] + +x: list[Final[int]] = [] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:118:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Final[int]]' [invalid-annotation] + +x: list[Final[int]] = [] # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:121:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid use of typing.Final [final-error] + +def func1(x: Final[list[int]]) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:134:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid keyword argument a to function N.__new__ [wrong-keyword-args] + +N(a=1) # E +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:135:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function N.__new__ was called with the wrong arguments [wrong-arg-types] + +N(x="", y="") # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_annotation.py:145:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Assigning to variable x, which was annotated with Final [final-error] + + x += 1 # E: cannot modify Final value + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -38,5 +123,5 @@ Line 147: Expected 1 errors Line 149: Expected 1 errors Line 152: Expected 1 errors Line 155: Expected 1 errors -Line 93: Unexpected errors ['File "qualifiers_final_annotation.py", line 93, in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error]'] +Line 93: Unexpected errors ['qualifiers_final_annotation.py:93:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class ClassCChild overrides final class attribute BORDER_WIDTH, defined in base class ClassC [final-error]'] """ diff --git a/conformance/results/pytype/qualifiers_final_decorator.toml b/conformance/results/pytype/qualifiers_final_decorator.toml index ca2fa29c..3910ac78 100644 --- a/conformance/results/pytype/qualifiers_final_decorator.toml +++ b/conformance/results/pytype/qualifiers_final_decorator.toml @@ -4,19 +4,247 @@ Does not report error for overloaded @final method defined in stub file. Does not report error for overload that is marked @final when implementation is not. """ output = """ -File "qualifiers_final_decorator.py", line 8, in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error] -File "qualifiers_final_decorator.py", line 21, in : Cannot subclass final class: Base1 [final-error] -File "qualifiers_final_decorator.py", line 52, in method4: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error] -File "qualifiers_final_decorator.py", line 76, in method4: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 90, in method: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 103, in method: bad return type [bad-return-type] -File "qualifiers_final_decorator.py", line 117, in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error] -File "qualifiers_final_decorator.py", line 118, in Derived5: Overriding method signature mismatch [signature-mismatch] -File "qualifiers_final_decorator.py", line 125, in : Cannot apply @final decorator to func1 [final-error] +qualifiers_final_decorator.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error] + +from _qualifiers_final_decorator import Base3, Base4 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:21:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot subclass final class: Base1 [final-error] + +class Derived1(Base1): # E: Cannot inherit from final class "Base" +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:52:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:55:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error] + +class Derived2(Base2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method1(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @classmethod # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method2(cls) -> None: # E[method2] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @staticmethod # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method3() -> None: # E[method3] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: int) -> int: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + @overload +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method4(self, x: str) -> str: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +\u001b[1m\u001b[31m\u001b[39m\u001b[0m + def method4(self, x: int | str) -> int | str: # E[method4] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + return 0 +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:76:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method4: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:90:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:103:16: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method: bad return type [bad-return-type] + + return 0 + \u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:117:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error] + +class Derived5(Base5_1, Base5_2): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + def method(self) -> None: # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:118:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Derived5: Overriding method signature mismatch [signature-mismatch] + + def method(self) -> None: # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ... +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +qualifiers_final_decorator.py:125:2: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Cannot apply @final decorator to func1 [final-error] + +@final # E[func]: not allowed on non-method function. + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -27,11 +255,11 @@ 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 8: Unexpected errors ['File "qualifiers_final_decorator.py", line 8, in : Couldn\\'t import pyi for \\'_qualifiers_final_decorator\\' [pyi-error]'] -Line 52: Unexpected errors ['File "qualifiers_final_decorator.py", line 52, in method4: bad return type [bad-return-type]'] -Line 55: Unexpected errors ['File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error]', 'File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error]', 'File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error]', 'File "qualifiers_final_decorator.py", line 55, in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error]'] -Line 76: Unexpected errors ['File "qualifiers_final_decorator.py", line 76, in method4: bad return type [bad-return-type]'] -Line 90: Unexpected errors ['File "qualifiers_final_decorator.py", line 90, in method: bad return type [bad-return-type]'] -Line 103: Unexpected errors ['File "qualifiers_final_decorator.py", line 103, in method: bad return type [bad-return-type]'] -Line 117: Unexpected errors ['File "qualifiers_final_decorator.py", line 117, in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error]'] +Line 8: Unexpected errors ["qualifiers_final_decorator.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Couldn't import pyi for '_qualifiers_final_decorator' [pyi-error]"] +Line 52: Unexpected errors ['qualifiers_final_decorator.py:52:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] +Line 55: Unexpected errors ['qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method4, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method3, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method2, defined in base class Base2 [final-error]', 'qualifiers_final_decorator.py:55:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived2 overrides final method method1, defined in base class Base2 [final-error]'] +Line 76: Unexpected errors ['qualifiers_final_decorator.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method4: bad return type [bad-return-type]'] +Line 90: Unexpected errors ['qualifiers_final_decorator.py:90:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: bad return type [bad-return-type]'] +Line 103: Unexpected errors ['qualifiers_final_decorator.py:103:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method: bad return type [bad-return-type]'] +Line 117: Unexpected errors ['qualifiers_final_decorator.py:117:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Class Derived5 overrides final method method, defined in base class Base5_2 [final-error]'] """ diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index bb235259..7a231858 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -3,20 +3,45 @@ notes = """ Does not understand NoReturn or Never. """ output = """ -File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet] -File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type] -File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] -File "specialtypes_never.py", line 86, in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] +specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_never.py:21:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: bad return type [bad-return-type] + + sys.exit(1) \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + sys.exit(1) +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_never.py:68:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] + + v1: int = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +specialtypes_never.py:69:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: str = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +specialtypes_never.py:70:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] + + v3: list[str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +specialtypes_never.py:86:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Type annotation for v3 does not match type of assignment [annotation-type-mismatch] + + v3: list[int] = c # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 105: Expected 1 errors -Line 11: Unexpected errors ['File "specialtypes_never.py", line 11, in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['File "specialtypes_never.py", line 21, in func1: bad return type [bad-return-type]'] -Line 68: Unexpected errors ['File "specialtypes_never.py", line 68, in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 69: Unexpected errors ['File "specialtypes_never.py", line 69, in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] -Line 70: Unexpected errors ['File "specialtypes_never.py", line 70, in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] +Line 11: Unexpected errors ['specialtypes_never.py:11:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] +Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/specialtypes_none.toml b/conformance/results/pytype/specialtypes_none.toml index 1c1b30f2..03a38e99 100644 --- a/conformance/results/pytype/specialtypes_none.toml +++ b/conformance/results/pytype/specialtypes_none.toml @@ -4,8 +4,16 @@ Does not detect type incompatibility between None and type[None]. Does not detect type incompatibility between None and incompatible protocol. """ output = """ -File "specialtypes_none.py", line 21, in : Function func1 was called with the wrong arguments [wrong-arg-types] -File "specialtypes_none.py", line 41, in : Function func2 was called with the wrong arguments [wrong-arg-types] +specialtypes_none.py:21:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func1 was called with the wrong arguments [wrong-arg-types] + +func1(type(None)) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_none.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types] + +func2(None) # E: not compatible +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/specialtypes_promotions.toml b/conformance/results/pytype/specialtypes_promotions.toml index dc20943f..8380712e 100644 --- a/conformance/results/pytype/specialtypes_promotions.toml +++ b/conformance/results/pytype/specialtypes_promotions.toml @@ -1,6 +1,10 @@ conformant = "Pass" output = """ -File "specialtypes_promotions.py", line 13, in func1: No attribute 'numerator' on float [attribute-error] +specialtypes_promotions.py:13:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: No attribute 'numerator' on float [attribute-error] + + f.numerator # E + \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/specialtypes_type.toml b/conformance/results/pytype/specialtypes_type.toml index 3a00c1aa..c9ad2035 100644 --- a/conformance/results/pytype/specialtypes_type.toml +++ b/conformance/results/pytype/specialtypes_type.toml @@ -4,26 +4,80 @@ Does not reject Callable when passed to type[T]. Does not allow access to known attributes from object of type `type[Any]`. """ output = """ -File "specialtypes_type.py", line 56, in : Function func4 was called with the wrong arguments [wrong-arg-types] -File "specialtypes_type.py", line 64, in : Invalid type annotation 'T' [invalid-annotation] -File "specialtypes_type.py", line 76, in : Invalid type annotation 'type[int, str]' [invalid-annotation] -File "specialtypes_type.py", line 98, in func7: Any [assert-type] -File "specialtypes_type.py", line 102, in func7: Any [assert-type] -File "specialtypes_type.py", line 106, in func7: Any [assert-type] -File "specialtypes_type.py", line 110, in func7: Any [assert-type] -File "specialtypes_type.py", line 117, in func8: No attribute 'unknown' on Type[object] [attribute-error] -File "specialtypes_type.py", line 120, in func8: No attribute 'unknown' on Type[object] [attribute-error] -File "specialtypes_type.py", line 143, in : No attribute 'unknown' on Type[type] [attribute-error] -File "specialtypes_type.py", line 144, in : No attribute 'unknown' on Type[type] [attribute-error] -File "specialtypes_type.py", line 145, in : No attribute 'unknown' on Type[type] [attribute-error] -File "specialtypes_type.py", line 146, in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function func4 was called with the wrong arguments [wrong-arg-types] + +func4(TeamUser) # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] + +def func5(x: type[T]) -> None: +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:76:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'type[int, str]' [invalid-annotation] + +bad_type1: type[int, str] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:98:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(a.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:102:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(b.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:106:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(c.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:110:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Any [assert-type] + + assert_type(d.__mro__, tuple[type, ...]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] + + a.unknown # E + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:120:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] + + b.unknown # E + \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA1.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA2.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA3.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + +specialtypes_type.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] + +TA4.unknown # E +\u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 70: Expected 1 errors -Line 64: Unexpected errors ['File "specialtypes_type.py", line 64, in : Invalid type annotation \\'T\\' [invalid-annotation]'] -Line 98: Unexpected errors ['File "specialtypes_type.py", line 98, in func7: Any [assert-type]'] -Line 102: Unexpected errors ['File "specialtypes_type.py", line 102, in func7: Any [assert-type]'] -Line 106: Unexpected errors ['File "specialtypes_type.py", line 106, in func7: Any [assert-type]'] -Line 110: Unexpected errors ['File "specialtypes_type.py", line 110, in func7: Any [assert-type]'] +Line 64: Unexpected errors ["specialtypes_type.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]"] +Line 98: Unexpected errors ['specialtypes_type.py:98:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] +Line 102: Unexpected errors ['specialtypes_type.py:102:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] +Line 106: Unexpected errors ['specialtypes_type.py:106:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] +Line 110: Unexpected errors ['specialtypes_type.py:110:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Any [assert-type]'] """ diff --git a/conformance/results/pytype/tuples_type_compat.toml b/conformance/results/pytype/tuples_type_compat.toml index 638c5bf2..c198de7a 100644 --- a/conformance/results/pytype/tuples_type_compat.toml +++ b/conformance/results/pytype/tuples_type_compat.toml @@ -5,61 +5,281 @@ Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`. Does not support tuple narrowing based on `len()` type guard (optional). """ output = """ -File "tuples_type_compat.py", line 15, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 22, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 27, in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 47, in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 71, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 74, in func5: tuple [assert-type] -File "tuples_type_compat.py", line 78, in func5: tuple [assert-type] -File "tuples_type_compat.py", line 82, in func5: tuple [assert-type] -File "tuples_type_compat.py", line 91, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 115, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] -File "tuples_type_compat.py", line 117, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] -File "tuples_type_compat.py", line 134, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 139, in func8: Sequence [assert-type] -File "tuples_type_compat.py", line 140, in func8: Sequence [assert-type] -File "tuples_type_compat.py", line 143, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 143, in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation] -File "tuples_type_compat.py", line 143, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 144, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 146, in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 146, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 147, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 148, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 149, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 150, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 153, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 153, in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation] -File "tuples_type_compat.py", line 153, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 154, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 155, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 156, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 157, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 159, in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation] -File "tuples_type_compat.py", line 159, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_compat.py", line 160, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 161, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 162, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 163, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 167, in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 167, in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 168, in func9: Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 168, in func9: Invalid type annotation 'tuple[str, str, *tuple[int]]' [invalid-annotation] -File "tuples_type_compat.py", line 169, in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 169, in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 170, in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 170, in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 171, in func9: Type annotation for t5 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 171, in func9: Invalid type annotation 'tuple[str, str, str, *tuple[str, ...]]' [invalid-annotation] -File "tuples_type_compat.py", line 172, in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 172, in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation] -File "tuples_type_compat.py", line 173, in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 173, in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] -File "tuples_type_compat.py", line 174, in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 174, in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] -File "tuples_type_compat.py", line 175, in func9: Type annotation for t9 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_compat.py", line 175, in func9: Invalid type annotation 'tuple[*tuple[str, ...], str, str, str]' [invalid-annotation] +tuples_type_compat.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: tuple[int, int] = t1 # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:22:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(t1: tuple[int], t2: tuple[int, *tuple[int, ...]], t3: tuple[int, ...]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:27:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation] + + v2: tuple[int, *tuple[int, ...]] + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:47:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] + + v6: tuple[int, *tuple[str, ...]] = t3 # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:71:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func5(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:74:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] + + assert_type(val, tuple[int]) # tuple[int] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] + + assert_type(val, tuple[str, str] | tuple[int, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:82:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func5: tuple [assert-type] + + assert_type(val, tuple[int, str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:91:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func6(val: tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:115:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] + + assert_type(subj, tuple[int | str, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:117:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type] + + assert_type(subj, tuple[int | str, int]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:134:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + + t1: tuple[complex, list[int]], t2: tuple[int, *tuple[str, ...]], t3: tuple[()] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:139:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] + + assert_type(test_seq(t2), Sequence[int | str]) # Could be Sequence[object] + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:140:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Sequence [assert-type] + + assert_type(test_seq(t3), Sequence[Never]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + +t1: tuple[int, *tuple[str]] = (1, "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation] + +t1: tuple[int, *tuple[str]] = (1, "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:143:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t1: tuple[int, *tuple[str]] = (1, "") # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + +t1 = (1, "", "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation] + +t2: tuple[int, *tuple[str, ...]] = (1,) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:146:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t2: tuple[int, *tuple[str, ...]] = (1,) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:147:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:148:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "", "") # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:149:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, 1, "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:150:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "", 1) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:153:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:153:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation] + +t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:153:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t3: tuple[int, *tuple[str, ...], int] = (1, 2) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:154:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:155:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", "", 2) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:156:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:157:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + +t3 = (1, "", "", 1.2) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:159:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation] + +t4: tuple[*tuple[str, ...], int] = (1,) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:159:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t4: tuple[*tuple[str, ...], int] = (1,) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_compat.py:160:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = ("", 1) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:161:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = ("", "", 1) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:162:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = (1, "", 1) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:163:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + +t4 = ("", "", 1.2) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:167:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + + t1: tuple[str, str, *tuple[int, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:167:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation] + + t1: tuple[str, str, *tuple[int, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:168:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + + t2: tuple[str, str, *tuple[int]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:168:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int]]' [invalid-annotation] + + t2: tuple[str, str, *tuple[int]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:169:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch] + + t3: tuple[str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:169:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation] + + t3: tuple[str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch] + + t4: tuple[str, str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:170:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation] + + t4: tuple[str, str, *tuple[str, ...]] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:171:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t5 does not match type of assignment [annotation-type-mismatch] + + t5: tuple[str, str, str, *tuple[str, ...]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:171:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, str, str, *tuple[str, ...]]' [invalid-annotation] + + t5: tuple[str, str, str, *tuple[str, ...]] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch] + + t6: tuple[str, *tuple[int, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:172:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation] + + t6: tuple[str, *tuple[int, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch] + + t7: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:173:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] + + t7: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:174:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch] + + t8: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:174:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation] + + t8: tuple[*tuple[str, ...], str] = a # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:175:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Type annotation for t9 does not match type of assignment [annotation-type-mismatch] + + t9: tuple[*tuple[str, ...], str, str, str] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_compat.py:175:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str, str, str]' [invalid-annotation] + + t9: tuple[*tuple[str, ...], str, str, str] = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -68,33 +288,33 @@ Line 32: Expected 1 errors Line 33: Expected 1 errors Line 43: Expected 1 errors Line 62: Expected 1 errors -Line 22: Unexpected errors ['File "tuples_type_compat.py", line 22, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 27: Unexpected errors ['File "tuples_type_compat.py", line 27, in func2: Invalid type annotation \\'tuple[int, *tuple[int, ...]]\\' [invalid-annotation]'] -Line 47: Unexpected errors ['File "tuples_type_compat.py", line 47, in func3: Invalid type annotation \\'tuple[int, *tuple[str, ...]]\\' [invalid-annotation]'] -Line 71: Unexpected errors ['File "tuples_type_compat.py", line 71, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 74: Unexpected errors ['File "tuples_type_compat.py", line 74, in func5: tuple [assert-type]'] -Line 78: Unexpected errors ['File "tuples_type_compat.py", line 78, in func5: tuple [assert-type]'] -Line 82: Unexpected errors ['File "tuples_type_compat.py", line 82, in func5: tuple [assert-type]'] -Line 91: Unexpected errors ['File "tuples_type_compat.py", line 91, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 115: Unexpected errors ['File "tuples_type_compat.py", line 115, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 117: Unexpected errors ['File "tuples_type_compat.py", line 117, in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 134: Unexpected errors ['File "tuples_type_compat.py", line 134, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 139: Unexpected errors ['File "tuples_type_compat.py", line 139, in func8: Sequence [assert-type]'] -Line 140: Unexpected errors ['File "tuples_type_compat.py", line 140, in func8: Sequence [assert-type]'] -Line 143: Unexpected errors ['File "tuples_type_compat.py", line 143, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 143, in : Invalid type annotation \\'tuple[int, *tuple[str]]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 143, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 146: Unexpected errors ['File "tuples_type_compat.py", line 146, in : Invalid type annotation \\'tuple[int, *tuple[str, ...]]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 146, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 147: Unexpected errors ['File "tuples_type_compat.py", line 147, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 148: Unexpected errors ['File "tuples_type_compat.py", line 148, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] -Line 153: Unexpected errors ['File "tuples_type_compat.py", line 153, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 153, in : Invalid type annotation \\'tuple[int, *tuple[str, ...], int]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 153, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 154: Unexpected errors ['File "tuples_type_compat.py", line 154, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 155: Unexpected errors ['File "tuples_type_compat.py", line 155, in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] -Line 159: Unexpected errors ['File "tuples_type_compat.py", line 159, in : Invalid type annotation \\'tuple[*tuple[str, ...], int]\\' [invalid-annotation]', 'File "tuples_type_compat.py", line 159, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 160: Unexpected errors ['File "tuples_type_compat.py", line 160, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 161: Unexpected errors ['File "tuples_type_compat.py", line 161, in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] -Line 167: Unexpected errors ['File "tuples_type_compat.py", line 167, in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 167, in func9: Invalid type annotation \\'tuple[str, str, *tuple[int, ...]]\\' [invalid-annotation]'] -Line 169: Unexpected errors ['File "tuples_type_compat.py", line 169, in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 169, in func9: Invalid type annotation \\'tuple[str, *tuple[str, ...]]\\' [invalid-annotation]'] -Line 170: Unexpected errors ['File "tuples_type_compat.py", line 170, in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 170, in func9: Invalid type annotation \\'tuple[str, str, *tuple[str, ...]]\\' [invalid-annotation]'] -Line 172: Unexpected errors ['File "tuples_type_compat.py", line 172, in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 172, in func9: Invalid type annotation \\'tuple[str, *tuple[int, ...], str]\\' [invalid-annotation]'] -Line 173: Unexpected errors ['File "tuples_type_compat.py", line 173, in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 173, in func9: Invalid type annotation \\'tuple[*tuple[str, ...], str]\\' [invalid-annotation]'] -Line 174: Unexpected errors ['File "tuples_type_compat.py", line 174, in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_type_compat.py", line 174, in func9: Invalid type annotation \\'tuple[*tuple[str, ...], str]\\' [invalid-annotation]'] +Line 22: Unexpected errors ["tuples_type_compat.py:22:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 27: Unexpected errors ["tuples_type_compat.py:27:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation 'tuple[int, *tuple[int, ...]]' [invalid-annotation]"] +Line 47: Unexpected errors ["tuples_type_compat.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]"] +Line 71: Unexpected errors ["tuples_type_compat.py:71:47: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 74: Unexpected errors ['tuples_type_compat.py:74:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] +Line 78: Unexpected errors ['tuples_type_compat.py:78:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] +Line 82: Unexpected errors ['tuples_type_compat.py:82:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5: tuple [assert-type]'] +Line 91: Unexpected errors ["tuples_type_compat.py:91:47: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 115: Unexpected errors ['tuples_type_compat.py:115:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 117: Unexpected errors ['tuples_type_compat.py:117:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 134: Unexpected errors ["tuples_type_compat.py:134:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 139: Unexpected errors ['tuples_type_compat.py:139:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] +Line 140: Unexpected errors ['tuples_type_compat.py:140:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] +Line 143: Unexpected errors ['tuples_type_compat.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str]]' [invalid-annotation]", "tuples_type_compat.py:143:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 146: Unexpected errors ["tuples_type_compat.py:146:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...]]' [invalid-annotation]", "tuples_type_compat.py:146:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 147: Unexpected errors ['tuples_type_compat.py:147:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] +Line 148: Unexpected errors ['tuples_type_compat.py:148:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch]'] +Line 153: Unexpected errors ['tuples_type_compat.py:153:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:153:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[int, *tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:153:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 154: Unexpected errors ['tuples_type_compat.py:154:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] +Line 155: Unexpected errors ['tuples_type_compat.py:155:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t3 does not match type of assignment [annotation-type-mismatch]'] +Line 159: Unexpected errors ["tuples_type_compat.py:159:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[str, ...], int]' [invalid-annotation]", "tuples_type_compat.py:159:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 160: Unexpected errors ['tuples_type_compat.py:160:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] +Line 161: Unexpected errors ['tuples_type_compat.py:161:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for t4 does not match type of assignment [annotation-type-mismatch]'] +Line 167: Unexpected errors ['tuples_type_compat.py:167:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t1 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:167:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[int, ...]]' [invalid-annotation]"] +Line 169: Unexpected errors ['tuples_type_compat.py:169:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t3 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:169:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[str, ...]]' [invalid-annotation]"] +Line 170: Unexpected errors ['tuples_type_compat.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t4 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:170:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, str, *tuple[str, ...]]' [invalid-annotation]"] +Line 172: Unexpected errors ['tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t6 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:172:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[str, *tuple[int, ...], str]' [invalid-annotation]"] +Line 173: Unexpected errors ['tuples_type_compat.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t7 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:173:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] +Line 174: Unexpected errors ['tuples_type_compat.py:174:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Type annotation for t8 does not match type of assignment [annotation-type-mismatch]', "tuples_type_compat.py:174:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: Invalid type annotation 'tuple[*tuple[str, ...], str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/tuples_type_form.toml b/conformance/results/pytype/tuples_type_form.toml index f8bb9439..8ecf9d22 100644 --- a/conformance/results/pytype/tuples_type_form.toml +++ b/conformance/results/pytype/tuples_type_form.toml @@ -1,18 +1,70 @@ conformant = "Pass" output = """ -File "tuples_type_form.py", line 12, in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 14, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 15, in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 25, in : Type annotation for t10 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 36, in : Type annotation for t20 does not match type of assignment [annotation-type-mismatch] -File "tuples_type_form.py", line 40, in : Invalid type annotation 'tuple[int, int, Any]' [invalid-annotation] -File "tuples_type_form.py", line 41, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "tuples_type_form.py", line 42, in : Invalid type annotation 'tuple[Any, int]' [invalid-annotation] -File "tuples_type_form.py", line 42, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "tuples_type_form.py", line 43, in : Invalid type annotation 'tuple[int, Any, int]' [invalid-annotation] -File "tuples_type_form.py", line 43, in : Invalid type annotation 'Ellipsis' [invalid-annotation] -File "tuples_type_form.py", line 44, in : Invalid type annotation '' [invalid-annotation] -File "tuples_type_form.py", line 45, in : Invalid type annotation '' [invalid-annotation] +tuples_type_form.py:12:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t1 does not match type of assignment [annotation-type-mismatch] + +t1 = (1, 2) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_form.py:14:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1,) # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_form.py:15:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t2 does not match type of assignment [annotation-type-mismatch] + +t2 = (1, "") # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_type_form.py:25:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t10 does not match type of assignment [annotation-type-mismatch] + +t10 = (1,) # E +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +tuples_type_form.py:36:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for t20 does not match type of assignment [annotation-type-mismatch] + +t20 = (1, 2, 3, "") # E +\u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m + +tuples_type_form.py:40:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, int, Any]' [invalid-annotation] + +t31: tuple[int, int, ...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:41:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +t32: tuple[...] # E + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:42:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any, int]' [invalid-annotation] + +t33: tuple[..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:42:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +t33: tuple[..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[int, Any, int]' [invalid-annotation] + +t34: tuple[int, ..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:43:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Ellipsis' [invalid-annotation] + +t34: tuple[int, ..., int] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:44:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t35: tuple[*tuple[str], ...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_type_form.py:45:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t36: tuple[*tuple[str, ...], ...] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/tuples_unpacked.toml b/conformance/results/pytype/tuples_unpacked.toml index 78e943a8..9b4b5b55 100644 --- a/conformance/results/pytype/tuples_unpacked.toml +++ b/conformance/results/pytype/tuples_unpacked.toml @@ -4,50 +4,164 @@ Does not support `typing.Unpack`. Does not support unpacked tuples within a tuple type form. """ output = """ -File "tuples_unpacked.py", line 13, in : typing.Unpack not supported yet [not-supported-yet] -File "tuples_unpacked.py", line 13, in : typing.TypeVarTuple not supported yet [not-supported-yet] -File "tuples_unpacked.py", line 16, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 17, in func1: Tuple[Any] [assert-type] -File "tuples_unpacked.py", line 18, in func1: Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 19, in func1: Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 25, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 26, in func2: Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 31, in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] -File "tuples_unpacked.py", line 31, in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation] -File "tuples_unpacked.py", line 31, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 31, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 32, in : Tuple[Any] [assert-type] -File "tuples_unpacked.py", line 33, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 33, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 38, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 38, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 39, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 40, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 40, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 41, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 41, in : Function list.extend was called with the wrong arguments [wrong-arg-types] -File "tuples_unpacked.py", line 46, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] -File "tuples_unpacked.py", line 49, in : Invalid type annotation '' [invalid-annotation] -File "tuples_unpacked.py", line 50, in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation] -File "tuples_unpacked.py", line 51, in func3: Invalid type annotation 'tuple[*tuple[str, ...], *Ts]' [invalid-annotation] +tuples_unpacked.py:13:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import TypeVarTuple, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:13:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet] + +from typing import TypeVarTuple, Unpack, assert_type +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func1(x: tuple[int, *tuple[bool, bool], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Tuple[Any] [assert-type] + + assert_type(x, tuple[int, bool, bool, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:18:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation '' [invalid-annotation] + + assert_type(x, tuple[*tuple[int, bool], bool, str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:19:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Invalid type annotation '' [invalid-annotation] + + assert_type(x, tuple[int, bool, *tuple[bool, str]]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:25:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func2(x: tuple[int, *tuple[bool, ...], str]): + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:26:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Invalid type annotation '' [invalid-annotation] + + assert_type(x, tuple[int, *tuple[bool, ...], str]) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:31:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +u1: tuple[*tuple[int], *tuple[int]] = (int(1), int(1)) # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] + +assert_type(u1, tuple[int, int]) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +u2: tuple[*tuple[int, ...], *tuple[int]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:33:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +u2: tuple[*tuple[int, ...], *tuple[int]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:38:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t1: tuple[*tuple[str], *tuple[str]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:38:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +t1: tuple[*tuple[str], *tuple[str]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:39:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t2: tuple[*tuple[str, *tuple[str, ...]]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:39:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t2: tuple[*tuple[str, *tuple[str, ...]]] # OK + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t3: tuple[*tuple[str, ...], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:40:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +t3: tuple[*tuple[str, ...], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:41:11: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types] + +t4: tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]] # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count] + +Ts = TypeVarTuple("Ts") + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:49:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] + +def func3(t: tuple[*Ts]): + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + +tuples_unpacked.py:50:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation] + + t5: tuple[*tuple[str], *Ts] # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +tuples_unpacked.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Invalid type annotation 'tuple[*tuple[str, ...], *Ts]' [invalid-annotation] + + t6: tuple[*tuple[str, ...], *Ts] # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 59: Expected 1 errors Lines 60, 61: Expected error (tag 't14') -Line 13: Unexpected errors ['File "tuples_unpacked.py", line 13, in : typing.Unpack not supported yet [not-supported-yet]', 'File "tuples_unpacked.py", line 13, in : typing.TypeVarTuple not supported yet [not-supported-yet]'] -Line 16: Unexpected errors ['File "tuples_unpacked.py", line 16, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 17: Unexpected errors ['File "tuples_unpacked.py", line 17, in func1: Tuple[Any] [assert-type]'] -Line 18: Unexpected errors ['File "tuples_unpacked.py", line 18, in func1: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 19: Unexpected errors ['File "tuples_unpacked.py", line 19, in func1: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 25: Unexpected errors ['File "tuples_unpacked.py", line 25, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 26: Unexpected errors ['File "tuples_unpacked.py", line 26, in func2: Invalid type annotation \\'\\' [invalid-annotation]'] -Line 31: Unexpected errors ['File "tuples_unpacked.py", line 31, in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch]', 'File "tuples_unpacked.py", line 31, in : Invalid type annotation \\'tuple[*tuple[int], *tuple[int]]\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 31, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 31, in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 32: Unexpected errors ['File "tuples_unpacked.py", line 32, in : Tuple[Any] [assert-type]'] -Line 33: Unexpected errors ['File "tuples_unpacked.py", line 33, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 33, in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 38: Unexpected errors ['File "tuples_unpacked.py", line 38, in : Invalid type annotation \\'\\' [invalid-annotation]', 'File "tuples_unpacked.py", line 38, in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 39: Unexpected errors ['File "tuples_unpacked.py", line 39, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 46: Unexpected errors ['File "tuples_unpacked.py", line 46, in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 49: Unexpected errors ['File "tuples_unpacked.py", line 49, in : Invalid type annotation \\'\\' [invalid-annotation]'] -Line 50: Unexpected errors ['File "tuples_unpacked.py", line 50, in func3: Invalid type annotation \\'tuple[*tuple[str], *Ts]\\' [invalid-annotation]'] +Line 13: Unexpected errors ['tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]', 'tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] +Line 16: Unexpected errors ["tuples_unpacked.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ['tuples_unpacked.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[Any] [assert-type]'] +Line 18: Unexpected errors ["tuples_unpacked.py:18:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] +Line 19: Unexpected errors ["tuples_unpacked.py:19:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] +Line 25: Unexpected errors ["tuples_unpacked.py:25:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 26: Unexpected errors ["tuples_unpacked.py:26:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation '' [invalid-annotation]"] +Line 31: Unexpected errors ['tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch]', "tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation]", "tuples_unpacked.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] +Line 32: Unexpected errors ['tuples_unpacked.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 33: Unexpected errors ["tuples_unpacked.py:33:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:33:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] +Line 38: Unexpected errors ["tuples_unpacked.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:38:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] +Line 39: Unexpected errors ["tuples_unpacked.py:39:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "tuples_unpacked.py:39:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 46: Unexpected errors ['tuples_unpacked.py:46:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] +Line 49: Unexpected errors ["tuples_unpacked.py:49:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 50: Unexpected errors ["tuples_unpacked.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/typeddicts_alt_syntax.toml b/conformance/results/pytype/typeddicts_alt_syntax.toml index cb4b223d..62574fb0 100644 --- a/conformance/results/pytype/typeddicts_alt_syntax.toml +++ b/conformance/results/pytype/typeddicts_alt_syntax.toml @@ -5,8 +5,16 @@ 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 = """ -File "typeddicts_alt_syntax.py", line 27, in : Function typing.TypedDict was called with the wrong arguments [wrong-arg-types] -File "typeddicts_alt_syntax.py", line 41, in : Function typing.TypedDict expects 2 arg(s), got 3 [wrong-arg-count] +typeddicts_alt_syntax.py:27:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.TypedDict was called with the wrong arguments [wrong-arg-types] + +BadTypedDict2 = TypedDict("BadTypedDict2", {1: str}) # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_alt_syntax.py:41:10: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function typing.TypedDict expects 2 arg(s), got 3 [wrong-arg-count] + +Movie2 = TypedDict("Movie2", name=str, year=int) # E? + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/typeddicts_class_syntax.toml b/conformance/results/pytype/typeddicts_class_syntax.toml index 8b43fddd..c60ade24 100644 --- a/conformance/results/pytype/typeddicts_class_syntax.toml +++ b/conformance/results/pytype/typeddicts_class_syntax.toml @@ -5,7 +5,15 @@ Does not report when metaclass is provided. Does not report when other keyword argument is provided. """ output = """ -File "typeddicts_class_syntax.py", line 57, in : Invalid base class: Generic[T] [base-class-error] +typeddicts_class_syntax.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Generic[T] [base-class-error] + +class GenericTypedDict(TypedDict, Generic[T]): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + value: T +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -14,5 +22,5 @@ Line 33: Expected 1 errors Line 38: Expected 1 errors Line 44: Expected 1 errors Line 49: Expected 1 errors -Line 57: Unexpected errors ['File "typeddicts_class_syntax.py", line 57, in : Invalid base class: Generic[T] [base-class-error]'] +Line 57: Unexpected errors ['typeddicts_class_syntax.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: Generic[T] [base-class-error]'] """ diff --git a/conformance/results/pytype/typeddicts_inheritance.toml b/conformance/results/pytype/typeddicts_inheritance.toml index 12f67476..ca900269 100644 --- a/conformance/results/pytype/typeddicts_inheritance.toml +++ b/conformance/results/pytype/typeddicts_inheritance.toml @@ -1,8 +1,26 @@ conformant = "Pass" output = """ -File "typeddicts_inheritance.py", line 44, in : Invalid base class: NonTypedDict [base-class-error] -File "typeddicts_inheritance.py", line 54, in : Invalid base class: X1 [base-class-error] -File "typeddicts_inheritance.py", line 65, in : Invalid base class: Y2 [base-class-error] +typeddicts_inheritance.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: NonTypedDict [base-class-error] + +class BadTypedDict(TypedDict, NonTypedDict): # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + pass +\u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_inheritance.py:54:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: X1 [base-class-error] + +class Y1(X1): # E[Y1] +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + x: int # E[Y1]: cannot overwrite TypedDict field "x" +\u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_inheritance.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: Y2 [base-class-error] + +class XYZ2(X2, Y2): # E: cannot overwrite TypedDict field "x" while merging +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + xyz: bool +\u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pytype/typeddicts_operations.toml b/conformance/results/pytype/typeddicts_operations.toml index 8ed3fcdc..a01d0ede 100644 --- a/conformance/results/pytype/typeddicts_operations.toml +++ b/conformance/results/pytype/typeddicts_operations.toml @@ -6,11 +6,31 @@ Does not reject `clear` method on TypedDict with required keys. Does not reject delete operation for required key in TypedDict. """ output = """ -File "typeddicts_operations.py", line 28, in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 29, in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 32, in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 37, in func1: Type annotation for movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_operations.py", line 60, in : str [assert-type] +typeddicts_operations.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] + +movie = {"name": "Blade Runner"} # E: year is missing +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] + +movie = {"name": "Blade Runner", "year": 1982.1} # E: year is wrong type +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie does not match type of assignment [annotation-type-mismatch] + +movie = {"name": "", "year": 1900, "other": 2} # E: extra key +\u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:37:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for movie does not match type of assignment [annotation-type-mismatch] + + movie: Movie = {variable_key: "", "year": 1900} # E: variable key + \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m + +typeddicts_operations.py:60:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : str [assert-type] + +assert_type(movie_optional.get("name"), str | None) +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -21,5 +41,5 @@ Line 26: Expected 1 errors Line 47: Expected 1 errors Line 49: Expected 1 errors Line 62: Expected 1 errors -Line 60: Unexpected errors ['File "typeddicts_operations.py", line 60, in : str [assert-type]'] +Line 60: Unexpected errors ['typeddicts_operations.py:60:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : str [assert-type]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly.toml b/conformance/results/pytype/typeddicts_readonly.toml index 6dc215d7..fdf00b96 100644 --- a/conformance/results/pytype/typeddicts_readonly.toml +++ b/conformance/results/pytype/typeddicts_readonly.toml @@ -1,6 +1,10 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] +typeddicts_readonly.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -10,5 +14,5 @@ Line 50: Expected 1 errors Line 51: Expected 1 errors Line 60: Expected 1 errors Line 61: Expected 1 errors -Line 8: Unexpected errors ['File "typeddicts_readonly.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 8: Unexpected errors ['typeddicts_readonly.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_consistency.toml b/conformance/results/pytype/typeddicts_readonly_consistency.toml index 6d3b171f..466a0505 100644 --- a/conformance/results/pytype/typeddicts_readonly_consistency.toml +++ b/conformance/results/pytype/typeddicts_readonly_consistency.toml @@ -1,9 +1,25 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_consistency.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] -File "typeddicts_readonly_consistency.py", line 34, in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_consistency.py", line 35, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_consistency.py", line 40, in func1: Type annotation for v5 does not match type of assignment [annotation-type-mismatch] +typeddicts_readonly_consistency.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_consistency.py:34:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch] + + v1: A1 = b # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_readonly_consistency.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch] + + v2: A1 = c # OK + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_readonly_consistency.py:40:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Type annotation for v5 does not match type of assignment [annotation-type-mismatch] + + v5: C1 = a # E + \u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -13,7 +29,7 @@ Line 81: Expected 1 errors Line 82: Expected 1 errors Line 84: Expected 1 errors Line 85: Expected 1 errors -Line 8: Unexpected errors ['File "typeddicts_readonly_consistency.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -Line 34: Unexpected errors ['File "typeddicts_readonly_consistency.py", line 34, in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] -Line 35: Unexpected errors ['File "typeddicts_readonly_consistency.py", line 35, in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] +Line 8: Unexpected errors ['typeddicts_readonly_consistency.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 34: Unexpected errors ['typeddicts_readonly_consistency.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] +Line 35: Unexpected errors ['typeddicts_readonly_consistency.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_inheritance.toml b/conformance/results/pytype/typeddicts_readonly_inheritance.toml index 83fb06ba..c8e735ab 100644 --- a/conformance/results/pytype/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pytype/typeddicts_readonly_inheritance.toml @@ -1,22 +1,118 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_inheritance.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] -File "typeddicts_readonly_inheritance.py", line 18, in : Invalid base class: NamedDict [base-class-error] -File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error] -File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error] -File "typeddicts_readonly_inheritance.py", line 61, in : Invalid base class: OptionalName [base-class-error] -File "typeddicts_readonly_inheritance.py", line 65, in : Type annotation for d does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_inheritance.py", line 75, in : Invalid base class: OptionalIdent [base-class-error] -File "typeddicts_readonly_inheritance.py", line 83, in : Type annotation for u does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_inheritance.py", line 84, in : Type annotation for u does not match type of assignment [annotation-type-mismatch] -File "typeddicts_readonly_inheritance.py", line 93, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 97, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 101, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 105, in : Invalid base class: F1 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 119, in : Invalid base class: TD_A2 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 119, in : Invalid base class: TD_A2 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 132, in : Invalid base class: TD_B2 [base-class-error] -File "typeddicts_readonly_inheritance.py", line 132, in : Invalid base class: TD_B2 [base-class-error] +typeddicts_readonly_inheritance.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:18:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: NamedDict [base-class-error] + +class Album1(NamedDict): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + year: int +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: AlbumCollection [base-class-error] + +class RecordShop(AlbumCollection): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + albums: ReadOnly[list[Album1]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + alt: ReadOnly[list[str]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:47:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: AlbumCollection [base-class-error] + +class RecordShop(AlbumCollection): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: str +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + albums: ReadOnly[list[Album1]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + alt: ReadOnly[list[str]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:61:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: OptionalName [base-class-error] + +class RequiredName(OptionalName): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + name: ReadOnly[Required[str]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for d does not match type of assignment [annotation-type-mismatch] + +d: RequiredName = {} # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:75:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: OptionalIdent [base-class-error] + +class User(OptionalIdent): +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + ident: str # Required, mutable, and not an int +\u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:83:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u does not match type of assignment [annotation-type-mismatch] + +u = {"ident": 3} # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for u does not match type of assignment [annotation-type-mismatch] + +u = {} # E +\u001b[1m\u001b[31m~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:93:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F3(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + a: ReadOnly[int] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:97:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F4(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + a: NotRequired[int] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:101:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F5(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + b: ReadOnly[Required[int]] # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: F1 [base-class-error] + +class F6(F1): +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + c: ReadOnly[NotRequired[int]] # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_A2 [base-class-error] + +class TD_A(TD_A1, TD_A2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:119:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_A2 [base-class-error] + +class TD_A(TD_A1, TD_A2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_B2 [base-class-error] + +class TD_B(TD_B1, TD_B2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_inheritance.py:132:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid base class: TD_B2 [base-class-error] + +class TD_B(TD_B1, TD_B2): ... # E: x is incompatible +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -26,13 +122,13 @@ Line 82: Expected 1 errors Line 94: Expected 1 errors Line 98: Expected 1 errors Line 106: Expected 1 errors -Line 8: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 8, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] -Line 18: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 18, in : Invalid base class: NamedDict [base-class-error]'] -Line 47: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error]', 'File "typeddicts_readonly_inheritance.py", line 47, in : Invalid base class: AlbumCollection [base-class-error]'] -Line 61: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 61, in : Invalid base class: OptionalName [base-class-error]'] -Line 75: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 75, in : Invalid base class: OptionalIdent [base-class-error]'] -Line 93: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 93, in : Invalid base class: F1 [base-class-error]'] -Line 97: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 97, in : Invalid base class: F1 [base-class-error]'] -Line 101: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 101, in : Invalid base class: F1 [base-class-error]'] -Line 105: Unexpected errors ['File "typeddicts_readonly_inheritance.py", line 105, in : Invalid base class: F1 [base-class-error]'] +Line 8: Unexpected errors ['typeddicts_readonly_inheritance.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 18: Unexpected errors ['typeddicts_readonly_inheritance.py:18:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: NamedDict [base-class-error]'] +Line 47: Unexpected errors ['typeddicts_readonly_inheritance.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: AlbumCollection [base-class-error]', 'typeddicts_readonly_inheritance.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: AlbumCollection [base-class-error]'] +Line 61: Unexpected errors ['typeddicts_readonly_inheritance.py:61:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: OptionalName [base-class-error]'] +Line 75: Unexpected errors ['typeddicts_readonly_inheritance.py:75:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: OptionalIdent [base-class-error]'] +Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] +Line 97: Unexpected errors ['typeddicts_readonly_inheritance.py:97:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] +Line 101: Unexpected errors ['typeddicts_readonly_inheritance.py:101:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] +Line 105: Unexpected errors ['typeddicts_readonly_inheritance.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid base class: F1 [base-class-error]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_kwargs.toml b/conformance/results/pytype/typeddicts_readonly_kwargs.toml index 891f4fb7..d9462a9c 100644 --- a/conformance/results/pytype/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pytype/typeddicts_readonly_kwargs.toml @@ -1,11 +1,23 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_kwargs.py", line 8, in : typing.Unpack not supported yet [not-supported-yet] -File "typeddicts_readonly_kwargs.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] -File "typeddicts_readonly_kwargs.py", line 33, in impl: New container type for kwargs does not match type annotation [container-type-mismatch] +typeddicts_readonly_kwargs.py:8:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing.Unpack not supported yet [not-supported-yet] + +from typing import Protocol, TypedDict, Unpack +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_kwargs.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_readonly_kwargs.py:33:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in impl: New container type for kwargs does not match type annotation [container-type-mismatch] + + kwargs["key1"] = 3 # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ -Line 8: Unexpected errors ['File "typeddicts_readonly_kwargs.py", line 8, in : typing.Unpack not supported yet [not-supported-yet]'] -Line 9: Unexpected errors ['File "typeddicts_readonly_kwargs.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 8: Unexpected errors ['typeddicts_readonly_kwargs.py:8:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['typeddicts_readonly_kwargs.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/typeddicts_readonly_update.toml b/conformance/results/pytype/typeddicts_readonly_update.toml index 0ffc0476..081375bd 100644 --- a/conformance/results/pytype/typeddicts_readonly_update.toml +++ b/conformance/results/pytype/typeddicts_readonly_update.toml @@ -1,9 +1,13 @@ conformant = "Unsupported" output = """ -File "typeddicts_readonly_update.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet] +typeddicts_readonly_update.py:9:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet] + +from typing_extensions import ReadOnly +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 23: Expected 1 errors -Line 9: Unexpected errors ['File "typeddicts_readonly_update.py", line 9, in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] +Line 9: Unexpected errors ['typeddicts_readonly_update.py:9:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing_extensions.ReadOnly not supported yet [not-supported-yet]'] """ diff --git a/conformance/results/pytype/typeddicts_type_consistency.toml b/conformance/results/pytype/typeddicts_type_consistency.toml index 24d50b71..f5be5987 100644 --- a/conformance/results/pytype/typeddicts_type_consistency.toml +++ b/conformance/results/pytype/typeddicts_type_consistency.toml @@ -5,10 +5,26 @@ Incorrectly reports type violation in cases where there is none. Does not report type incompatibility between TypedDict and `dict[str, Any]`. """ output = """ -File "typeddicts_type_consistency.py", line 62, in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_type_consistency.py", line 65, in : Type annotation for b3 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_type_consistency.py", line 69, in : Type annotation for a3_1 does not match type of assignment [annotation-type-mismatch] -File "typeddicts_type_consistency.py", line 126, in : Type annotation for o2 does not match type of assignment [annotation-type-mismatch] +typeddicts_type_consistency.py:62:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch] + +a3: A3 = b3 +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_type_consistency.py:65:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for b3 does not match type of assignment [annotation-type-mismatch] + +b3 = a3 # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + +typeddicts_type_consistency.py:69:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for a3_1 does not match type of assignment [annotation-type-mismatch] + +a3_1: A3 = {"x": 0, "y": 0} # E +\u001b[1m\u001b[31m~~~~\u001b[39m\u001b[0m + +typeddicts_type_consistency.py:126:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for o2 does not match type of assignment [annotation-type-mismatch] + +o2: Outer1 = {"outer_key": {"inner_key": {"inner_key": 1}}} # E +\u001b[1m\u001b[31m~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ @@ -18,5 +34,5 @@ Line 76: Expected 1 errors Line 77: Expected 1 errors Line 78: Expected 1 errors Line 82: Expected 1 errors -Line 62: Unexpected errors ['File "typeddicts_type_consistency.py", line 62, in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch]'] +Line 62: Unexpected errors ['typeddicts_type_consistency.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for a3 does not match type of assignment [annotation-type-mismatch]'] """ diff --git a/conformance/results/pytype/typeddicts_usage.toml b/conformance/results/pytype/typeddicts_usage.toml index 746ab341..09e50f72 100644 --- a/conformance/results/pytype/typeddicts_usage.toml +++ b/conformance/results/pytype/typeddicts_usage.toml @@ -4,9 +4,21 @@ Does not report errant use of TypedDict in `isinstance` call. Does not reject use of TypedDict as TypeVar bound. """ output = """ -File "typeddicts_usage.py", line 23, in : TypedDict Movie does not contain key director [typed-dict-error] -File "typeddicts_usage.py", line 24, in : Type annotation for key year in TypedDict Movie does not match type of assignment [annotation-type-mismatch] -File "typeddicts_usage.py", line 28, in : Type annotation for movie2 does not match type of assignment [annotation-type-mismatch] +typeddicts_usage.py:23:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : TypedDict Movie does not contain key director [typed-dict-error] + +movie["director"] = "Ridley Scott" # E: invalid key 'director' +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_usage.py:24:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for key year in TypedDict Movie does not match type of assignment [annotation-type-mismatch] + +movie["year"] = "1982" # E: invalid value type ("int" expected) +\u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +typeddicts_usage.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Type annotation for movie2 does not match type of assignment [annotation-type-mismatch] + +movie2: Movie = {"title": "Blade Runner", "year": 1982} # E +\u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index a03e3ca2..19259c3a 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ -version = "pytype 2024.04.11" -test_duration = 35.2 +version = "pytype 2024.09.13" +test_duration = 32.8 diff --git a/conformance/results/results.html b/conformance/results/results.html index f6bfa00c..cffa1e37 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

Python Type System Conformance Test Results

- - - - + @@ -608,7 +608,7 @@

Python Type System Conformance Test Results

- + @@ -647,7 +647,7 @@

Python Type System Conformance Test Results

- + diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index d4404d12..c8955c0f 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -74,10 +74,22 @@ def install(self) -> bool: pass try: + # Uninstall any existing version if present. run( - [sys.executable, "-m", "pip", "install", "mypy", "--upgrade"], + [sys.executable, "-m", "pip", "uninstall", "mypy", "-y"], check=True, ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "mypy"], + check=True, + ) + + # Run "mypy --version" to ensure that it's installed and to work + # around timing issues caused by malware scanners on some systems. + self.get_version() + return True except CalledProcessError: print("Unable to install mypy") @@ -142,9 +154,15 @@ def name(self) -> str: def install(self) -> bool: try: - # Install the Python wrapper if it's not installed. + # Uninstall any old version if present. + run( + [sys.executable, "-m", "pip", "uninstall", "pyright", "-y"], + check=True, + ) + + # Install the latest version. run( - [sys.executable, "-m", "pip", "install", "pyright", "--upgrade"], + [sys.executable, "-m", "pip", "install", "pyright"], check=True, ) @@ -214,8 +232,15 @@ def install(self) -> bool: pass try: + # Uninstall any existing version if present. run( - [sys.executable, "-m", "pip", "install", "pyre-check", "--upgrade"], + [sys.executable, "-m", "pip", "uninstall", "pyre-check", "-y"], + check=True, + ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "pyre-check"], check=True, ) @@ -270,10 +295,18 @@ def name(self) -> str: def install(self) -> bool: try: + # Uninstall any existing version if present. run( - [sys.executable, "-m", "pip", "install", "pytype", "--upgrade"], + [sys.executable, "-m", "pip", "uninstall", "pytype", "-y"], check=True, ) + + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "pytype"], + check=True, + ) + return True except CalledProcessError: print("Unable to install pytype on this platform") @@ -331,7 +364,7 @@ def __init__(self, err: pytype_errors.Error) -> None: self._err = err def __lt__(self, other: "ErrorSorter", /) -> bool: - lineno_diff = self._err.lineno - other._err.lineno + lineno_diff = self._err.line - other._err.line if lineno_diff != 0: return lineno_diff < 0 return other._err.message < self._err.message @@ -339,7 +372,7 @@ def __lt__(self, other: "ErrorSorter", /) -> bool: def __eq__(self, other: object, /) -> bool: return ( isinstance(other, ErrorSorter) - and self._err.lineno == other._err.lineno + and self._err.line == other._err.line and other._err.message == self._err.message ) @@ -350,16 +383,13 @@ def __eq__(self, other: object, /) -> bool: return "\n".join(map(str, errors)) + "\n" def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: - # File "narrowing_typeguard.py", line 128, in : Function takes_callable_str was called with the wrong arguments [wrong-arg-types] - # File "directives_type_ignore.py", line 11: Stray type comment: ignore - additional stuff [ignored-type-comment]' + # annotations_forward_refs.py:103:1: unexpected indent [python-compiler-error] line_to_errors: dict[int, list[str]] = {} for line in output: - if '.py", line ' not in line: - continue - match = re.search(r"^File \"[^\"]+?\", line (\d+)", line) - assert match is not None, f"Failed to parse line number from: {line!r}" - lineno = int(match.group(1)) - line_to_errors.setdefault(int(lineno), []).append(line) + match = re.search(r"^[a-zA-Z0-9_]+.py:(\d+):(\d+): ", line) + if match is not None: + lineno = int(match.group(1)) + line_to_errors.setdefault(int(lineno), []).append(line) return line_to_errors diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index f19b6a18..7df2e64e 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -51,8 +51,15 @@ class ShouldBeCovariant4(Generic[T]): x: T -vo4_1: ShouldBeCovariant4[float] = ShouldBeCovariant4[int](1) # OK -vo4_4: ShouldBeCovariant4[int] = ShouldBeCovariant4[float](1.0) # E +# This test is problematic as of Python 3.13 because of the +# newly synthesized "__replace__" method, which causes the type +# variable to be inferred as invariant rather than covariant. +# See https://github.com/python/mypy/issues/17623#issuecomment-2266312738 +# for details. Until we sort this out, we'll leave this test commented +# out. + +# vo4_1: ShouldBeCovariant4[float] = ShouldBeCovariant4[int](1) # OK +# vo4_4: ShouldBeCovariant4[int] = ShouldBeCovariant4[float](1.0) # E class ShouldBeCovariant5(Generic[T]): From c5e52dd704b9792196f7d2acdf8824772f2da827 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 11 Oct 2024 13:38:19 -0700 Subject: [PATCH 09/29] =?UTF-8?q?Fixed=20a=20bug=20in=20the=20protocols=5F?= =?UTF-8?q?generic.py=20test=20related=20to=20protocol=20matc=E2=80=A6=20(?= =?UTF-8?q?#1864)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed a bug in the protocols_generic.py test related to protocol matching when method-scoped type variables were used. Both pyright and mypy were previously reported as failing this test, but they were actually working correctly. This was a bug in the original test case (which I wrote). Updated to the latest version of pytest (2024.10.11). It updates many error messages but has no substantive changes to the conformance results. --- .../results/mypy/protocols_generic.toml | 8 +- conformance/results/mypy/version.toml | 2 +- .../results/pyre/protocols_generic.toml | 1 + .../results/pyright/protocols_generic.toml | 8 +- conformance/results/pyright/version.toml | 2 +- .../results/pytype/aliases_explicit.toml | 6 +- .../results/pytype/aliases_implicit.toml | 8 +- .../results/pytype/aliases_typealiastype.toml | 4 +- .../pytype/annotations_forward_refs.toml | 6 +- .../results/pytype/annotations_typeexpr.toml | 4 +- .../results/pytype/callables_kwargs.toml | 4 +- .../results/pytype/dataclasses_slots.toml | 6 +- .../pytype/directives_reveal_type.toml | 4 +- .../pytype/generics_defaults_referential.toml | 14 +- .../results/pytype/generics_scoping.toml | 8 +- .../pytype/generics_self_advanced.toml | 12 +- .../results/pytype/generics_self_basic.toml | 8 +- .../pytype/generics_typevartuple_args.toml | 30 ++-- .../pytype/generics_typevartuple_basic.toml | 24 +-- .../generics_typevartuple_callable.toml | 28 ++-- .../pytype/generics_typevartuple_concat.toml | 12 +- .../generics_typevartuple_specialization.toml | 142 +++++++++--------- .../pytype/namedtuples_define_class.toml | 8 +- .../results/pytype/narrowing_typeis.toml | 4 +- .../results/pytype/protocols_generic.toml | 1 + .../results/pytype/qualifiers_annotated.toml | 2 +- .../results/pytype/specialtypes_type.toml | 12 +- .../results/pytype/tuples_type_compat.toml | 8 +- .../results/pytype/tuples_unpacked.toml | 12 +- conformance/results/pytype/version.toml | 4 +- conformance/results/results.html | 12 +- conformance/tests/protocols_generic.py | 2 +- 32 files changed, 200 insertions(+), 206 deletions(-) diff --git a/conformance/results/mypy/protocols_generic.toml b/conformance/results/mypy/protocols_generic.toml index 68b145e3..407eefd5 100644 --- a/conformance/results/mypy/protocols_generic.toml +++ b/conformance/results/mypy/protocols_generic.toml @@ -1,7 +1,4 @@ -conformant = "Partial" -notes = """ -Fails protocol matching when method-scoped TypeVar is used in protocol. -""" +conformant = "Pass" output = """ protocols_generic.py:40: error: Incompatible types in assignment (expression has type "Concrete1", variable has type "Proto1[int, str]") [assignment] protocols_generic.py:40: note: Following member(s) of "Concrete1" have conflicts: @@ -39,7 +36,6 @@ protocols_generic.py:147: note: def [T] m(self, item: T, callback: Calla protocols_generic.py:147: note: Got: protocols_generic.py:147: note: def m(self, item: str, callback: Callable[[int], str]) -> str """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 145: Unexpected errors ['protocols_generic.py:145: error: Incompatible types in assignment (expression has type "ConcreteHasProperty2", variable has type "HasPropertyProto") [assignment]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index aa90cb33..f2673d1c 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.11.2" -test_duration = 1.9 +test_duration = 1.6 diff --git a/conformance/results/pyre/protocols_generic.toml b/conformance/results/pyre/protocols_generic.toml index f1370fa7..0f071ec3 100644 --- a/conformance/results/pyre/protocols_generic.toml +++ b/conformance/results/pyre/protocols_generic.toml @@ -14,5 +14,6 @@ protocols_generic.py:146:0 Incompatible variable type [9]: hp3 is declared to ha conformance_automated = "Fail" errors_diff = """ Line 44: Expected 1 errors +Line 145: Expected 1 errors Line 147: Expected 1 errors """ diff --git a/conformance/results/pyright/protocols_generic.toml b/conformance/results/pyright/protocols_generic.toml index d15dd1ce..f19f84da 100644 --- a/conformance/results/pyright/protocols_generic.toml +++ b/conformance/results/pyright/protocols_generic.toml @@ -1,7 +1,4 @@ -conformant = "Partial" -notes = """ -Incorrectly generates type violation for protocol that uses method-scoped type variables. -""" +conformant = "Pass" output = """ protocols_generic.py:40:24 - error: Type "Concrete1" is not assignable to declared type "Proto1[int, str]"   "Concrete1" is incompatible with protocol "Proto1[int, str]" @@ -55,7 +52,6 @@ protocols_generic.py:147:25 - error: Type "ConcreteHasProperty4" is not assignab         Parameter 2: type "(T@m) -> str" is incompatible with type "(int) -> str"           Type "(T@m) -> str" is not assignable to type "(int) -> str" (reportAssignmentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 145: Unexpected errors ['protocols_generic.py:145:25 - error: Type "ConcreteHasProperty2" is not assignable to declared type "HasPropertyProto"'] """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index a90f554c..17fcd913 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.384" -test_duration = 1.3 +test_duration = 1.2 diff --git a/conformance/results/pytype/aliases_explicit.toml b/conformance/results/pytype/aliases_explicit.toml index 27f65cc6..c46571af 100644 --- a/conformance/results/pytype/aliases_explicit.toml +++ b/conformance/results/pytype/aliases_explicit.toml @@ -32,12 +32,12 @@ aliases_explicit.py:67:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] +aliases_explicit.py:68:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Optional[int]][int]' [invalid-annotation] p2: GoodTypeAlias3[int], # E: type alias is already specialized \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -aliases_explicit.py:69:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] +aliases_explicit.py:69:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[T][int, int]' [invalid-annotation] p3: GoodTypeAlias4[int, int], # E: too many type arguments \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -62,7 +62,7 @@ aliases_explicit.py:81:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] +aliases_explicit.py:82:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for BadTypeAlias4 [invalid-annotation] BadTypeAlias4: TA = [int for i in range(1)] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m diff --git a/conformance/results/pytype/aliases_implicit.toml b/conformance/results/pytype/aliases_implicit.toml index 64e38336..2be1cfd6 100644 --- a/conformance/results/pytype/aliases_implicit.toml +++ b/conformance/results/pytype/aliases_implicit.toml @@ -32,12 +32,12 @@ aliases_implicit.py:76:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[Optional[int]][int]' [invalid-annotation] +aliases_implicit.py:77:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[Optional[int]][int]' [invalid-annotation] p2: GoodTypeAlias3[int], # E: type alias is already specialized \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -aliases_implicit.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T][int, int]' [invalid-annotation] +aliases_implicit.py:78:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[T][int, int]' [invalid-annotation] p3: GoodTypeAlias4[int, int], # E: too many type arguments \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -126,7 +126,7 @@ def bad_type_aliases( pass \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m -aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] +aliases_implicit.py:105:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] def bad_type_aliases( \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -338,5 +338,5 @@ Line 133: Expected 1 errors Line 54: Unexpected errors ["aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[str, str]' [invalid-annotation]", "aliases_implicit.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Callable[Concatenate[int, P], R][[str, str], None]' [invalid-annotation]"] Line 68: Unexpected errors ['aliases_implicit.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[Concatenate, Any] [assert-type]'] Line 72: Unexpected errors ['aliases_implicit.py:72:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in good_type_aliases: Callable[[Any], None] [assert-type]'] -Line 105: Unexpected errors ["aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation]", 'aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] +Line 105: Unexpected errors ["aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '((int, str),)' for p3 [invalid-annotation]", 'aliases_implicit.py:105:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation "{\\'a\\': \\'b\\'}" for p5 [invalid-annotation]'] """ diff --git a/conformance/results/pytype/aliases_typealiastype.toml b/conformance/results/pytype/aliases_typealiastype.toml index 9e13b035..a9d4ad6b 100644 --- a/conformance/results/pytype/aliases_typealiastype.toml +++ b/conformance/results/pytype/aliases_typealiastype.toml @@ -28,7 +28,7 @@ aliases_typealiastype.py:22:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -aliases_typealiastype.py:22:66: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +aliases_typealiastype.py:22:66: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] Callable[P, TStr] | list[S] | list[GoodAlias5[S, TStr, P]] | tuple[*Ts], \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -77,5 +77,5 @@ Line 5: Unexpected errors ['aliases_typealiastype.py:5:1: \\x1b[1m\\x1b[31merror Line 11: Unexpected errors ['aliases_typealiastype.py:11:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 16: Unexpected errors ["aliases_typealiastype.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 19: Unexpected errors ["aliases_typealiastype.py:19:51: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias4' is not defined [name-error]"] -Line 22: Unexpected errors ["aliases_typealiastype.py:22:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias5' is not defined [name-error]", "aliases_typealiastype.py:22:66: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 22: Unexpected errors ["aliases_typealiastype.py:22:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Name 'GoodAlias5' is not defined [name-error]", "aliases_typealiastype.py:22:66: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/annotations_forward_refs.toml b/conformance/results/pytype/annotations_forward_refs.toml index b493b07e..c8757a0c 100644 --- a/conformance/results/pytype/annotations_forward_refs.toml +++ b/conformance/results/pytype/annotations_forward_refs.toml @@ -16,7 +16,7 @@ annotations_forward_refs.py:23:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: bad2: list[ClassA] # E: Runtime error: requires quotes \u001b[1m\u001b[31m~~~~~~\u001b[39m\u001b[0m -annotations_forward_refs.py:24:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''ClassA': str' and 'int: Type[int]' [unsupported-operands] +annotations_forward_refs.py:24:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : unsupported operand type(s) for |: ''ClassA': str' and 'int: type[int]' [unsupported-operands] bad3: "ClassA" | int # E: Runtime error \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -182,7 +182,7 @@ def invalid_annotations( pass \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m -annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] +annotations_forward_refs.py:40:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] def invalid_annotations( \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -438,7 +438,7 @@ Line 52: Expected 1 errors Line 53: Expected 1 errors Line 54: Expected 1 errors Line 55: Expected 1 errors -Line 40: Unexpected errors ["annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] +Line 40: Unexpected errors ["annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p9 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_forward_refs.py:40:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] Line 82: Unexpected errors ["annotations_forward_refs.py:82:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for str [invalid-annotation]"] Line 87: Unexpected errors ["annotations_forward_refs.py:87:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in ClassD: Invalid type annotation '' for x [invalid-annotation]"] Line 96: Unexpected errors ['annotations_forward_refs.py:96:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] diff --git a/conformance/results/pytype/annotations_typeexpr.toml b/conformance/results/pytype/annotations_typeexpr.toml index 87fa1060..322d352c 100644 --- a/conformance/results/pytype/annotations_typeexpr.toml +++ b/conformance/results/pytype/annotations_typeexpr.toml @@ -164,7 +164,7 @@ def invalid_annotations( pass \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m -annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] +annotations_typeexpr.py:87:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for p4 [invalid-annotation] def invalid_annotations( \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -377,5 +377,5 @@ Line 99: Expected 1 errors Line 100: Expected 1 errors Line 101: Expected 1 errors Line 102: Expected 1 errors -Line 87: Unexpected errors ["annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] +Line 87: Unexpected errors ["annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '{}' for p5 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '[int, str]' for p2 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'True' for p10 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p15 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' for p4 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '3' for p9 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '1' for p11 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '-1' for p12 [invalid-annotation]", "annotations_typeexpr.py:87:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '(int, str)' for p3 [invalid-annotation]"] """ diff --git a/conformance/results/pytype/callables_kwargs.toml b/conformance/results/pytype/callables_kwargs.toml index ae052884..a44b3c5c 100644 --- a/conformance/results/pytype/callables_kwargs.toml +++ b/conformance/results/pytype/callables_kwargs.toml @@ -23,7 +23,7 @@ callables_kwargs.py:35:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: assert_type(v3, str) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -callables_kwargs.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type] +callables_kwargs.py:41:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func2: dict[str, Unpack[TD1]] [assert-type] assert_type(kwargs, TD1) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -86,7 +86,7 @@ Line 10: Unexpected errors ['callables_kwargs.py:10:1: \\x1b[1m\\x1b[31merror\\x Line 24: Unexpected errors ['callables_kwargs.py:24:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] Line 32: Unexpected errors ['callables_kwargs.py:32:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] Line 35: Unexpected errors ['callables_kwargs.py:35:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Unpack[TD2] [assert-type]'] -Line 41: Unexpected errors ['callables_kwargs.py:41:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Dict[str, Unpack[TD1]] [assert-type]'] +Line 41: Unexpected errors ['callables_kwargs.py:41:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: dict[str, Unpack[TD1]] [assert-type]'] Line 47: Unexpected errors ['callables_kwargs.py:47:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Function func1 was called with the wrong arguments [wrong-arg-types]'] Line 49: Unexpected errors ["callables_kwargs.py:49:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Missing parameter 'v2' in call to function TD2.__init__ [missing-parameter]"] """ diff --git a/conformance/results/pytype/dataclasses_slots.toml b/conformance/results/pytype/dataclasses_slots.toml index be10aba0..c3318af8 100644 --- a/conformance/results/pytype/dataclasses_slots.toml +++ b/conformance/results/pytype/dataclasses_slots.toml @@ -5,7 +5,7 @@ Does not reject write to instance variable that is not defined in __slots__. Incorrectly reports error when accessing `__slots__` when `slots=True`. """ output = """ -dataclasses_slots.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error] +dataclasses_slots.py:56:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on type[DC5] [attribute-error] DC5.__slots__ \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -15,7 +15,7 @@ dataclasses_slots.py:57:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on Type[DC6] [attribute-error] +dataclasses_slots.py:66:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute '__slots__' on type[DC6] [attribute-error] DC6.__slots__ # E \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -31,6 +31,6 @@ errors_diff = """ Line 25: Expected 1 errors Line 38: Expected 1 errors Lines 10, 11: Expected error (tag 'DC1') -Line 56: Unexpected errors ["dataclasses_slots.py:56:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on Type[DC5] [attribute-error]"] +Line 56: Unexpected errors ["dataclasses_slots.py:56:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on type[DC5] [attribute-error]"] Line 57: Unexpected errors ["dataclasses_slots.py:57:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__slots__' on DC5 [attribute-error]"] """ diff --git a/conformance/results/pytype/directives_reveal_type.toml b/conformance/results/pytype/directives_reveal_type.toml index a18c7d07..05358bc8 100644 --- a/conformance/results/pytype/directives_reveal_type.toml +++ b/conformance/results/pytype/directives_reveal_type.toml @@ -9,7 +9,7 @@ directives_reveal_type.py:14:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in reveal_type(a) # Revealed type is "int | str" \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -directives_reveal_type.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: List[int] [reveal-type] +directives_reveal_type.py:15:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: list[int] [reveal-type] reveal_type(b) # Revealed type is "list[int]" \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -34,7 +34,7 @@ conformance_automated = "Fail" errors_diff = """ Line 19: Expected 1 errors Line 14: Unexpected errors ['directives_reveal_type.py:14:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Union[int, str] [reveal-type]'] -Line 15: Unexpected errors ['directives_reveal_type.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: List[int] [reveal-type]'] +Line 15: Unexpected errors ['directives_reveal_type.py:15:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: list[int] [reveal-type]'] Line 16: Unexpected errors ['directives_reveal_type.py:16:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Any [reveal-type]'] Line 17: Unexpected errors ['directives_reveal_type.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: ForwardReference [reveal-type]'] """ diff --git a/conformance/results/pytype/generics_defaults_referential.toml b/conformance/results/pytype/generics_defaults_referential.toml index 2a72e507..713d5a10 100644 --- a/conformance/results/pytype/generics_defaults_referential.toml +++ b/conformance/results/pytype/generics_defaults_referential.toml @@ -155,22 +155,22 @@ generics_defaults_referential.py:94:23: \u001b[1m\u001b[31merror\u001b[39m\u001b assert_type(Bar, type[Bar[Any, list[Any]]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:95:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] +generics_defaults_referential.py:95:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation] assert_type(Bar[int], type[Bar[int, list[int]]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:96:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation] +generics_defaults_referential.py:96:30: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation] assert_type(Bar[int](0, []), Bar[int, list[int]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:97:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] +generics_defaults_referential.py:97:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation] assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_defaults_referential.py:97:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation] +generics_defaults_referential.py:97:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation] assert_type(Bar[int, list[str]](0, []), Bar[int, list[str]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -210,8 +210,8 @@ Line 77: Unexpected errors ['generics_defaults_referential.py:77:1: \\x1b[1m\\x1 Line 87: Unexpected errors ['generics_defaults_referential.py:87:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : wrong arguments [invalid-typevar]'] Line 90: Unexpected errors ["generics_defaults_referential.py:90:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] Line 94: Unexpected errors ["generics_defaults_referential.py:94:23: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[Any, list]' [invalid-annotation]"] -Line 95: Unexpected errors ["generics_defaults_referential.py:95:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] -Line 96: Unexpected errors ["generics_defaults_referential.py:96:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[int]]' [invalid-annotation]"] -Line 97: Unexpected errors ["generics_defaults_referential.py:97:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]", "generics_defaults_referential.py:97:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, List[str]]' [invalid-annotation]"] +Line 95: Unexpected errors ["generics_defaults_referential.py:95:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation]"] +Line 96: Unexpected errors ["generics_defaults_referential.py:96:30: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[int]]' [invalid-annotation]"] +Line 97: Unexpected errors ["generics_defaults_referential.py:97:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation]", "generics_defaults_referential.py:97:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, list[str]]' [invalid-annotation]"] Line 98: Unexpected errors ["generics_defaults_referential.py:98:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]", "generics_defaults_referential.py:98:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Bar[int, str]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_scoping.toml b/conformance/results/pytype/generics_scoping.toml index d9f7e61d..32c0fd18 100644 --- a/conformance/results/pytype/generics_scoping.toml +++ b/conformance/results/pytype/generics_scoping.toml @@ -9,12 +9,12 @@ generics_scoping.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'List[T]' for global_var2 [invalid-annotation] +generics_scoping.py:95:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'list[T]' for global_var2 [invalid-annotation] global_var2: list[T] = [] # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m diff --git a/conformance/results/pytype/generics_self_advanced.toml b/conformance/results/pytype/generics_self_advanced.toml index 9a818632..c2cc90e8 100644 --- a/conformance/results/pytype/generics_self_advanced.toml +++ b/conformance/results/pytype/generics_self_advanced.toml @@ -39,7 +39,7 @@ generics_self_advanced.py:35:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in assert_type(self, Self) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_self_advanced.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: List[ChildB] [assert-type] +generics_self_advanced.py:36:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method2: list[ChildB] [assert-type] assert_type(self.a, list[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -54,12 +54,12 @@ generics_self_advanced.py:38:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in assert_type(self.method1(), Self) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_self_advanced.py:42:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: Type[ChildB] [assert-type] +generics_self_advanced.py:42:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: type[ChildB] [assert-type] assert_type(cls, type[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_self_advanced.py:43:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: List[ChildB] [assert-type] +generics_self_advanced.py:43:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in method3: list[ChildB] [assert-type] assert_type(cls.a, list[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -81,11 +81,11 @@ Line 12: Unexpected errors ['generics_self_advanced.py:12:9: \\x1b[1m\\x1b[31mer Line 19: Unexpected errors ['generics_self_advanced.py:19:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : ParentA [assert-type]'] Line 29: Unexpected errors ['generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]', 'generics_self_advanced.py:29:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method1: bad return type [bad-return-type]'] Line 35: Unexpected errors ['generics_self_advanced.py:35:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] -Line 36: Unexpected errors ['generics_self_advanced.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: List[ChildB] [assert-type]'] +Line 36: Unexpected errors ['generics_self_advanced.py:36:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: list[ChildB] [assert-type]'] Line 37: Unexpected errors ['generics_self_advanced.py:37:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] Line 38: Unexpected errors ['generics_self_advanced.py:38:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method2: ChildB [assert-type]'] -Line 42: Unexpected errors ['generics_self_advanced.py:42:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: Type[ChildB] [assert-type]'] -Line 43: Unexpected errors ['generics_self_advanced.py:43:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: List[ChildB] [assert-type]'] +Line 42: Unexpected errors ['generics_self_advanced.py:42:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: type[ChildB] [assert-type]'] +Line 43: Unexpected errors ['generics_self_advanced.py:43:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: list[ChildB] [assert-type]'] Line 44: Unexpected errors ['generics_self_advanced.py:44:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] Line 45: Unexpected errors ['generics_self_advanced.py:45:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in method3: ChildB [assert-type]'] """ diff --git a/conformance/results/pytype/generics_self_basic.toml b/conformance/results/pytype/generics_self_basic.toml index 0eb9ab43..28ff372a 100644 --- a/conformance/results/pytype/generics_self_basic.toml +++ b/conformance/results/pytype/generics_self_basic.toml @@ -15,14 +15,14 @@ generics_self_basic.py:14:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set Called from (traceback): line 52, in current file -generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Shape] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: type[Shape] [assert-type] assert_type(cls, type[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m Called from (traceback): line 54, in current file -generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: Type[Circle] [assert-type] +generics_self_basic.py:27:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in from_config: type[Circle] [assert-type] assert_type(cls, type[Self]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -53,7 +53,7 @@ generics_self_basic.py:64:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in set def set_value(self, value: T) -> Self: ... \u001b[1m\u001b[31m\u001b[39m\u001b[0m -generics_self_basic.py:67:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: Type[int]' [unsupported-operands] +generics_self_basic.py:67:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Container: unsupported operand type(s) for item retrieval: 'Self: TypeVar' and 'int: type[int]' [unsupported-operands] def foo(self, other: Self[int]) -> None: # E \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m @@ -64,7 +64,7 @@ errors_diff = """ Line 20: Expected 1 errors Line 33: Expected 1 errors Line 14: Unexpected errors ['generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Shape [assert-type]', 'generics_self_basic.py:14:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_scale: Circle [assert-type]'] -Line 27: Unexpected errors ['generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Shape] [assert-type]', 'generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: Type[Circle] [assert-type]'] +Line 27: Unexpected errors ['generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: type[Shape] [assert-type]', 'generics_self_basic.py:27:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in from_config: type[Circle] [assert-type]'] Line 40: Unexpected errors ['generics_self_basic.py:40:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in difference: Shape [assert-type]'] Line 64: Unexpected errors ['generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]', 'generics_self_basic.py:64:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in set_value: bad return type [bad-return-type]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_args.toml b/conformance/results/pytype/generics_typevartuple_args.toml index 91227fe9..f49671e3 100644 --- a/conformance/results/pytype/generics_typevartuple_args.toml +++ b/conformance/results/pytype/generics_typevartuple_args.toml @@ -20,7 +20,7 @@ def args_to_tuple(*args: *Ts) -> tuple[*Ts]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:16:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_args.py:16:34: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def args_to_tuple(*args: *Ts) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -32,7 +32,7 @@ generics_typevartuple_args.py:17:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: Called from (traceback): line 20, in current file -generics_typevartuple_args.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_args.py:20:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(args_to_tuple(1, "a"), tuple[int, str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -44,15 +44,15 @@ def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tupl ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:27:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_args.py:27:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:27:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_args.py:27:77: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]: - \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m generics_typevartuple_args.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in exec_le: bad return type [bad-return-type] @@ -61,12 +61,12 @@ generics_typevartuple_args.py:28:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: Called from (traceback): line 31, in current file -generics_typevartuple_args.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_args.py:31:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(exec_le("", Env()), tuple[()]) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_args.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(exec_le("", 0, "", Env()), tuple[int, str]) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -97,7 +97,7 @@ def func3(*args: * tuple[int, str]) -> None: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_args.py:70:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_args.py:70:18: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func4(*args: tuple[*Ts]): \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -120,15 +120,15 @@ Line 67: Expected 1 errors Line 76: Expected 1 errors Line 10: Unexpected errors ['generics_typevartuple_args.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 13: Unexpected errors ['generics_typevartuple_args.py:13:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 16: Unexpected errors ["generics_typevartuple_args.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_args.py:16:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 16: Unexpected errors ["generics_typevartuple_args.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_args.py:16:34: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 17: Unexpected errors ['generics_typevartuple_args.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in args_to_tuple: bad return type [bad-return-type]'] -Line 20: Unexpected errors ['generics_typevartuple_args.py:20:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] -Line 27: Unexpected errors ["generics_typevartuple_args.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:27:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_args.py:27:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 20: Unexpected errors ['generics_typevartuple_args.py:20:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] +Line 27: Unexpected errors ["generics_typevartuple_args.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:27:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_args.py:27:77: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 28: Unexpected errors ['generics_typevartuple_args.py:28:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in exec_le: bad return type [bad-return-type]'] -Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] -Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] +Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] Line 42: Unexpected errors ["generics_typevartuple_args.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] Line 51: Unexpected errors ["generics_typevartuple_args.py:51:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_args.py:51:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 62: Unexpected errors ["generics_typevartuple_args.py:62:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]"] -Line 70: Unexpected errors ["generics_typevartuple_args.py:70:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 70: Unexpected errors ["generics_typevartuple_args.py:70:18: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_basic.toml b/conformance/results/pytype/generics_typevartuple_basic.toml index 8bd98126..0b78be1c 100644 --- a/conformance/results/pytype/generics_typevartuple_basic.toml +++ b/conformance/results/pytype/generics_typevartuple_basic.toml @@ -25,7 +25,7 @@ def func1(*args: *Ts) -> tuple[*Ts]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:16:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:16:26: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func1(*args: *Ts) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -45,7 +45,7 @@ generics_typevartuple_basic.py:23:13: \u001b[1m\u001b[31merror\u001b[39m\u001b[0 class Array(Generic[*Shape]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:24:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:24:31: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] def __init__(self, shape: tuple[*Shape]): \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -55,7 +55,7 @@ generics_typevartuple_basic.py:25:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m self._shape: tuple[*Shape] = shape \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:27:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:27:28: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Array: Invalid type annotation '' [invalid-annotation] def get_shape(self) -> tuple[*Shape]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -200,17 +200,17 @@ generics_typevartuple_basic.py:67:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m Ts3 = TypeVarTuple("Ts3", bound=int) # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:75:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:75:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:75:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:75:35: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_basic.py:75:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_basic.py:75:50: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -222,7 +222,7 @@ generics_typevartuple_basic.py:76:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m Called from (traceback): line 84, in current file -generics_typevartuple_basic.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_basic.py:84:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(func2((0,), (1,)), tuple[int]) # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -286,20 +286,20 @@ Line 100: Expected 1 errors Line 7: Unexpected errors ['generics_typevartuple_basic.py:7:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 9: Unexpected errors ['generics_typevartuple_basic.py:9:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 12: Unexpected errors ["generics_typevartuple_basic.py:12:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 16: Unexpected errors ["generics_typevartuple_basic.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_basic.py:16:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 16: Unexpected errors ["generics_typevartuple_basic.py:16:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : No attribute '__iter__' on TypeVarTuple [attribute-error]", "generics_typevartuple_basic.py:16:26: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 17: Unexpected errors ['generics_typevartuple_basic.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] Line 20: Unexpected errors ['generics_typevartuple_basic.py:20:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 23: Unexpected errors ["generics_typevartuple_basic.py:23:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] -Line 24: Unexpected errors ["generics_typevartuple_basic.py:24:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 24: Unexpected errors ["generics_typevartuple_basic.py:24:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] Line 25: Unexpected errors ["generics_typevartuple_basic.py:25:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] -Line 27: Unexpected errors ["generics_typevartuple_basic.py:27:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] +Line 27: Unexpected errors ["generics_typevartuple_basic.py:27:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Array: Invalid type annotation '' [invalid-annotation]"] Line 36: Unexpected errors ['generics_typevartuple_basic.py:36:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:36:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:36:28: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] Line 37: Unexpected errors ['generics_typevartuple_basic.py:37:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:37:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:37:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] Line 38: Unexpected errors ['generics_typevartuple_basic.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', "generics_typevartuple_basic.py:38:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Array[Time, Batch, Height, Width]' [invalid-annotation]", 'generics_typevartuple_basic.py:38:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Array.__init__ was called with the wrong arguments [wrong-arg-types]'] Line 54: Unexpected errors ["generics_typevartuple_basic.py:54:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in __init__: Invalid type annotation 'tuple[*Shape,]' [invalid-annotation]"] -Line 75: Unexpected errors ["generics_typevartuple_basic.py:75:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 75: Unexpected errors ["generics_typevartuple_basic.py:75:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_basic.py:75:50: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 76: Unexpected errors ['generics_typevartuple_basic.py:76:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] -Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] Line 93: Unexpected errors ['generics_typevartuple_basic.py:93:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:35: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:93:53: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] Line 94: Unexpected errors ['generics_typevartuple_basic.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in multiply: bad return type [bad-return-type]'] Line 97: Unexpected errors ['generics_typevartuple_basic.py:97:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]', 'generics_typevartuple_basic.py:97:49: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] diff --git a/conformance/results/pytype/generics_typevartuple_callable.toml b/conformance/results/pytype/generics_typevartuple_callable.toml index 6abb2179..c2cf1782 100644 --- a/conformance/results/pytype/generics_typevartuple_callable.toml +++ b/conformance/results/pytype/generics_typevartuple_callable.toml @@ -13,12 +13,12 @@ generics_typevartuple_callable.py:12:6: \u001b[1m\u001b[31merror\u001b[39m\u001b Ts = TypeVarTuple("Ts") \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:17:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:17:61: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:17:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:17:32: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in Process: Invalid type annotation '' [invalid-annotation] def __init__(self, target: Callable[[*Ts], None], args: tuple[*Ts]) -> None: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -33,17 +33,17 @@ generics_typevartuple_callable.py:26:1: \u001b[1m\u001b[31merror\u001b[39m\u001b Process(target=func1, args=("", 0)) # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:29:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:29:57: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:29:38: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:29:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func2(f: Callable[[int, *Ts, T], tuple[T, *Ts]]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -75,7 +75,7 @@ generics_typevartuple_callable.py:41:1: \u001b[1m\u001b[31merror\u001b[39m\u001b assert_type(func2(callback1), tuple[str, int, complex]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_callable.py:42:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(func2(callback2), tuple[str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -87,12 +87,12 @@ def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:45:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:45:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_callable.py:45:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_callable.py:45:43: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -104,7 +104,7 @@ generics_typevartuple_callable.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b Called from (traceback): line 49, in current file -generics_typevartuple_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +generics_typevartuple_callable.py:49:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(func3(1, "", 3j, 3.4), tuple[float, str, complex]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -114,15 +114,15 @@ conformance_automated = "Fail" errors_diff = """ Line 10: Unexpected errors ['generics_typevartuple_callable.py:10:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 12: Unexpected errors ['generics_typevartuple_callable.py:12:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 17: Unexpected errors ["generics_typevartuple_callable.py:17:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:17:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]"] +Line 17: Unexpected errors ["generics_typevartuple_callable.py:17:61: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:17:32: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in Process: Invalid type annotation '' [invalid-annotation]"] Line 25: Unexpected errors ['generics_typevartuple_callable.py:25:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function Process.__init__ was called with the wrong arguments [wrong-arg-types]'] -Line 29: Unexpected errors ["generics_typevartuple_callable.py:29:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 29: Unexpected errors ["generics_typevartuple_callable.py:29:57: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:38: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:29:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 30: Unexpected errors ['generics_typevartuple_callable.py:30:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: bad return type [bad-return-type]'] Line 34: Unexpected errors ['generics_typevartuple_callable.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback1: bad return type [bad-return-type]'] Line 38: Unexpected errors ['generics_typevartuple_callable.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in callback2: bad return type [bad-return-type]'] Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function func2 was called with the wrong arguments [wrong-arg-types]', 'generics_typevartuple_callable.py:41:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] -Line 45: Unexpected errors ["generics_typevartuple_callable.py:45:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_callable.py:45:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:45:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] +Line 45: Unexpected errors ["generics_typevartuple_callable.py:45:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Missing parameter 'self' in call to function tuple.__iter__ [missing-parameter]", "generics_typevartuple_callable.py:45:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_callable.py:45:43: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 46: Unexpected errors ['generics_typevartuple_callable.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: bad return type [bad-return-type]'] -Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] """ diff --git a/conformance/results/pytype/generics_typevartuple_concat.toml b/conformance/results/pytype/generics_typevartuple_concat.toml index 38a84f71..aa170894 100644 --- a/conformance/results/pytype/generics_typevartuple_concat.toml +++ b/conformance/results/pytype/generics_typevartuple_concat.toml @@ -95,12 +95,12 @@ def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_concat.py:47:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:47:27: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_concat.py:47:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:47:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def prefix_tuple(x: T, y: tuple[*Ts]) -> tuple[T, *Ts]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -120,12 +120,12 @@ generics_typevartuple_concat.py:52:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0 assert_type(z, tuple[int, bool, str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_concat.py:55:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:55:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_concat.py:55:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_concat.py:55:37: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def move_first_element_to_last(tup: tuple[T, *Ts]) -> tuple[*Ts, T]: \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -147,9 +147,9 @@ Line 38: Unexpected errors ['generics_typevartuple_concat.py:38:14: \\x1b[1m\\x1 Line 40: Unexpected errors ['generics_typevartuple_concat.py:40:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] Line 42: Unexpected errors ['generics_typevartuple_concat.py:42:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] Line 44: Unexpected errors ['generics_typevartuple_concat.py:44:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: class Array is not indexable [not-indexable]'] -Line 47: Unexpected errors ["generics_typevartuple_concat.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]", "generics_typevartuple_concat.py:47:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:47:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 47: Unexpected errors ["generics_typevartuple_concat.py:47:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T' [invalid-annotation]", "generics_typevartuple_concat.py:47:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:47:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 48: Unexpected errors ['generics_typevartuple_concat.py:48:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in prefix_tuple: bad return type [bad-return-type]'] Line 51: Unexpected errors ['generics_typevartuple_concat.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function prefix_tuple was called with the wrong arguments [wrong-arg-types]'] Line 52: Unexpected errors ['generics_typevartuple_concat.py:52:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] -Line 55: Unexpected errors ["generics_typevartuple_concat.py:55:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:55:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 55: Unexpected errors ["generics_typevartuple_concat.py:55:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "generics_typevartuple_concat.py:55:37: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/generics_typevartuple_specialization.toml b/conformance/results/pytype/generics_typevartuple_specialization.toml index 992d68c4..ea620c39 100644 --- a/conformance/results/pytype/generics_typevartuple_specialization.toml +++ b/conformance/results/pytype/generics_typevartuple_specialization.toml @@ -33,7 +33,7 @@ generics_typevartuple_specialization.py:33:14: \u001b[1m\u001b[31merror\u001b[39 def func2(y: Array[Time, Height, Width]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:41:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] IntTuple = tuple[int, *Ts] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -43,17 +43,17 @@ generics_typevartuple_specialization.py:42:25: \u001b[1m\u001b[31merror\u001b[39 NamedArray = tuple[str, Array[*Ts]] \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:45:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation] +generics_typevartuple_specialization.py:45:40: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[str, Array][Height]' [invalid-annotation] def func3(a: IntTuple[float, bool], b: NamedArray[Height]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:45:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation] +generics_typevartuple_specialization.py:45:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][float, bool]' [invalid-annotation] def func3(a: IntTuple[float, bool], b: NamedArray[Height]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: Tuple[Any] [assert-type] +generics_typevartuple_specialization.py:46:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func3: tuple[Any] [assert-type] assert_type(a, tuple[int, float, bool]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -63,7 +63,7 @@ generics_typevartuple_specialization.py:47:31: \u001b[1m\u001b[31merror\u001b[39 assert_type(b, tuple[str, Array[Height]]) \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: Tuple[Any] [assert-type] +generics_typevartuple_specialization.py:51:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func4: tuple[Any] [assert-type] assert_type(a, tuple[int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -113,27 +113,27 @@ generics_typevartuple_specialization.py:80:46: \u001b[1m\u001b[31merror\u001b[39 def takes_float_array_with_specific_shape(y: FloatArray[Height, Width]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:89:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:89:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] VariadicTuple = tuple[T, *Ts] \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:92:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation] +generics_typevartuple_specialization.py:92:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, int]' [invalid-annotation] def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:92:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation] +generics_typevartuple_specialization.py:92:42: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][float]' [invalid-annotation] def func6(a: VariadicTuple[str, int], b: VariadicTuple[float], c: VariadicTuple): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:93:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] +generics_typevartuple_specialization.py:93:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: tuple[Any] [assert-type] assert_type(a, tuple[str, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: Tuple[Any] [assert-type] +generics_typevartuple_specialization.py:94:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func6: tuple[Any] [assert-type] assert_type(b, tuple[float]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -153,22 +153,22 @@ generics_typevartuple_specialization.py:99:7: \u001b[1m\u001b[31merror\u001b[39m Ts2 = TypeVarTuple("Ts2") \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:101:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:101:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] IntTupleVar = tuple[int, *Ts1] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:102:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:102:20: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] IntFloatTupleVar = IntTupleVar[float, *Ts2] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:103:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:103:21: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] IntFloatsTupleVar = IntTupleVar[*tuple[float, ...]] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:109:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] IntTupleGeneric[*Ts] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -178,17 +178,17 @@ generics_typevartuple_specialization.py:110:1: \u001b[1m\u001b[31merror\u001b[39 IntTupleGeneric[*tuple[float, ...]] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:117:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:117:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA1 = tuple[*Ts, T1, T2] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:118:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:118:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA2 = tuple[T1, T2, *Ts] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:119:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:119:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA3 = tuple[T1, *Ts, T2, T3] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -198,7 +198,7 @@ generics_typevartuple_specialization.py:120:7: \u001b[1m\u001b[31merror\u001b[39 TA4 = tuple[T1, T2, *tuple[int, ...]] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:121:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA5 = tuple[T1, *Ts, T2, *Ts] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -208,7 +208,7 @@ generics_typevartuple_specialization.py:121:13: \u001b[1m\u001b[31merror\u001b[3 TA5 = tuple[T1, *Ts, T2, *Ts] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:122:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:122:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -218,17 +218,17 @@ generics_typevartuple_specialization.py:122:13: \u001b[1m\u001b[31merror\u001b[3 TA6 = tuple[T1, *Ts, T2, *tuple[int, ...]] # E \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:125:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:125:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA7 = tuple[*Ts, T1, T2] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:127:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][int]' [invalid-annotation] +generics_typevartuple_specialization.py:127:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][int]' [invalid-annotation] v1: TA7[int] # E: requires at least two type arguments \u001b[1m\u001b[31m~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:130:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:130:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -247,7 +247,7 @@ def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:130:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:130:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func7(a: TA7[*Ts, T1, T2]) -> tuple[tuple[*Ts], T1, T2]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -257,42 +257,42 @@ generics_typevartuple_specialization.py:131:5: \u001b[1m\u001b[31merror\u001b[39 ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:134:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation] +generics_typevartuple_specialization.py:134:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool]' [invalid-annotation] def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:134:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] +generics_typevartuple_specialization.py:134:33: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation] def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:134:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] +generics_typevartuple_specialization.py:134:59: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation] def func8(a: TA7[str, bool], b: TA7[str, bool, float], c: TA7[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] +generics_typevartuple_specialization.py:135:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type] assert_type(func7(a), tuple[tuple[()], str, bool]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:136:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] +generics_typevartuple_specialization.py:136:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type] assert_type(func7(b), tuple[tuple[str], bool, float]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:137:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type] +generics_typevartuple_specialization.py:137:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type] assert_type(func7(c), tuple[tuple[str, bool], float, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:140:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:140:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA8 = tuple[T1, *Ts, T2, T3] \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:143:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:143:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -318,7 +318,7 @@ def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: ... \u001b[1m\u001b[31m~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:143:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:143:45: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func9(a: TA8[T1, *Ts, T2, T3]) -> tuple[tuple[*Ts], T1, T2, T3]: \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -328,42 +328,42 @@ generics_typevartuple_specialization.py:144:5: \u001b[1m\u001b[31merror\u001b[39 ... \u001b[1m\u001b[31m~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:147:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation] +generics_typevartuple_specialization.py:147:15: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation] def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:147:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation] +generics_typevartuple_specialization.py:147:41: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation] def func10(a: TA8[str, bool, float], b: TA8[str, bool, float, int]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] +generics_typevartuple_specialization.py:148:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type] assert_type(func9(a), tuple[tuple[()], str, bool, float]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:149:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type] +generics_typevartuple_specialization.py:149:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type] assert_type(func9(b), tuple[tuple[bool], str, float, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:152:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:152:7: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA9 = tuple[*Ts, T1] \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:153:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:153:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] TA10 = TA9[*tuple[int, ...]] # OK \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:156:24: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:156:24: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:156:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:156:55: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] def func11(a: TA10, b: TA9[*tuple[int, ...], str], c: TA9[*tuple[int, ...], str]): \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -383,12 +383,12 @@ generics_typevartuple_specialization.py:159:20: \u001b[1m\u001b[31merror\u001b[3 assert_type(c, tuple[*tuple[int, ...], str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:162:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +generics_typevartuple_specialization.py:162:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] TA11 = tuple[T, *Ts1] \u001b[1m\u001b[31m~~~~~~~~~~~~~~\u001b[39m\u001b[0m -generics_typevartuple_specialization.py:163:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation] +generics_typevartuple_specialization.py:163:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation] TA12 = TA11[*Ts2] # E \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -402,12 +402,12 @@ Line 16: Unexpected errors ["generics_typevartuple_specialization.py:16:13: \\x1 Line 24: Unexpected errors ['generics_typevartuple_specialization.py:24:27: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] Line 28: Unexpected errors ['generics_typevartuple_specialization.py:28:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] Line 33: Unexpected errors ['generics_typevartuple_specialization.py:33:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 41: Unexpected errors ["generics_typevartuple_specialization.py:41:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 41: Unexpected errors ["generics_typevartuple_specialization.py:41:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 42: Unexpected errors ['generics_typevartuple_specialization.py:42:25: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array is not indexable [not-indexable]'] -Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[str, Array][Height]' [invalid-annotation]", "generics_typevartuple_specialization.py:45:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float, bool]' [invalid-annotation]"] -Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Tuple[Any] [assert-type]'] +Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[str, Array][Height]' [invalid-annotation]", "generics_typevartuple_specialization.py:45:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][float, bool]' [invalid-annotation]"] +Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: tuple[Any] [assert-type]'] Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:31: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: class Array is not indexable [not-indexable]'] -Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: Tuple[Any] [assert-type]'] +Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func4: tuple[Any] [assert-type]'] Line 55: Unexpected errors ['generics_typevartuple_specialization.py:55:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 59: Unexpected errors ["generics_typevartuple_specialization.py:59:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Generic' [invalid-annotation]"] Line 63: Unexpected errors ['generics_typevartuple_specialization.py:63:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] @@ -417,38 +417,38 @@ Line 68: Unexpected errors ['generics_typevartuple_specialization.py:68:20: \\x1 Line 69: Unexpected errors ['generics_typevartuple_specialization.py:69:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func5_0: class Array2 is not indexable [not-indexable]'] Line 76: Unexpected errors ['generics_typevartuple_specialization.py:76:16: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] Line 80: Unexpected errors ['generics_typevartuple_specialization.py:80:46: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : class Array2 is not indexable [not-indexable]'] -Line 89: Unexpected errors ["generics_typevartuple_specialization.py:89:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 92: Unexpected errors ["generics_typevartuple_specialization.py:92:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, int]' [invalid-annotation]", "generics_typevartuple_specialization.py:92:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][float]' [invalid-annotation]"] -Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] -Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Tuple[Any] [assert-type]'] +Line 89: Unexpected errors ["generics_typevartuple_specialization.py:89:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 92: Unexpected errors ["generics_typevartuple_specialization.py:92:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, int]' [invalid-annotation]", "generics_typevartuple_specialization.py:92:42: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][float]' [invalid-annotation]"] +Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: tuple[Any] [assert-type]'] +Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: tuple[Any] [assert-type]'] Line 95: Unexpected errors ["generics_typevartuple_specialization.py:95:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Invalid type annotation '' [invalid-annotation]"] Line 98: Unexpected errors ['generics_typevartuple_specialization.py:98:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] Line 99: Unexpected errors ['generics_typevartuple_specialization.py:99:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 101: Unexpected errors ["generics_typevartuple_specialization.py:101:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 102: Unexpected errors ["generics_typevartuple_specialization.py:102:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] -Line 103: Unexpected errors ["generics_typevartuple_specialization.py:103:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] -Line 117: Unexpected errors ["generics_typevartuple_specialization.py:117:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 118: Unexpected errors ["generics_typevartuple_specialization.py:118:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 119: Unexpected errors ["generics_typevartuple_specialization.py:119:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 101: Unexpected errors ["generics_typevartuple_specialization.py:101:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 102: Unexpected errors ["generics_typevartuple_specialization.py:102:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] +Line 103: Unexpected errors ["generics_typevartuple_specialization.py:103:21: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] +Line 117: Unexpected errors ["generics_typevartuple_specialization.py:117:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 118: Unexpected errors ["generics_typevartuple_specialization.py:118:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 119: Unexpected errors ["generics_typevartuple_specialization.py:119:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 120: Unexpected errors ["generics_typevartuple_specialization.py:120:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 125: Unexpected errors ["generics_typevartuple_specialization.py:125:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 130: Unexpected errors ["generics_typevartuple_specialization.py:130:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:130:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 125: Unexpected errors ["generics_typevartuple_specialization.py:125:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 130: Unexpected errors ["generics_typevartuple_specialization.py:130:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:130:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:130:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 131: Unexpected errors ['generics_typevartuple_specialization.py:131:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: bad return type [bad-return-type]'] -Line 134: Unexpected errors ["generics_typevartuple_specialization.py:134:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] -Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Tuple[Tuple[Any], Any, Any] [assert-type]'] -Line 140: Unexpected errors ["generics_typevartuple_specialization.py:140:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 143: Unexpected errors ["generics_typevartuple_specialization.py:143:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T3' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:143:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 134: Unexpected errors ["generics_typevartuple_specialization.py:134:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:33: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:134:59: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type]'] +Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type]'] +Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: tuple[tuple[Any], Any, Any] [assert-type]'] +Line 140: Unexpected errors ["generics_typevartuple_specialization.py:140:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 143: Unexpected errors ["generics_typevartuple_specialization.py:143:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T3' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T2' [invalid-annotation]", "generics_typevartuple_specialization.py:143:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'T1' [invalid-annotation]", "generics_typevartuple_specialization.py:143:45: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 144: Unexpected errors ['generics_typevartuple_specialization.py:144:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func9: bad return type [bad-return-type]'] -Line 147: Unexpected errors ["generics_typevartuple_specialization.py:147:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:147:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][str, bool, float, int]' [invalid-annotation]"] -Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: Tuple[Tuple[Any], Any, Any, Any] [assert-type]'] -Line 152: Unexpected errors ["generics_typevartuple_specialization.py:152:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 153: Unexpected errors ["generics_typevartuple_specialization.py:153:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] -Line 156: Unexpected errors ["generics_typevartuple_specialization.py:156:24: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:156:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'Tuple[Any][]' [invalid-annotation]"] +Line 147: Unexpected errors ["generics_typevartuple_specialization.py:147:15: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float]' [invalid-annotation]", "generics_typevartuple_specialization.py:147:41: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][str, bool, float, int]' [invalid-annotation]"] +Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type]'] +Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func10: tuple[tuple[Any], Any, Any, Any] [assert-type]'] +Line 152: Unexpected errors ["generics_typevartuple_specialization.py:152:7: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 153: Unexpected errors ["generics_typevartuple_specialization.py:153:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] +Line 156: Unexpected errors ["generics_typevartuple_specialization.py:156:24: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]", "generics_typevartuple_specialization.py:156:55: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[Any][]' [invalid-annotation]"] Line 157: Unexpected errors ["generics_typevartuple_specialization.py:157:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] Line 158: Unexpected errors ["generics_typevartuple_specialization.py:158:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] Line 159: Unexpected errors ["generics_typevartuple_specialization.py:159:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func11: Invalid type annotation '' [invalid-annotation]"] -Line 162: Unexpected errors ["generics_typevartuple_specialization.py:162:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 162: Unexpected errors ["generics_typevartuple_specialization.py:162:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/namedtuples_define_class.toml b/conformance/results/pytype/namedtuples_define_class.toml index bad1600d..189add7c 100644 --- a/conformance/results/pytype/namedtuples_define_class.toml +++ b/conformance/results/pytype/namedtuples_define_class.toml @@ -19,12 +19,12 @@ namedtuples_define_class.py:28:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: i assert_type(p1[-3], int) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -namedtuples_define_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] +namedtuples_define_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Union[int, str], ...] [assert-type] assert_type(p1[0:2], tuple[int, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -namedtuples_define_class.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Union[int, str], ...] [assert-type] +namedtuples_define_class.py:30:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Union[int, str], ...] [assert-type] assert_type(p1[0:], tuple[int, int, str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -75,7 +75,7 @@ Line 98: Expected 1 errors Line 105: Expected 1 errors Line 27: Unexpected errors ['namedtuples_define_class.py:27:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] Line 28: Unexpected errors ['namedtuples_define_class.py:28:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Union[int, str] [assert-type]'] -Line 29: Unexpected errors ['namedtuples_define_class.py:29:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] -Line 30: Unexpected errors ['namedtuples_define_class.py:30:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Union[int, str], ...] [assert-type]'] +Line 29: Unexpected errors ['namedtuples_define_class.py:29:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Union[int, str], ...] [assert-type]'] +Line 30: Unexpected errors ['namedtuples_define_class.py:30:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Union[int, str], ...] [assert-type]'] Line 95: Unexpected errors ['namedtuples_define_class.py:95:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Any [assert-type]'] """ diff --git a/conformance/results/pytype/narrowing_typeis.toml b/conformance/results/pytype/narrowing_typeis.toml index e5f70078..7101206c 100644 --- a/conformance/results/pytype/narrowing_typeis.toml +++ b/conformance/results/pytype/narrowing_typeis.toml @@ -5,7 +5,7 @@ Does not reject covariant use of TypeIs. Does not reject TypeIs where return type is not consistent with input type due to variance. """ output = """ -narrowing_typeis.py:19:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: Tuple[str, ...] [assert-type] +narrowing_typeis.py:19:9: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func1: tuple[str, ...] [assert-type] assert_type(names, tuple[str, str]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -44,5 +44,5 @@ Line 105: Expected 1 errors Line 110: Expected 1 errors Line 191: Expected 1 errors Line 199: Expected 1 errors -Line 19: Unexpected errors ['narrowing_typeis.py:19:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[str, ...] [assert-type]'] +Line 19: Unexpected errors ['narrowing_typeis.py:19:9: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: tuple[str, ...] [assert-type]'] """ diff --git a/conformance/results/pytype/protocols_generic.toml b/conformance/results/pytype/protocols_generic.toml index 2ab4a937..3de69759 100644 --- a/conformance/results/pytype/protocols_generic.toml +++ b/conformance/results/pytype/protocols_generic.toml @@ -52,6 +52,7 @@ conformance_automated = "Fail" errors_diff = """ Line 66: Expected 1 errors Line 74: Expected 1 errors +Line 145: Expected 1 errors Line 147: Expected 1 errors Line 12: Unexpected errors ['protocols_generic.py:12:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] Line 13: Unexpected errors ['protocols_generic.py:13:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "contravariant" to TypeVar not supported yet [not-supported-yet]'] diff --git a/conformance/results/pytype/qualifiers_annotated.toml b/conformance/results/pytype/qualifiers_annotated.toml index 4b5d16f8..86e4ce6b 100644 --- a/conformance/results/pytype/qualifiers_annotated.toml +++ b/conformance/results/pytype/qualifiers_annotated.toml @@ -16,7 +16,7 @@ qualifiers_annotated.py:44:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad3 [invalid-annotation] +qualifiers_annotated.py:45:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' for Bad3 [invalid-annotation] Bad3: Annotated[[int for i in range(1)], ""] # E: invalid type expression \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m diff --git a/conformance/results/pytype/specialtypes_type.toml b/conformance/results/pytype/specialtypes_type.toml index c9ad2035..98f8ffbb 100644 --- a/conformance/results/pytype/specialtypes_type.toml +++ b/conformance/results/pytype/specialtypes_type.toml @@ -41,32 +41,32 @@ specialtypes_type.py:110:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func assert_type(d.__mro__, tuple[type, ...]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] +specialtypes_type.py:117:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on type[object] [attribute-error] a.unknown # E \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:120:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on Type[object] [attribute-error] +specialtypes_type.py:120:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in func8: No attribute 'unknown' on type[object] [attribute-error] b.unknown # E \u001b[1m\u001b[31m~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:143:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] TA1.unknown # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:144:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] TA2.unknown # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:145:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] TA3.unknown # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m -specialtypes_type.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on Type[type] [attribute-error] +specialtypes_type.py:146:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : No attribute 'unknown' on type[type] [attribute-error] TA4.unknown # E \u001b[1m\u001b[31m~~~~~~~~~~~\u001b[39m\u001b[0m diff --git a/conformance/results/pytype/tuples_type_compat.toml b/conformance/results/pytype/tuples_type_compat.toml index c198de7a..029eb713 100644 --- a/conformance/results/pytype/tuples_type_compat.toml +++ b/conformance/results/pytype/tuples_type_compat.toml @@ -50,12 +50,12 @@ tuples_type_compat.py:91:47: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 115: Unexpected errors ['tuples_type_compat.py:115:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] -Line 117: Unexpected errors ['tuples_type_compat.py:117:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: Tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 115: Unexpected errors ['tuples_type_compat.py:115:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type]'] +Line 117: Unexpected errors ['tuples_type_compat.py:117:13: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func7: tuple[Union[int, str], Union[int, str]] [assert-type]'] Line 134: Unexpected errors ["tuples_type_compat.py:134:40: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 139: Unexpected errors ['tuples_type_compat.py:139:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] Line 140: Unexpected errors ['tuples_type_compat.py:140:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func8: Sequence [assert-type]'] diff --git a/conformance/results/pytype/tuples_unpacked.toml b/conformance/results/pytype/tuples_unpacked.toml index 9b4b5b55..1b2f6feb 100644 --- a/conformance/results/pytype/tuples_unpacked.toml +++ b/conformance/results/pytype/tuples_unpacked.toml @@ -19,7 +19,7 @@ tuples_unpacked.py:16:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Tuple[Any] [assert-type] +tuples_unpacked.py:32:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : tuple[Any] [assert-type] assert_type(u1, tuple[int, int]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -129,7 +129,7 @@ tuples_unpacked.py:46:6: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] +tuples_unpacked.py:49:14: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation '' [invalid-annotation] def func3(t: tuple[*Ts]): \u001b[1m\u001b[31m~~~~~~~~~~\u001b[39m\u001b[0m @@ -151,17 +151,17 @@ Line 59: Expected 1 errors Lines 60, 61: Expected error (tag 't14') Line 13: Unexpected errors ['tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.Unpack not supported yet [not-supported-yet]', 'tuples_unpacked.py:13:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : typing.TypeVarTuple not supported yet [not-supported-yet]'] Line 16: Unexpected errors ["tuples_unpacked.py:16:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] -Line 17: Unexpected errors ['tuples_unpacked.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Tuple[Any] [assert-type]'] +Line 17: Unexpected errors ['tuples_unpacked.py:17:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: tuple[Any] [assert-type]'] Line 18: Unexpected errors ["tuples_unpacked.py:18:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] Line 19: Unexpected errors ["tuples_unpacked.py:19:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: Invalid type annotation '' [invalid-annotation]"] Line 25: Unexpected errors ["tuples_unpacked.py:25:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 26: Unexpected errors ["tuples_unpacked.py:26:20: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func2: Invalid type annotation '' [invalid-annotation]"] Line 31: Unexpected errors ['tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Type annotation for u1 does not match type of assignment [annotation-type-mismatch]', "tuples_unpacked.py:31:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation 'tuple[*tuple[int], *tuple[int]]' [invalid-annotation]", "tuples_unpacked.py:31:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:31:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] -Line 32: Unexpected errors ['tuples_unpacked.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Tuple[Any] [assert-type]'] +Line 32: Unexpected errors ['tuples_unpacked.py:32:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : tuple[Any] [assert-type]'] Line 33: Unexpected errors ["tuples_unpacked.py:33:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:33:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] Line 38: Unexpected errors ["tuples_unpacked.py:38:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", 'tuples_unpacked.py:38:11: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function list.extend was called with the wrong arguments [wrong-arg-types]'] Line 39: Unexpected errors ["tuples_unpacked.py:39:12: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]", "tuples_unpacked.py:39:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 46: Unexpected errors ['tuples_unpacked.py:46:6: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function TypeVarTuple.__init__ expects 1 arg(s), got 2 [wrong-arg-count]'] -Line 49: Unexpected errors ["tuples_unpacked.py:49:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] +Line 49: Unexpected errors ["tuples_unpacked.py:49:14: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Invalid type annotation '' [invalid-annotation]"] Line 50: Unexpected errors ["tuples_unpacked.py:50:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func3: Invalid type annotation 'tuple[*tuple[str], *Ts]' [invalid-annotation]"] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 19259c3a..79ea0346 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ -version = "pytype 2024.09.13" -test_duration = 32.8 +version = "pytype 2024.10.11" +test_duration = 31.9 diff --git a/conformance/results/results.html b/conformance/results/results.html index cffa1e37..ec61d4b0 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

 
mypy 1.11.1
-
13.2sec
+
mypy 1.11.2
+
1.9sec
pyright 1.1.374
-
1.5sec
+
pyright 1.1.384
+
1.3sec
pyre 0.9.22
-
5.4sec
+
4.5sec
pytype 2024.04.11
-
35.2sec
+
pytype 2024.09.13
+
32.8sec
@@ -551,7 +551,7 @@

Python Type System Conformance Test Results

     protocols_generic
Partial

Fails protocol matching when method-scoped TypeVar is used in protocol.

Pass
Partial

Incorrectly generates type violation for protocol that uses method-scoped type variables.

Partial

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

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

Partial

Does not correctly enforce contravariance in protocol type compatibility tests.

Does not correctly enforce invariance in protocol type compatibility tests.

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

     callables_kwargs PassPass
Partial

Incorrectly handles assert_type for unpacked TypedDict.

Unsupported

Does not understand Unpack in the context of **kwargs annotation.

Unsupported

Does not understand Unpack in the context of **kwargs annotation.

     constructors_call_type
Partial

Does not validate call to custom metaclass __call__ method through type[T].

Pass
Partial

Fails to report error when passing incorrect arguments for metaclass __call__ method.

Pass
Partial

Does not validate call to custom metaclass __call__ method through type[T].

- - - + + diff --git a/conformance/tests/protocols_generic.py b/conformance/tests/protocols_generic.py index d3bbf8a0..95886428 100644 --- a/conformance/tests/protocols_generic.py +++ b/conformance/tests/protocols_generic.py @@ -142,6 +142,6 @@ def m(self, item: str, callback: Callable[[int], str]) -> str: hp1: HasPropertyProto = ConcreteHasProperty1() # OK -hp2: HasPropertyProto = ConcreteHasProperty2() # OK +hp2: HasPropertyProto = ConcreteHasProperty2() # E hp3: HasPropertyProto = ConcreteHasProperty3() # E hp4: HasPropertyProto = ConcreteHasProperty4() # E From f86459c750258648578acffe7c59f9f4ee033097 Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Mon, 14 Oct 2024 20:28:19 -0700 Subject: [PATCH 10/29] Updated conformance results for mypy 1.12. (#1866) * Fixes bugs that previously caused a crash when running generics_defaults and generics_syntax_declarations tests. * Fixes conformance issues in the following tests: aliases_type_statement, generics_paramspec_components, generics_syntax_declarations, generics_variance_inference, tuples_type_compat. * Adds support for functionality covered by tests: typeddicts_readonly, typeddicts_readonly_consistency, typeddicts_readonly_inheritance, typeddicts_readonly_kwargs, typeddicts_readonly_update. Fixed bugs in a couple of tests that were uncovered by mypy update. * The aliases_type_statement test assumed errors would be reported on a particular line. * The generics_syntax_declarations test assumed certain unspecified behaviors when evaluating the type of a type parameter. * The generics_variance_inference test was missing a return type annotation. --- .../results/mypy/aliases_explicit.toml | 3 +- .../results/mypy/aliases_type_statement.toml | 33 ++++---- .../results/mypy/aliases_typealiastype.toml | 3 +- .../results/mypy/generics_defaults.toml | 35 +++++++- .../mypy/generics_paramspec_components.toml | 3 +- .../mypy/generics_syntax_declarations.toml | 28 +++---- .../mypy/generics_variance_inference.toml | 22 +---- .../results/mypy/literals_literalstring.toml | 4 +- .../mypy/literals_parameterizations.toml | 2 +- .../results/mypy/qualifiers_annotated.toml | 3 +- .../mypy/qualifiers_final_annotation.toml | 2 +- .../results/mypy/tuples_type_compat.toml | 3 - .../results/mypy/typeddicts_readonly.toml | 36 ++------ .../mypy/typeddicts_readonly_consistency.toml | 16 ++-- .../mypy/typeddicts_readonly_inheritance.toml | 82 ++++--------------- .../mypy/typeddicts_readonly_kwargs.toml | 12 +-- .../mypy/typeddicts_readonly_update.toml | 14 ++-- .../results/mypy/typeddicts_required.toml | 4 +- conformance/results/mypy/version.toml | 4 +- .../results/pyre/aliases_type_statement.toml | 14 ++-- .../pyre/generics_syntax_declarations.toml | 20 ++--- conformance/results/pyre/version.toml | 2 +- .../pyright/aliases_type_statement.toml | 18 ++-- .../pyright/generics_syntax_declarations.toml | 22 ++--- conformance/results/pyright/version.toml | 2 +- .../pytype/aliases_type_statement.toml | 14 ++-- .../pytype/generics_syntax_declarations.toml | 20 ++--- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 30 +++---- conformance/src/type_checker.py | 10 --- conformance/tests/aliases_type_statement.py | 10 +-- .../tests/generics_syntax_declarations.py | 6 +- .../tests/generics_variance_inference.py | 4 +- 33 files changed, 198 insertions(+), 285 deletions(-) diff --git a/conformance/results/mypy/aliases_explicit.toml b/conformance/results/mypy/aliases_explicit.toml index bcf03a09..ee057629 100644 --- a/conformance/results/mypy/aliases_explicit.toml +++ b/conformance/results/mypy/aliases_explicit.toml @@ -12,7 +12,8 @@ aliases_explicit.py:79: error: Invalid type alias: expression is not a valid typ aliases_explicit.py:80: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_explicit.py:81: error: Invalid type alias: expression is not a valid type [valid-type] aliases_explicit.py:82: error: Invalid type alias: expression is not a valid type [valid-type] -aliases_explicit.py:83: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_explicit.py:83: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] +aliases_explicit.py:83: error: Name "b" is not defined [name-defined] aliases_explicit.py:84: error: Invalid type alias: expression is not a valid type [valid-type] aliases_explicit.py:85: error: Invalid type alias: expression is not a valid type [valid-type] aliases_explicit.py:86: error: Invalid type alias: expression is not a valid type [valid-type] diff --git a/conformance/results/mypy/aliases_type_statement.toml b/conformance/results/mypy/aliases_type_statement.toml index 536ef0ce..d33d0275 100644 --- a/conformance/results/mypy/aliases_type_statement.toml +++ b/conformance/results/mypy/aliases_type_statement.toml @@ -1,21 +1,20 @@ conformant = "Partial" notes = """ -Does not reject use of TypeAliasType as base class. -Does not reject redefinition of type alias defined with type statement. Does not reject type alias defined in function scope. -Does not reject type alias with circular definition. """ output = """ aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count" [attr-defined] aliases_type_statement.py:19: error: "TypeAliasType" not callable [operator] aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] +aliases_type_statement.py:26: error: Type alias defined using "type" statement not valid as base class [misc] aliases_type_statement.py:31: error: Parameterized generics cannot be used with class or instance checks [misc] aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "_ClassInfo" [arg-type] aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_type_statement.py:39: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:40: error: Invalid type alias: expression is not a valid type [valid-type] -aliases_type_statement.py:41: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_type_statement.py:41: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] +aliases_type_statement.py:41: error: Name "b" is not defined [name-defined] aliases_type_statement.py:42: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:43: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:44: error: Invalid type alias: expression is not a valid type [valid-type] @@ -25,22 +24,18 @@ aliases_type_statement.py:46: error: Invalid type: try using Literal[True] inste aliases_type_statement.py:47: error: Invalid type: try using Literal[1] instead? [valid-type] aliases_type_statement.py:48: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:49: error: Invalid type alias: expression is not a valid type [valid-type] -aliases_type_statement.py:54: error: Name "BadTypeAlias14" already defined on line 52 [no-redef] -aliases_type_statement.py:64: error: All type parameters should be declared ("V" not declared) [valid-type] -aliases_type_statement.py:69: error: All type parameters should be declared ("T1" not declared) [valid-type] -aliases_type_statement.py:79: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" [type-var] -aliases_type_statement.py:81: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" [type-var] -aliases_type_statement.py:84: error: Cannot resolve name "RecursiveTypeAlias3" (possible cyclic definition) [misc] -aliases_type_statement.py:86: error: Invalid recursive alias: a union item of itself [misc] -aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias6" (possible cyclic definition) [misc] -aliases_type_statement.py:90: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] -aliases_type_statement.py:91: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] +aliases_type_statement.py:52: error: Name "BadTypeAlias14" already defined on line 51 [no-redef] +aliases_type_statement.py:62: error: All type parameters should be declared ("V" not declared) [valid-type] +aliases_type_statement.py:67: error: All type parameters should be declared ("T1" not declared) [valid-type] +aliases_type_statement.py:77: error: Type argument "str" of "RecursiveTypeAlias2" must be a subtype of "int" [type-var] +aliases_type_statement.py:79: error: Type argument "int" of "RecursiveTypeAlias2" must be a subtype of "str" [type-var] +aliases_type_statement.py:82: error: Cannot resolve name "RecursiveTypeAlias3" (possible cyclic definition) [misc] +aliases_type_statement.py:84: error: Invalid recursive alias: a union item of itself [misc] +aliases_type_statement.py:88: error: Cannot resolve name "RecursiveTypeAlias6" (possible cyclic definition) [misc] +aliases_type_statement.py:88: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] +aliases_type_statement.py:89: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 26: Expected 1 errors -Line 52: Expected 1 errors -Line 58: Expected 1 errors -Line 54: Unexpected errors ['aliases_type_statement.py:54: error: Name "BadTypeAlias14" already defined on line 52 [no-redef]'] -Line 91: Unexpected errors ['aliases_type_statement.py:91: error: Cannot resolve name "RecursiveTypeAlias7" (possible cyclic definition) [misc]'] +Line 56: Expected 1 errors """ diff --git a/conformance/results/mypy/aliases_typealiastype.toml b/conformance/results/mypy/aliases_typealiastype.toml index fe6dd997..078f9961 100644 --- a/conformance/results/mypy/aliases_typealiastype.toml +++ b/conformance/results/mypy/aliases_typealiastype.toml @@ -23,7 +23,8 @@ aliases_typealiastype.py:52: error: Invalid type alias: expression is not a vali aliases_typealiastype.py:53: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_typealiastype.py:54: error: Invalid type alias: expression is not a valid type [valid-type] aliases_typealiastype.py:55: error: Invalid type alias: expression is not a valid type [valid-type] -aliases_typealiastype.py:56: error: Invalid type alias: expression is not a valid type [valid-type] +aliases_typealiastype.py:56: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] +aliases_typealiastype.py:56: error: Name "b" is not defined [name-defined] aliases_typealiastype.py:57: error: Invalid type alias: expression is not a valid type [valid-type] aliases_typealiastype.py:58: error: Invalid type alias: expression is not a valid type [valid-type] aliases_typealiastype.py:59: error: Invalid type alias: expression is not a valid type [valid-type] diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index 19633b6f..b8fb5b0f 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -1,11 +1,42 @@ conformant = "Unsupported" output = """ +generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] +generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] +generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] +generics_defaults.py:38: error: Expression is of type "type[OneDefault[Any, Any]]", not "type[OneDefault[float, bool]]" [assert-type] +generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type] +generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:50: error: Type application has too few types (expected between 2 and 5) [misc] +generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type] +generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Any]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type] +generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*tuple[Any, ...]]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type] +generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type] +generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type] +generics_defaults.py:152: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] +generics_defaults.py:166: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type] +generics_defaults.py:167: error: Expression is of type "Any", not "int" [assert-type] +generics_defaults.py:167: error: Access to generic instance variables via class is ambiguous [misc] """ 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 30: Unexpected errors ['generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] +Line 31: Unexpected errors ['generics_defaults.py:31: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type]'] +Line 38: Unexpected errors ['generics_defaults.py:38: error: Expression is of type "type[OneDefault[Any, Any]]", not "type[OneDefault[float, bool]]" [assert-type]'] +Line 45: Unexpected errors ['generics_defaults.py:45: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[Any, Any, str, int, bool]]" [assert-type]'] +Line 46: Unexpected errors ['generics_defaults.py:46: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 52: Unexpected errors ['generics_defaults.py:52: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 55: Unexpected errors ['generics_defaults.py:55: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 59: Unexpected errors ['generics_defaults.py:59: error: Expression is of type "type[AllTheDefaults[Any, Any, Any, Any, Any]]", not "type[AllTheDefaults[int, complex, str, int, bool]]" [assert-type]'] +Line 79: Unexpected errors ['generics_defaults.py:79: error: Expression is of type "type[Class_ParamSpec[Any]]", not "type[Class_ParamSpec[[str, int]]]" [assert-type]'] +Line 94: Unexpected errors ['generics_defaults.py:94: error: Expression is of type "type[Class_TypeVarTuple[*tuple[Any, ...]]]", not "type[Class_TypeVarTuple[str, int]]" [assert-type]'] +Line 151: Unexpected errors ['generics_defaults.py:151: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [float, bool]]]" [assert-type]', 'generics_defaults.py:151: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 152: Unexpected errors ['generics_defaults.py:152: error: Expression is of type "type[Foo6[*tuple[Any, ...], Any]]", not "type[Foo6[int, str, [bytes]]]" [assert-type]', 'generics_defaults.py:152: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 166: Unexpected errors ['generics_defaults.py:166: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [assert-type]'] +Line 167: Unexpected errors ['generics_defaults.py:167: error: Expression is of type "Any", not "int" [assert-type]', 'generics_defaults.py:167: error: Access to generic instance variables via class is ambiguous [misc]'] """ diff --git a/conformance/results/mypy/generics_paramspec_components.toml b/conformance/results/mypy/generics_paramspec_components.toml index 0cfb13a9..66a386ad 100644 --- a/conformance/results/mypy/generics_paramspec_components.toml +++ b/conformance/results/mypy/generics_paramspec_components.toml @@ -4,7 +4,6 @@ Does not report illegal use of "P.args" on normal parameter. Does not report error when P.args is specified but P.kwargs is missing. Does not report error when P is out of scope and P.args and P.kwargs is used. Does not report error when keyword argument is specified between P.args and P.kwargs. -Does not report error when calling callable and argument is missing for concatenated parameters. """ output = """ generics_paramspec_components.py:17: error: Use "P.args" for variadic "*" parameter [valid-type] @@ -15,6 +14,7 @@ generics_paramspec_components.py:49: error: Argument 2 has incompatible type "** generics_paramspec_components.py:51: error: Argument 1 has incompatible type "int"; expected "P.args" [arg-type] generics_paramspec_components.py:70: error: Argument 1 has incompatible type "*P.args"; expected "int" [arg-type] generics_paramspec_components.py:70: error: Argument 2 has incompatible type "int"; expected "P.args" [arg-type] +generics_paramspec_components.py:72: error: Argument 1 has incompatible type "*P.args"; expected "int" [arg-type] generics_paramspec_components.py:83: error: "foo" gets multiple values for keyword argument "x" [misc] generics_paramspec_components.py:83: error: Argument 1 to "foo" has incompatible type "*P.args"; expected "int" [arg-type] generics_paramspec_components.py:83: error: Argument 3 to "foo" has incompatible type "**P.kwargs"; expected "int" [arg-type] @@ -31,5 +31,4 @@ Line 36: Expected 1 errors Line 38: Expected 1 errors Line 41: Expected 1 errors Line 60: Expected 1 errors -Line 72: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_syntax_declarations.toml b/conformance/results/mypy/generics_syntax_declarations.toml index 91b06d4a..66d51c93 100644 --- a/conformance/results/mypy/generics_syntax_declarations.toml +++ b/conformance/results/mypy/generics_syntax_declarations.toml @@ -1,19 +1,17 @@ -conformant = "Partial" -notes = """ -Does not detect many illegal usages of type parameter syntax. -""" +conformant = "Pass" output = """ +generics_syntax_declarations.py:17: error: Generic[...] base class is redundant [misc] +generics_syntax_declarations.py:25: error: No arguments expected for "Protocol" base class [misc] +generics_syntax_declarations.py:32: error: "T" has no attribute "is_integer" [attr-defined] +generics_syntax_declarations.py:44: error: Name "V" is not defined [name-defined] +generics_syntax_declarations.py:48: error: Bracketed expression "[...]" is not valid as a type [valid-type] +generics_syntax_declarations.py:60: error: Type variable must have at least two constrained types [misc] +generics_syntax_declarations.py:64: error: Type variable must have at least two constrained types [misc] +generics_syntax_declarations.py:71: error: Variable "generics_syntax_declarations.t1" is not valid as a type [valid-type] +generics_syntax_declarations.py:71: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_declarations.py:75: error: Invalid type: try using Literal[3] instead? [valid-type] +generics_syntax_declarations.py:79: error: Name "S" is not defined [name-defined] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 19: Expected 1 errors -Line 27: Expected 1 errors -Line 34: Expected 1 errors -Line 46: Expected 1 errors -Line 50: Expected 1 errors -Line 62: Expected 1 errors -Line 66: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 81: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_variance_inference.toml b/conformance/results/mypy/generics_variance_inference.toml index 57189510..b1158c7e 100644 --- a/conformance/results/mypy/generics_variance_inference.toml +++ b/conformance/results/mypy/generics_variance_inference.toml @@ -1,20 +1,12 @@ -conformant = "Partial" -notes = """ -Computes incorrect variance in some cases. -""" +conformant = "Pass" output = """ generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") [assignment] generics_variance_inference.py:25: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[float, float, int]") [assignment] generics_variance_inference.py:28: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, int]") [assignment] -generics_variance_inference.py:29: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, float]") [assignment] generics_variance_inference.py:41: error: Incompatible types in assignment (expression has type "ShouldBeCovariant1[float]", variable has type "ShouldBeCovariant1[int]") [assignment] -generics_variance_inference.py:48: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract] -generics_variance_inference.py:49: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract] generics_variance_inference.py:49: error: Incompatible types in assignment (expression has type "ShouldBeCovariant2[float]", variable has type "ShouldBeCovariant2[int]") [assignment] generics_variance_inference.py:58: error: Incompatible types in assignment (expression has type "ShouldBeCovariant3[float]", variable has type "ShouldBeCovariant3[int]") [assignment] -generics_variance_inference.py:66: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[int]", variable has type "ShouldBeCovariant4[float]") [assignment] generics_variance_inference.py:67: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[float]", variable has type "ShouldBeCovariant4[int]") [assignment] -generics_variance_inference.py:79: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[int]", variable has type "ShouldBeCovariant5[float]") [assignment] generics_variance_inference.py:80: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[float]", variable has type "ShouldBeCovariant5[int]") [assignment] generics_variance_inference.py:96: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[int]", variable has type "ShouldBeInvariant1[float]") [assignment] generics_variance_inference.py:97: error: Incompatible types in assignment (expression has type "ShouldBeInvariant1[float]", variable has type "ShouldBeInvariant1[int]") [assignment] @@ -28,16 +20,10 @@ generics_variance_inference.py:130: error: Incompatible types in assignment (exp generics_variance_inference.py:138: error: Incompatible types in assignment (expression has type "ShouldBeInvariant5[int]", variable has type "ShouldBeInvariant5[float]") [assignment] generics_variance_inference.py:149: error: Incompatible types in assignment (expression has type "ShouldBeContravariant1[int]", variable has type "ShouldBeContravariant1[float]") [assignment] generics_variance_inference.py:169: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[float]", variable has type "ShouldBeInvariant6[int]") [assignment] +generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") [assignment] generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] -generics_variance_inference.py:193: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[float]", variable has type "ShouldBeContravariant2[int]") [assignment] +generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") [assignment] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 170: Expected 1 errors -Line 194: Expected 1 errors -Line 29: Unexpected errors ['generics_variance_inference.py:29: error: Incompatible types in assignment (expression has type "ClassA[int, float, float]", variable has type "ClassA[int, int, float]") [assignment]'] -Line 48: Unexpected errors ['generics_variance_inference.py:48: error: Cannot instantiate abstract class "ShouldBeCovariant2" with abstract attributes "__getitem__" and "__len__" [abstract]'] -Line 66: Unexpected errors ['generics_variance_inference.py:66: error: Incompatible types in assignment (expression has type "ShouldBeCovariant4[int]", variable has type "ShouldBeCovariant4[float]") [assignment]'] -Line 79: Unexpected errors ['generics_variance_inference.py:79: error: Incompatible types in assignment (expression has type "ShouldBeCovariant5[int]", variable has type "ShouldBeCovariant5[float]") [assignment]'] -Line 193: Unexpected errors ['generics_variance_inference.py:193: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[float]", variable has type "ShouldBeContravariant2[int]") [assignment]'] """ diff --git a/conformance/results/mypy/literals_literalstring.toml b/conformance/results/mypy/literals_literalstring.toml index b6554e3f..5258d254 100644 --- a/conformance/results/mypy/literals_literalstring.toml +++ b/conformance/results/mypy/literals_literalstring.toml @@ -8,7 +8,7 @@ literals_literalstring.py:37: error: Parameter 1 of Literal[...] is invalid [va literals_literalstring.py:43: error: Incompatible types in assignment (expression has type "Literal['two']", variable has type "Literal['']") [assignment] literals_literalstring.py:74: error: Incompatible types in assignment (expression has type "int", variable has type "str") [assignment] literals_literalstring.py:75: error: Incompatible types in assignment (expression has type "bytes", variable has type "str") [assignment] -literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [misc] +literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match] literals_literalstring.py:167: error: Expression is of type "B", not "A" [assert-type] """ conformance_automated = "Fail" @@ -17,6 +17,6 @@ Line 66: Expected 1 errors Line 120: Expected 1 errors Line 134: Expected 1 errors Line 171: Expected 1 errors -Line 157: Unexpected errors ["literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [misc]"] +Line 157: Unexpected errors ["literals_literalstring.py:157: error: Overloaded function signature 3 will never be matched: signature 2's parameter type(s) are the same or broader [overload-cannot-match]"] Line 167: Unexpected errors ['literals_literalstring.py:167: error: Expression is of type "B", not "A" [assert-type]'] """ diff --git a/conformance/results/mypy/literals_parameterizations.toml b/conformance/results/mypy/literals_parameterizations.toml index b5a99264..730d531d 100644 --- a/conformance/results/mypy/literals_parameterizations.toml +++ b/conformance/results/mypy/literals_parameterizations.toml @@ -8,7 +8,7 @@ literals_parameterizations.py:42: error: Invalid type: Literal[...] cannot conta literals_parameterizations.py:43: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] literals_parameterizations.py:44: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] literals_parameterizations.py:45: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] -literals_parameterizations.py:47: error: Invalid type: Literal[...] cannot contain arbitrary expressions [valid-type] +literals_parameterizations.py:47: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_parameterizations.py:48: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_parameterizations.py:49: error: Parameter 1 of Literal[...] is invalid [valid-type] literals_parameterizations.py:50: error: Parameter 1 of Literal[...] is invalid [valid-type] diff --git a/conformance/results/mypy/qualifiers_annotated.toml b/conformance/results/mypy/qualifiers_annotated.toml index 289e9d8b..f2a37363 100644 --- a/conformance/results/mypy/qualifiers_annotated.toml +++ b/conformance/results/mypy/qualifiers_annotated.toml @@ -11,7 +11,8 @@ qualifiers_annotated.py:43: error: Bracketed expression "[...]" is not valid as qualifiers_annotated.py:44: error: Syntax error in type annotation [syntax] qualifiers_annotated.py:44: note: Suggestion: Is there a spurious trailing comma? qualifiers_annotated.py:45: error: Invalid type comment or annotation [valid-type] -qualifiers_annotated.py:46: error: Invalid type comment or annotation [valid-type] +qualifiers_annotated.py:46: error: Inline TypedDict is experimental, must be enabled with --enable-incomplete-feature=InlineTypedDict [misc] +qualifiers_annotated.py:46: error: Name "b" is not defined [name-defined] qualifiers_annotated.py:47: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:48: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:49: error: Invalid type comment or annotation [valid-type] diff --git a/conformance/results/mypy/qualifiers_final_annotation.toml b/conformance/results/mypy/qualifiers_final_annotation.toml index eecb8fd0..d0898be4 100644 --- a/conformance/results/mypy/qualifiers_final_annotation.toml +++ b/conformance/results/mypy/qualifiers_final_annotation.toml @@ -33,7 +33,7 @@ qualifiers_final_annotation.py:135: error: Unexpected keyword argument "y" for " qualifiers_final_annotation.py:141: error: Cannot assign to final name "ID1" [misc] qualifiers_final_annotation.py:145: error: Cannot assign to final name "x" [misc] qualifiers_final_annotation.py:147: error: Cannot assign to final name "x" [misc] -qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper", variable has type "int") [assignment] +qualifiers_final_annotation.py:152: error: Incompatible types in assignment (expression has type "TextIOWrapper[_WrappedBuffer]", variable has type "int") [assignment] qualifiers_final_annotation.py:155: error: Cannot assign to final name "x" [misc] """ conformance_automated = "Fail" diff --git a/conformance/results/mypy/tuples_type_compat.toml b/conformance/results/mypy/tuples_type_compat.toml index 55d7bf4d..3882ed3f 100644 --- a/conformance/results/mypy/tuples_type_compat.toml +++ b/conformance/results/mypy/tuples_type_compat.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ Does not support tuple narrowing based on `len()` type guard (optional). -Incorrectly narrows tuple based on sequence patterns. """ output = """ tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") [assignment] @@ -13,7 +12,6 @@ tuples_type_compat.py:62: error: Incompatible types in assignment (expression ha tuples_type_compat.py:95: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int]" [assert-type] tuples_type_compat.py:99: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[str, str] | tuple[int, int]" [assert-type] tuples_type_compat.py:103: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int, str, int]" [assert-type] -tuples_type_compat.py:117: error: Expression is of type "tuple[Never, int]", not "tuple[int | str, int]" [assert-type] tuples_type_compat.py:136: error: Expression is of type "Sequence[object]", not "Sequence[complex | list[int]]" [assert-type] tuples_type_compat.py:139: error: Expression is of type "Sequence[object]", not "Sequence[int | str]" [assert-type] tuples_type_compat.py:144: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") [assignment] @@ -32,7 +30,6 @@ errors_diff = """ Line 95: Unexpected errors ['tuples_type_compat.py:95: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int]" [assert-type]'] Line 99: Unexpected errors ['tuples_type_compat.py:99: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[str, str] | tuple[int, int]" [assert-type]'] Line 103: Unexpected errors ['tuples_type_compat.py:103: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]", not "tuple[int, str, int]" [assert-type]'] -Line 117: Unexpected errors ['tuples_type_compat.py:117: error: Expression is of type "tuple[Never, int]", not "tuple[int | str, int]" [assert-type]'] Line 136: Unexpected errors ['tuples_type_compat.py:136: error: Expression is of type "Sequence[object]", not "Sequence[complex | list[int]]" [assert-type]'] Line 139: Unexpected errors ['tuples_type_compat.py:139: error: Expression is of type "Sequence[object]", not "Sequence[int | str]" [assert-type]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly.toml b/conformance/results/mypy/typeddicts_readonly.toml index 8af1a3a9..6dc58bb6 100644 --- a/conformance/results/mypy/typeddicts_readonly.toml +++ b/conformance/results/mypy/typeddicts_readonly.toml @@ -1,35 +1,17 @@ -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Incorrectly rejects NotRequired directive when used in an Annotated annotation. +""" output = """ -typeddicts_readonly.py:18: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:18: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly.py:25: error: "ReadOnly?[builtins.list[builtins.str]]" has no attribute "append" [attr-defined] -typeddicts_readonly.py:31: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:31: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly.py:37: error: "ReadOnly?[builtins.list[builtins.str]]" has no attribute "append" [attr-defined] -typeddicts_readonly.py:45: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:45: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly.py:45: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly.py:46: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:46: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly.py:46: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly.py:55: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly.py:55: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +typeddicts_readonly.py:24: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:36: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:50: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:51: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_readonly.py:60: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] """ conformance_automated = "Fail" errors_diff = """ -Line 24: Expected 1 errors -Line 36: Expected 1 errors -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: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 25: Unexpected errors ['typeddicts_readonly.py:25: error: "ReadOnly?[builtins.list[builtins.str]]" has no attribute "append" [attr-defined]'] -Line 31: Unexpected errors ['typeddicts_readonly.py:31: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 37: Unexpected errors ['typeddicts_readonly.py:37: error: "ReadOnly?[builtins.list[builtins.str]]" has no attribute "append" [attr-defined]'] -Line 45: Unexpected errors ['typeddicts_readonly.py:45: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly.py:45: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 46: Unexpected errors ['typeddicts_readonly.py:46: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly.py:46: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 55: Unexpected errors ['typeddicts_readonly.py:55: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] Line 56: Unexpected errors ['typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_consistency.toml b/conformance/results/mypy/typeddicts_readonly_consistency.toml index 9228d163..ea01b2dc 100644 --- a/conformance/results/mypy/typeddicts_readonly_consistency.toml +++ b/conformance/results/mypy/typeddicts_readonly_consistency.toml @@ -1,24 +1,18 @@ -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Incorrectly rejects assignment of required item to not-required read-only item. +""" output = """ -typeddicts_readonly_consistency.py:30: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_consistency.py:30: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_consistency.py:30: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_consistency.py:37: error: Incompatible types in assignment (expression has type "A1", variable has type "B1") [assignment] typeddicts_readonly_consistency.py:38: error: Incompatible types in assignment (expression has type "C1", variable has type "B1") [assignment] typeddicts_readonly_consistency.py:40: error: Incompatible types in assignment (expression has type "A1", variable has type "C1") [assignment] -typeddicts_readonly_consistency.py:41: error: Incompatible types in assignment (expression has type "B1", variable has type "C1") [assignment] -typeddicts_readonly_consistency.py:66: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_consistency.py:66: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment] +typeddicts_readonly_consistency.py:81: error: Incompatible types in assignment (expression has type "A2", variable has type "B2") [assignment] typeddicts_readonly_consistency.py:82: error: Incompatible types in assignment (expression has type "C2", variable has type "B2") [assignment] typeddicts_readonly_consistency.py:84: error: Incompatible types in assignment (expression has type "A2", variable has type "C2") [assignment] typeddicts_readonly_consistency.py:85: error: Incompatible types in assignment (expression has type "B2", variable has type "C2") [assignment] """ conformance_automated = "Fail" errors_diff = """ -Line 81: Expected 1 errors -Line 30: Unexpected errors ['typeddicts_readonly_consistency.py:30: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_consistency.py:30: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 41: Unexpected errors ['typeddicts_readonly_consistency.py:41: error: Incompatible types in assignment (expression has type "B1", variable has type "C1") [assignment]'] -Line 66: Unexpected errors ['typeddicts_readonly_consistency.py:66: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] Line 79: Unexpected errors ['typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_inheritance.toml b/conformance/results/mypy/typeddicts_readonly_inheritance.toml index 609c0abf..46bc4ce0 100644 --- a/conformance/results/mypy/typeddicts_readonly_inheritance.toml +++ b/conformance/results/mypy/typeddicts_readonly_inheritance.toml @@ -1,91 +1,39 @@ -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Incorrectly rejects non-ReadOnly override of ReadOnly item. +Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type. +Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item. +""" output = """ -typeddicts_readonly_inheritance.py:15: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:15: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc] -typeddicts_readonly_inheritance.py:43: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:43: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:44: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +typeddicts_readonly_inheritance.py:25: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly_inheritance.py:36: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc] -typeddicts_readonly_inheritance.py:49: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:49: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_inheritance.py:50: error: Overwriting TypedDict field "alt" while extending [misc] -typeddicts_readonly_inheritance.py:50: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:50: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:58: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:58: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:58: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc] -typeddicts_readonly_inheritance.py:62: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:62: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:62: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:65: error: Missing key "name" for TypedDict "RequiredName" [typeddict-item] -typeddicts_readonly_inheritance.py:72: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:72: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:72: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc] +typeddicts_readonly_inheritance.py:81: error: ReadOnly TypedDict key "ident" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly_inheritance.py:82: error: ReadOnly TypedDict key "ident" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly_inheritance.py:82: error: Value of "ident" has incompatible type "int"; expected "str" [typeddict-item] typeddicts_readonly_inheritance.py:83: error: Incompatible types (expression has type "int", TypedDict item "ident" has type "str") [typeddict-item] typeddicts_readonly_inheritance.py:84: error: Missing key "ident" for TypedDict "User" [typeddict-item] -typeddicts_readonly_inheritance.py:89: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:89: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:89: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:90: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:90: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:94: error: Overwriting TypedDict field "a" while extending [misc] -typeddicts_readonly_inheritance.py:94: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_inheritance.py:98: error: Overwriting TypedDict field "a" while extending [misc] typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc] -typeddicts_readonly_inheritance.py:102: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:102: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:102: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:106: error: Overwriting TypedDict field "c" while extending [misc] -typeddicts_readonly_inheritance.py:106: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:106: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:106: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:111: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:111: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:116: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:116: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "x" while merging [misc] typeddicts_readonly_inheritance.py:119: error: Overwriting TypedDict field "y" while merging [misc] -typeddicts_readonly_inheritance.py:123: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:123: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:123: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:124: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:124: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:124: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:128: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:128: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:128: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_readonly_inheritance.py:129: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_inheritance.py:129: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_inheritance.py:129: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "x" while merging [misc] typeddicts_readonly_inheritance.py:132: error: Overwriting TypedDict field "y" while merging [misc] """ conformance_automated = "Fail" errors_diff = """ -Line 36: Expected 1 errors -Line 15: Unexpected errors ['typeddicts_readonly_inheritance.py:15: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] Line 19: Unexpected errors ['typeddicts_readonly_inheritance.py:19: error: Overwriting TypedDict field "name" while extending [misc]'] -Line 43: Unexpected errors ['typeddicts_readonly_inheritance.py:43: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 44: Unexpected errors ['typeddicts_readonly_inheritance.py:44: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc]', 'typeddicts_readonly_inheritance.py:49: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 58: Unexpected errors ['typeddicts_readonly_inheritance.py:58: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:58: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc]', 'typeddicts_readonly_inheritance.py:62: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:62: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 72: Unexpected errors ['typeddicts_readonly_inheritance.py:72: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:72: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] +Line 25: Unexpected errors ['typeddicts_readonly_inheritance.py:25: error: ReadOnly TypedDict key "name" TypedDict is mutated [typeddict-readonly-mutated]'] +Line 49: Unexpected errors ['typeddicts_readonly_inheritance.py:49: error: Overwriting TypedDict field "albums" while extending [misc]'] +Line 62: Unexpected errors ['typeddicts_readonly_inheritance.py:62: error: Overwriting TypedDict field "name" while extending [misc]'] Line 76: Unexpected errors ['typeddicts_readonly_inheritance.py:76: error: Overwriting TypedDict field "ident" while extending [misc]'] -Line 89: Unexpected errors ['typeddicts_readonly_inheritance.py:89: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:89: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 90: Unexpected errors ['typeddicts_readonly_inheritance.py:90: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:90: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc]', 'typeddicts_readonly_inheritance.py:102: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:102: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 111: Unexpected errors ['typeddicts_readonly_inheritance.py:111: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 116: Unexpected errors ['typeddicts_readonly_inheritance.py:116: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 123: Unexpected errors ['typeddicts_readonly_inheritance.py:123: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:123: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] -Line 124: Unexpected errors ['typeddicts_readonly_inheritance.py:124: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:124: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 128: Unexpected errors ['typeddicts_readonly_inheritance.py:128: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:128: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 129: Unexpected errors ['typeddicts_readonly_inheritance.py:129: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]', 'typeddicts_readonly_inheritance.py:129: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] +Line 81: Unexpected errors ['typeddicts_readonly_inheritance.py:81: error: ReadOnly TypedDict key "ident" TypedDict is mutated [typeddict-readonly-mutated]'] +Line 102: Unexpected errors ['typeddicts_readonly_inheritance.py:102: error: Overwriting TypedDict field "b" while extending [misc]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_kwargs.toml b/conformance/results/mypy/typeddicts_readonly_kwargs.toml index cc8dcd74..a90e015f 100644 --- a/conformance/results/mypy/typeddicts_readonly_kwargs.toml +++ b/conformance/results/mypy/typeddicts_readonly_kwargs.toml @@ -1,13 +1,7 @@ -conformant = "Unsupported" +conformant = "Pass" output = """ -typeddicts_readonly_kwargs.py:24: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_kwargs.py:24: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_kwargs.py:25: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_kwargs.py:25: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +typeddicts_readonly_kwargs.py:33: error: ReadOnly TypedDict key "key1" TypedDict is mutated [typeddict-readonly-mutated] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 33: Expected 1 errors -Line 24: Unexpected errors ['typeddicts_readonly_kwargs.py:24: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 25: Unexpected errors ['typeddicts_readonly_kwargs.py:25: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_update.toml b/conformance/results/mypy/typeddicts_readonly_update.toml index dfb56389..c53706fc 100644 --- a/conformance/results/mypy/typeddicts_readonly_update.toml +++ b/conformance/results/mypy/typeddicts_readonly_update.toml @@ -1,13 +1,13 @@ -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Incorrectly allows update of ReadOnly item. +Incorrectly rejects update involving an item with Never type. +""" output = """ -typeddicts_readonly_update.py:17: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_update.py:17: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases -typeddicts_readonly_update.py:30: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type] -typeddicts_readonly_update.py:30: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +typeddicts_readonly_update.py:34: error: Argument 1 to "update" of "TypedDict" has incompatible type "B"; expected "TypedDict({'x'?=: int, 'y': int})" [typeddict-item] """ conformance_automated = "Fail" errors_diff = """ Line 23: Expected 1 errors -Line 17: Unexpected errors ['typeddicts_readonly_update.py:17: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] -Line 30: Unexpected errors ['typeddicts_readonly_update.py:30: error: Variable "typing_extensions.ReadOnly" is not valid as a type [valid-type]'] +Line 34: Unexpected errors ['typeddicts_readonly_update.py:34: error: Argument 1 to "update" of "TypedDict" has incompatible type "B"; expected "TypedDict({\\'x\\'?=: int, \\'y\\': int})" [typeddict-item]'] """ diff --git a/conformance/results/mypy/typeddicts_required.toml b/conformance/results/mypy/typeddicts_required.toml index 885bf857..7cf6994d 100644 --- a/conformance/results/mypy/typeddicts_required.toml +++ b/conformance/results/mypy/typeddicts_required.toml @@ -5,8 +5,8 @@ Does not support nesting of `Annotated` and `Required` or `NotRequired`. output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:62: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:63: error: NotRequired[] can be only used in a TypedDict definition [valid-type] +typeddicts_required.py:62: error: "Required[]" type cannot be nested [valid-type] +typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [valid-type] typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index f2673d1c..cdbafd59 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.11.2" -test_duration = 1.6 +version = "mypy 1.12.0" +test_duration = 1.7 diff --git a/conformance/results/pyre/aliases_type_statement.toml b/conformance/results/pyre/aliases_type_statement.toml index 02d923e1..31559fcb 100644 --- a/conformance/results/pyre/aliases_type_statement.toml +++ b/conformance/results/pyre/aliases_type_statement.toml @@ -25,14 +25,14 @@ Line 46: Expected 1 errors Line 47: Expected 1 errors Line 48: Expected 1 errors Line 49: Expected 1 errors -Line 52: Expected 1 errors -Line 58: Expected 1 errors -Line 64: Expected 1 errors -Line 69: Expected 1 errors +Line 56: Expected 1 errors +Line 62: Expected 1 errors +Line 67: Expected 1 errors +Line 77: Expected 1 errors Line 79: Expected 1 errors -Line 81: Expected 1 errors +Line 82: Expected 1 errors Line 84: Expected 1 errors -Line 86: Expected 1 errors -Line 90: Expected 1 errors +Lines 51, 52: Expected error (tag 'TA14') +Lines 88, 89: Expected error (tag 'RTA6') Line 8: Unexpected errors ['aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/generics_syntax_declarations.toml b/conformance/results/pyre/generics_syntax_declarations.toml index 59b938d5..41081106 100644 --- a/conformance/results/pyre/generics_syntax_declarations.toml +++ b/conformance/results/pyre/generics_syntax_declarations.toml @@ -7,15 +7,15 @@ generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax """ conformance_automated = "Fail" errors_diff = """ -Line 19: Expected 1 errors -Line 27: Expected 1 errors -Line 34: Expected 1 errors -Line 46: Expected 1 errors -Line 50: Expected 1 errors -Line 62: Expected 1 errors -Line 66: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 81: Expected 1 errors +Line 17: Expected 1 errors +Line 25: Expected 1 errors +Line 32: Expected 1 errors +Line 44: Expected 1 errors +Line 48: Expected 1 errors +Line 60: Expected 1 errors +Line 64: Expected 1 errors +Line 71: Expected 1 errors +Line 75: Expected 1 errors +Line 79: Expected 1 errors Line 13: Unexpected errors ['generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax'] """ diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index f4f08845..4c6e1161 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 4.5 +test_duration = 4.6 diff --git a/conformance/results/pyright/aliases_type_statement.toml b/conformance/results/pyright/aliases_type_statement.toml index ee9f8f7c..4556366e 100644 --- a/conformance/results/pyright/aliases_type_statement.toml +++ b/conformance/results/pyright/aliases_type_statement.toml @@ -36,19 +36,19 @@ aliases_type_statement.py:46:23 - error: Expected class but received "Literal[Tr aliases_type_statement.py:47:23 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_type_statement.py:48:23 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) aliases_type_statement.py:49:23 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) -aliases_type_statement.py:52:10 - error: Type alias declaration "BadTypeAlias14" is obscured by a declaration of the same name (reportRedeclaration) -aliases_type_statement.py:58:10 - error: A type statement can be used only within a module or class scope (reportGeneralTypeIssues) -aliases_type_statement.py:64:23 - error: Type parameter "V" is not included in the type parameter list for "TA1" (reportGeneralTypeIssues) -aliases_type_statement.py:69:17 - error: Type parameter "T1" is not included in the type parameter list for "TA2" (reportGeneralTypeIssues) -aliases_type_statement.py:79:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" +aliases_type_statement.py:51:6 - error: Type alias declaration "BadTypeAlias14" is obscured by a declaration of the same name (reportRedeclaration) +aliases_type_statement.py:56:10 - error: A type statement can be used only within a module or class scope (reportGeneralTypeIssues) +aliases_type_statement.py:62:23 - error: Type parameter "V" is not included in the type parameter list for "TA1" (reportGeneralTypeIssues) +aliases_type_statement.py:67:17 - error: Type parameter "T1" is not included in the type parameter list for "TA2" (reportGeneralTypeIssues) +aliases_type_statement.py:77:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]"   Type "str" is not assignable to type "int"     "str" is not assignable to "int" (reportInvalidTypeForm) -aliases_type_statement.py:81:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]" +aliases_type_statement.py:79:7 - error: Could not specialize type "RecursiveTypeAlias2[S@RecursiveTypeAlias2, T@RecursiveTypeAlias2, P@RecursiveTypeAlias2]"   Type "int" is not assignable to type "str"     "int" is not assignable to "str" (reportInvalidTypeForm) -aliases_type_statement.py:84:28 - error: Type alias "RecursiveTypeAlias3" cannot use itself in its definition (reportGeneralTypeIssues) -aliases_type_statement.py:86:31 - error: Type alias "RecursiveTypeAlias4" cannot use itself in its definition (reportGeneralTypeIssues) -aliases_type_statement.py:90:28 - error: Type alias "RecursiveTypeAlias6" cannot use itself in its definition (reportGeneralTypeIssues) +aliases_type_statement.py:82:28 - error: Type alias "RecursiveTypeAlias3" cannot use itself in its definition (reportGeneralTypeIssues) +aliases_type_statement.py:84:31 - error: Type alias "RecursiveTypeAlias4" cannot use itself in its definition (reportGeneralTypeIssues) +aliases_type_statement.py:88:28 - error: Type alias "RecursiveTypeAlias6" cannot use itself in its definition (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_syntax_declarations.toml b/conformance/results/pyright/generics_syntax_declarations.toml index 4321bdb3..25db9152 100644 --- a/conformance/results/pyright/generics_syntax_declarations.toml +++ b/conformance/results/pyright/generics_syntax_declarations.toml @@ -1,18 +1,18 @@ conformant = "Pass" output = """ -generics_syntax_declarations.py:19:17 - error: "Generic" base class cannot be used with type parameter syntax (reportGeneralTypeIssues) -generics_syntax_declarations.py:27:20 - error: Type arguments are not allowed with Protocol class when using type parameter syntax (reportGeneralTypeIssues) -generics_syntax_declarations.py:34:11 - error: Cannot access attribute "is_integer" for class "str*" +generics_syntax_declarations.py:17:17 - error: "Generic" base class cannot be used with type parameter syntax (reportGeneralTypeIssues) +generics_syntax_declarations.py:25:20 - error: Type arguments are not allowed with Protocol class when using type parameter syntax (reportGeneralTypeIssues) +generics_syntax_declarations.py:32:11 - error: Cannot access attribute "is_integer" for class "str*"   Attribute "is_integer" is unknown (reportAttributeAccessIssue) -generics_syntax_declarations.py:46:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) -generics_syntax_declarations.py:50:17 - error: List expression not allowed in type expression +generics_syntax_declarations.py:44:21 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) +generics_syntax_declarations.py:48:17 - error: List expression not allowed in type expression   Use List[T] to indicate a list type or Union[T1, T2] to indicate a union type (reportInvalidTypeForm) -generics_syntax_declarations.py:50:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) -generics_syntax_declarations.py:62:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) -generics_syntax_declarations.py:66:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) -generics_syntax_declarations.py:73:17 - error: Variable not allowed in type expression (reportInvalidTypeForm) -generics_syntax_declarations.py:77:18 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) -generics_syntax_declarations.py:81:23 - error: "S" is not defined (reportUndefinedVariable) +generics_syntax_declarations.py:48:17 - error: Expected class but received "list[Unknown]" (reportGeneralTypeIssues) +generics_syntax_declarations.py:60:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) +generics_syntax_declarations.py:64:17 - error: TypeVar must have at least two constrained types (reportGeneralTypeIssues) +generics_syntax_declarations.py:71:17 - error: Variable not allowed in type expression (reportInvalidTypeForm) +generics_syntax_declarations.py:75:18 - error: Expected class but received "Literal[3]" (reportGeneralTypeIssues) +generics_syntax_declarations.py:79:23 - error: "S" is not defined (reportUndefinedVariable) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 17fcd913..a90f554c 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.384" -test_duration = 1.2 +test_duration = 1.3 diff --git a/conformance/results/pytype/aliases_type_statement.toml b/conformance/results/pytype/aliases_type_statement.toml index cd7ae295..84f4bc31 100644 --- a/conformance/results/pytype/aliases_type_statement.toml +++ b/conformance/results/pytype/aliases_type_statement.toml @@ -25,13 +25,13 @@ Line 46: Expected 1 errors Line 47: Expected 1 errors Line 48: Expected 1 errors Line 49: Expected 1 errors -Line 52: Expected 1 errors -Line 58: Expected 1 errors -Line 64: Expected 1 errors -Line 69: Expected 1 errors +Line 56: Expected 1 errors +Line 62: Expected 1 errors +Line 67: Expected 1 errors +Line 77: Expected 1 errors Line 79: Expected 1 errors -Line 81: Expected 1 errors +Line 82: Expected 1 errors Line 84: Expected 1 errors -Line 86: Expected 1 errors -Line 90: Expected 1 errors +Lines 51, 52: Expected error (tag 'TA14') +Lines 88, 89: Expected error (tag 'RTA6') """ diff --git a/conformance/results/pytype/generics_syntax_declarations.toml b/conformance/results/pytype/generics_syntax_declarations.toml index 3eeb5652..3960f34b 100644 --- a/conformance/results/pytype/generics_syntax_declarations.toml +++ b/conformance/results/pytype/generics_syntax_declarations.toml @@ -7,14 +7,14 @@ SyntaxError: Type parameter lists are only supported in Python 3.12 and greater """ conformance_automated = "Fail" errors_diff = """ -Line 19: Expected 1 errors -Line 27: Expected 1 errors -Line 34: Expected 1 errors -Line 46: Expected 1 errors -Line 50: Expected 1 errors -Line 62: Expected 1 errors -Line 66: Expected 1 errors -Line 73: Expected 1 errors -Line 77: Expected 1 errors -Line 81: Expected 1 errors +Line 17: Expected 1 errors +Line 25: Expected 1 errors +Line 32: Expected 1 errors +Line 44: Expected 1 errors +Line 48: Expected 1 errors +Line 60: Expected 1 errors +Line 64: Expected 1 errors +Line 71: Expected 1 errors +Line 75: Expected 1 errors +Line 79: Expected 1 errors """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 79ea0346..a314c2a0 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 31.9 +test_duration = 33.1 diff --git a/conformance/results/results.html b/conformance/results/results.html index ec61d4b0..eb55cda3 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

Python Type System Conformance Test Results

 
mypy 1.11.2
-
1.9sec
+
1.6sec
pyright 1.1.384
-
1.3sec
+
1.2sec
pyre 0.9.22
4.5sec
pytype 2024.09.13
-
32.8sec
+
pytype 2024.10.11
+
31.9sec
@@ -550,8 +550,8 @@

Python Type System Conformance Test Results

Partial

Reports errors for protocol static method with "..." implementation.

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

Does not report type incompatibility when assigning to attribute defined in protocol.

Does not reject instantiation of class that derives from protocol but doesn't implement attribute.

Does not report instantiation of class that derives from protocol but doesn't implement method.

     protocols_generic
Partial

Fails protocol matching when method-scoped TypeVar is used in protocol.

Partial

Incorrectly generates type violation for protocol that uses method-scoped type variables.

PassPass
Partial

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

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

Partial

Does not correctly enforce contravariance in protocol type compatibility tests.

Does not correctly enforce invariance in protocol type compatibility tests.

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

- - + @@ -337,7 +337,7 @@

Python Type System Conformance Test Results

- + @@ -415,7 +415,7 @@

Python Type System Conformance Test Results

- + @@ -484,7 +484,7 @@

Python Type System Conformance Test Results

- + @@ -808,31 +808,31 @@

Python Type System Conformance Test Results

- + - + - + - + - + @@ -859,7 +859,7 @@

Python Type System Conformance Test Results

Tuples - + diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index c8955c0f..185a3a0c 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -109,16 +109,6 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: "-m", "mypy", ".", - # Enable experimental support for PEP 695 syntax. - # This can be removed once it's no longer experimental. - "--enable-incomplete-feature=NewGenericSyntax", - # Mypy currently crashes when run on a couple of test cases, - # so we need to exclude them for now. Remove this once mypy adds - # support for this functionality. - "--exclude", - r"generics_defaults\.py", - "--exclude", - r"generics_syntax_declarations\.py", "--disable-error-code", "empty-body", ] diff --git a/conformance/tests/aliases_type_statement.py b/conformance/tests/aliases_type_statement.py index 23fe137c..024b4098 100644 --- a/conformance/tests/aliases_type_statement.py +++ b/conformance/tests/aliases_type_statement.py @@ -48,10 +48,8 @@ def func2(x: object): type BadTypeAlias12 = list or set # E type BadTypeAlias13 = f"{'int'}" # E -if 1 < 2: - type BadTypeAlias14 = int # E: redeclared -else: - type BadTypeAlias14 = int +type BadTypeAlias14 = int # E[TA14]: redeclared +type BadTypeAlias14 = int # E[TA14]: redeclared def func3(): @@ -87,5 +85,5 @@ def func3(): type RecursiveTypeAlias5[T] = T | list[RecursiveTypeAlias5[T]] -type RecursiveTypeAlias6 = RecursiveTypeAlias7 # E: circular definition -type RecursiveTypeAlias7 = RecursiveTypeAlias6 +type RecursiveTypeAlias6 = RecursiveTypeAlias7 # E[RTA6]: circular definition +type RecursiveTypeAlias7 = RecursiveTypeAlias6 # E[RTA6]: circular definition diff --git a/conformance/tests/generics_syntax_declarations.py b/conformance/tests/generics_syntax_declarations.py index 21ab84cb..62d2d101 100644 --- a/conformance/tests/generics_syntax_declarations.py +++ b/conformance/tests/generics_syntax_declarations.py @@ -7,13 +7,11 @@ # This generic class is parameterized by a TypeVar T, a # TypeVarTuple Ts, and a ParamSpec P. -from typing import Generic, ParamSpec, Protocol, TypeVar, TypeVarTuple, assert_type +from typing import Generic, Protocol class ChildClass[T, *Ts, **P]: - assert_type(T, TypeVar) - assert_type(Ts, TypeVarTuple) - assert_type(P, ParamSpec) + pass class ClassA[T](Generic[T]): # E: Runtime error diff --git a/conformance/tests/generics_variance_inference.py b/conformance/tests/generics_variance_inference.py index c2de9376..c7e09760 100644 --- a/conformance/tests/generics_variance_inference.py +++ b/conformance/tests/generics_variance_inference.py @@ -41,7 +41,7 @@ def __iter__(self) -> Iterator[T]: vco1_2: ShouldBeCovariant1[int] = ShouldBeCovariant1[float]() # E -class ShouldBeCovariant2[T](Sequence[T]): +class ShouldBeCovariant2[T](ShouldBeCovariant1[T]): pass @@ -85,7 +85,7 @@ def __init__(self, value: T) -> None: self._value = value @property - def value(self): + def value(self) -> T: return self._value @value.setter From f516a434a7ac22aba321f97dd6aafd3dbfd9834f Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 16 Oct 2024 08:51:13 -0700 Subject: [PATCH 11/29] Updated conformance results for pyright 1.1.385. (#1867) * Fixes regression caught by constructors_call_type test * Fixes regression caught by generics_typevartuple_args test --- .../results/pyright/constructors_call_type.toml | 11 ++++------- .../results/pyright/generics_typevartuple_args.toml | 9 ++++----- conformance/results/pyright/version.toml | 4 ++-- conformance/results/results.html | 6 +++--- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/conformance/results/pyright/constructors_call_type.toml b/conformance/results/pyright/constructors_call_type.toml index 2e33755c..da804d72 100644 --- a/conformance/results/pyright/constructors_call_type.toml +++ b/conformance/results/pyright/constructors_call_type.toml @@ -1,18 +1,15 @@ -conformant = "Partial" -notes = """ -Fails to report error when passing incorrect arguments for metaclass __call__ method. -""" +conformant = "Pass" errors_diff = """ -Line 30: Expected 1 errors -Line 72: Expected 1 errors """ output = """ +constructors_call_type.py:30:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:40:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:50:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:59:9 - error: Expected 0 positional arguments (reportCallIssue) constructors_call_type.py:64:9 - error: Expected 0 positional arguments (reportCallIssue) +constructors_call_type.py:72:5 - error: Arguments missing for parameters "x", "y" (reportCallIssue) constructors_call_type.py:81:5 - error: Argument missing for parameter "y" (reportCallIssue) constructors_call_type.py:82:12 - error: Argument of type "Literal[2]" cannot be assigned to parameter "y" of type "str" in function "__new__"   "Literal[2]" is not assignable to "str" (reportArgumentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" diff --git a/conformance/results/pyright/generics_typevartuple_args.toml b/conformance/results/pyright/generics_typevartuple_args.toml index 04a4cc5b..2ef2c70e 100644 --- a/conformance/results/pyright/generics_typevartuple_args.toml +++ b/conformance/results/pyright/generics_typevartuple_args.toml @@ -8,16 +8,15 @@ generics_typevartuple_args.py:48:10 - error: Argument of type "Literal['2']" can   "Literal['2']" is not assignable to "int" (reportArgumentType) generics_typevartuple_args.py:57:10 - error: Argument of type "Literal[1]" cannot be assigned to parameter of type "str" in function "func2"   "Literal[1]" is not assignable to "str" (reportArgumentType) -generics_typevartuple_args.py:59:7 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "int" in function "func2" -  "Literal['']" is not assignable to "int" (reportArgumentType) +generics_typevartuple_args.py:58:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) +generics_typevartuple_args.py:59:1 - error: Argument missing for parameter "args[2]" (reportCallIssue) +generics_typevartuple_args.py:67:1 - error: Argument missing for parameter "args[1]" (reportCallIssue) generics_typevartuple_args.py:75:13 - error: Argument of type "tuple[Literal[1], Literal[2]]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4"   "tuple[Literal[1], Literal[2]]" is not assignable to "tuple[int]"     Tuple size mismatch; expected 1 but received 2 (reportArgumentType) generics_typevartuple_args.py:76:14 - error: Argument of type "tuple[Literal['1']]" cannot be assigned to parameter "args" of type "tuple[*Ts@func4]" in function "func4"   "Literal['1']" is not assignable to "int" (reportArgumentType) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 58: Expected 1 errors -Line 67: Expected 1 errors """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index a90f554c..4849f62d 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.384" -test_duration = 1.3 +version = "pyright 1.1.385" +test_duration = 1.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index eb55cda3..c6515ec3 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -161,8 +161,8 @@

Python Type System Conformance Test Results

- - + From af4693a02a22a2517b8cc23a90a341e2f6f67fec Mon Sep 17 00:00:00 2001 From: Zac Hatfield-Dodds Date: Tue, 22 Oct 2024 18:39:27 -0700 Subject: [PATCH 12/29] Suggest `pyupgrade` or `ruff` for modernizing superseded typing features (#1868) Suggest `pyupgrade` or `ruff` for modernizing --- docs/guides/modernizing.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index 0c6309a3..db5d81e8 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -24,6 +24,12 @@ Each section states the minimum Python version required to use the feature, whether it is available in typing-extensions, and whether it is available using quoting. +.. tip:: + + Tools such as `pyupgrade `__ or + `ruff `__ can automatically perform + these refactorings for you. + .. note:: The latest version of typing-extensions is available for all Python From adc675fa9209ec1830fcea3c622562e722b60b44 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Wed, 23 Oct 2024 14:54:21 +0100 Subject: [PATCH 13/29] Modernizing guide: also mention `com2ann` (#1869) Small followup to #1868 This guide mentions type comments as one of the older typing features that you might like to modernize; as far as I know, `com2ann` is still the best tool for auto-converting these to Python-3 type annotations. --- docs/guides/modernizing.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index db5d81e8..279febd6 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -26,8 +26,9 @@ available using quoting. .. tip:: - Tools such as `pyupgrade `__ or - `ruff `__ can automatically perform + Tools such as `pyupgrade `__, + `ruff `__ and/or + `com2ann `__ can automatically perform these refactorings for you. .. note:: From b4b9c4e7e249aab777ad5b46cd529e5e9bc8861b Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Wed, 23 Oct 2024 09:49:54 -0700 Subject: [PATCH 14/29] Updated conformance results for mypy 1.13 and pyright 1.1.386 (#1870) Pyright fixed one conformance bug in callables_kwargs test. Mypy results did not change. --- conformance/results/mypy/version.toml | 4 ++-- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/callables_kwargs.toml | 11 +++-------- .../results/pyright/typeddicts_readonly_kwargs.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/results.html | 10 +++++----- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index cdbafd59..6f12777c 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.12.0" -test_duration = 1.7 +version = "mypy 1.13.0" +test_duration = 1.5 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 4c6e1161..48f19eaa 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 4.6 +test_duration = 4.4 diff --git a/conformance/results/pyright/callables_kwargs.toml b/conformance/results/pyright/callables_kwargs.toml index b3e1e6c0..9dea95b6 100644 --- a/conformance/results/pyright/callables_kwargs.toml +++ b/conformance/results/pyright/callables_kwargs.toml @@ -1,11 +1,7 @@ -conformant = "Partial" -notes = """ -Incorrectly handles assert_type for unpacked TypedDict. -""" +conformant = "Pass" output = """ callables_kwargs.py:28:5 - error: Could not access item in TypedDict -  "v2" is not a required key in "*TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) -callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure) +  "v2" is not a required key in "TD2", so access may result in runtime exception (reportTypedDictNotRequiredAccess) callables_kwargs.py:46:5 - error: Arguments missing for parameters "v1", "v3" (reportCallIssue) callables_kwargs.py:51:32 - error: No parameter named "v4" (reportCallIssue) callables_kwargs.py:52:11 - error: Expected 0 positional arguments (reportCallIssue) @@ -32,7 +28,6 @@ callables_kwargs.py:103:19 - error: Type "(**kwargs: **TD2) -> None" is not assi callables_kwargs.py:111:30 - error: Typed dictionary overlaps with keyword parameter: v1 (reportGeneralTypeIssues) callables_kwargs.py:122:21 - error: Expected TypedDict type argument for Unpack (reportGeneralTypeIssues) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 41: Unexpected errors ['callables_kwargs.py:41:17 - error: "assert_type" mismatch: expected "TD1" but received "*TD1" (reportAssertTypeFailure)'] """ diff --git a/conformance/results/pyright/typeddicts_readonly_kwargs.toml b/conformance/results/pyright/typeddicts_readonly_kwargs.toml index 6ef10226..4a2e2d22 100644 --- a/conformance/results/pyright/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyright/typeddicts_readonly_kwargs.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ typeddicts_readonly_kwargs.py:33:5 - error: Could not assign item in TypedDict -  "key1" is a read-only key in "*ReadOnlyArgs" (reportTypedDictNotRequiredAccess) +  "key1" is a read-only key in "ReadOnlyArgs" (reportTypedDictNotRequiredAccess) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 4849f62d..49cfb801 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.385" +version = "pyright 1.1.386" test_duration = 1.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index c6515ec3..3211c84f 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,14 +158,14 @@

Python Type System Conformance Test Results

 
mypy 1.11.2
-
1.6sec
+
mypy 1.12.0
+
1.7sec
pyright 1.1.384
-
1.2sec
+
1.3sec
pyre 0.9.22
-
4.5sec
+
4.6sec
pytype 2024.10.11
-
31.9sec
+
33.1sec
@@ -277,7 +277,7 @@

Python Type System Conformance Test Results

Unsupported

Does not support ParamSpec.

     generics_paramspec_components
Partial

Does not report illegal use of "P.args" on normal parameter.

Does not report error when P.args is specified but P.kwargs is missing.

Does not report error when P is out of scope and P.args and P.kwargs is used.

Does not report error when keyword argument is specified between P.args and P.kwargs.

Does not report error when calling callable and argument is missing for concatenated parameters.

Partial

Does not report illegal use of "P.args" on normal parameter.

Does not report error when P.args is specified but P.kwargs is missing.

Does not report error when P is out of scope and P.args and P.kwargs is used.

Does not report error when keyword argument is specified between P.args and P.kwargs.

Pass
Partial

Does not report illegal use of "P.args" on normal parameter.

Does not report error when P.args is specified but P.kwargs is missing.

Does not report error when P is out of scope and P.args and P.kwargs is used.

Does not report error when calling callback defined with ParamSpec with incorrect arguments.

Does not report error when keyword argument is specified between P.args and P.kwargs.

Does not report error when calling callable and argument is missing for concatenated parameters.

Unsupported

Does not support ParamSpec.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_declarations
Partial

Does not detect many illegal usages of type parameter syntax.

Pass Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

Unsupported

Does not support covariant or contravariant TypeVars.

     generics_variance_inference
Partial

Computes incorrect variance in some cases.

Pass Pass
Unsupported

Type parameter syntax not yet support.

Unsupported

Type parameter syntax not yet support.

Partial

Does not detect type violation for some deeply-nested types.

Does not properly handle `|` for unions in some recursive type alias definitions.

Does not detect cyclical references in recursive type alias definition.

     aliases_type_statement
Partial

Does not reject use of TypeAliasType as base class.

Does not reject redefinition of type alias defined with type statement.

Does not reject type alias defined in function scope.

Does not reject type alias with circular definition.

Partial

Does not reject type alias defined in function scope.

Pass
Unsupported

Does not support `type` statement.

Unsupported

Does not support `type` statement.

Partial

Does not report type violation with TypedDict value assignment.

Does not report reference to unknown key in TypedDict.

Does not reject `clear` method on TypedDict with required keys.

Does not reject delete operation for required key in TypedDict.

     typeddicts_readonlyUnsupported
Partial

Incorrectly rejects NotRequired directive when used in an Annotated annotation.

Pass Unsupported Unsupported
     typeddicts_readonly_consistencyUnsupported
Partial

Incorrectly rejects assignment of required item to not-required read-only item.

Pass Unsupported Unsupported
     typeddicts_readonly_inheritanceUnsupported
Partial

Incorrectly rejects non-ReadOnly override of ReadOnly item.

Incorrectly rejects override of ReadOnly item with another ReadOnly item with narrower type.

Incorrectly rejects override of NotRequired ReadOnly item with a Required ReadOnly item.

Pass Unsupported Unsupported
     typeddicts_readonly_kwargsUnsupportedPass Pass Unsupported Unsupported
     typeddicts_readonly_updateUnsupported
Partial

Incorrectly allows update of ReadOnly item.

Incorrectly rejects update involving an item with Never type.

Pass Unsupported Unsupported
     tuples_type_compat
Partial

Does not support tuple narrowing based on `len()` type guard (optional).

Incorrectly narrows tuple based on sequence patterns.

Partial

Does not support tuple narrowing based on `len()` type guard (optional).

Pass
Partial

Does not support some unpacked tuple forms.

Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`.

Does not support tuple narrowing based on `len()` type guard (optional).

Does not correctly evaluate `Sequence[Never]` for `tuple[()]`.

Partial

Does not support unpacked tuple forms.

Does not report type violation when assigning `tuple[int, ...]` to `tuple[int]`.

Does not support tuple narrowing based on `len()` type guard (optional).

mypy 1.12.0
1.7sec
pyright 1.1.384
-
1.3sec
+
pyright 1.1.385
+
1.2sec
pyre 0.9.22
4.6sec
@@ -647,7 +647,7 @@

Python Type System Conformance Test Results

     constructors_call_type
Partial

Does not validate call to custom metaclass __call__ method through type[T].

Partial

Fails to report error when passing incorrect arguments for metaclass __call__ method.

Pass Pass
Partial

Does not validate call to custom metaclass __call__ method through type[T].

- - - + From 02b385a9b1205be6c2e8122a740ddd0bb30c6fa7 Mon Sep 17 00:00:00 2001 From: migeed-z Date: Thu, 24 Oct 2024 11:37:59 -0700 Subject: [PATCH 15/29] Add missing return type to generic_syntax_infer_variance.py (#1871) * add missing return type to generic_syntax_infer_variance.py * update generics_syntax_infer_variance.py --- .../results/mypy/generics_syntax_infer_variance.toml | 3 +++ conformance/results/mypy/version.toml | 2 +- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 2 +- conformance/results/pytype/specialtypes_never.toml | 7 +++---- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 8 ++++---- conformance/tests/generics_syntax_infer_variance.py | 2 +- 8 files changed, 15 insertions(+), 13 deletions(-) diff --git a/conformance/results/mypy/generics_syntax_infer_variance.toml b/conformance/results/mypy/generics_syntax_infer_variance.toml index 1db3d4a8..4a4ecc71 100644 --- a/conformance/results/mypy/generics_syntax_infer_variance.toml +++ b/conformance/results/mypy/generics_syntax_infer_variance.toml @@ -55,6 +55,8 @@ generics_syntax_infer_variance.py:86: error: The type "type[ShouldBeCovariant6]" generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc] generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:90: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases +generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] +generics_syntax_infer_variance.py:94: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type] generics_syntax_infer_variance.py:98: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_infer_variance.py:102: error: "ShouldBeInvariant1" expects no type arguments, but 1 given [type-arg] @@ -121,6 +123,7 @@ Line 81: Unexpected errors ['generics_syntax_infer_variance.py:81: error: Variab Line 85: Unexpected errors ['generics_syntax_infer_variance.py:85: error: "ShouldBeCovariant6" expects no type arguments, but 1 given [type-arg]', 'generics_syntax_infer_variance.py:85: error: The type "type[ShouldBeCovariant6]" is not generic and not indexable [misc]'] Line 89: Unexpected errors ['generics_syntax_infer_variance.py:89: error: Free type variable expected in Generic[...] [misc]'] Line 90: Unexpected errors ['generics_syntax_infer_variance.py:90: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] +Line 94: Unexpected errors ['generics_syntax_infer_variance.py:94: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 98: Unexpected errors ['generics_syntax_infer_variance.py:98: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] Line 106: Unexpected errors ['generics_syntax_infer_variance.py:106: error: Free type variable expected in Generic[...] [misc]'] Line 107: Unexpected errors ['generics_syntax_infer_variance.py:107: error: Variable "generics_syntax_infer_variance.T" is not valid as a type [valid-type]'] diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 6f12777c..33181f43 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.13.0" -test_duration = 1.5 +test_duration = 2.6 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 48f19eaa..9b63b04f 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.22" -test_duration = 4.4 +test_duration = 6.5 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 49cfb801..9430b168 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ version = "pyright 1.1.386" -test_duration = 1.2 +test_duration = 1.9 diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index 7a231858..be27a72a 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -8,11 +8,10 @@ specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 21: Unexpected errors ['specialtypes_never.py:21:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index a314c2a0..47fa98ff 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 33.1 +test_duration = 50.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index 3211c84f..98e57034 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

 
mypy 1.12.0
-
1.7sec
+
mypy 1.13.0
+
1.5sec
pyright 1.1.385
+
pyright 1.1.386
1.2sec
pyre 0.9.22
-
4.6sec
+
4.4sec
pytype 2024.10.11
33.1sec
@@ -608,7 +608,7 @@

Python Type System Conformance Test Results

     callables_kwargs Pass
Partial

Incorrectly handles assert_type for unpacked TypedDict.

Pass
Unsupported

Does not understand Unpack in the context of **kwargs annotation.

Unsupported

Does not understand Unpack in the context of **kwargs annotation.

 
mypy 1.13.0
-
1.5sec
+
2.6sec
pyright 1.1.386
-
1.2sec
+
1.9sec
pyre 0.9.22
-
4.4sec
+
6.5sec
pytype 2024.10.11
-
33.1sec
+
50.2sec
diff --git a/conformance/tests/generics_syntax_infer_variance.py b/conformance/tests/generics_syntax_infer_variance.py index 7df2e64e..62d14ccb 100644 --- a/conformance/tests/generics_syntax_infer_variance.py +++ b/conformance/tests/generics_syntax_infer_variance.py @@ -91,7 +91,7 @@ def __init__(self, value: T) -> None: self._value = value @property - def value(self): + def value(self) -> T: return self._value @value.setter From b633be4d316274d9dbd05709068a61e7cb1d417d Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:28:07 +0200 Subject: [PATCH 16/29] Add a label for typed dictionaries class-based syntax (#1873) --- docs/spec/typeddict.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/spec/typeddict.rst b/docs/spec/typeddict.rst index 38a2e4b8..15d9aeaa 100644 --- a/docs/spec/typeddict.rst +++ b/docs/spec/typeddict.rst @@ -35,6 +35,7 @@ particular, :term:`assignability ` should be :term:`structural`: a more specific TypedDict type can be assignable to a more general TypedDict type, without any inheritance relationship between them. +.. _typeddict-class-based-syntax: Class-based Syntax ^^^^^^^^^^^^^^^^^^ From d19b1b233125e02e10f8b26bc625a8f6885d98d9 Mon Sep 17 00:00:00 2001 From: Zeina Migeed Date: Tue, 29 Oct 2024 16:24:34 -0700 Subject: [PATCH 17/29] Update conformance results after new pyre release (#1878) update conformance results after new pyre release --- conformance/results/mypy/version.toml | 2 +- .../results/pyre/aliases_explicit.toml | 4 + .../results/pyre/aliases_implicit.toml | 8 +- conformance/results/pyre/aliases_newtype.toml | 2 +- .../results/pyre/aliases_recursive.toml | 4 +- .../results/pyre/aliases_type_statement.toml | 56 +++++---- .../results/pyre/aliases_typealiastype.toml | 4 - .../results/pyre/aliases_variance.toml | 8 +- .../pyre/annotations_forward_refs.toml | 4 +- .../results/pyre/annotations_generators.toml | 4 +- .../results/pyre/annotations_methods.toml | 2 +- .../results/pyre/callables_annotation.toml | 2 + .../results/pyre/callables_kwargs.toml | 40 +++---- .../results/pyre/callables_protocol.toml | 6 +- .../results/pyre/callables_subtyping.toml | 10 +- .../results/pyre/classes_classvar.toml | 4 +- .../results/pyre/classes_override.toml | 9 +- .../results/pyre/constructors_call_init.toml | 14 ++- .../results/pyre/constructors_call_new.toml | 29 ++--- .../results/pyre/constructors_callable.toml | 29 ++--- .../results/pyre/dataclasses_descriptors.toml | 17 +-- .../pyre/dataclasses_transform_func.toml | 2 - .../results/pyre/dataclasses_usage.toml | 7 +- .../results/pyre/directives_assert_type.toml | 9 +- .../results/pyre/directives_reveal_type.toml | 8 +- .../pyre/directives_type_ignore_file1.toml | 7 +- .../pyre/directives_version_platform.toml | 10 +- conformance/results/pyre/enums_behaviors.toml | 7 +- .../results/pyre/enums_definition.toml | 10 +- conformance/results/pyre/enums_expansion.toml | 7 +- .../results/pyre/enums_member_names.toml | 8 +- .../results/pyre/enums_member_values.toml | 28 ++--- conformance/results/pyre/enums_members.toml | 26 ++-- .../pyre/exceptions_context_managers.toml | 12 +- conformance/results/pyre/generics_basic.toml | 6 +- .../results/pyre/generics_defaults.toml | 103 ++++++++-------- .../pyre/generics_defaults_referential.toml | 40 +++---- .../generics_defaults_specialization.toml | 20 ++-- .../pyre/generics_paramspec_components.toml | 2 +- .../pyre/generics_paramspec_semantics.toml | 6 +- .../results/pyre/generics_scoping.toml | 19 +-- .../results/pyre/generics_self_advanced.toml | 25 ++-- .../results/pyre/generics_self_basic.toml | 14 +-- .../pyre/generics_syntax_compatibility.toml | 9 +- .../pyre/generics_syntax_declarations.toml | 23 ++-- .../pyre/generics_syntax_infer_variance.toml | 44 +++---- .../results/pyre/generics_syntax_scoping.toml | 14 ++- .../results/pyre/generics_type_erasure.toml | 21 ++-- .../pyre/generics_typevartuple_args.toml | 41 +++---- .../pyre/generics_typevartuple_basic.toml | 76 +++--------- .../pyre/generics_typevartuple_callable.toml | 26 +--- .../pyre/generics_typevartuple_concat.toml | 39 ++---- .../pyre/generics_typevartuple_overloads.toml | 15 +-- .../generics_typevartuple_specialization.toml | 91 ++++---------- .../pyre/generics_typevartuple_unpack.toml | 24 +--- .../results/pyre/generics_upper_bound.toml | 2 +- .../results/pyre/generics_variance.toml | 4 +- .../pyre/generics_variance_inference.toml | 53 ++++++--- .../results/pyre/historical_positional.toml | 15 +-- .../results/pyre/literals_interactions.toml | 16 +-- .../results/pyre/literals_literalstring.toml | 4 +- .../pyre/literals_parameterizations.toml | 2 - .../pyre/namedtuples_define_class.toml | 30 +---- .../pyre/namedtuples_define_functional.toml | 26 +--- .../results/pyre/namedtuples_type_compat.toml | 11 +- .../results/pyre/namedtuples_usage.toml | 29 +---- .../results/pyre/narrowing_typeguard.toml | 11 +- .../results/pyre/narrowing_typeis.toml | 46 ++------ conformance/results/pyre/overloads_basic.toml | 7 +- .../results/pyre/protocols_generic.toml | 2 +- .../results/pyre/protocols_merging.toml | 7 +- .../results/pyre/qualifiers_annotated.toml | 10 +- .../results/pyre/specialtypes_any.toml | 11 +- .../results/pyre/specialtypes_never.toml | 4 +- .../results/pyre/specialtypes_type.toml | 16 +++ .../results/pyre/tuples_type_compat.toml | 111 ++++++------------ conformance/results/pyre/tuples_unpacked.toml | 25 +--- .../results/pyre/typeddicts_class_syntax.toml | 4 +- .../results/pyre/typeddicts_inheritance.toml | 7 +- .../results/pyre/typeddicts_operations.toml | 8 +- .../results/pyre/typeddicts_readonly.toml | 18 ++- .../pyre/typeddicts_readonly_consistency.toml | 12 +- .../pyre/typeddicts_readonly_inheritance.toml | 20 ++-- .../pyre/typeddicts_readonly_kwargs.toml | 10 +- .../pyre/typeddicts_readonly_update.toml | 10 +- .../results/pyre/typeddicts_required.toml | 4 - .../results/pyre/typeddicts_usage.toml | 8 +- conformance/results/pyre/version.toml | 5 +- conformance/results/pyright/version.toml | 3 +- conformance/results/results.html | 102 ++++++++-------- 90 files changed, 683 insertions(+), 1027 deletions(-) diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 33181f43..bdefc8cf 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.13.0" -test_duration = 2.6 +test_duration = 2.7 diff --git a/conformance/results/pyre/aliases_explicit.toml b/conformance/results/pyre/aliases_explicit.toml index 473b04ee..1ed27f71 100644 --- a/conformance/results/pyre/aliases_explicit.toml +++ b/conformance/results/pyre/aliases_explicit.toml @@ -15,6 +15,8 @@ aliases_explicit.py:26:0 Incompatible variable type [9]: GoodTypeAlias12 is decl aliases_explicit.py:26:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. aliases_explicit.py:41:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type. aliases_explicit.py:44:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias12` is not defined as a type. +aliases_explicit.py:57:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`. +aliases_explicit.py:60:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`. 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]]`. @@ -44,5 +46,7 @@ Line 23: Unexpected errors ['aliases_explicit.py:23:0 Incompatible variable type Line 26: Unexpected errors ['aliases_explicit.py:26:0 Incompatible variable type [9]: GoodTypeAlias12 is declared to have type `TA` but is used as type `Type[typing.Callable[..., Variable[$synthetic_attribute_resolution_variable]]]`.', 'aliases_explicit.py:26:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] Line 41: Unexpected errors ['aliases_explicit.py:41:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type.'] Line 44: Unexpected errors ['aliases_explicit.py:44:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias12` is not defined as a type.'] +Line 57: Unexpected errors ['aliases_explicit.py:57:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`.'] +Line 60: Unexpected errors ['aliases_explicit.py:60:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`.'] 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..322c2932 100644 --- a/conformance/results/pyre/aliases_implicit.toml +++ b/conformance/results/pyre/aliases_implicit.toml @@ -12,6 +12,8 @@ aliases_implicit.py:38:26 Incompatible parameter type [6]: In call `typing.Gener aliases_implicit.py:42:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`. aliases_implicit.py:54:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type. aliases_implicit.py:58:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias13` is not defined as a type. +aliases_implicit.py:68:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`. +aliases_implicit.py:72:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`. 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. @@ -26,7 +28,7 @@ aliases_implicit.py:116:9 Undefined or invalid type [11]: Annotation `BadTypeAli aliases_implicit.py:117:9 Undefined or invalid type [11]: Annotation `BadTypeAlias12` is not defined as a type. aliases_implicit.py:118:9 Undefined or invalid type [11]: Annotation `BadTypeAlias13` is not defined as a type. aliases_implicit.py:119:9 Undefined or invalid type [11]: Annotation `BadTypeAlias14` is not defined as a type. -aliases_implicit.py:131:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `typing.Any`. +aliases_implicit.py:131:0 Assert type [70]: Expected `List[int]` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ @@ -42,5 +44,7 @@ Line 38: Unexpected errors ['aliases_implicit.py:38:26 Incompatible parameter ty Line 42: Unexpected errors ['aliases_implicit.py:42:27 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[typing.Any, Type[Variable[$synthetic_attribute_resolution_variable]]]` but got `Tuple[ParamSpec, None]`.'] Line 54: Unexpected errors ['aliases_implicit.py:54:8 Undefined or invalid type [11]: Annotation `GoodTypeAlias9` is not defined as a type.'] Line 58: Unexpected errors ['aliases_implicit.py:58:9 Undefined or invalid type [11]: Annotation `GoodTypeAlias13` is not defined as a type.'] -Line 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`.'] +Line 68: Unexpected errors ['aliases_implicit.py:68:4 Assert type [70]: Expected `typing.Callable[[int, str, str], None]` but got `unknown`.'] +Line 72: Unexpected errors ['aliases_implicit.py:72:4 Assert type [70]: Expected `typing.Callable[..., None]` but got `unknown`.'] +Line 131: Unexpected errors ['aliases_implicit.py:131:0 Assert type [70]: 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..86ab3d22 100644 --- a/conformance/results/pyre/aliases_newtype.toml +++ b/conformance/results/pyre/aliases_newtype.toml @@ -15,7 +15,6 @@ aliases_newtype.py:38:5 Invalid type parameters [24]: Non-generic type `GoodNewT 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 = """ @@ -25,4 +24,5 @@ Line 32: Expected 1 errors Line 47: Expected 1 errors Line 49: Expected 1 errors Line 58: 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..69aeafb1 100644 --- a/conformance/results/pyre/aliases_recursive.toml +++ b/conformance/results/pyre/aliases_recursive.toml @@ -8,7 +8,7 @@ aliases_recursive.py:19:0 Incompatible variable type [9]: j4 is declared to have 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:42:39 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[Type[Variable[_KT]], Type[Variable[_VT_co]]]` 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. @@ -29,7 +29,7 @@ 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 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]]]` 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.'] diff --git a/conformance/results/pyre/aliases_type_statement.toml b/conformance/results/pyre/aliases_type_statement.toml index 31559fcb..e3ce7deb 100644 --- a/conformance/results/pyre/aliases_type_statement.toml +++ b/conformance/results/pyre/aliases_type_statement.toml @@ -1,9 +1,36 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not support `type` statement. +Does not complain when a type alias cannot be used as a base class. +Does not complain when a type alias cannot be used as a function. +Does not complain when a type statement definition combines new and old TypeVars. +Does not complain when a type statement definition uses old TypeVars. +Does not properly support recursive aliases. """ output = """ -aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax +aliases_type_statement.py:37:0 Invalid type [31]: Expression `eval("".join(map(chr, [105, 110, 116])))` is not a valid type. +aliases_type_statement.py:38:0 Invalid type [31]: Expression `[int, str]` is not a valid type. +aliases_type_statement.py:39:0 Invalid type [31]: Expression `((int, str))` is not a valid type. +aliases_type_statement.py:40:0 Invalid type [31]: Expression `comprehension(int for generators(generator(i in range(1) if )))` is not a valid type. +aliases_type_statement.py:41:0 Invalid type [31]: Expression `{ "a":"b" }` is not a valid type. +aliases_type_statement.py:42:0 Invalid type [31]: Expression `lambda () (int)()` is not a valid type. +aliases_type_statement.py:43:0 Invalid type [31]: Expression `[int][0]` is not a valid type. +aliases_type_statement.py:44:0 Invalid type [31]: Expression `int if 1 < 3 else str` is not a valid type. +aliases_type_statement.py:45:0 Undefined or invalid type [11]: Annotation `var1` is not defined as a type. +aliases_type_statement.py:46:0 Invalid type [31]: Expression `True` is not a valid type. +aliases_type_statement.py:47:0 Invalid type [31]: Expression `1` is not a valid type. +aliases_type_statement.py:48:0 Invalid type [31]: Expression `list or set` is not a valid type. +aliases_type_statement.py:49:0 Invalid type [31]: Expression `f"{"int"}"` is not a valid type. +aliases_type_statement.py:72:0 Incompatible variable type [9]: r1_1 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `int`. +aliases_type_statement.py:73:0 Incompatible variable type [9]: r1_2 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `List[Union[List[int], int]]`. +aliases_type_statement.py:77:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(str, str, ...)]` is not a valid type. +aliases_type_statement.py:78:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, ...)]` is not a valid type. +aliases_type_statement.py:79:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, int, ...)]` is not a valid type. +aliases_type_statement.py:80:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, [int, str])]` is not a valid type. +aliases_type_statement.py:82:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias3` is not defined as a type. +aliases_type_statement.py:84:0 Invalid type parameters [24]: Non-generic type `RecursiveTypeAlias4` cannot take parameters. +aliases_type_statement.py:84:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias4` is not defined as a type. +aliases_type_statement.py:88:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias7` is not defined as a type. +aliases_type_statement.py:89:0 Undefined or invalid type [11]: Annotation `RecursiveTypeAlias6` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ @@ -12,27 +39,12 @@ Line 19: Expected 1 errors Line 23: Expected 1 errors Line 26: Expected 1 errors Line 31: Expected 1 errors -Line 37: Expected 1 errors -Line 38: Expected 1 errors -Line 39: 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 -Line 46: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 49: Expected 1 errors Line 56: Expected 1 errors Line 62: Expected 1 errors Line 67: Expected 1 errors -Line 77: Expected 1 errors -Line 79: Expected 1 errors -Line 82: Expected 1 errors -Line 84: Expected 1 errors Lines 51, 52: Expected error (tag 'TA14') -Lines 88, 89: Expected error (tag 'RTA6') -Line 8: Unexpected errors ['aliases_type_statement.py:8:6 Parsing failure [404]: invalid syntax'] +Line 72: Unexpected errors ['aliases_type_statement.py:72:0 Incompatible variable type [9]: r1_1 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `int`.'] +Line 73: Unexpected errors ['aliases_type_statement.py:73:0 Incompatible variable type [9]: r1_2 is declared to have type `aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[aliases_type_statement.RecursiveTypeAlias1 (resolves to Union[List[RecursiveTypeAlias1], T])], T])` but is used as type `List[Union[List[int], int]]`.'] +Line 78: Unexpected errors ['aliases_type_statement.py:78:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, ...)]` is not a valid type.'] +Line 80: Unexpected errors ['aliases_type_statement.py:80:6 Invalid type [31]: Expression `RecursiveTypeAlias2[(int, str, [int, str])]` is not a valid type.'] """ diff --git a/conformance/results/pyre/aliases_typealiastype.toml b/conformance/results/pyre/aliases_typealiastype.toml index 152a87de..29cd273f 100644 --- a/conformance/results/pyre/aliases_typealiastype.toml +++ b/conformance/results/pyre/aliases_typealiastype.toml @@ -6,11 +6,9 @@ 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 = """ @@ -36,8 +34,6 @@ 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..a5492b60 100644 --- a/conformance/results/pyre/aliases_variance.toml +++ b/conformance/results/pyre/aliases_variance.toml @@ -1,9 +1,9 @@ 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. +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](invariant)` 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](invariant)` 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](invariant)` 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](invariant)` because subclasses cannot use more permissive type variables than their superclasses. """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 6c52e88e..6dd78f97 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -13,7 +13,7 @@ annotations_forward_refs.py:42:8 Invalid type [31]: Expression `"[int, str]"` is 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:46:8 Invalid type [31]: Expression `lambda () (int)()` is not a valid 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. @@ -24,6 +24,7 @@ annotations_forward_refs.py:53:9 Invalid type [31]: Expression `"int or str"` is 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:96:0 Assert type [70]: Expected `int` but got `unknown`. annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation ` """ conformance_automated = "Fail" @@ -36,5 +37,6 @@ Line 54: Expected 1 errors Line 66: 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 96: Unexpected errors ['annotations_forward_refs.py:96:0 Assert type [70]: Expected `int` but got `unknown`.'] 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..4ce5994d 100644 --- a/conformance/results/pyre/annotations_generators.toml +++ b/conformance/results/pyre/annotations_generators.toml @@ -15,12 +15,12 @@ annotations_generators.py:92:4 Incompatible return type [7]: Expected `int` but annotations_generators.py:118:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[A, None, typing.Any]`. annotations_generators.py:119:4 Incompatible return type [7]: Expected `Iterator[B]` but got `Generator[int, None, typing.Any]`. annotations_generators.py:135:4 Incompatible return type [7]: Expected `Generator[None, str, None]` but got `Generator[None, int, typing.Any]`. -annotations_generators.py: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]]`. +annotations_generators.py:182:0 Assert type [70]: Expected `typing.Callable[[], Coroutine[typing.Any, typing.Any, AsyncIterator[int]]]` but got `typing.Callable(generator29)[[], AsyncIterator[int]]`. """ conformance_automated = "Fail" errors_diff = """ Line 51: Expected 1 errors Line 86: Expected 1 errors Line 88: Unexpected errors ['annotations_generators.py:88:4 Incompatible return type [7]: Expected `int` but got `Generator[typing.Any, typing.Any, int]`.'] -Line 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 182: Unexpected errors ['annotations_generators.py:182:0 Assert type [70]: 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 c6be1388..4c131204 100644 --- a/conformance/results/pyre/annotations_methods.toml +++ b/conformance/results/pyre/annotations_methods.toml @@ -3,7 +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`. +annotations_methods.py:42:0 Assert type [70]: Expected `A` but got `B`. """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyre/callables_annotation.toml b/conformance/results/pyre/callables_annotation.toml index 384310ba..2d155ba0 100644 --- a/conformance/results/pyre/callables_annotation.toml +++ b/conformance/results/pyre/callables_annotation.toml @@ -18,6 +18,7 @@ callables_annotation.py:59:4 Invalid type [31]: Expression `typing.Callable[([.. 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:155:4 Incompatible variable type [9]: ok9 is declared to have type `Proto4[[...]]` but is used as type `Proto3`. 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`. @@ -39,6 +40,7 @@ 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 155: Unexpected errors ['callables_annotation.py:155:4 Incompatible variable type [9]: ok9 is declared to have type `Proto4[[...]]` but is used as type `Proto3`.'] 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]]`.'] diff --git a/conformance/results/pyre/callables_kwargs.toml b/conformance/results/pyre/callables_kwargs.toml index 596abc4d..6714bfea 100644 --- a/conformance/results/pyre/callables_kwargs.toml +++ b/conformance/results/pyre/callables_kwargs.toml @@ -1,31 +1,21 @@ -conformant = "Unsupported" +conformant = "Pass" 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. +callables_kwargs.py:46:4 Missing argument [20]: Call `func1` expects argument `v3`. +callables_kwargs.py:51:4 Unexpected keyword [28]: Unexpected keyword argument `v4` to call `func1`. +callables_kwargs.py:52:4 Too many arguments [19]: Call `func1` expects 0 positional arguments, 3 were provided. +callables_kwargs.py:58:12 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `TD2` but got `Dict[str, str]`. +callables_kwargs.py:61:12 Incompatible parameter type [6]: In call `func1`, for 1st positional argument, expected `TD2` but got `Dict[str, Union[int, str]]`. +callables_kwargs.py:63:4 Unexpected keyword [28]: Unexpected keyword argument `v1` to call `func1`. +callables_kwargs.py:64:4 Unexpected keyword [28]: Unexpected keyword argument `v3` to call `func2`. +callables_kwargs.py:65:4 Unexpected keyword [28]: Unexpected keyword argument `v1` to call `func2`. +callables_kwargs.py:101:0 Incompatible variable type [9]: v3 is declared to have type `TDProtocol3` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. +callables_kwargs.py:102:0 Incompatible variable type [9]: v4 is declared to have type `TDProtocol4` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. +callables_kwargs.py:103:0 Incompatible variable type [9]: v5 is declared to have type `TDProtocol5` but is used as type `typing.Callable(func1)[[Keywords(Unpack[TD2])], None]`. +callables_kwargs.py:111:21 Duplicate parameter [65]: Duplicate parameter name `v1`. +callables_kwargs.py:122:12 Invalid type [31]: `Unpack` in kwargs may only be used with typed dictionaries. `Variable[T (bound to TD2)]` is not a typed dictionary. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 46: Expected 1 errors -Line 51: Expected 1 errors -Line 58: Expected 1 errors -Line 63: 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`.'] """ diff --git a/conformance/results/pyre/callables_protocol.toml b/conformance/results/pyre/callables_protocol.toml index c4630b5e..a20e7472 100644 --- a/conformance/results/pyre/callables_protocol.toml +++ b/conformance/results/pyre/callables_protocol.toml @@ -21,14 +21,12 @@ callables_protocol.py:186:4 Incompatible attribute type [8]: Attribute `other_at 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]`. +callables_protocol.py:284:0 Incompatible variable type [9]: cb13_2 is declared to have type `Proto13_Default` but is used as type `typing.Callable(cb13_no_default)[[Named(path, str)], str]`. +callables_protocol.py:311:0 Incompatible variable type [9]: cb14_2 is declared to have type `Proto14_Default` but is used as type `typing.Callable(cb14_no_default)[[KeywordOnly(path, str)], str]`. """ conformance_automated = "Fail" errors_diff = """ Line 238: 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..64b9b65f 100644 --- a/conformance/results/pyre/callables_subtyping.toml +++ b/conformance/results/pyre/callables_subtyping.toml @@ -4,11 +4,8 @@ Rejects standard parameter as incompatible with keyword-only parameter. Rejects use of Callable with ParamSpec in TypeAlias definition. """ errors_diff = """ -Line 236: Expected 1 errors +Line 196: 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.'] @@ -36,18 +33,15 @@ callables_subtyping.py:151:4 Incompatible variable type [9]: f3 is declared to h 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:236:4 Incompatible variable type [9]: f1 is declared to have type `DefaultArg8` but is used as type `NoDefaultArg8`. 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`. diff --git a/conformance/results/pyre/classes_classvar.toml b/conformance/results/pyre/classes_classvar.toml index 52902aed..a44ae1aa 100644 --- a/conformance/results/pyre/classes_classvar.toml +++ b/conformance/results/pyre/classes_classvar.toml @@ -17,7 +17,7 @@ classes_classvar.py:40:13 Unbound name [10]: Name `var` is used but not defined 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:78:0 Assert type [70]: 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`. """ @@ -34,5 +34,5 @@ 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 78: Unexpected errors ['classes_classvar.py:78:0 Assert type [70]: Expected `float` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/classes_override.toml b/conformance/results/pyre/classes_override.toml index ac73d049..bb459508 100644 --- a/conformance/results/pyre/classes_override.toml +++ b/conformance/results/pyre/classes_override.toml @@ -1,6 +1,5 @@ -conformant = "Partial" +conformant = "Pass" 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`. @@ -9,11 +8,7 @@ classes_override.py:65:4 Invalid override [40]: `classes_override.ChildA.method4 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" +conformance_automated = "Pass" 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`.'] """ diff --git a/conformance/results/pyre/constructors_call_init.toml b/conformance/results/pyre/constructors_call_init.toml index 9358ef09..0db6964f 100644 --- a/conformance/results/pyre/constructors_call_init.toml +++ b/conformance/results/pyre/constructors_call_init.toml @@ -3,24 +3,26 @@ notes = """ Does not infer type of Self for self parameter of __init__ method. Does not report errors during binding to self parameter of __init__ method. Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method. +Incorrectly raises Incompatible overload type errors. +Incorrectly raises compatibility type errors. """ conformance_automated = "Fail" errors_diff = """ Line 42: Expected 1 errors Line 56: Expected 1 errors Line 107: Expected 1 errors -Line 24: Unexpected errors ['constructors_call_init.py:24:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] +Line 24: Unexpected errors ['constructors_call_init.py:24:0 Assert type [70]: 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 91: Unexpected errors ["constructors_call_init.py:91:0 Assert type [70]: Expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`."] +Line 99: Unexpected errors ["constructors_call_init.py:99:0 Assert type [70]: 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:24:0 Assert type [70]: 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:91:0 Assert type [70]: Expected `Class6[int, str]` but got `Class6[typing_extensions.Literal[0], typing_extensions.Literal['']]`. +constructors_call_init.py:99:0 Assert type [70]: 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..f0be5794 100644 --- a/conformance/results/pyre/constructors_call_new.toml +++ b/conformance/results/pyre/constructors_call_new.toml @@ -2,29 +2,30 @@ conformant = "Partial" notes = """ Does not support __new__ return type that is not a subclass of the class being constructed. Does not report errors during binding to cls parameter of __new__ method. +Incorrectly raises compatibility type errors. """ conformance_automated = "Fail" errors_diff = """ 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`.'] +Line 23: Unexpected errors ['constructors_call_new.py:23:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`.'] +Line 35: Unexpected errors ['constructors_call_new.py:35:0 Assert type [70]: Expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`.'] +Line 36: Unexpected errors ["constructors_call_new.py:36:0 Assert type [70]: Expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`."] +Line 49: Unexpected errors ['constructors_call_new.py:49:0 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: 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:23:0 Assert type [70]: Expected `Class1[int]` but got `Class1[typing_extensions.Literal[1]]`. +constructors_call_new.py:35:0 Assert type [70]: Expected `Class2[int]` but got `Class2[typing_extensions.Literal[1]]`. +constructors_call_new.py:36:0 Assert type [70]: Expected `Class2[str]` but got `Class2[typing_extensions.Literal['']]`. +constructors_call_new.py:49:0 Assert type [70]: 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:0 Assert type [70]: 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:4 Assert type [70]: 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:0 Assert type [70]: Expected `Union[Class6, int]` but got `Class6`. constructors_call_new.py:89:12 Missing argument [20]: Call `Class6.__init__` expects argument `x`. """ diff --git a/conformance/results/pyre/constructors_callable.toml b/conformance/results/pyre/constructors_callable.toml index 554365e1..0f3650ea 100644 --- a/conformance/results/pyre/constructors_callable.toml +++ b/conformance/results/pyre/constructors_callable.toml @@ -4,6 +4,7 @@ Does not generate a union type for __new__ and __init__ when converting class to Does not ignore __init__ based on __new__ return type when converting class to callable. Does not support __new__ return type that is different from class being constructed. Does not use annotated type of self in __init__ method to generate return type of callable. +Incorrectly raises incompatibility type errors. """ conformance_automated = "Fail" errors_diff = """ @@ -11,17 +12,17 @@ Line 127: Expected 1 errors Line 144: Expected 1 errors Line 184: Expected 1 errors Line 195: Expected 1 errors -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 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 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 78: Unexpected errors ['constructors_callable.py:78:0 Assert type [70]: Expected `int` but got `Class4`.'] +Line 126: Unexpected errors ['constructors_callable.py:126:0 Assert type [70]: Expected `Class6Proxy` but got `Class6`.', 'constructors_callable.py:126:12 Missing argument [20]: PositionalOnly call expects argument `x`.'] +Line 143: Unexpected errors ['constructors_callable.py:143:0 Assert type [70]: 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 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 164: Unexpected errors ['constructors_callable.py:164:0 Assert type [70]: Expected `Class7[int]` but got `Class7[typing.Any]`.'] +Line 165: Unexpected errors ['constructors_callable.py:165:0 Assert type [70]: 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 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 183: Unexpected errors ['constructors_callable.py:183:0 Assert type [70]: 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 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`.'] +Line 194: Unexpected errors ['constructors_callable.py:194:0 Assert type [70]: 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]`. @@ -34,26 +35,26 @@ constructors_callable.py:65:0 Missing argument [20]: PositionalOnly call expects 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:78:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:164:0 Assert type [70]: Expected `Class7[int]` but got `Class7[typing.Any]`. +constructors_callable.py:165:0 Assert type [70]: 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:183:0 Assert type [70]: 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`. +constructors_callable.py:194:0 Assert type [70]: Expected `Class9` but got `typing.Any`. """ diff --git a/conformance/results/pyre/dataclasses_descriptors.toml b/conformance/results/pyre/dataclasses_descriptors.toml index 0f99b597..05c108e4 100644 --- a/conformance/results/pyre/dataclasses_descriptors.toml +++ b/conformance/results/pyre/dataclasses_descriptors.toml @@ -1,19 +1,20 @@ conformant = "Partial" notes = """ Incorrectly generates error when calling constructor of dataclass with descriptor. +Incorrectly raises incompatibility type errors. """ 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]`. +dataclasses_descriptors.py:61:0 Assert type [70]: Expected `List[int]` but got `Desc2[int]`. +dataclasses_descriptors.py:62:0 Assert type [70]: Expected `List[str]` but got `Desc2[str]`. +dataclasses_descriptors.py:66:0 Assert type [70]: Expected `int` but got `Desc2[int]`. +dataclasses_descriptors.py:67:0 Assert type [70]: Expected `str` but got `Desc2[str]`. """ conformance_automated = "Fail" errors_diff = """ Line 35: Unexpected errors ['dataclasses_descriptors.py:35:10 Incompatible parameter type [6]: In call `DC1.__init__`, for 1st positional argument, expected `Desc1` but got `int`.'] -Line 61: Unexpected errors ['dataclasses_descriptors.py:61:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[int]` but got `Desc2[int]`.'] -Line 62: Unexpected errors ['dataclasses_descriptors.py:62:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `List[str]` but got `Desc2[str]`.'] -Line 66: Unexpected errors ['dataclasses_descriptors.py:66:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `Desc2[int]`.'] -Line 67: Unexpected errors ['dataclasses_descriptors.py:67:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `Desc2[str]`.'] +Line 61: Unexpected errors ['dataclasses_descriptors.py:61:0 Assert type [70]: Expected `List[int]` but got `Desc2[int]`.'] +Line 62: Unexpected errors ['dataclasses_descriptors.py:62:0 Assert type [70]: Expected `List[str]` but got `Desc2[str]`.'] +Line 66: Unexpected errors ['dataclasses_descriptors.py:66:0 Assert type [70]: Expected `int` but got `Desc2[int]`.'] +Line 67: Unexpected errors ['dataclasses_descriptors.py:67:0 Assert type [70]: Expected `str` but got `Desc2[str]`.'] """ diff --git a/conformance/results/pyre/dataclasses_transform_func.toml b/conformance/results/pyre/dataclasses_transform_func.toml index 2f69091f..1cefede1 100644 --- a/conformance/results/pyre/dataclasses_transform_func.toml +++ b/conformance/results/pyre/dataclasses_transform_func.toml @@ -5,7 +5,6 @@ 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. @@ -27,7 +26,6 @@ dataclasses_transform_func.py:97:0 Invalid assignment [41]: Cannot reassign fina conformance_automated = "Fail" errors_diff = """ 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.'] diff --git a/conformance/results/pyre/dataclasses_usage.toml b/conformance/results/pyre/dataclasses_usage.toml index 4620f9ec..f0a0ea0d 100644 --- a/conformance/results/pyre/dataclasses_usage.toml +++ b/conformance/results/pyre/dataclasses_usage.toml @@ -3,6 +3,7 @@ notes = """ Does not report error when field with no default follows field with default. Complains on `assert_type` when used for bound methods vs `Callable`. Does not understand `__dataclass_fields__`. +Incorrectly raises incompatibility type errors. """ output = """ dataclasses_usage.py:50:5 Missing argument [20]: Call `InventoryItem.__init__` expects argument `unit_price`. @@ -11,14 +12,13 @@ dataclasses_usage.py:52:5 Too many arguments [19]: Call `InventoryItem.__init__` 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]]`. +dataclasses_usage.py:213:0 Assert type [70]: Expected `DC16[int]` but got `DC16[typing_extensions.Literal[1]]`. """ conformance_automated = "Fail" errors_diff = """ @@ -26,9 +26,8 @@ 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]]`.'] +Line 213: Unexpected errors ['dataclasses_usage.py:213:0 Assert type [70]: 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..7c81101d 100644 --- a/conformance/results/pyre/directives_assert_type.toml +++ b/conformance/results/pyre/directives_assert_type.toml @@ -1,13 +1,12 @@ conformant = "Pass" 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:27:4 Assert type [70]: Expected `int` but got `Union[int, str]`. +directives_assert_type.py:28:4 Assert type [70]: Expected `int` but got `typing.Any`. +directives_assert_type.py:29:4 Assert type [70]: 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:32:4 Assert type [70]: Expected `int` but got `typing_extensions.Literal['']`. directives_assert_type.py:33:4 Too many arguments [19]: Call `assert_type` expects 2 positional arguments, 3 were provided. """ conformance_automated = "Pass" diff --git a/conformance/results/pyre/directives_reveal_type.toml b/conformance/results/pyre/directives_reveal_type.toml index 492d32b2..64a213ec 100644 --- a/conformance/results/pyre/directives_reveal_type.toml +++ b/conformance/results/pyre/directives_reveal_type.toml @@ -1,6 +1,5 @@ -conformant = "Partial" +conformant = "Pass" 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]`. @@ -8,9 +7,8 @@ directives_reveal_type.py:15:4 Revealed type [-1]: Revealed type for `b` is `typ 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]`. +directives_reveal_type.py:20:4 Too many arguments [19]: Call `reveal_type` expects 1 positional argument, 2 were provided. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -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..07cd73b2 100644 --- a/conformance/results/pyre/directives_type_ignore_file1.toml +++ b/conformance/results/pyre/directives_type_ignore_file1.toml @@ -1,11 +1,8 @@ -conformant = "Unsupported" +conformant = "Pass" 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_version_platform.toml b/conformance/results/pyre/directives_version_platform.toml index 24d9f1ea..01d4e4b4 100644 --- a/conformance/results/pyre/directives_version_platform.toml +++ b/conformance/results/pyre/directives_version_platform.toml @@ -1,16 +1,10 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -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_behaviors.toml b/conformance/results/pyre/enums_behaviors.toml index 42e56231..49c045e2 100644 --- a/conformance/results/pyre/enums_behaviors.toml +++ b/conformance/results/pyre/enums_behaviors.toml @@ -1,10 +1,9 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not enforce that Enum classes are implicitly final. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 39: Expected 1 errors """ output = """ +enums_behaviors.py:39:0 Invalid inheritance [39]: Cannot inherit from final enum `Shape`. Enums with defined members cannot be extended. """ diff --git a/conformance/results/pyre/enums_definition.toml b/conformance/results/pyre/enums_definition.toml index 832a9d48..7e80103f 100644 --- a/conformance/results/pyre/enums_definition.toml +++ b/conformance/results/pyre/enums_definition.toml @@ -1,11 +1,8 @@ -conformant = "Partial" +conformant = "Pass" 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. @@ -13,7 +10,8 @@ enums_definition.py:27:9 Too many arguments [19]: Call `Enum.__new__` expects 1 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:0 Assert type [70]: Expected `typing_extensions.Literal[Color7.RED]` but got `unknown`. enums_definition.py:38:12 Undefined attribute [16]: `Color7` has no attribute `RED`. +enums_definition.py:39:0 Assert type [70]: Expected `typing_extensions.Literal[Color8.RED]` but got `unknown`. 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..340065e0 100644 --- a/conformance/results/pyre/enums_expansion.toml +++ b/conformance/results/pyre/enums_expansion.toml @@ -1,12 +1,11 @@ conformant = "Pass" notes = """ -Does not perform type narrowing based on enum literal expansion (optional). """ conformance_automated = "Pass" errors_diff = """ """ 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`. +enums_expansion.py:25:8 Assert type [70]: Expected `typing_extensions.Literal[Color.GREEN]` but got `Color`. +enums_expansion.py:35:12 Assert type [70]: Expected `Never` but got `Color`. +enums_expansion.py:53:8 Assert type [70]: 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..263b2fab 100644 --- a/conformance/results/pyre/enums_member_names.toml +++ b/conformance/results/pyre/enums_member_names.toml @@ -6,8 +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`. +enums_member_names.py:21:0 Assert type [70]: Expected `typing_extensions.Literal['RED']` but got `str`. +enums_member_names.py:22:0 Assert type [70]: Expected `typing_extensions.Literal['RED']` but got `str`. +enums_member_names.py:26:4 Assert type [70]: Expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['RED']]` but got `str`. +enums_member_names.py:30:4 Assert type [70]: Expected `Union[typing_extensions.Literal['BLUE'], typing_extensions.Literal['GREEN'], typing_extensions.Literal['RED']]` but got `str`. """ diff --git a/conformance/results/pyre/enums_member_values.toml b/conformance/results/pyre/enums_member_values.toml index 84241741..e14ce8a6 100644 --- a/conformance/results/pyre/enums_member_values.toml +++ b/conformance/results/pyre/enums_member_values.toml @@ -1,23 +1,17 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not enforce declared type of `_value_`. -Does not enforce assigned tuple types for enum members (optional). -Does not evaluate literal types for enum member values (optional). -Does not evaluate literal types for auto values (optional). """ -conformance_automated = "Fail" +conformance_automated = "Pass" 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`. +enums_member_values.py:21:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:22:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:26:4 Assert type [70]: Expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[3]]` but got `typing.Any`. +enums_member_values.py:30:4 Assert type [70]: Expected `Union[typing_extensions.Literal[1], typing_extensions.Literal[2], typing_extensions.Literal[3]]` but got `typing.Any`. +enums_member_values.py:54:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:68:0 Assert type [70]: Expected `typing_extensions.Literal[1]` but got `typing.Any`. +enums_member_values.py:78:4 Incompatible attribute type [8]: Attribute `GREEN` declared in class `Color3` has type `int` but is used as type `str`. +enums_member_values.py:85:8 Incompatible attribute type [8]: Attribute `_value_` declared in class `Planet2` has type `str` but is used as type `int`. +enums_member_values.py:96:0 Assert type [70]: Expected `int` but got `typing.Any`. """ diff --git a/conformance/results/pyre/enums_members.toml b/conformance/results/pyre/enums_members.toml index 34529ba5..91220359 100644 --- a/conformance/results/pyre/enums_members.toml +++ b/conformance/results/pyre/enums_members.toml @@ -11,30 +11,18 @@ Does not support `_ignore_` mechanism (optional). """ conformance_automated = "Fail" errors_diff = """ -Line 50: Expected 1 errors Line 82: Expected 1 errors Line 83: 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 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]`.'] +Line 100: Unexpected errors ['enums_members.py:100:0 Assert type [70]: Expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`.'] """ 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:50:4 Illegal annotation target [35]: Target `enums_members.Pet3.DOG` cannot be annotated as it is an enum member. Enum value types can be specified by annotating the `_value_` attribute. +enums_members.py:84:0 Assert type [70]: Expected `typing_extensions.Literal[Pet4.species]` but got `str`. +enums_members.py:85:0 Assert type [70]: Expected `typing_extensions.Literal[Pet4.speak]` but got `typing.Callable(Pet4.speak)[[Named(self, Pet4)], None]`. +enums_members.py:100:0 Assert type [70]: Expected `typing_extensions.Literal[TrafficLight.YELLOW]` but got `typing_extensions.Literal[TrafficLight.AMBER]`. 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`. +enums_members.py:146:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[Pet5.DOG]`. +enums_members.py:147:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[Pet5.FISH]`. """ diff --git a/conformance/results/pyre/exceptions_context_managers.toml b/conformance/results/pyre/exceptions_context_managers.toml index 9dff9945..507ba624 100644 --- a/conformance/results/pyre/exceptions_context_managers.toml +++ b/conformance/results/pyre/exceptions_context_managers.toml @@ -1,13 +1,13 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not understand context manager exception rules. +assert_type causes failures. """ 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`.'] +Line 50: Unexpected errors ['exceptions_context_managers.py:50:4 Assert type [70]: Expected `Union[int, str]` but got `str`.'] +Line 57: Unexpected errors ['exceptions_context_managers.py:57:4 Assert type [70]: 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`. +exceptions_context_managers.py:50:4 Assert type [70]: Expected `Union[int, str]` but got `str`. +exceptions_context_managers.py:57:4 Assert type [70]: Expected `Union[int, str]` but got `str`. """ diff --git a/conformance/results/pyre/generics_basic.toml b/conformance/results/pyre/generics_basic.toml index b7e8d00b..0b3d5e6d 100644 --- a/conformance/results/pyre/generics_basic.toml +++ b/conformance/results/pyre/generics_basic.toml @@ -12,14 +12,14 @@ generics_basic.py:34:15 Incompatible parameter type [6]: In call `str.__add__`, 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[...]. +generics_basic.py:157:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. +generics_basic.py:158:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. """ conformance_automated = "Fail" errors_diff = """ -Line 157: Expected 1 errors -Line 158: Expected 1 errors +Line 55: 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..2db9965f 100644 --- a/conformance/results/pyre/generics_defaults.toml +++ b/conformance/results/pyre/generics_defaults.toml @@ -6,64 +6,64 @@ 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:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`. generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. -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:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`. generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`. generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters. -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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:46:0 Assert type [70]: 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:52:0 Assert type [70]: 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:55:0 Assert type [70]: 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:59:0 Assert type [70]: 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:63:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:91:25 Undefined or invalid type [11]: Annotation `DefaultTs` is not defined as a type. +generics_defaults.py:94:0 Assert type [70]: Expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`. 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:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `Class_TypeVarTuple`. generics_defaults.py:95:34 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. -generics_defaults.py:96:31 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Tuple[]` but got `Tuple[Type[int], Type[bool]]`. Expected has length 0, but actual has length 2. +generics_defaults.py:96:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `typing.Any`. +generics_defaults.py:96:12 Undefined attribute [16]: `Class_TypeVarTuple` has no attribute `__getitem__`. +generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters. 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:127:0 Assert type [70]: Expected `int` but got `unknown`. +generics_defaults.py:138:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. 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 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`. 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`. generics_defaults.py:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters. +generics_defaults.py:167:0 Assert type [70]: Expected `int` but got `unknown`. """ conformance_automated = "Fail" errors_diff = """ @@ -71,38 +71,37 @@ 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 30: Unexpected errors ['generics_defaults.py:30:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `Type[NoNonDefaults]`.', 'generics_defaults.py:30:27 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] +Line 31: Unexpected errors ['generics_defaults.py:31:0 Assert type [70]: Expected `Type[NoNonDefaults[]]` but got `typing.Any`.', 'generics_defaults.py:31:12 Undefined attribute [16]: `NoNonDefaults` has no attribute `__getitem__`.', 'generics_defaults.py:31:32 Invalid type parameters [24]: Non-generic type `NoNonDefaults` cannot take parameters.'] +Line 32: Unexpected errors ['generics_defaults.py:32:0 Assert type [70]: 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 38: Unexpected errors ['generics_defaults.py:38:0 Assert type [70]: 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 Assert type [70]: 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 45: Unexpected errors ['generics_defaults.py:45:0 Assert type [70]: 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 Assert type [70]: 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 52: Unexpected errors ['generics_defaults.py:52:0 Assert type [70]: 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 55: Unexpected errors ['generics_defaults.py:55:0 Assert type [70]: 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 59: Unexpected errors ['generics_defaults.py:59:0 Assert type [70]: 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 63: Unexpected errors ['generics_defaults.py:63:0 Assert type [70]: 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 79: Unexpected errors ['generics_defaults.py:79:0 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: 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 91: Unexpected errors ['generics_defaults.py:91:25 Undefined or invalid type [11]: Annotation `DefaultTs` is not defined as a type.'] +Line 94: Unexpected errors ['generics_defaults.py:94:0 Assert type [70]: Expected `Type[Class_TypeVarTuple[]]` but got `Type[Class_TypeVarTuple]`.', '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 Assert type [70]: 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:0 Assert type [70]: Expected `Class_TypeVarTuple[]` but got `typing.Any`.', 'generics_defaults.py:96:12 Undefined attribute [16]: `Class_TypeVarTuple` has no attribute `__getitem__`.', 'generics_defaults.py:96:45 Invalid type parameters [24]: Non-generic type `Class_TypeVarTuple` cannot take parameters.'] 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 127: Unexpected errors ['generics_defaults.py:127:0 Assert type [70]: Expected `int` but got `unknown`.'] +Line 148: Unexpected errors ["generics_defaults.py:148:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Ts`.", '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 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: Expected `typing.Callable[[Foo7[]], Foo7[]]` but got `typing.Callable(Foo7.meth)[[Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]], Variable[_Self_generics_defaults_Foo7__ (bound to Foo7)]]`.', 'generics_defaults.py:166:23 Invalid type parameters [24]: Non-generic type `Foo7` cannot take parameters.'] +Line 167: Unexpected errors ['generics_defaults.py:167:0 Assert type [70]: Expected `int` but got `unknown`.'] """ diff --git a/conformance/results/pyre/generics_defaults_referential.toml b/conformance/results/pyre/generics_defaults_referential.toml index 3da14a21..d7759bb4 100644 --- a/conformance/results/pyre/generics_defaults_referential.toml +++ b/conformance/results/pyre/generics_defaults_referential.toml @@ -3,18 +3,18 @@ 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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. @@ -24,16 +24,16 @@ generics_defaults_referential.py:53:13 Undefined or invalid type [11]: Annotatio 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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" @@ -44,18 +44,18 @@ 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 23: Unexpected errors ['generics_defaults_referential.py:23:0 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: 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 35: Unexpected errors ['generics_defaults_referential.py:35:0 Assert type [70]: 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.'] +Line 94: Unexpected errors ['generics_defaults_referential.py:94:0 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: 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..91acb349 100644 --- a/conformance/results/pyre/generics_defaults_specialization.toml +++ b/conformance/results/pyre/generics_defaults_specialization.toml @@ -7,18 +7,21 @@ generics_defaults_specialization.py:19:30 Undefined or invalid type [11]: Annota 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:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`. generics_defaults_specialization.py:26:20 Invalid type parameters [24]: Non-generic type `SomethingWithNoDefaults` cannot take parameters. +generics_defaults_specialization.py:27:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`. 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:0 Assert type [70]: 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:0 Assert type [70]: 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:0 Assert type [70]: 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:53:0 Assert type [70]: Expected `str` but got `unknown`. 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`. @@ -29,13 +32,14 @@ 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 26: Unexpected errors ['generics_defaults_specialization.py:26:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`.', '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:4 Assert type [70]: Expected `SomethingWithNoDefaults[]` but got `unknown`.', '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 45: Unexpected errors ['generics_defaults_specialization.py:45:0 Assert type [70]: 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 Assert type [70]: 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 Assert type [70]: 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 53: Unexpected errors ['generics_defaults_specialization.py:53:0 Assert type [70]: Expected `str` but got `unknown`.'] Line 58: Unexpected errors ['generics_defaults_specialization.py:58:10 Undefined or invalid type [11]: Annotation `DefaultIntT` is not defined as a type.'] Line 65: Unexpected errors ['generics_defaults_specialization.py:65:0 Incompatible variable type [9]: v1 is declared to have type `Baz[]` but is used as type `Spam`.', 'generics_defaults_specialization.py:65:4 Invalid type parameters [24]: Non-generic type `Baz` cannot take parameters.'] """ diff --git a/conformance/results/pyre/generics_paramspec_components.toml b/conformance/results/pyre/generics_paramspec_components.toml index daf77e2f..76e8a8c2 100644 --- a/conformance/results/pyre/generics_paramspec_components.toml +++ b/conformance/results/pyre/generics_paramspec_components.toml @@ -13,7 +13,7 @@ generics_paramspec_components.py:17:44 Undefined or invalid type [11]: Annotatio 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:83:8 Unexpected keyword [28]: Unexpected keyword argument `x` to call `outer.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`. """ diff --git a/conformance/results/pyre/generics_paramspec_semantics.toml b/conformance/results/pyre/generics_paramspec_semantics.toml index a3a645b6..85121218 100644 --- a/conformance/results/pyre/generics_paramspec_semantics.toml +++ b/conformance/results/pyre/generics_paramspec_semantics.toml @@ -7,9 +7,9 @@ generics_paramspec_semantics.py:61:22 Incompatible parameter type [6]: In call ` 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`. +generics_paramspec_semantics.py:127:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions. Consider using a context manager instead of a decorator, if possible. +generics_paramspec_semantics.py:132:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions. Consider using a context manager instead of a decorator, if possible. +generics_paramspec_semantics.py:137:1 Invalid decoration [56]: Pyre doesn't yet support decorators with ParamSpec applied to generic functions. Consider using a context manager instead of a decorator, if possible. """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyre/generics_scoping.toml b/conformance/results/pyre/generics_scoping.toml index ae6cd48c..e91ac08b 100644 --- a/conformance/results/pyre/generics_scoping.toml +++ b/conformance/results/pyre/generics_scoping.toml @@ -2,17 +2,18 @@ conformant = "Partial" notes = """ False negative on generic class nested within generic function with same type variable. False negative on generic class nested within generic class with same type variable. +False negative on assert_type uses. """ 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:14:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[1]`. +generics_scoping.py:15:0 Assert type [70]: 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:42:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['abc']`. +generics_scoping.py:43:0 Assert type [70]: 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:87:4 Incompatible attribute type [8]: Attribute `alias` declared in class `Outer` has type `TypeAlias` but is used as type `Type[List[Variable[T]]]`. generics_scoping.py: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__`. @@ -21,8 +22,8 @@ conformance_automated = "Fail" errors_diff = """ Line 65: Expected 1 errors Line 75: Expected 1 errors -Line 14: Unexpected errors ['generics_scoping.py:14:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing_extensions.Literal[1]`.'] -Line 15: Unexpected errors ["generics_scoping.py:15:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['a']`."] -Line 42: Unexpected errors ["generics_scoping.py:42:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing_extensions.Literal['abc']`."] -Line 43: Unexpected errors ["generics_scoping.py:43:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing_extensions.Literal[b'abc']`."] +Line 14: Unexpected errors ['generics_scoping.py:14:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[1]`.'] +Line 15: Unexpected errors ["generics_scoping.py:15:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['a']`."] +Line 42: Unexpected errors ["generics_scoping.py:42:0 Assert type [70]: Expected `str` but got `typing_extensions.Literal['abc']`."] +Line 43: Unexpected errors ["generics_scoping.py:43:0 Assert type [70]: 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 e7ef9d28..f298efb4 100644 --- a/conformance/results/pyre/generics_self_advanced.toml +++ b/conformance/results/pyre/generics_self_advanced.toml @@ -1,23 +1,24 @@ conformant = "Partial" notes = """ Does not handle use of `Self` within class body correctly. +False negatives on assert_type uses. """ 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`. +generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`. +generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`. +generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`. +generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`. +generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`. +generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`. """ 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`.'] +Line 35: Unexpected errors ['generics_self_advanced.py:35:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] +Line 37: Unexpected errors ['generics_self_advanced.py:37:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] +Line 38: Unexpected errors ['generics_self_advanced.py:38:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] +Line 42: Unexpected errors ['generics_self_advanced.py:42:8 Assert type [70]: Expected `unknown` but got `Type[ChildB]`.'] +Line 44: Unexpected errors ['generics_self_advanced.py:44:8 Assert type [70]: Expected `unknown` but got `typing.Any`.'] +Line 45: Unexpected errors ['generics_self_advanced.py:45:8 Assert type [70]: Expected `unknown` but got `ChildB`.'] """ diff --git a/conformance/results/pyre/generics_self_basic.toml b/conformance/results/pyre/generics_self_basic.toml index 8b64f812..db088609 100644 --- a/conformance/results/pyre/generics_self_basic.toml +++ b/conformance/results/pyre/generics_self_basic.toml @@ -3,17 +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:8 Assert type [70]: 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:27:8 Assert type [70]: 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)]`. +generics_self_basic.py:40:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`. +generics_self_basic.py:67:25 Invalid type parameters [24]: Non-generic type `_Self_generics_self_basic_Container__` cannot take parameters. """ conformance_automated = "Fail" errors_diff = """ -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)]`.'] +Line 14: Unexpected errors ['generics_self_basic.py:14:8 Assert type [70]: 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 Assert type [70]: Expected `unknown` but got `Type[Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]]`.'] +Line 40: Unexpected errors ['generics_self_basic.py:40:8 Assert type [70]: Expected `unknown` but got `Variable[_Self_generics_self_basic_Shape__ (bound to Shape)]`.'] """ diff --git a/conformance/results/pyre/generics_syntax_compatibility.toml b/conformance/results/pyre/generics_syntax_compatibility.toml index 46268f56..71877e3c 100644 --- a/conformance/results/pyre/generics_syntax_compatibility.toml +++ b/conformance/results/pyre/generics_syntax_compatibility.toml @@ -1,11 +1,14 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +False negative on mixing legacy and PEP695 syntax. +Does not detect mixing legacy and PEP695 syntax in methods. """ output = """ -generics_syntax_compatibility.py:14:13 Parsing failure [404]: invalid syntax +generics_syntax_compatibility.py:14:16 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[K]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[K]`. +generics_syntax_compatibility.py:18:19 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[K]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[K]`. """ conformance_automated = "Fail" errors_diff = """ Line 26: Expected 1 errors +Line 18: Unexpected errors ["generics_syntax_compatibility.py:18:19 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[K]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[K]`."] """ diff --git a/conformance/results/pyre/generics_syntax_declarations.toml b/conformance/results/pyre/generics_syntax_declarations.toml index 41081106..a97c785e 100644 --- a/conformance/results/pyre/generics_syntax_declarations.toml +++ b/conformance/results/pyre/generics_syntax_declarations.toml @@ -1,21 +1,20 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Does not detect incorrect use of legacy style syntax mixed with PEP695 syntax. +False negatives due to assert_type use. """ output = """ -generics_syntax_declarations.py:13:17 Parsing failure [404]: invalid syntax +generics_syntax_declarations.py:32:8 Undefined attribute [16]: `Variable[T (bound to str)]` has no attribute `is_integer`. +generics_syntax_declarations.py:44:20 Invalid bound [75]: `dict[(str, V)]` is not valid bound. +generics_syntax_declarations.py:48:16 Invalid bound [75]: `[str, int]` is not valid bound. +generics_syntax_declarations.py:60:16 Invalid bound [75]: `()` is not valid bound. +generics_syntax_declarations.py:64:16 Invalid bound [75]: `(str)` is not valid bound. +generics_syntax_declarations.py:71:16 Invalid bound [75]: `$local_generics_syntax_declarations$t1` is not valid bound. +generics_syntax_declarations.py:75:16 Invalid bound [75]: `(3, bytes)` is not valid bound. +generics_syntax_declarations.py:79:16 Invalid bound [75]: `(list[S], str)` is not valid bound. """ conformance_automated = "Fail" errors_diff = """ Line 17: Expected 1 errors Line 25: Expected 1 errors -Line 32: Expected 1 errors -Line 44: Expected 1 errors -Line 48: Expected 1 errors -Line 60: Expected 1 errors -Line 64: Expected 1 errors -Line 71: Expected 1 errors -Line 75: Expected 1 errors -Line 79: 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 7a848658..2894b29b 100644 --- a/conformance/results/pyre/generics_syntax_infer_variance.toml +++ b/conformance/results/pyre/generics_syntax_infer_variance.toml @@ -1,29 +1,33 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Incorrectly determines that a class cannot be instantiated with __getitem__. +Incorrectly handles mixing legacy and PEP695 syntax. """ output = """ -generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax +generics_syntax_infer_variance.py:15:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. +generics_syntax_infer_variance.py:17:0 Invalid variance definition [77]: Cannot use infer_variance with predefined variance. +generics_syntax_infer_variance.py:29:0 Incompatible variable type [9]: vco1_2 is declared to have type `ShouldBeCovariant1[int]` but is used as type `ShouldBeCovariant1[float]`. +generics_syntax_infer_variance.py:36:36 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`. +generics_syntax_infer_variance.py:37:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. +generics_syntax_infer_variance.py:37:34 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`. +generics_syntax_infer_variance.py:46:0 Incompatible variable type [9]: vco3_2 is declared to have type `ShouldBeCovariant3[int]` but is used as type `ShouldBeCovariant3[float]`. +generics_syntax_infer_variance.py:75:0 Incompatible variable type [9]: vo5_2 is declared to have type `ShouldBeCovariant5[int]` but is used as type `ShouldBeCovariant5[float]`. +generics_syntax_infer_variance.py:86:0 Incompatible variable type [9]: vo6_2 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. +generics_syntax_infer_variance.py:102:0 Incompatible variable type [9]: vinv1_1 is declared to have type `ShouldBeInvariant1[float]` but is used as type `ShouldBeInvariant1[int]`. +generics_syntax_infer_variance.py:103:0 Incompatible variable type [9]: vinv1_2 is declared to have type `ShouldBeInvariant1[int]` but is used as type `ShouldBeInvariant1[float]`. +generics_syntax_infer_variance.py:117:0 Incompatible variable type [9]: vinv2_1 is declared to have type `ShouldBeInvariant2[float]` but is used as type `ShouldBeInvariant2[int]`. +generics_syntax_infer_variance.py:118:0 Incompatible variable type [9]: vinv2_2 is declared to have type `ShouldBeInvariant2[int]` but is used as type `ShouldBeInvariant2[float]`. +generics_syntax_infer_variance.py:125:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. +generics_syntax_infer_variance.py:126:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. +generics_syntax_infer_variance.py:127:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. +generics_syntax_infer_variance.py:128:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. +generics_syntax_infer_variance.py:133:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. +generics_syntax_infer_variance.py:155:0 Incompatible variable type [9]: vcontra1_1 is declared to have type `ShouldBeContravariant1[float]` but is used as type `ShouldBeContravariant1[int]`. """ conformance_automated = "Fail" errors_diff = """ -Line 15: Expected 1 errors -Line 17: Expected 1 errors -Line 29: Expected 1 errors -Line 37: Expected 1 errors -Line 46: Expected 1 errors -Line 75: Expected 1 errors -Line 86: Expected 1 errors -Line 102: Expected 1 errors -Line 103: Expected 1 errors -Line 117: Expected 1 errors -Line 118: Expected 1 errors -Line 125: Expected 1 errors -Line 126: Expected 1 errors -Line 127: Expected 1 errors -Line 128: Expected 1 errors Line 136: Expected 1 errors Line 144: Expected 1 errors -Line 155: Expected 1 errors -Line 132: Unexpected errors ['generics_syntax_infer_variance.py:132:25 Parsing failure [404]: invalid syntax'] +Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36:36 Invalid class instantiation [45]: Cannot instantiate abstract class `ShouldBeCovariant2` with abstract methods `__getitem__`, `__len__`.'] +Line 133: Unexpected errors ["generics_syntax_infer_variance.py:133:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] """ diff --git a/conformance/results/pyre/generics_syntax_scoping.toml b/conformance/results/pyre/generics_syntax_scoping.toml index db9a56f1..4ac894c8 100644 --- a/conformance/results/pyre/generics_syntax_scoping.toml +++ b/conformance/results/pyre/generics_syntax_scoping.toml @@ -1,16 +1,20 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Does not properly handle mixing legacy syntax with PEP695 syntax. """ output = """ -generics_syntax_scoping.py:14:13 Parsing failure [404]: invalid syntax +generics_syntax_scoping.py:14:19 Invalid bound [75]: `typing.Sequence[$local_generics_syntax_scoping$S]` is not valid bound. +generics_syntax_scoping.py:18:16 Invalid bound [75]: `typing.Sequence[$local_generics_syntax_scoping$T]` is not valid bound. +generics_syntax_scoping.py:27:38 Undefined or invalid type [11]: Annotation `T` is not defined as a type. +generics_syntax_scoping.py:31:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `int`. +generics_syntax_scoping.py:98:28 Undefined or invalid type [11]: Annotation `ClassE.T` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ -Line 18: Expected 1 errors Line 35: Expected 1 errors Line 44: Expected 1 errors Line 92: Expected 1 errors Line 95: Expected 1 errors -Line 98: Expected 1 errors +Line 27: Unexpected errors ['generics_syntax_scoping.py:27:38 Undefined or invalid type [11]: Annotation `T` is not defined as a type.'] +Line 31: Unexpected errors ['generics_syntax_scoping.py:31:41 Incompatible parameter type [6]: In call `typing.GenericMeta.__getitem__`, for 1st positional argument, expected `Type[Variable[T]]` but got `int`.'] """ diff --git a/conformance/results/pyre/generics_type_erasure.toml b/conformance/results/pyre/generics_type_erasure.toml index f2bc6919..af4f56c4 100644 --- a/conformance/results/pyre/generics_type_erasure.toml +++ b/conformance/results/pyre/generics_type_erasure.toml @@ -3,15 +3,16 @@ notes = """ Does not erase unspecified type variables to `Any` prior to `assert_type` handling. False negatives on instance attribute access on the type. Does not infer type of `DefaultDict` with explicit type parameters on constructor. +False negatives on assert_type uses. """ 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:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`. +generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`. +generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`. +generics_type_erasure.py:21:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`. generics_type_erasure.py:38:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[int]` but got `str`. generics_type_erasure.py:40:15 Incompatible parameter type [6]: In call `Node.__init__`, for 1st positional argument, expected `Optional[str]` but got `int`. -generics_type_erasure.py:56:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `bytes` but got `typing.Any`. +generics_type_erasure.py:56:0 Assert type [70]: Expected `bytes` but got `typing.Any`. """ conformance_automated = "Fail" errors_diff = """ @@ -20,9 +21,9 @@ 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`.'] +Line 17: Unexpected errors ["generics_type_erasure.py:17:0 Assert type [70]: Expected `Node[str]` but got `Node[typing_extensions.Literal['']]`."] +Line 18: Unexpected errors ['generics_type_erasure.py:18:0 Assert type [70]: Expected `Node[int]` but got `Node[typing_extensions.Literal[0]]`.'] +Line 19: Unexpected errors ['generics_type_erasure.py:19:0 Assert type [70]: Expected `Node[typing.Any]` but got `Node[Variable[T]]`.'] +Line 21: Unexpected errors ['generics_type_erasure.py:21:0 Assert type [70]: Expected `int` but got `typing_extensions.Literal[0]`.'] +Line 56: Unexpected errors ['generics_type_erasure.py:56:0 Assert type [70]: Expected `bytes` but got `typing.Any`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_args.toml b/conformance/results/pyre/generics_typevartuple_args.toml index eaca737d..7f48df0c 100644 --- a/conformance/results/pyre/generics_typevartuple_args.toml +++ b/conformance/results/pyre/generics_typevartuple_args.toml @@ -1,32 +1,25 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not support star expressions for `Unpack`. +Does not property handle TypeVarTuple. """ 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. +generics_typevartuple_args.py:20:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['a']]`. +generics_typevartuple_args.py:32:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal['']]`. +generics_typevartuple_args.py:33:0 Invalid argument [32]: Argument types `typing_extensions.Literal[0], typing_extensions.Literal['']` are not compatible with expected variadic elements `*generics_typevartuple_args.Ts, generics_typevartuple_args.Env`. +generics_typevartuple_args.py:34:0 Invalid argument [32]: Argument types `typing_extensions.Literal[0], typing_extensions.Literal['']` are not compatible with expected variadic elements `*generics_typevartuple_args.Ts, generics_typevartuple_args.Env`. +generics_typevartuple_args.py:48:9 Incompatible parameter type [6]: In call `func1`, for 2nd positional argument, expected `int` but got `str`. +generics_typevartuple_args.py:57:0 Invalid argument [32]: Argument types `typing_extensions.Literal[1], typing_extensions.Literal[1], typing_extensions.Literal['']` are not compatible with expected variadic elements `int, *Tuple[str, ...], str`. +generics_typevartuple_args.py:58:0 Invalid argument [32]: Argument types `typing_extensions.Literal[1]` are not compatible with expected variadic elements `int, *Tuple[str, ...], str`. +generics_typevartuple_args.py:59:0 Invalid argument [32]: Argument types `typing_extensions.Literal['']` are not compatible with expected variadic elements `int, *Tuple[str, ...], str`. +generics_typevartuple_args.py:66:6 Incompatible parameter type [6]: In call `func3`, for 1st positional argument, expected `Unpack[Tuple[int, str]]` but got `int`. +generics_typevartuple_args.py:66:9 Incompatible parameter type [6]: In call `func3`, for 2nd positional argument, expected `Unpack[Tuple[int, str]]` but got `str`. +generics_typevartuple_args.py:67:6 Incompatible parameter type [6]: In call `func3`, for 1st positional argument, expected `Unpack[Tuple[int, str]]` but got `int`. """ conformance_automated = "Fail" errors_diff = """ -Line 33: Expected 1 errors -Line 34: Expected 1 errors -Line 48: Expected 1 errors -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.'] +Line 20: Unexpected errors ["generics_typevartuple_args.py:20:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[1], typing_extensions.Literal['a']]`."] +Line 32: Unexpected errors ["generics_typevartuple_args.py:32:0 Assert type [70]: Expected `Tuple[int, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal['']]`."] +Line 66: Unexpected errors ['generics_typevartuple_args.py:66:6 Incompatible parameter type [6]: In call `func3`, for 1st positional argument, expected `Unpack[Tuple[int, str]]` but got `int`.', 'generics_typevartuple_args.py:66:9 Incompatible parameter type [6]: In call `func3`, for 2nd positional argument, expected `Unpack[Tuple[int, str]]` but got `str`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_basic.toml b/conformance/results/pyre/generics_typevartuple_basic.toml index 8964996a..6b3fded1 100644 --- a/conformance/results/pyre/generics_typevartuple_basic.toml +++ b/conformance/results/pyre/generics_typevartuple_basic.toml @@ -1,73 +1,33 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ Does not support TypeVarTuple. +False negatives due to assert_type. """ 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:42:33 Incompatible parameter type [6]: In call `Array.__init__`, for 1st positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Shape]` but got `Height`. +generics_typevartuple_basic.py:43:0 Incompatible variable type [9]: v5 is declared to have type `Array[Batch, Height, Width]` but is used as type `Array[Batch, Width]`. +generics_typevartuple_basic.py:44:0 Incompatible variable type [9]: v6 is declared to have type `Array[Time, Batch, Height, Width]` but is used as type `Array[Time, Batch, Width, Height]`. 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:54:21 Invalid type variable [34]: The type variable `Shape` isn't present in the function's parameters. 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. +generics_typevartuple_basic.py:84:0 Assert type [70]: Expected `Tuple[int]` but got `Tuple[typing_extensions.Literal[0]]`. +generics_typevartuple_basic.py:84:24 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`. +generics_typevartuple_basic.py:87:12 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`. +generics_typevartuple_basic.py:89:12 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[str]`. +generics_typevartuple_basic.py:90:14 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`. +generics_typevartuple_basic.py:99:16 Incompatible parameter type [6]: In call `multiply`, for 2nd positional argument, expected `Array[*generics_typevartuple_basic.Shape]` but got `Array[Width]`. +generics_typevartuple_basic.py:100:16 Incompatible parameter type [6]: In call `multiply`, for 2nd positional argument, expected `Array[*generics_typevartuple_basic.Shape]` but got `Array[Height, Width]`. +generics_typevartuple_basic.py:106:13 Undefined or invalid type [11]: Annotation `Ts1` is not defined as a type. +generics_typevartuple_basic.py:106:13 Undefined or invalid type [11]: Annotation `Ts2` is not defined as a type. """ conformance_automated = "Fail" errors_diff = """ Line 53: Expected 1 errors Line 56: Expected 1 errors Line 59: Expected 1 errors -Line 89: 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 54: Unexpected errors ["generics_typevartuple_basic.py:54:21 Invalid type variable [34]: The type variable `Shape` isn't present in the function's parameters."] +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:0 Assert type [70]: Expected `Tuple[int]` but got `Tuple[typing_extensions.Literal[0]]`.', 'generics_typevartuple_basic.py:84:24 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`.'] +Line 87: Unexpected errors ['generics_typevartuple_basic.py:87:12 Incompatible parameter type [6]: In call `func2`, for 2nd positional argument, expected `typing.Tuple[*generics_typevartuple_basic.Ts]` but got `Tuple[int]`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_callable.toml b/conformance/results/pyre/generics_typevartuple_callable.toml index e3c989ea..aa0453d9 100644 --- a/conformance/results/pyre/generics_typevartuple_callable.toml +++ b/conformance/results/pyre/generics_typevartuple_callable.toml @@ -1,28 +1,12 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not support TypeVarTuple. +False negatives due to assert_type. """ 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. +generics_typevartuple_callable.py:26:8 Incompatible parameter type [6]: In call `Process.__init__`, for argument `target`, expected `typing.Callable[[Variable(*generics_typevartuple_callable.Ts)], None]` but got `typing.Callable(func1)[[Named(arg1, int), Named(arg2, str)], None]`. +generics_typevartuple_callable.py:49:0 Assert type [70]: Expected `Tuple[float, str, complex]` but got `Tuple[float, typing_extensions.Literal[''], complex]`. """ 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 49: Unexpected errors ["generics_typevartuple_callable.py:49:0 Assert type [70]: Expected `Tuple[float, str, complex]` but got `Tuple[float, typing_extensions.Literal[''], complex]`."] """ diff --git a/conformance/results/pyre/generics_typevartuple_concat.toml b/conformance/results/pyre/generics_typevartuple_concat.toml index e3a1bf0f..3754ffc8 100644 --- a/conformance/results/pyre/generics_typevartuple_concat.toml +++ b/conformance/results/pyre/generics_typevartuple_concat.toml @@ -1,39 +1,14 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Does not support TypeVarTuple. +False negatives due to assert_type. +False compatability error message. """ 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`. +generics_typevartuple_concat.py:52:0 Assert type [70]: Expected `Tuple[int, bool, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal[True], typing_extensions.Literal['a']]`. +generics_typevartuple_concat.py:56:4 Incompatible return type [7]: Expected `typing.Tuple[*generics_typevartuple_concat.Ts, Variable[T]]` but got `typing.Tuple[*Tuple[object, ...], object]`. """ 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`.'] +Line 52: Unexpected errors ["generics_typevartuple_concat.py:52:0 Assert type [70]: Expected `Tuple[int, bool, str]` but got `Tuple[typing_extensions.Literal[0], typing_extensions.Literal[True], typing_extensions.Literal['a']]`."] +Line 56: Unexpected errors ['generics_typevartuple_concat.py:56:4 Incompatible return type [7]: Expected `typing.Tuple[*generics_typevartuple_concat.Ts, Variable[T]]` but got `typing.Tuple[*Tuple[object, ...], object]`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_overloads.toml b/conformance/results/pyre/generics_typevartuple_overloads.toml index 9696e56a..08cb3a92 100644 --- a/conformance/results/pyre/generics_typevartuple_overloads.toml +++ b/conformance/results/pyre/generics_typevartuple_overloads.toml @@ -3,18 +3,11 @@ 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. +generics_typevartuple_overloads.py:18:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `18`. +generics_typevartuple_overloads.py:22:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `22`. """ 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.'] +Line 18: Unexpected errors ['generics_typevartuple_overloads.py:18:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `18`.'] +Line 22: Unexpected errors ['generics_typevartuple_overloads.py:22:4 Incompatible overload [43]: The implementation of `Array.transpose` does not accept all possible arguments of overload defined on line `22`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_specialization.toml b/conformance/results/pyre/generics_typevartuple_specialization.toml index d6cf07fe..0f155d1b 100644 --- a/conformance/results/pyre/generics_typevartuple_specialization.toml +++ b/conformance/results/pyre/generics_typevartuple_specialization.toml @@ -3,78 +3,33 @@ 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. +generics_typevartuple_specialization.py:29:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Height, Width]`. +generics_typevartuple_specialization.py:34:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Time, Height, Width]`. +generics_typevartuple_specialization.py:121:0 Invalid type [31]: Expression `tuple[(T1, *Ts, T2, *Ts)]` is not a valid type. +generics_typevartuple_specialization.py:122:0 Invalid type [31]: Expression `tuple[(T1, *Ts, T2, *tuple[(int, ...)])]` is not a valid type. +generics_typevartuple_specialization.py:127:4 Invalid type variable [34]: The type variable `Variable[T1]` can only be used to annotate generic classes or functions. +generics_typevartuple_specialization.py:127:4 Invalid type variable [34]: The type variable `Variable[T2]` can only be used to annotate generic classes or functions. +generics_typevartuple_specialization.py:127:4 Invalid type variable [34]: The type variable `Ts` can only be used to annotate generic classes or functions. +generics_typevartuple_specialization.py:136:4 Assert type [70]: Expected `Tuple[Tuple[str], bool, float]` but got `Tuple[Tuple[float], str, bool]`. +generics_typevartuple_specialization.py:137:4 Assert type [70]: Expected `Tuple[Tuple[str, bool], float, int]` but got `Tuple[Tuple[float, int], str, bool]`. +generics_typevartuple_specialization.py:148:4 Assert type [70]: Expected `Tuple[Tuple[], str, bool, float]` but got `Tuple[Tuple[], float, str, bool]`. +generics_typevartuple_specialization.py:149:4 Assert type [70]: Expected `Tuple[Tuple[bool], str, float, int]` but got `Tuple[Tuple[int], float, str, bool]`. +generics_typevartuple_specialization.py:157:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], int]` but got `typing.Tuple[*Tuple[typing.Any, ...], typing.Any]`. +generics_typevartuple_specialization.py:158:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`. +generics_typevartuple_specialization.py:159:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`. """ conformance_automated = "Fail" errors_diff = """ Line 109: Expected 1 errors Line 110: Expected 1 errors Line 163: Expected 1 errors -Line 16: Unexpected errors ['generics_typevartuple_specialization.py:16:12 Invalid type [31]: Expression `typing.Generic[(*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.'] +Line 29: Unexpected errors ['generics_typevartuple_specialization.py:29:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Height, Width]`.'] +Line 34: Unexpected errors ['generics_typevartuple_specialization.py:34:21 Incompatible parameter type [6]: In call `takes_any_array1`, for 1st positional argument, expected `Array[]` but got `Array[Time, Height, Width]`.'] +Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:4 Assert type [70]: Expected `Tuple[Tuple[str], bool, float]` but got `Tuple[Tuple[float], str, bool]`.'] +Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:4 Assert type [70]: Expected `Tuple[Tuple[str, bool], float, int]` but got `Tuple[Tuple[float, int], str, bool]`.'] +Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:4 Assert type [70]: Expected `Tuple[Tuple[], str, bool, float]` but got `Tuple[Tuple[], float, str, bool]`.'] +Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:4 Assert type [70]: Expected `Tuple[Tuple[bool], str, float, int]` but got `Tuple[Tuple[int], float, str, bool]`.'] +Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], int]` but got `typing.Tuple[*Tuple[typing.Any, ...], typing.Any]`.'] +Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`.'] +Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:4 Assert type [70]: Expected `typing.Tuple[*Tuple[int, ...], str]` but got `typing.Tuple[*generics_typevartuple_specialization.Ts, Variable[T1]]`.'] """ diff --git a/conformance/results/pyre/generics_typevartuple_unpack.toml b/conformance/results/pyre/generics_typevartuple_unpack.toml index 7e2f93c9..e71e46e5 100644 --- a/conformance/results/pyre/generics_typevartuple_unpack.toml +++ b/conformance/results/pyre/generics_typevartuple_unpack.toml @@ -1,27 +1,9 @@ -conformant = "Unsupported" +conformant = "Pass" 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. +generics_typevartuple_unpack.py:30:27 Incompatible parameter type [6]: In call `process_batch_channels`, for 1st positional argument, expected `Array[Batch, *Tuple[typing.Any, ...], Channels]` but got `Array[Batch]`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" 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..6c88c406 100644 --- a/conformance/results/pyre/generics_upper_bound.toml +++ b/conformance/results/pyre/generics_upper_bound.toml @@ -4,11 +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 56: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_variance.toml b/conformance/results/pyre/generics_variance.toml index 3054f35e..ee65464e 100644 --- a/conformance/results/pyre/generics_variance.toml +++ b/conformance/results/pyre/generics_variance.toml @@ -4,8 +4,8 @@ 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:77:0 Invalid type variance [46]: The type variable `Variable[T_co](covariant)` is incompatible with parent class type variable `Variable[T](invariant)` 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](invariant)` 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. diff --git a/conformance/results/pyre/generics_variance_inference.toml b/conformance/results/pyre/generics_variance_inference.toml index a0efdd76..39a5cb8c 100644 --- a/conformance/results/pyre/generics_variance_inference.toml +++ b/conformance/results/pyre/generics_variance_inference.toml @@ -1,17 +1,36 @@ -conformant = "Unsupported" +conformant = "Partial" notes = """ -Type parameter syntax not yet support. +Does not properly handle mixing legacy and PEP695 syntax. +False negative about a type variable not being present in the function's parameters. """ output = """ -generics_variance_inference.py:15:13 Parsing failure [404]: invalid syntax +generics_variance_inference.py:24:4 Incompatible variable type [9]: v1 is declared to have type `ClassA[int, int, int]` but is used as type `ClassA[float, int, int]`. +generics_variance_inference.py:25:4 Incompatible variable type [9]: v2 is declared to have type `ClassA[float, float, int]` but is used as type `ClassA[float, int, int]`. +generics_variance_inference.py:28:4 Incompatible variable type [9]: v4 is declared to have type `ClassA[int, int, int]` but is used as type `ClassA[int, float, float]`. +generics_variance_inference.py:33:41 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:36:26 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:48:0 Incompatible variable type [9]: vco2_1 is declared to have type `ShouldBeCovariant2[float]` but is used as type `ShouldBeCovariant2[int]`. +generics_variance_inference.py:49:0 Incompatible variable type [9]: vco2_2 is declared to have type `ShouldBeCovariant2[int]` but is used as type `ShouldBeCovariant2[float]`. +generics_variance_inference.py:53:25 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:63:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. +generics_variance_inference.py:75:19 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:88:23 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:104:27 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters. +generics_variance_inference.py:119:0 Incompatible variable type [9]: vinv3_1 is declared to have type `ShouldBeInvariant3[float, str]` but is used as type `ShouldBeInvariant3[int, str]`. +generics_variance_inference.py:120:0 Incompatible variable type [9]: vinv3_2 is declared to have type `ShouldBeInvariant3[int, str]` but is used as type `ShouldBeInvariant3[float, str]`. +generics_variance_inference.py:121:0 Incompatible variable type [9]: vinv3_3 is declared to have type `ShouldBeInvariant3[str, float]` but is used as type `ShouldBeInvariant3[str, int]`. +generics_variance_inference.py:122:0 Incompatible variable type [9]: vinv3_4 is declared to have type `ShouldBeInvariant3[str, int]` but is used as type `ShouldBeInvariant3[str, float]`. +generics_variance_inference.py:127:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`. +generics_variance_inference.py:169:0 Incompatible variable type [9]: a1 is declared to have type `ShouldBeInvariant6[int]` but is used as type `ShouldBeInvariant6[float]`. +generics_variance_inference.py:170:0 Incompatible variable type [9]: a2 is declared to have type `ShouldBeInvariant6[float]` but is used as type `ShouldBeInvariant6[int]`. +generics_variance_inference.py:181:0 Incompatible variable type [9]: b1 is declared to have type `ShouldBeCovariant6[int]` but is used as type `ShouldBeCovariant6[float]`. +generics_variance_inference.py:182:0 Incompatible variable type [9]: b2 is declared to have type `ShouldBeCovariant6[float]` but is used as type `ShouldBeCovariant6[int]`. +generics_variance_inference.py:193:0 Incompatible variable type [9]: c1 is declared to have type `ShouldBeContravariant2[int]` but is used as type `ShouldBeContravariant2[float]`. +generics_variance_inference.py:194:0 Incompatible variable type [9]: c2 is declared to have type `ShouldBeContravariant2[float]` but is used as type `ShouldBeContravariant2[int]`. """ conformance_automated = "Fail" errors_diff = """ -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 28: Expected 1 errors Line 41: Expected 1 errors -Line 49: Expected 1 errors Line 58: Expected 1 errors Line 67: Expected 1 errors Line 80: Expected 1 errors @@ -19,16 +38,18 @@ Line 96: Expected 1 errors Line 97: Expected 1 errors Line 111: Expected 1 errors Line 112: Expected 1 errors -Line 119: Expected 1 errors -Line 120: Expected 1 errors -Line 121: Expected 1 errors -Line 122: Expected 1 errors Line 130: Expected 1 errors Line 138: Expected 1 errors Line 149: Expected 1 errors -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'] +Line 33: Unexpected errors ["generics_variance_inference.py:33:41 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 36: Unexpected errors ["generics_variance_inference.py:36:26 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 48: Unexpected errors ['generics_variance_inference.py:48:0 Incompatible variable type [9]: vco2_1 is declared to have type `ShouldBeCovariant2[float]` but is used as type `ShouldBeCovariant2[int]`.'] +Line 53: Unexpected errors ["generics_variance_inference.py:53:25 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 63: Unexpected errors ["generics_variance_inference.py:63:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] +Line 75: Unexpected errors ["generics_variance_inference.py:75:19 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 88: Unexpected errors ["generics_variance_inference.py:88:23 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 104: Unexpected errors ["generics_variance_inference.py:104:27 Invalid type variable [34]: The type variable `Variable[T]` isn't present in the function's parameters."] +Line 127: Unexpected errors ["generics_variance_inference.py:127:7 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T]`."] +Line 182: Unexpected errors ['generics_variance_inference.py:182:0 Incompatible variable type [9]: b2 is declared to have type `ShouldBeCovariant6[float]` but is used as type `ShouldBeCovariant6[int]`.'] +Line 193: Unexpected errors ['generics_variance_inference.py:193:0 Incompatible variable type [9]: c1 is declared to have type `ShouldBeContravariant2[int]` but is used as type `ShouldBeContravariant2[float]`.'] """ diff --git a/conformance/results/pyre/historical_positional.toml b/conformance/results/pyre/historical_positional.toml index 9e1a52b2..96a40960 100644 --- a/conformance/results/pyre/historical_positional.toml +++ b/conformance/results/pyre/historical_positional.toml @@ -1,19 +1,12 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject positional-only parameter after non-positional-only parameter. -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:26:15 Invalid positional-only parameter [69]: Positional-only parameters cannot appear after parameters that accept keyword arguments. +historical_positional.py:38:25 Invalid positional-only parameter [69]: Positional-only parameters cannot appear after parameters that accept keyword arguments. 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" +conformance_automated = "Pass" errors_diff = """ -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`.'] """ diff --git a/conformance/results/pyre/literals_interactions.toml b/conformance/results/pyre/literals_interactions.toml index fd34d1f4..a7af3cc4 100644 --- a/conformance/results/pyre/literals_interactions.toml +++ b/conformance/results/pyre/literals_interactions.toml @@ -6,17 +6,13 @@ 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. +literals_interactions.py:15:4 Invalid tuple index [73]: Index 5 is out of bounds for concrete tuple with 3 members. +literals_interactions.py:16:4 Invalid tuple index [73]: Index -5 is out of bounds for concrete tuple with 3 members. +literals_interactions.py:17:4 Invalid tuple index [73]: Index 4 is out of bounds for concrete tuple with 3 members. +literals_interactions.py:18:4 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. +literals_interactions.py:93:8 Assert type [70]: Expected `str` but got `Union[Status, str]`. """ conformance_automated = "Fail" errors_diff = """ -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.'] +Line 93: Unexpected errors ['literals_interactions.py:93:8 Assert type [70]: Expected `str` but got `Union[Status, str]`.'] """ diff --git a/conformance/results/pyre/literals_literalstring.toml b/conformance/results/pyre/literals_literalstring.toml index d9248118..2367ab62 100644 --- a/conformance/results/pyre/literals_literalstring.toml +++ b/conformance/results/pyre/literals_literalstring.toml @@ -7,7 +7,7 @@ literals_literalstring.py:36:11 Invalid type [31]: Expression `LiteralString` is 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:52:4 Assert type [70]: 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']`. @@ -17,5 +17,5 @@ literals_literalstring.py:171:4 Incompatible variable type [9]: x1 is declared t """ 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 52: Unexpected errors ['literals_literalstring.py:52:4 Assert type [70]: Expected `typing_extensions.LiteralString` but got `str`.'] """ diff --git a/conformance/results/pyre/literals_parameterizations.toml b/conformance/results/pyre/literals_parameterizations.toml index 6dc0a522..2dbdfbc5 100644 --- a/conformance/results/pyre/literals_parameterizations.toml +++ b/conformance/results/pyre/literals_parameterizations.toml @@ -11,7 +11,6 @@ literals_parameterizations.py:33:0 Invalid type [31]: Expression `ReadOnlyMode` 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. @@ -33,5 +32,4 @@ errors_diff = """ Line 46: 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.'] """ diff --git a/conformance/results/pyre/namedtuples_define_class.toml b/conformance/results/pyre/namedtuples_define_class.toml index 49225bc7..3ce86df7 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:32:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. +namedtuples_define_class.py:33:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. 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:59:4 Missing named tuple default [74]: Named tuple field without default value may not be preceded by a field with default value. 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`. +namedtuples_define_class.py:105:23 Invalid inheritance [39]: If NamedTuple is included as a base class, the class may not extend anything else besides Generic. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 32: Expected 1 errors -Line 33: Expected 1 errors -Line 59: 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..dc132443 100644 --- a/conformance/results/pyre/namedtuples_define_functional.toml +++ b/conformance/results/pyre/namedtuples_define_functional.toml @@ -1,8 +1,5 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not handle illegal named tuple names the same as runtime. -Does not handle defined fields correctly when extra flags like `rename` or `default` are used. -Does not support defaults in functional form. """ output = """ namedtuples_define_functional.py:16:7 Missing argument [20]: Call `Point1.__init__` expects argument `y`. @@ -14,24 +11,9 @@ namedtuples_define_functional.py:37:7 Too many arguments [19]: Call `Point5.__in 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`. +namedtuples_define_functional.py:52:0 Duplicate parameter [65]: Duplicate parameter name `a`. +namedtuples_define_functional.py:66:0 Missing argument [20]: Call `NT5.__init__` expects argument `a`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" 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.'] """ diff --git a/conformance/results/pyre/namedtuples_type_compat.toml b/conformance/results/pyre/namedtuples_type_compat.toml index 76f3303c..d9c3d790 100644 --- a/conformance/results/pyre/namedtuples_type_compat.toml +++ b/conformance/results/pyre/namedtuples_type_compat.toml @@ -1,17 +1,10 @@ -conformant = "Unsupported" +conformant = "Pass" 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" +conformance_automated = "Pass" 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.'] """ diff --git a/conformance/results/pyre/namedtuples_usage.toml b/conformance/results/pyre/namedtuples_usage.toml index a9956c36..785cef05 100644 --- a/conformance/results/pyre/namedtuples_usage.toml +++ b/conformance/results/pyre/namedtuples_usage.toml @@ -1,35 +1,16 @@ conformant = "Partial" notes = """ -Does not report out-of-range index access with named tuple instance. -Does not reject attempt to delete named tuple field by name. -Does not reject attempt to delete named tuple field by index. -Incorrectly handles subclasses of named tuples that add more attributes. -Does not handle unpacking of named tuples. """ output = """ -namedtuples_usage.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_usage.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_usage.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. -namedtuples_usage.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`. -namedtuples_usage.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. -namedtuples_usage.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`. +namedtuples_usage.py:34:6 Invalid tuple index [73]: Index 3 is out of bounds for concrete tuple with 3 members. +namedtuples_usage.py:35:6 Invalid tuple index [73]: Index -4 is out of bounds for concrete tuple with 3 members. 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:42:0 Unable to delete tuple member [72]: Tuples are immutable, so their members may not be deleted. +namedtuples_usage.py:43:0 Unable to delete tuple member [72]: Tuples are immutable, so their members may not be deleted. 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" +conformance_automated = "Pass" errors_diff = """ -Line 34: Expected 1 errors -Line 35: Expected 1 errors -Line 42: Expected 1 errors -Line 43: Expected 1 errors -Line 27: Unexpected errors ['namedtuples_usage.py:27:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 28: Unexpected errors ['namedtuples_usage.py:28:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 29: Unexpected errors ['namedtuples_usage.py:29:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] -Line 30: Unexpected errors ['namedtuples_usage.py:30:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `str` but got `typing.Any`.'] -Line 31: Unexpected errors ['namedtuples_usage.py:31:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 32: Unexpected errors ['namedtuples_usage.py:32:0 Incompatible parameter type [6]: In call `assert_type`, for 1st positional argument, expected `int` but got `typing.Any`.'] -Line 61: Unexpected errors ['namedtuples_usage.py:61:0 Unable to unpack [23]: Unable to unpack 0 values, 3 were expected.'] """ diff --git a/conformance/results/pyre/narrowing_typeguard.toml b/conformance/results/pyre/narrowing_typeguard.toml index 7bf7ead7..3f370ecf 100644 --- a/conformance/results/pyre/narrowing_typeguard.toml +++ b/conformance/results/pyre/narrowing_typeguard.toml @@ -1,15 +1,12 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject TypeGuard method with too few parameters. """ output = """ +narrowing_typeguard.py:102:22 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. +narrowing_typeguard.py:107:21 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. 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" +conformance_automated = "Pass" 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]]`.'] """ diff --git a/conformance/results/pyre/narrowing_typeis.toml b/conformance/results/pyre/narrowing_typeis.toml index 2746dc5f..f3d989e3 100644 --- a/conformance/results/pyre/narrowing_typeis.toml +++ b/conformance/results/pyre/narrowing_typeis.toml @@ -1,39 +1,15 @@ -conformant = "Unsupported" +conformant = "Pass" 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`. +narrowing_typeis.py:105:22 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. +narrowing_typeis.py:110:21 Invalid type guard [68]: User-defined type guard functions or methods must have at least one input parameter. +narrowing_typeis.py:132: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)], TypeIs[int]]`. +narrowing_typeis.py:152: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)], TypeIs[int]]`. +narrowing_typeis.py:169:16 Incompatible parameter type [6]: In call `takes_typeguard`, for 1st positional argument, expected `typing.Callable[[object], TypeGuard[int]]` but got `typing.Callable(is_int_typeis)[[Named(val, object)], TypeIs[int]]`. +narrowing_typeis.py:170:13 Incompatible parameter type [6]: In call `takes_typeis`, for 1st positional argument, expected `typing.Callable[[object], TypeIs[int]]` but got `typing.Callable(is_int_typeguard)[[Named(val, object)], TypeGuard[int]]`. +narrowing_typeis.py:191:17 Incompatible parameter type [6]: In call `takes_int_typeis`, for 1st positional argument, expected `typing.Callable[[object], TypeIs[int]]` but got `typing.Callable(bool_typeis)[[Named(val, object)], TypeIs[bool]]`. +narrowing_typeis.py:195:26 Invalid type guard [68]: The narrowed type str of this type guard is not a subtype of the first positional parameter type int. +narrowing_typeis.py:199:44 Invalid type guard [68]: The narrowed type typing.List[int] of this type guard is not a subtype of the first positional parameter type typing.List[object]. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 105: Expected 1 errors -Line 110: Expected 1 errors -Line 132: Expected 1 errors -Line 152: Expected 1 errors -Line 169: Expected 1 errors -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..7a5d5b54 100644 --- a/conformance/results/pyre/overloads_basic.toml +++ b/conformance/results/pyre/overloads_basic.toml @@ -1,12 +1,11 @@ -conformant = "Partial" +conformant = "Pass" 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:63:0 Incompatible overload [43]: At least two overload signatures must be present. overloads_basic.py:75:0 Missing overload implementation [42]: Overloaded function `func2` must have an implementation. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Lines 62, 63: Expected error (tag 'func1') """ diff --git a/conformance/results/pyre/protocols_generic.toml b/conformance/results/pyre/protocols_generic.toml index 0f071ec3..dd13ab52 100644 --- a/conformance/results/pyre/protocols_generic.toml +++ b/conformance/results/pyre/protocols_generic.toml @@ -5,6 +5,7 @@ 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:44:29 Invalid inheritance [39]: Subscripted Protocol and Generic may not appear in the same base class list 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]`. @@ -13,7 +14,6 @@ protocols_generic.py:146:0 Incompatible variable type [9]: hp3 is declared to ha """ conformance_automated = "Fail" errors_diff = """ -Line 44: Expected 1 errors Line 145: 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..05c0cbd4 100644 --- a/conformance/results/pyre/protocols_merging.toml +++ b/conformance/results/pyre/protocols_merging.toml @@ -1,15 +1,14 @@ -conformant = "Partial" +conformant = "Pass" 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:67:15 Invalid inheritance [39]: If Protocol is included as a base class, all other base classes must be protocols or Generic. 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" +conformance_automated = "Pass" errors_diff = """ -Line 67: Expected 1 errors """ diff --git a/conformance/results/pyre/qualifiers_annotated.toml b/conformance/results/pyre/qualifiers_annotated.toml index 2c9bc289..c92e8f39 100644 --- a/conformance/results/pyre/qualifiers_annotated.toml +++ b/conformance/results/pyre/qualifiers_annotated.toml @@ -16,19 +16,19 @@ qualifiers_annotated.py:51:6 Invalid type [31]: Expression `typing.Annotated[(Tr 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:64:7 Invalid type parameters [24]: Generic type `Annotated` expects at least 2 type parameters, received 1. 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:91:0 Invalid class instantiation [45]: `Annotated` cannot be instantiated. qualifiers_annotated.py:93:0 Call error [29]: `TypeAlias` is not a function. qualifiers_annotated.py:105:4 Undefined attribute [16]: `typing.Type` has no attribute `a`. qualifiers_annotated.py:106:4 Undefined attribute [16]: `typing.Type` has no attribute `b`. """ conformance_automated = "Fail" errors_diff = """ -Line 64: Expected 1 errors -Line 91: Expected 1 errors +Line 76: Expected 1 errors +Line 84: Expected 1 errors +Line 92: Expected 1 errors Line 105: Unexpected errors ['qualifiers_annotated.py:105:4 Undefined attribute [16]: `typing.Type` has no attribute `a`.'] Line 106: Unexpected errors ['qualifiers_annotated.py:106:4 Undefined attribute [16]: `typing.Type` has no attribute `b`.'] """ diff --git a/conformance/results/pyre/specialtypes_any.toml b/conformance/results/pyre/specialtypes_any.toml index b3b83dde..07cd73b2 100644 --- a/conformance/results/pyre/specialtypes_any.toml +++ b/conformance/results/pyre/specialtypes_any.toml @@ -1,15 +1,8 @@ -conformant = "Partial" +conformant = "Pass" 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..1cdfcc0b 100644 --- a/conformance/results/pyre/specialtypes_never.toml +++ b/conformance/results/pyre/specialtypes_never.toml @@ -3,7 +3,7 @@ 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:19:21 Incompatible return type [7]: Function declared non-returnable, but got implicit return value of `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`. @@ -14,8 +14,6 @@ specialtypes_never.py:105:4 Incompatible return type [7]: Expected `ClassC[Varia """ 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`.'] diff --git a/conformance/results/pyre/specialtypes_type.toml b/conformance/results/pyre/specialtypes_type.toml index 78343fa2..a2a0c9c5 100644 --- a/conformance/results/pyre/specialtypes_type.toml +++ b/conformance/results/pyre/specialtypes_type.toml @@ -9,6 +9,14 @@ 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:98:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. +specialtypes_type.py:99:4 Assert type [70]: Expected `typing.Any` but got `unknown`. +specialtypes_type.py:102:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. +specialtypes_type.py:103:4 Assert type [70]: Expected `typing.Any` but got `unknown`. +specialtypes_type.py:106:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. +specialtypes_type.py:107:4 Assert type [70]: Expected `typing.Any` but got `unknown`. +specialtypes_type.py:110:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`. +specialtypes_type.py:111:4 Assert type [70]: Expected `typing.Any` but got `unknown`. 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]`. @@ -21,6 +29,14 @@ Line 120: Expected 1 errors Line 144: Expected 1 errors Line 145: Expected 1 errors Line 146: Expected 1 errors +Line 98: Unexpected errors ['specialtypes_type.py:98:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] +Line 99: Unexpected errors ['specialtypes_type.py:99:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] +Line 102: Unexpected errors ['specialtypes_type.py:102:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] +Line 103: Unexpected errors ['specialtypes_type.py:103:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] +Line 106: Unexpected errors ['specialtypes_type.py:106:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] +Line 107: Unexpected errors ['specialtypes_type.py:107:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] +Line 110: Unexpected errors ['specialtypes_type.py:110:4 Assert type [70]: Expected `typing.Tuple[Type[typing.Any], ...]` but got `unknown`.'] +Line 111: Unexpected errors ['specialtypes_type.py:111:4 Assert type [70]: Expected `typing.Any` but got `unknown`.'] 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..72799fbd 100644 --- a/conformance/results/pyre/tuples_type_compat.toml +++ b/conformance/results/pyre/tuples_type_compat.toml @@ -7,55 +7,29 @@ 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. +tuples_type_compat.py:72:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:74:8 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:76:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:78:8 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:80:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:82:8 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:95:12 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:99:12 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:103:12 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`. +tuples_type_compat.py:115:12 Assert type [70]: Expected `Tuple[Union[int, str], str]` but got `Tuple[Union[int, str], Union[int, str]]`. +tuples_type_compat.py:117:12 Assert type [70]: Expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`. +tuples_type_compat.py:140:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`. +tuples_type_compat.py:144:0 Incompatible variable type [9]: t1 is declared to have type `Tuple[int, str]` but is used as type `Tuple[int, str, str]`. +tuples_type_compat.py:149:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, int, str]`. +tuples_type_compat.py:150:0 Incompatible variable type [9]: t2 is declared to have type `typing.Tuple[int, *Tuple[str, ...]]` but is used as type `Tuple[int, str, int]`. +tuples_type_compat.py:156:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str]`. +tuples_type_compat.py:157:0 Incompatible variable type [9]: t3 is declared to have type `typing.Tuple[int, *Tuple[str, ...], int]` but is used as type `Tuple[int, str, str, float]`. +tuples_type_compat.py:162:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[int, str, int]`. +tuples_type_compat.py:163:0 Incompatible variable type [9]: t4 is declared to have type `typing.Tuple[*Tuple[str, ...], int]` but is used as type `Tuple[str, str, float]`. +tuples_type_compat.py:168:4 Incompatible variable type [9]: t2 is declared to have type `Tuple[str, str, int]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:171:4 Incompatible variable type [9]: t5 is declared to have type `typing.Tuple[str, str, str, *Tuple[str, ...]]` but is used as type `Tuple[str, str]`. +tuples_type_compat.py:175:4 Incompatible variable type [9]: t9 is declared to have type `typing.Tuple[*Tuple[str, ...], str, str, str]` but is used as type `Tuple[str, str]`. """ conformance_automated = "Fail" errors_diff = """ @@ -64,34 +38,17 @@ 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 72: Unexpected errors ['tuples_type_compat.py:72:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 74: Unexpected errors ['tuples_type_compat.py:74:8 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 76: Unexpected errors ['tuples_type_compat.py:76:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 78: Unexpected errors ['tuples_type_compat.py:78:8 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 80: Unexpected errors ['tuples_type_compat.py:80:11 Incompatible parameter type [6]: In call `len`, for 1st positional argument, expected `pyre_extensions.PyreReadOnly[Sized]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 82: Unexpected errors ['tuples_type_compat.py:82:8 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 95: Unexpected errors ['tuples_type_compat.py:95:12 Assert type [70]: Expected `Tuple[int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 99: Unexpected errors ['tuples_type_compat.py:99:12 Assert type [70]: Expected `Union[Tuple[int, int], Tuple[str, str]]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 103: Unexpected errors ['tuples_type_compat.py:103:12 Assert type [70]: Expected `Tuple[int, str, int]` but got `Union[Tuple[int], Tuple[str, str], typing.Tuple[int, *Tuple[str, ...], int]]`.'] +Line 115: Unexpected errors ['tuples_type_compat.py:115:12 Assert type [70]: 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 Assert type [70]: Expected `Tuple[Union[int, str], int]` but got `Tuple[Union[int, str], Union[int, str]]`.'] +Line 140: Unexpected errors ['tuples_type_compat.py:140:4 Assert type [70]: Expected `Sequence[Never]` but got `Sequence[Variable[T]]`.'] """ diff --git a/conformance/results/pyre/tuples_unpacked.toml b/conformance/results/pyre/tuples_unpacked.toml index 9e1dd53b..b257b259 100644 --- a/conformance/results/pyre/tuples_unpacked.toml +++ b/conformance/results/pyre/tuples_unpacked.toml @@ -1,34 +1,13 @@ -conformant = "Partial" +conformant = "Pass" 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" +conformance_automated = "Pass" 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.'] """ diff --git a/conformance/results/pyre/typeddicts_class_syntax.toml b/conformance/results/pyre/typeddicts_class_syntax.toml index 3bcd1520..ff3c7e5f 100644 --- a/conformance/results/pyre/typeddicts_class_syntax.toml +++ b/conformance/results/pyre/typeddicts_class_syntax.toml @@ -6,7 +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]`. +typeddicts_class_syntax.py:49:0 Unexpected keyword [28]: Unexpected keyword argument `other` to call `object.__init_subclass__`. """ conformance_automated = "Fail" errors_diff = """ @@ -14,6 +14,4 @@ Line 29: Expected 1 errors 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_inheritance.toml b/conformance/results/pyre/typeddicts_inheritance.toml index 3e91f5b6..5ac846af 100644 --- a/conformance/results/pyre/typeddicts_inheritance.toml +++ b/conformance/results/pyre/typeddicts_inheritance.toml @@ -1,12 +1,11 @@ -conformant = "Partial" +conformant = "Pass" notes = """ -Does not reject TypedDict class that inherits from non-TypedDict class. """ output = """ +typeddicts_inheritance.py:44:30 Invalid inheritance [39]: `NonTypedDict` is not a valid parent class for a typed dictionary. Expected a typed dictionary or typing.Generic. 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" +conformance_automated = "Pass" errors_diff = """ -Line 44: Expected 1 errors """ diff --git a/conformance/results/pyre/typeddicts_operations.toml b/conformance/results/pyre/typeddicts_operations.toml index 14ebfde9..e8b1cf65 100644 --- a/conformance/results/pyre/typeddicts_operations.toml +++ b/conformance/results/pyre/typeddicts_operations.toml @@ -1,6 +1,5 @@ -conformant = "Partial" +conformant = "Pass" 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`. @@ -11,11 +10,10 @@ typeddicts_operations.py:28:8 TypedDict initialization error [55]: Missing requi 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:49:0 Invalid TypedDict operation [54]: Cannot delete required field `name` from TypedDict `Movie`. typeddicts_operations.py:62:0 Undefined attribute [16]: `MovieOptional` has no attribute `clear`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 49: Expected 1 errors """ diff --git a/conformance/results/pyre/typeddicts_readonly.toml b/conformance/results/pyre/typeddicts_readonly.toml index 70380b51..2af32a98 100644 --- a/conformance/results/pyre/typeddicts_readonly.toml +++ b/conformance/results/pyre/typeddicts_readonly.toml @@ -1,14 +1,12 @@ -conformant = "Unsupported" +conformant = "Pass" output = """ -typeddicts_readonly.py:18:13 Undefined or invalid type [11]: Annotation `ReadOnly` is not defined as a type. +typeddicts_readonly.py:24:16 Invalid TypedDict operation [54]: Cannot write to `Band` read-only field `members`. +typeddicts_readonly.py:36:16 Invalid TypedDict operation [54]: Cannot write to `Band2` read-only field `members`. +typeddicts_readonly.py:50:14 Invalid TypedDict operation [54]: Cannot write to `Movie1` read-only field `title`. +typeddicts_readonly.py:51:13 Invalid TypedDict operation [54]: Cannot write to `Movie1` read-only field `year`. +typeddicts_readonly.py:60:14 Invalid TypedDict operation [54]: Cannot write to `Movie2` read-only field `title`. +typeddicts_readonly.py:61:13 Invalid TypedDict operation [54]: Cannot write to `Movie2` read-only field `year`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 24: Expected 1 errors -Line 36: Expected 1 errors -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..21056412 100644 --- a/conformance/results/pyre/typeddicts_readonly_consistency.toml +++ b/conformance/results/pyre/typeddicts_readonly_consistency.toml @@ -1,21 +1,13 @@ -conformant = "Unsupported" +conformant = "Pass" 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" +conformance_automated = "Pass" 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`.'] """ diff --git a/conformance/results/pyre/typeddicts_readonly_inheritance.toml b/conformance/results/pyre/typeddicts_readonly_inheritance.toml index 8bcacffd..abf96bda 100644 --- a/conformance/results/pyre/typeddicts_readonly_inheritance.toml +++ b/conformance/results/pyre/typeddicts_readonly_inheritance.toml @@ -1,27 +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:36:13 Invalid TypedDict operation [54]: Cannot write to `Album2` read-only field `name`. +typeddicts_readonly_inheritance.py:47:0 Inconsistent override [15]: `alt` overrides attribute defined in `AlbumCollection` inconsistently. Type `typing.List[str]` is not a subtype of the overridden attribute `typing.List[typing.Union[int, str]]`. 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:93: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: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:105:0 Inconsistent override [15]: `c` 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`. +typeddicts_readonly_inheritance.py:119:0 Invalid inheritance [39]: Field `y` has type `int` in base class `TD_A1` and type `float` in base class `TD_A2`. +typeddicts_readonly_inheritance.py:132:0 Invalid inheritance [39]: `y` is a required field in base class `TD_B1` and a non-required field in base class `TD_B2` (because of `total=False`). +typeddicts_readonly_inheritance.py:132:0 Invalid inheritance [39]: `x` is a required field in base class `TD_B2` and a non-required field in base class `TD_B1` (because of `total=False`). """ conformance_automated = "Fail" errors_diff = """ -Line 36: Expected 1 errors Line 50: Expected 1 errors Line 94: Expected 1 errors Line 98: Expected 1 errors Line 106: 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 47: Unexpected errors ['typeddicts_readonly_inheritance.py:47:0 Inconsistent override [15]: `alt` overrides attribute defined in `AlbumCollection` inconsistently. Type `typing.List[str]` is not a subtype of the overridden attribute `typing.List[typing.Union[int, str]]`.'] +Line 93: Unexpected errors ['typeddicts_readonly_inheritance.py:93:0 Inconsistent override [15]: `a` overrides attribute defined in `F1` inconsistently. Type `int` 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`.'] +Line 105: Unexpected errors ['typeddicts_readonly_inheritance.py:105:0 Inconsistent override [15]: `c` 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..0f1dddfb 100644 --- a/conformance/results/pyre/typeddicts_readonly_kwargs.toml +++ b/conformance/results/pyre/typeddicts_readonly_kwargs.toml @@ -1,11 +1,7 @@ -conformant = "Unsupported" +conformant = "Pass" 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. +typeddicts_readonly_kwargs.py:33:21 Invalid TypedDict operation [54]: Cannot write to `ReadOnlyArgs` read-only field `key1`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" 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..46846324 100644 --- a/conformance/results/pyre/typeddicts_readonly_update.toml +++ b/conformance/results/pyre/typeddicts_readonly_update.toml @@ -1,11 +1,7 @@ -conformant = "Unsupported" +conformant = "Pass" 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`. +typeddicts_readonly_update.py:23:10 Incompatible parameter type [6]: In call `TypedDictionary.update`, for 1st positional argument, cannot update read-only fields of `A`. """ -conformance_automated = "Fail" +conformance_automated = "Pass" 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..60e6c0ce 100644 --- a/conformance/results/pyre/typeddicts_required.toml +++ b/conformance/results/pyre/typeddicts_required.toml @@ -8,8 +8,6 @@ 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 = """ @@ -18,6 +16,4 @@ 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_usage.toml b/conformance/results/pyre/typeddicts_usage.toml index 02967540..1699d6be 100644 --- a/conformance/results/pyre/typeddicts_usage.toml +++ b/conformance/results/pyre/typeddicts_usage.toml @@ -1,4 +1,4 @@ -conformant = "Partial" +conformant = "Pass" notes = """ Does not report errant use of TypedDict in `isinstance` call. Does not reject use of TypedDict as TypeVar bound. @@ -7,9 +7,9 @@ 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`. +typeddicts_usage.py:35:21 TypedDict used in isinstance [71]: TypedDict classes may not be used for instance checks. +typeddicts_usage.py:40:0 Undefined or invalid type [11]: Annotation `TypedDict` is not defined as a type. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -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 9b63b04f..5c0e095c 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,3 @@ -version = "pyre 0.9.22" -test_duration = 6.5 +version = "pyre 0.9.23" +test_duration = 9.1 + diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 9430b168..6441c95a 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,3 @@ version = "pyright 1.1.386" -test_duration = 1.9 +test_duration = 2.0 + diff --git a/conformance/results/results.html b/conformance/results/results.html index 98e57034..724b351b 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,13 +159,13 @@

Python Type System Conformance Test Results

- - + @@ -297,13 +297,13 @@

Python Type System Conformance Test Results

- + - + @@ -333,55 +333,55 @@

Python Type System Conformance Test Results

- + - + - + - + - + - + - + - + - + @@ -399,7 +399,7 @@

Python Type System Conformance Test Results

- + @@ -417,7 +417,7 @@

Python Type System Conformance Test Results

- + - + - + @@ -558,7 +558,7 @@

Python Type System Conformance Test Results

- + @@ -609,7 +609,7 @@

Python Type System Conformance Test Results

- + @@ -630,7 +630,7 @@

Python Type System Conformance Test Results

- + @@ -642,7 +642,7 @@

Python Type System Conformance Test Results

- + @@ -654,7 +654,7 @@

Python Type System Conformance Test Results

- + @@ -669,7 +669,7 @@

Python Type System Conformance Test Results

- + - + - + @@ -771,7 +771,7 @@

Python Type System Conformance Test Results

- + - + - + - + - + @@ -828,13 +828,13 @@

Python Type System Conformance Test Results

- + - + @@ -852,7 +852,7 @@

Python Type System Conformance Test Results

- + - + - + - + - + - + - + - + @@ -933,7 +933,7 @@

Python Type System Conformance Test Results

- + @@ -948,13 +948,13 @@

Python Type System Conformance Test Results

- + - + - + @@ -987,7 +987,7 @@

Python Type System Conformance Test Results

- + @@ -1005,7 +1005,7 @@

Python Type System Conformance Test Results

- + @@ -1017,7 +1017,7 @@

Python Type System Conformance Test Results

- + - +
 
mypy 1.13.0
-
2.6sec
+
2.7sec
pyright 1.1.386
-
1.9sec
+
2.0sec
pyre 0.9.22
-
6.5sec
+
pyre 0.9.23
+
9.1sec
pytype 2024.10.11
50.2sec
@@ -210,7 +210,7 @@

Python Type System Conformance Test Results

     specialtypes_any Pass Pass
Partial

Does not support Any as a base class.

Pass Pass
     specialtypes_never
     generics_scoping
Partial

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

Pass
Partial

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

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

Partial

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

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

False negative on assert_type uses.

Partial

Fails to reject type alias within generic class that uses class's type variable.

Fails to reject unbound type variable in constructor call in global scope.

     generics_self_advanced
Partial

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

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

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

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

Pass
Partial

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

Partial

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

False negatives on assert_type uses.

Unsupported

Does not understand `Self` type.

     generics_self_attributes
     generics_syntax_compatibility Pass Pass
Unsupported

Type parameter syntax not yet support.

Partial

False negative on mixing legacy and PEP695 syntax.

Does not detect mixing legacy and PEP695 syntax in methods.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_declarations Pass Pass
Unsupported

Type parameter syntax not yet support.

Partial

Does not detect incorrect use of legacy style syntax mixed with PEP695 syntax.

False negatives due to assert_type use.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_infer_variance
Unsupported

Type parameter syntax not yet support.

Pass
Unsupported

Type parameter syntax not yet support.

Partial

Incorrectly determines that a class cannot be instantiated with __getitem__.

Incorrectly handles mixing legacy and PEP695 syntax.

Unsupported

Type parameter syntax not yet support.

     generics_syntax_scoping
Partial

Does not following runtime scoping rules for type parameters in all cases.

Pass
Unsupported

Type parameter syntax not yet support.

Partial

Does not properly handle mixing legacy syntax with PEP695 syntax.

Unsupported

Type parameter syntax not yet support.

     generics_type_erasure
Partial

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

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

Pass
Partial

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

False negatives on instance attribute access on the type.

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

Partial

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

False negatives on instance attribute access on the type.

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

False negatives on assert_type uses.

Unsupported
     generics_typevartuple_args
Partial

Does not enforce that tuples captured by TypeVarTuple are same type.

Pass
Unsupported

Does not support star expressions for `Unpack`.

Partial

Does not property handle TypeVarTuple.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_basic
Partial

Does not enforce that tuples captured by TypeVarTuple are same length.

Does not enforce that tuples captured by TypeVarTuple are same type.

Pass
Unsupported

Does not support TypeVarTuple.

Partial

Does not support TypeVarTuple.

False negatives due to assert_type.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_callable Pass Pass
Unsupported

Does not support TypeVarTuple.

Partial

False negatives due to assert_type.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_concat Pass Pass
Unsupported

Does not support TypeVarTuple.

Partial

False negatives due to assert_type.

False compatability error message.

Unsupported

Does not support TypeVarTuple.

     generics_typevartuple_overloads
     generics_typevartuple_unpack Pass Pass
Unsupported

Does not support star expressions for `Unpack`.

Pass
Unsupported

Does not support TypeVarTuple.

     generics_upper_bound
     generics_variance_inference Pass Pass
Unsupported

Type parameter syntax not yet support.

Partial

Does not properly handle mixing legacy and PEP695 syntax.

False negative about a type variable not being present in the function's parameters.

Unsupported

Type parameter syntax not yet support.

@@ -453,7 +453,7 @@

Python Type System Conformance Test Results

     classes_override
Partial

Does not handle case where parent class derives from Any.

Pass
Partial

Does not allow Any as a base class, leading to false positives.

Pass
Unsupported

Does not yet support the @override decorator.

@@ -486,7 +486,7 @@

Python Type System Conformance Test Results

     aliases_type_statement
Partial

Does not reject type alias defined in function scope.

Pass
Unsupported

Does not support `type` statement.

Partial

Does not complain when a type alias cannot be used as a base class.

Does not complain when a type alias cannot be used as a function.

Does not complain when a type statement definition combines new and old TypeVars.

Does not complain when a type statement definition uses old TypeVars.

Does not properly support recursive aliases.

Unsupported

Does not support `type` statement.

     aliases_typealiastype
     protocols_merging Pass Pass
Partial

Does not reject a protocol class that derives from a non-protocol class.

Pass
Partial

Does not reject a protocol class that derives from a non-protocol class.

Does not report attempt to instantiate abstract class downgraded from protocol class.

     protocols_modules
     callables_kwargs Pass Pass
Unsupported

Does not understand Unpack in the context of **kwargs annotation.

Pass
Unsupported

Does not understand Unpack in the context of **kwargs annotation.

     callables_protocol
     constructors_call_init
Partial

Does not report errors during binding to self parameter of __init__ method.

Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

Pass
Partial

Does not infer type of Self for self parameter of __init__ method.

Does not report errors during binding to self parameter of __init__ method.

Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

Partial

Does not infer type of Self for self parameter of __init__ method.

Does not report errors during binding to self parameter of __init__ method.

Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

Incorrectly raises Incompatible overload type errors.

Incorrectly raises compatibility type errors.

Partial

Does not report errors during binding to self parameter of __init__ method.

Does not infer type of Self for self parameter of __init__ method.

Rejects valid type annotation for self parameter in __init__ method.

Does not support function-scoped TypeVars in self annotation in __init__ method.

Does not reject use of class-scoped type variables in annotation of self parameter in __init__ method.

     constructors_call_metaclass
     constructors_call_new
Partial

Does not support __new__ return type that is not a subclass of the class being constructed.

Does not skip evaluation of __init__ based on __new__ return type.

Does not report errors during binding to cls parameter of __new__ method.

Pass
Partial

Does not support __new__ return type that is not a subclass of the class being constructed.

Does not report errors during binding to cls parameter of __new__ method.

Partial

Does not support __new__ return type that is not a subclass of the class being constructed.

Does not report errors during binding to cls parameter of __new__ method.

Incorrectly raises compatibility type errors.

Partial

Does not honor explicit specialization of generic class when used in constructor call.

Does not support __new__ return type that is not a subclass of the class being constructed.

Does not skip evaluation of __init__ based on __new__ return type.

     constructors_call_type
     constructors_callable
Partial

Does not generate a union type for __new__ and __init__ when converting class to callable.

Does not ignore __init__ based on __new__ return type when converting class to callable.

Does not support __new__ return type that is different from class being constructed.

Pass
Partial

Does not generate a union type for __new__ and __init__ when converting class to callable.

Does not ignore __init__ based on __new__ return type when converting class to callable.

Does not support __new__ return type that is different from class being constructed.

Does not use annotated type of self in __init__ method to generate return type of callable.

Partial

Does not generate a union type for __new__ and __init__ when converting class to callable.

Does not ignore __init__ based on __new__ return type when converting class to callable.

Does not support __new__ return type that is different from class being constructed.

Does not use annotated type of self in __init__ method to generate return type of callable.

Incorrectly raises incompatibility type errors.

Partial

Does not generate a union type for __new__ and __init__ when converting class to callable.

Does not ignore __init__ based on __new__ return type when converting class to callable.

Does not support __new__ return type that is different from class being constructed.

Does not use annotated type of self in __init__ method to generate return type of callable.

     constructors_consistency
     overloads_basic Pass Pass
Partial

Does not reject a function with a single @overload signature.

Pass
Partial

Does not reject a function with a single @overload signature.

Does not reject a function with @overload signature but no implementation.

@@ -678,7 +678,7 @@

Python Type System Conformance Test Results

     exceptions_context_managers Pass Pass
Unsupported

Does not understand context manager exception rules.

Partial

assert_type causes failures.

Unsupported

Does not support code flow analysis.

@@ -687,7 +687,7 @@

Python Type System Conformance Test Results

     dataclasses_descriptors
Partial

Does not correctly evaluate type of descriptor access.

Pass
Partial

Incorrectly generates error when calling constructor of dataclass with descriptor.

Partial

Incorrectly generates error when calling constructor of dataclass with descriptor.

Incorrectly raises incompatibility type errors.

Unsupported

Does not understand descriptor objects in dataclass.

     dataclasses_final
     dataclasses_usage
Pass*

Does not detect unannotated usage of `dataclasses.field()`.

Pass
Partial

Does not report error when field with no default follows field with default.

Complains on `assert_type` when used for bound methods vs `Callable`.

Does not understand `__dataclass_fields__`.

Partial

Does not report error when field with no default follows field with default.

Complains on `assert_type` when used for bound methods vs `Callable`.

Does not understand `__dataclass_fields__`.

Incorrectly raises incompatibility type errors.

Pass
@@ -798,25 +798,25 @@

Python Type System Conformance Test Results

     typeddicts_inheritance Pass Pass
Partial

Does not reject TypedDict class that inherits from non-TypedDict class.

Pass Pass
     typeddicts_operations Pass Pass
Partial

Does not reject `del` of required key.

Pass
Partial

Does not report type violation with TypedDict value assignment.

Does not report reference to unknown key in TypedDict.

Does not reject `clear` method on TypedDict with required keys.

Does not reject delete operation for required key in TypedDict.

     typeddicts_readonly
Partial

Incorrectly rejects NotRequired directive when used in an Annotated annotation.

PassUnsupportedPass Unsupported
     typeddicts_readonly_consistency
Partial

Incorrectly rejects assignment of required item to not-required read-only item.

PassUnsupportedPass Unsupported
     typeddicts_readonly_inheritance
     typeddicts_readonly_kwargs Pass PassUnsupportedPass Unsupported
     typeddicts_readonly_update
Partial

Incorrectly allows update of ReadOnly item.

Incorrectly rejects update involving an item with Never type.

PassUnsupportedPass Unsupported
     typeddicts_required
     typeddicts_usage Pass Pass
Partial

Does not report errant use of TypedDict in `isinstance` call.

Does not reject use of TypedDict as TypeVar bound.

Pass*

Does not report errant use of TypedDict in `isinstance` call.

Does not reject use of TypedDict as TypeVar bound.

Partial

Does not report errant use of TypedDict in `isinstance` call.

Does not reject use of TypedDict as TypeVar bound.

@@ -873,7 +873,7 @@

Python Type System Conformance Test Results

     tuples_unpacked
Partial

"More than one unpack" error is missing a line number.

Pass
Partial

Does not understand star syntax for `Unpack`.

Pass
Unsupported

Does not support `typing.Unpack`.

Does not support unpacked tuples within a tuple type form.

@@ -888,19 +888,19 @@

Python Type System Conformance Test Results

     namedtuples_define_functional Pass Pass
Partial

Does not handle illegal named tuple names the same as runtime.

Does not handle defined fields correctly when extra flags like `rename` or `default` are used.

Does not support defaults in functional form.

Pass
Partial

Does not handle illegal named tuple names the same as runtime.

Does not support defaults in functional form.

     namedtuples_type_compat Pass Pass
Unsupported

Rejects valid type compatibility between named tuple and tuple.

Pass Pass
     namedtuples_usage
Partial

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

Pass
Partial

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

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

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

Incorrectly handles subclasses of named tuples that add more attributes.

Does not handle unpacking of named tuples.

Partial
Partial

Incorrectly rejects valid index of named tuple instance when using a negative index.

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

Does not reject attempt to overwrite named tuple entry by name.

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

@@ -909,19 +909,19 @@

Python Type System Conformance Test Results

     enums_behaviors Pass Pass
Partial

Does not enforce that Enum classes are implicitly final.

Pass
Partial

Does not enforce that Enum classes are implicitly final.

     enums_definition Pass Pass
Partial

Does not support custom Enum classes based on EnumType metaclass.

Does not support some functional forms for Enum class definitions (optional).

Pass
Pass*

Does not support some functional forms for Enum class definitions (optional).

     enums_expansion
Partial

Improperly applies narrowing to Flag subclass.

Pass
Pass*

Does not perform type narrowing based on enum literal expansion (optional).

Pass
Partial

Improperly applies narrowing to Flag subclass.

     enums_member_names
     enums_member_values
Partial

Does not enforce declared type of `_value_`.

Does not enforce assigned tuple types for enum members (optional).

Pass
Partial

Does not enforce declared type of `_value_`.

Does not enforce assigned tuple types for enum members (optional).

Does not evaluate literal types for enum member values (optional).

Does not evaluate literal types for auto values (optional).

Pass
Partial

Does not enforce declared type of `_value_`.

Does not correctly enforce assigned tuple types for enum members (optional).

Does not evaluate literal types for enum member values (optional).

Does not evaluate literal types for auto values (optional).

     enums_members
     narrowing_typeguard Pass Pass
Partial

Does not reject TypeGuard method with too few parameters.

Pass
Partial

Does not reject TypeGuard method with too few parameters.

     narrowing_typeis Pass PassUnsupportedPass
Partial

Does not narrow correctly on generic tuple type.

Does not reject covariant use of TypeIs.

Does not reject TypeIs where return type is not consistent with input type due to variance.

@@ -963,7 +963,7 @@

Python Type System Conformance Test Results

     directives_assert_type Pass Pass
Pass*

Does not weaken literal types in `assert_type`, which some (other) tests rely on.

Pass
Partial

Incorrectly allows assert(x, int) where x is a Literal.

     directives_cast
     directives_reveal_type Pass Pass
Partial

Produces errors rather than warnings on `reveal_type`.

Pass
Partial

Does not reject call to reveal_type with zero arguments.

Does not reject call to reveal_type with too many arguments.

     directives_type_checking
     directives_type_ignore_file1 Pass Pass
Unsupported

Does not support file-level `#type: ignore` comment.

Pass Pass
     directives_type_ignore_file2
     directives_version_platform
Pass*

Does not understand three-element form of sys.version checks.

Does not understand os.name checks.

Pass
Partial

Does not support sys.platform checks.

Does not support os.name checks.

Pass
Pass*

Does not understand three-element form of sys.version checks.

Does not understand os.name checks.

@@ -1026,7 +1026,7 @@

Python Type System Conformance Test Results

     historical_positional
Partial

Does not reject positional-only parameter after non-positional-only parameter.

Treats keyword-only parameter as positional-only.

Applies legacy positional-only rules when PEP 570 syntax is used.

Pass
Partial

Does not reject positional-only parameter after non-positional-only parameter.

Incorrectly applies legacy positional-only rules when explicit *args are used.

Incorrectly applies legacy positional-only rules when PEP 570 syntax is used.

Pass
Partial

Does not apply rules for pre-3.8 positional-only parameters in some cases.

Does not reject positional-only parameter after non-positional-only parameter.

From a1d4d07f2ca6beb01a8db1b72f66120fc6ba33cb Mon Sep 17 00:00:00 2001 From: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Date: Tue, 29 Oct 2024 17:20:15 -0700 Subject: [PATCH 18/29] Mention use of cast in enum type stub example (#1877) --- docs/spec/enums.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/spec/enums.rst b/docs/spec/enums.rst index a3fa1ccd..fe38a358 100644 --- a/docs/spec/enums.rst +++ b/docs/spec/enums.rst @@ -123,8 +123,9 @@ statically in cases where dynamic values are used. genus: str # Non-member attribute species: str # Non-member attribute - CAT = ... # Member attribute - DOG = ... # Member attribute + CAT = 1 # Member attribute with known value and type + DOG = cast(int, ...) # Member attribute with unknown value and known type + BIRD = ... # Member attribute with unknown value and type * Members defined within an enum class should not include explicit type annotations. Type checkers should infer a literal type for all members. From b2d1056de08823773a4dc0fa445c4bb2c087627c Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 11 Nov 2024 20:38:31 +0100 Subject: [PATCH 19/29] Tools can perform "some" refactorings (#1886) --- docs/guides/modernizing.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index 279febd6..2d17b636 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -29,7 +29,7 @@ available using quoting. Tools such as `pyupgrade `__, `ruff `__ and/or `com2ann `__ can automatically perform - these refactorings for you. + some of these refactorings for you. .. note:: From 46b05a4c10ed3841c9bc5126ba9f31dd8ae061e7 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Mon, 18 Nov 2024 13:10:13 +0100 Subject: [PATCH 20/29] Modernizing guide: Mention TypeGuard/TypeIs (#1887) --- docs/guides/modernizing.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/guides/modernizing.rst b/docs/guides/modernizing.rst index 2d17b636..a4eb3d5a 100644 --- a/docs/guides/modernizing.rst +++ b/docs/guides/modernizing.rst @@ -341,3 +341,16 @@ Update your imports to use the new locations:: from collections.abc import Hashable, Sized def f(x: Hashable) -> Sized: ... + +``typing.TypeGuard`` +==================== + +*Available since:* Python 3.13, typing-extensions + +:data:`TypeIs ` is an alternative to +:data:`TypeGuard ` that usually has more intuitive +behavior, but has other restrictions. See the documentation for +:data:`TypeIs ` for more information. + +Review existing uses of :data:`TypeGuard ` to see if they +should be replaced with :data:`TypeIs `. From 438dc29b11d03ed446209a5f156684b6084fc1ec Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Tue, 26 Nov 2024 17:36:17 -0800 Subject: [PATCH 21/29] Clarify some behavior around user-defined generic classes (#1879) * Update generics.rst * Update protocol.rst * Address reviewer comments. * Fix silly typo * English * Incorporate additional rules suggested by @erictraut. * Mandate error on inconsistent type variable order. * Mention inheriting from a generic in ways to define a class as generic. --- docs/spec/generics.rst | 103 ++++++++++++++++++++++++++++++++++------- docs/spec/protocol.rst | 11 ++++- 2 files changed, 95 insertions(+), 19 deletions(-) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index 2cb3f6f6..c7a61594 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -93,8 +93,16 @@ This is equivalent to omitting the generic notation and just saying User-defined generic types -------------------------- -You can include a ``Generic`` base class to define a user-defined class -as generic. Example:: +There are several ways to define a user-defined class as generic: + +* Include a ``Generic`` base class. +* Use the new generic class syntax in Python 3.12 and higher. +* Include a `` Protocol`` base class parameterized with type variables. This + approach also marks the class as a protocol - see + :ref:`generic protocols` for more information. +* Include a generic base class parameterized with type variables. + +Example using ``Generic``:: from typing import TypeVar, Generic from logging import Logger @@ -118,14 +126,14 @@ as generic. Example:: def log(self, message: str) -> None: self.logger.info('{}: {}'.format(self.name, message)) -Or, in Python 3.12 and higher, by using the new syntax for generic -classes:: +Or, using the new generic class syntax:: class LoggedVar[T]: # methods as in previous example -This implicitly adds ``Generic[T]`` as a base class and type checkers -should treat the two largely equivalently (except for variance, see below). +This implicitly adds ``Generic[T]`` as a base class, and type checkers +should treat the two definitions of ``LoggedVar`` largely equivalently (except +for variance, see below). ``Generic[T]`` as a base class defines that the class ``LoggedVar`` takes a single type parameter ``T``. This also makes ``T`` valid as @@ -144,7 +152,6 @@ A generic type can have any number of type variables, and type variables may be constrained. This is valid:: from typing import TypeVar, Generic - ... T = TypeVar('T') S = TypeVar('S') @@ -156,29 +163,52 @@ Each type variable argument to ``Generic`` must be distinct. This is thus invalid:: from typing import TypeVar, Generic - ... T = TypeVar('T') class Pair(Generic[T, T]): # INVALID ... -The ``Generic[T]`` base class is redundant in simple cases where you -subclass some other generic class and specify type variables for its -parameters:: +All arguments to ``Generic`` or ``Protocol`` must be type variables:: - from typing import TypeVar - from collections.abc import Iterator + from typing import Generic, Protocol + + class Bad1(Generic[int]): # INVALID + ... + class Bad2(Protocol[int]): # INVALID + ... + +When a ``Generic`` or parameterized ``Protocol`` base class is present, all type +parameters for the class must appear within the ``Generic`` or +``Protocol`` type argument list, respectively. A type checker should report an +error if a type variable that is not included in the type argument list appears +elsewhere in the base class list:: + + from typing import Generic, Protocol, TypeVar + from collections.abc import Iterable T = TypeVar('T') + S = TypeVar('S') - class MyIter(Iterator[T]): + class Bad1(Iterable[T], Generic[S]): # INVALID + ... + class Bad2(Iterable[T], Protocol[S]): # INVALID ... -That class definition is equivalent to:: +Note that the above rule does not apply to a bare ``Protocol`` base class. This +is valid (see below):: - class MyIter(Iterator[T], Generic[T]): - ... + from typing import Protocol, TypeVar + from collections.abc import Iterator + + T = TypeVar('T') + + class MyIterator(Iterator[T], Protocol): ... + +When no ``Generic`` or parameterized ``Protocol`` base class is present, a +defined class is generic if you subclass one or more other generic classes and +specify type variables for their parameters. See :ref:`generic-base-classes` +for details. You can use multiple inheritance with ``Generic``:: @@ -402,6 +432,7 @@ instead is preferred. (First, creating the subscripted class, e.g. ``Node[int]``, has a runtime cost. Second, using a type alias is more readable.) +.. _`generic-base-classes`: Arbitrary generic types as base classes --------------------------------------- @@ -458,8 +489,44 @@ Also consider the following example:: class MyDict(Mapping[str, T]): ... -In this case MyDict has a single parameter, T. +In this case ``MyDict`` has a single type parameter, ``T``. + +Type variables are applied to the defined class in the order in which +they first appear in any generic base classes:: + + from typing import Generic, TypeVar + + T1 = TypeVar('T1') + T2 = TypeVar('T2') + T3 = TypeVar('T3') + + class Parent1(Generic[T1, T2]): + ... + class Parent2(Generic[T1, T2]): + ... + class Child(Parent1[T1, T3], Parent2[T2, T3]): + ... + +That ``Child`` definition is equivalent to:: + class Child(Parent1[T1, T3], Parent2[T2, T3], Generic[T1, T3, T2]): + ... + +A type checker should report an error when the type variable order is +inconsistent:: + + from typing import Generic, TypeVar + + T1 = TypeVar('T1') + T2 = TypeVar('T2') + T3 = TypeVar('T3') + + class Grandparent(Generic[T1, T2]): + ... + class Parent(Grandparent[T1, T2]): + ... + class Child(Parent[T1, T2], Grandparent[T2, T1]): # INVALID + ... Abstract generic types ---------------------- diff --git a/docs/spec/protocol.rst b/docs/spec/protocol.rst index e280f0ed..50b64f37 100644 --- a/docs/spec/protocol.rst +++ b/docs/spec/protocol.rst @@ -257,6 +257,7 @@ from regular ABCs, where abstractness is simply defined by having at least one abstract method being unimplemented. Protocol classes must be marked *explicitly*. +.. _`generic-protocols`: Generic protocols ^^^^^^^^^^^^^^^^^ @@ -271,7 +272,15 @@ non-protocol generic types:: ... ``Protocol[T, S, ...]`` is allowed as a shorthand for -``Protocol, Generic[T, S, ...]``. +``Protocol, Generic[T, S, ...]``. It is an error to combine +``Protocol[T, S, ...]`` with ``Generic[T, S, ...]``, or with the new syntax for +generic classes in Python 3.12 and above:: + + class Iterable(Protocol[T], Generic[T]): # INVALID + ... + + class Iterable[T](Protocol[T]): # INVALID + ... User-defined generic protocols support explicitly declared variance. Type checkers will warn if the inferred variance is different from From cbedd6df4e89b92863e5534da6ea2aa9e6bb8f61 Mon Sep 17 00:00:00 2001 From: Rebecca Chen Date: Mon, 2 Dec 2024 20:36:57 -0800 Subject: [PATCH 22/29] Update conformance tests for recent generics spec change (#1892) * Baseline changes * New test cases for generics_base_class. * New test cases in generics_basic. --- .../results/mypy/generics_base_class.toml | 8 +++-- conformance/results/mypy/generics_basic.toml | 12 ++++--- conformance/results/mypy/version.toml | 2 +- .../results/pyre/generics_base_class.toml | 2 ++ conformance/results/pyre/generics_basic.toml | 7 +++- conformance/results/pyre/version.toml | 3 +- .../dataclasses_transform_converter.toml | 2 +- .../results/pyright/generics_base_class.toml | 2 ++ .../results/pyright/generics_basic.toml | 8 ++++- .../results/pyright/overloads_basic.toml | 4 +-- .../pyright/protocols_class_objects.toml | 4 +-- .../results/pyright/specialtypes_none.toml | 2 +- conformance/results/pyright/version.toml | 5 ++- .../results/pytype/generics_base_class.toml | 18 +++++++++++ .../results/pytype/generics_basic.toml | 32 +++++++++++++++++-- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 20 ++++++------ conformance/tests/generics_base_class.py | 25 +++++++++++++++ conformance/tests/generics_basic.py | 19 ++++++++++- 19 files changed, 142 insertions(+), 35 deletions(-) diff --git a/conformance/results/mypy/generics_base_class.toml b/conformance/results/mypy/generics_base_class.toml index 7d1dbad8..a0c547ee 100644 --- a/conformance/results/mypy/generics_base_class.toml +++ b/conformance/results/mypy/generics_base_class.toml @@ -1,4 +1,7 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Does not detect inconsistent type variable ordering. +""" output = """ generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" [arg-type] generics_base_class.py:29: error: Variable "typing.Generic" is not valid as a type [valid-type] @@ -9,6 +12,7 @@ generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 gi generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given [type-arg] generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 98: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_basic.toml b/conformance/results/mypy/generics_basic.toml index 00c82440..78cbd2ee 100644 --- a/conformance/results/mypy/generics_basic.toml +++ b/conformance/results/mypy/generics_basic.toml @@ -10,10 +10,14 @@ generics_basic.py:69: error: Value of type variable "AnyStr" of "concat" cannot generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index] generics_basic.py:158: error: Invalid index type "int" for "MyMap2[int, str]"; expected type "str" [index] -generics_basic.py:191: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc] -generics_basic.py:191: error: Type variable "generics_basic.T" is unbound [valid-type] -generics_basic.py:191: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_basic.py:191: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_basic.py:162: error: Free type variable expected in Generic[...] [misc] +generics_basic.py:163: error: Free type variable expected in Protocol[...] [misc] +generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] +generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] +generics_basic.py:208: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc] +generics_basic.py:208: error: Type variable "generics_basic.T" is unbound [valid-type] +generics_basic.py:208: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_basic.py:208: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index bdefc8cf..c328270a 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.13.0" -test_duration = 2.7 +test_duration = 2.5 diff --git a/conformance/results/pyre/generics_base_class.toml b/conformance/results/pyre/generics_base_class.toml index 0e50c8f7..3cac3f43 100644 --- a/conformance/results/pyre/generics_base_class.toml +++ b/conformance/results/pyre/generics_base_class.toml @@ -2,6 +2,7 @@ conformant = "Partial" notes = """ Does not reject illegal use of Generic. Does not allow using generic in assert_type expression. +Does not detect inconsistent type variable ordering. """ 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`. @@ -13,4 +14,5 @@ conformance_automated = "Fail" errors_diff = """ Line 29: Expected 1 errors Line 30: Expected 1 errors +Line 98: Expected 1 errors """ diff --git a/conformance/results/pyre/generics_basic.toml b/conformance/results/pyre/generics_basic.toml index 0b3d5e6d..2aab0059 100644 --- a/conformance/results/pyre/generics_basic.toml +++ b/conformance/results/pyre/generics_basic.toml @@ -4,6 +4,7 @@ False positives in examples using constrained type variables. False negative for constraint parameterized by a type variable. False negative in custom map example. False positive using `iter`. +False negative for bad type arguments to Generic/Protocol. False negative for generic metaclass. """ output = """ @@ -16,10 +17,14 @@ generics_basic.py:69:14 Incompatible parameter type [6]: In call `concat`, for 2 generics_basic.py:121:0 Duplicate type variables [59]: Duplicate type variable `T` in Generic[...]. generics_basic.py:157:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. generics_basic.py:158:7 Incompatible parameter type [6]: In call `typing.Mapping.__getitem__`, for 1st positional argument, expected `str` but got `int`. +generics_basic.py:171:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T_co]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T_co]`. +generics_basic.py:172:11 Invalid type variable [34]: The current class isn't generic with respect to the type variable `Variable[T_co]`. To reference the type variable, you can modify the class to inherit from `typing.Generic[T_co]`. """ conformance_automated = "Fail" errors_diff = """ Line 55: Expected 1 errors -Line 191: Expected 1 errors +Line 162: Expected 1 errors +Line 163: Expected 1 errors +Line 208: 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/version.toml b/conformance/results/pyre/version.toml index 5c0e095c..3ed7e73c 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,3 +1,2 @@ version = "pyre 0.9.23" -test_duration = 9.1 - +test_duration = 4.3 diff --git a/conformance/results/pyright/dataclasses_transform_converter.toml b/conformance/results/pyright/dataclasses_transform_converter.toml index 479f0d75..ec7db74c 100644 --- a/conformance/results/pyright/dataclasses_transform_converter.toml +++ b/conformance/results/pyright/dataclasses_transform_converter.toml @@ -40,5 +40,5 @@ dataclasses_transform_converter.py:130:67 - error: Argument of type "Literal[1]" dataclasses_transform_converter.py:133:75 - error: Argument of type "type[int]" cannot be assigned to parameter "default_factory" of type "(() -> S@model_field) | None" in function "model_field"   Type "type[int]" is not assignable to type "(() -> str) | None"     No overloaded function matches type "() -> str" -    "type[type]" is not assignable to "type[None]" (reportArgumentType) +    Type is not assignable to "None" (reportArgumentType) """ diff --git a/conformance/results/pyright/generics_base_class.toml b/conformance/results/pyright/generics_base_class.toml index fa4abde3..e39db1ee 100644 --- a/conformance/results/pyright/generics_base_class.toml +++ b/conformance/results/pyright/generics_base_class.toml @@ -10,6 +10,8 @@ generics_base_class.py:30:8 - error: "Generic" is not valid in this context (rep generics_base_class.py:49:38 - error: Too many type arguments provided for "LinkedList"; expected 1 but received 2 (reportInvalidTypeArguments) generics_base_class.py:61:30 - error: Too many type arguments provided for "MyDict"; expected 1 but received 2 (reportInvalidTypeArguments) generics_base_class.py:68:28 - error: Type arguments for "Generic" must be unique (reportInvalidTypeForm) +generics_base_class.py:98:7 - error: Base classes of BadChild are mutually incompatible +  Base class "Grandparent[T2@BadChild, T1@BadChild]" derives from "Grandparent[T2@BadChild, T1@BadChild]" which is incompatible with type "Grandparent[T1@BadChild, T2@BadChild]" (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/generics_basic.toml b/conformance/results/pyright/generics_basic.toml index 290ffe41..8b77d57f 100644 --- a/conformance/results/pyright/generics_basic.toml +++ b/conformance/results/pyright/generics_basic.toml @@ -13,7 +13,13 @@ generics_basic.py:157:5 - error: Argument of type "Literal[0]" cannot be assigne   "Literal[0]" is not assignable to "str" (reportArgumentType) generics_basic.py:158:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__"   "Literal[0]" is not assignable to "str" (reportArgumentType) -generics_basic.py:191:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues) +generics_basic.py:162:20 - error: Type argument for "Generic" must be a type variable (reportInvalidTypeForm) +generics_basic.py:163:21 - error: Type argument for "Protocol" must be a type parameter (reportInvalidTypeForm) +generics_basic.py:171:7 - error: Generic[] or Protocol[] must include all type variables +  Missing type variables: "T_co" (reportGeneralTypeIssues) +generics_basic.py:172:7 - error: Generic[] or Protocol[] must include all type variables +  Missing type variables: "T_co" (reportGeneralTypeIssues) +generics_basic.py:208:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/pyright/overloads_basic.toml b/conformance/results/pyright/overloads_basic.toml index b4148bcc..5171f52e 100644 --- a/conformance/results/pyright/overloads_basic.toml +++ b/conformance/results/pyright/overloads_basic.toml @@ -1,8 +1,8 @@ conformant = "Pass" output = """ overloads_basic.py:37:1 - error: No overloads for "__getitem__" match the provided arguments (reportCallIssue) -overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice" in function "__getitem__" -  "Literal['']" is not assignable to "slice" (reportArgumentType) +overloads_basic.py:37:1 - error: Argument of type "Literal['']" cannot be assigned to parameter "__s" of type "slice[Any, Any, Any]" in function "__getitem__" +  "Literal['']" is not assignable to "slice[Any, Any, Any]" (reportArgumentType) overloads_basic.py:63:5 - error: "func1" is marked as overload, but additional overloads are missing (reportInconsistentOverload) overloads_basic.py:75:5 - error: "func2" is marked as overload, but no implementation is provided (reportNoOverloadImplementation) """ diff --git a/conformance/results/pyright/protocols_class_objects.toml b/conformance/results/pyright/protocols_class_objects.toml index 2c3bfe0f..f68c71e6 100644 --- a/conformance/results/pyright/protocols_class_objects.toml +++ b/conformance/results/pyright/protocols_class_objects.toml @@ -5,8 +5,8 @@ protocols_class_objects.py:29:5 - error: Argument of type "type[Proto]" cannot b protocols_class_objects.py:34:7 - error: Type "type[Proto]" is not assignable to declared type "type[Proto]"   "Proto" is not a concrete class type and cannot be assigned to type "type[Proto]" (reportAssignmentType) protocols_class_objects.py:58:16 - error: Type "type[ConcreteA]" is not assignable to declared type "ProtoA1" -  "type[type]" is not assignable to "type[ConcreteA]" -  "type[type]" is not assignable to "type[ConcreteA]" +  Type "type[ConcreteA]" is not assignable to type "ConcreteA" +  Type "type[ConcreteA]" is not assignable to type "ConcreteA"   "method1" is an incompatible type     Type "(self: ConcreteA, x: int) -> int" is not assignable to type "(x: int) -> int"       Parameter name mismatch: "x" versus "self" diff --git a/conformance/results/pyright/specialtypes_none.toml b/conformance/results/pyright/specialtypes_none.toml index 94561c88..5bfb2d37 100644 --- a/conformance/results/pyright/specialtypes_none.toml +++ b/conformance/results/pyright/specialtypes_none.toml @@ -1,7 +1,7 @@ conformant = "Pass" output = """ specialtypes_none.py:21:7 - error: Argument of type "type[None]" cannot be assigned to parameter "val1" of type "None" in function "func1" -  "type[type]" is not assignable to "type[None]" (reportArgumentType) +  Type is not assignable to "None" (reportArgumentType) specialtypes_none.py:27:19 - error: Type "None" is not assignable to declared type "Iterable[Unknown]"   "None" is incompatible with protocol "Iterable[Unknown]"     "__iter__" is not present (reportAssignmentType) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 6441c95a..6269389b 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,3 +1,2 @@ -version = "pyright 1.1.386" -test_duration = 2.0 - +version = "pyright 1.1.389" +test_duration = 2.5 diff --git a/conformance/results/pytype/generics_base_class.toml b/conformance/results/pytype/generics_base_class.toml index 096f7d00..a3aa1cea 100644 --- a/conformance/results/pytype/generics_base_class.toml +++ b/conformance/results/pytype/generics_base_class.toml @@ -2,6 +2,7 @@ conformant = "Partial" notes = """ False negative on passing SymbolTable to dict[str, list[object]]. Does not reject illegal use of Generic. +Wrong type variable order when inheriting from multiple generic base classes. """ output = """ generics_base_class.py:29:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'T' [invalid-annotation] @@ -26,9 +27,26 @@ generics_base_class.py:68:17: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_parent1 was called with the wrong arguments [wrong-arg-types] + +takes_parent1(child) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:91:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Function takes_parent2 was called with the wrong arguments [wrong-arg-types] + +takes_parent2(child) # OK +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_base_class.py:98:1: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'BadChild' [invalid-annotation] + +class BadChild(Parent[T1, T2], Grandparent[T2, T1]): ... # E +\u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + """ conformance_automated = "Fail" errors_diff = """ Line 26: Expected 1 errors Line 30: Expected 1 errors +Line 90: Unexpected errors ['generics_base_class.py:90:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function takes_parent1 was called with the wrong arguments [wrong-arg-types]'] +Line 91: Unexpected errors ['generics_base_class.py:91:1: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : Function takes_parent2 was called with the wrong arguments [wrong-arg-types]'] """ diff --git a/conformance/results/pytype/generics_basic.toml b/conformance/results/pytype/generics_basic.toml index 5ab2769b..db7695d2 100644 --- a/conformance/results/pytype/generics_basic.toml +++ b/conformance/results/pytype/generics_basic.toml @@ -1,6 +1,8 @@ conformant = "Partial" notes = """ False positives in examples using constrained type variables. +Argument 'covariant' to TypeVar not supported. +False negative for type variables missing from Generic/Protocol base class. False negative for generic metaclass. """ output = """ @@ -66,7 +68,27 @@ generics_basic.py:158:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my m2[0] # E \u001b[1m\u001b[31m~~~~~\u001b[39m\u001b[0m -generics_basic.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type] +generics_basic.py:162:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Generic' [invalid-annotation] + +class Bad1(Generic[int]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:163:12: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : Invalid type annotation 'Protocol' [invalid-annotation] + +class Bad2(Protocol[int]): ... # E + \u001b[1m\u001b[31m~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:168:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +T_co = TypeVar("T_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:169:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet] + +S_co = TypeVar("S_co", covariant=True) + \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m + +generics_basic.py:199:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type] assert_type(iter(m), Iterator[Any]) \u001b[1m\u001b[31m~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[39m\u001b[0m @@ -74,9 +96,13 @@ generics_basic.py:182:5: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in test_my """ conformance_automated = "Fail" errors_diff = """ -Line 191: Expected 1 errors +Line 171: Expected 1 errors +Line 172: Expected 1 errors +Line 208: Expected 1 errors Line 34: Unexpected errors ['generics_basic.py:34:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in concat: bad return type [bad-return-type]'] Line 67: Unexpected errors ['generics_basic.py:67:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: MyStr [assert-type]'] Line 68: Unexpected errors ['generics_basic.py:68:17: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Function concat was called with the wrong arguments [wrong-arg-types]', 'generics_basic.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_concat_subtype: Any [assert-type]'] -Line 182: Unexpected errors ['generics_basic.py:182:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type]'] +Line 168: Unexpected errors ['generics_basic.py:168:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 169: Unexpected errors ['generics_basic.py:169:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] +Line 199: Unexpected errors ['generics_basic.py:199:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in test_my_iterable_any: Iterator[nothing] [assert-type]'] """ diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index 47fa98ff..d7a8701e 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 50.2 +test_duration = 45.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index 724b351b..26eb1c70 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,16 +159,16 @@

Python Type System Conformance Test Results

- + - - - + + - - + + diff --git a/conformance/tests/generics_base_class.py b/conformance/tests/generics_base_class.py index bfcb6347..61de5945 100644 --- a/conformance/tests/generics_base_class.py +++ b/conformance/tests/generics_base_class.py @@ -71,3 +71,28 @@ class BadClass1(Generic[T, T]): # E class GoodClass1(dict[T, T]): # OK pass + +# > Type variables are applied to the defined class in the order in which +# > they first appear in any generic base classes. + +T1 = TypeVar("T1") +T2 = TypeVar("T2") +T3 = TypeVar("T3") + +class Parent1(Generic[T1, T2]): ... +class Parent2(Generic[T1, T2]): ... +class Child(Parent1[T1, T3], Parent2[T2, T3]): ... + +def takes_parent1(x: Parent1[int, bytes]): ... +def takes_parent2(x: Parent2[str, bytes]): ... + +child: Child[int, bytes, str] = Child() +takes_parent1(child) # OK +takes_parent2(child) # OK + +# > A type checker should report an error when the type variable order is +# > inconsistent. + +class Grandparent(Generic[T1, T2]): ... +class Parent(Grandparent[T1, T2]): ... +class BadChild(Parent[T1, T2], Grandparent[T2, T1]): ... # E diff --git a/conformance/tests/generics_basic.py b/conformance/tests/generics_basic.py index 0a35336b..179d8475 100644 --- a/conformance/tests/generics_basic.py +++ b/conformance/tests/generics_basic.py @@ -7,7 +7,7 @@ from __future__ import annotations from collections.abc import Sequence -from typing import Any, Generic, TypeVar, assert_type +from typing import Any, Generic, Protocol, TypeVar, assert_type T = TypeVar("T") @@ -157,6 +157,23 @@ def test_my_map(m1: MyMap1[str, int], m2: MyMap2[int, str]): m1[0] # E m2[0] # E +# > All arguments to ``Generic`` or ``Protocol`` must be type variables. + +class Bad1(Generic[int]): ... # E +class Bad2(Protocol[int]): ... # E + +# > All type parameters for the class must appear within the ``Generic`` or +# > ``Protocol`` type argument list. + +T_co = TypeVar("T_co", covariant=True) +S_co = TypeVar("S_co", covariant=True) + +class Bad3(Iterable[T_co], Generic[S_co]): ... # E +class Bad4(Iterable[T_co], Protocol[S_co]): ... # E + +# > The above rule does not apply to a bare ``Protocol`` base class. + +class MyIterator(Iterator[T_co], Protocol): ... # OK # > You can use multiple inheritance with ``Generic`` From 69ddc2389df3b8e94a7bc512e7b1f94e275810f8 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 3 Dec 2024 14:04:38 +0100 Subject: [PATCH 23/29] Fix a typo (#1893) --- docs/guides/writing_stubs.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 71d13a71..7475cce0 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -113,8 +113,8 @@ Stub Content This section documents best practices on what elements to include or leave out of stub files. -Modules excluded fom stubs --------------------------- +Modules excluded from stubs +--------------------------- Not all modules should be included in stubs. From ad4cbc45f868f47031494694bdb7349119302f59 Mon Sep 17 00:00:00 2001 From: Sebastian Rittau Date: Tue, 3 Dec 2024 17:13:26 +0100 Subject: [PATCH 24/29] Writing Stubs: Add "Overloads and Flags" section (#1894) --- docs/guides/writing_stubs.rst | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index 7475cce0..bde28632 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -405,6 +405,64 @@ common mistakes like unintentionally passing in ``None``. If in doubt, consider asking the library maintainers about their intent. +Common Patterns +=============== + +.. _stub-patterns: + +This section documents common patterns that are useful in stub files. + +Overloads and Flags +------------------- + +.. _overloads-and-flags: + +Sometimes a function or method has a flag argument that changes the return type +or other accepted argument types. For example, take the following function:: + + def open(name: str, mode: Literal["r", "w"] = "r") -> Reader | Writer: + ... + +We can express this case easily with two overloads:: + + @overload + def open(name: str, mode: Literal["r"] = "r") -> Reader: ... + @overload + def open(name: str, mode: Literal["w"]) -> Writer: ... + +The first overload is picked when the mode is ``"r"`` or not given, and the +second overload is picked when the mode is ``"w"``. But what if the first +argument is optional? + +:: + + def open(name: str | None = None, mode: Literal["r", "w"] = "r") -> Reader | Writer: + ... + +Ideally we would be able to use the following overloads:: + + @overload + def open(name: str | None = None, mode: Literal["r"] = "r") -> Reader: ... + @overload + def open(name: str | None = None, mode: Literal["w"]) -> Writer: ... + +And while the first overload is fine, the second is a syntax error in Python, +because non-default arguments cannot follow default arguments. To work around +this, we need an extra overload:: + + @overload + def open(name: str | None = None, mode: Literal["r"] = "r") -> Reader: ... + @overload + def open(name: str | None, mode: Literal["w"]) -> Writer: ... + @overload + def open(*, mode: Literal["w"]) -> Writer: ... + +As before, the first overload is picked when the mode is ``"r"`` or not given. +Otherwise, the second overload is used when ``open`` is called with an explicit +``name``, e.g. ``open("file.txt", "w")`` or ``open(None, "w")``. The third +overload is used when ``open`` is called without a name , e.g. +``open(mode="w")``. + Style Guide =========== From d1e4add4f50493cc87124c741ba5c45a0bbe083b Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Thu, 5 Dec 2024 20:17:57 +0100 Subject: [PATCH 25/29] Remove paragraph mentioning minor edits through the mailing list (#1891) --- docs/spec/dataclasses.rst | 5 ----- 1 file changed, 5 deletions(-) diff --git a/docs/spec/dataclasses.rst b/docs/spec/dataclasses.rst index ed914595..92d53d22 100644 --- a/docs/spec/dataclasses.rst +++ b/docs/spec/dataclasses.rst @@ -192,11 +192,6 @@ customization of default behaviors: in ``typing.py``. Type checkers should report errors for any unrecognized parameters. -In the future, we may add additional parameters to -``dataclass_transform`` as needed to support common behaviors in user -code. These additions will be made after reaching consensus on -typing-sig rather than via additional PEPs. - The following sections provide additional examples showing how these parameters are used. From 6dd6fe403634ac5c89849e57141bcbc116ee2831 Mon Sep 17 00:00:00 2001 From: InSync Date: Sun, 8 Dec 2024 07:43:41 +0700 Subject: [PATCH 26/29] Specs clarification: Forbid `ClassVar` and `Final` within `TypedDict` body (#1890) --- docs/spec/class-compat.rst | 4 ++++ docs/spec/qualifiers.rst | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/docs/spec/class-compat.rst b/docs/spec/class-compat.rst index 9f88d564..f3086e75 100644 --- a/docs/spec/class-compat.rst +++ b/docs/spec/class-compat.rst @@ -89,6 +89,10 @@ annotated in ``__init__`` or other methods, rather than in the class:: def __init__(self, content): self.content: T = content +``ClassVar`` cannot be used as a qualifier for a :ref:`TypedDict ` +item or a :ref:`NamedTuple ` field. Such usage also generates +an error at runtime. + .. _`override`: ``@override`` diff --git a/docs/spec/qualifiers.rst b/docs/spec/qualifiers.rst index 4a3bcc9f..7ba4d9f4 100644 --- a/docs/spec/qualifiers.rst +++ b/docs/spec/qualifiers.rst @@ -203,6 +203,10 @@ following should be allowed:: Y: Final = "y" N = NamedTuple("N", [(X, int), (Y, int)]) +``Final`` cannot be used as a qualifier for a :ref:`TypedDict ` +item or a :ref:`NamedTuple ` field. Such usage also generates +an error at runtime. + .. _`annotated`: ``Annotated`` From 59081c2dce23cd12d6611657ba6fc62e5ebdfc37 Mon Sep 17 00:00:00 2001 From: Victorien <65306057+Viicos@users.noreply.github.com> Date: Mon, 16 Dec 2024 15:17:27 +0100 Subject: [PATCH 27/29] Fix markup in generics specification (#1900) --- docs/spec/generics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/spec/generics.rst b/docs/spec/generics.rst index c7a61594..d6055e20 100644 --- a/docs/spec/generics.rst +++ b/docs/spec/generics.rst @@ -97,7 +97,7 @@ There are several ways to define a user-defined class as generic: * Include a ``Generic`` base class. * Use the new generic class syntax in Python 3.12 and higher. -* Include a `` Protocol`` base class parameterized with type variables. This +* Include a ``Protocol`` base class parameterized with type variables. This approach also marks the class as a protocol - see :ref:`generic protocols` for more information. * Include a generic base class parameterized with type variables. From a434c99b2207ded1aa687041220fe4868f1dc6fe Mon Sep 17 00:00:00 2001 From: Danny Yang Date: Tue, 17 Dec 2024 01:40:15 -0500 Subject: [PATCH 28/29] Add content from typeshed/CONTRIBUTING.md (#1882) * add content from typeshed/CONTRIBUTING.md * fix build errors * address review comments * Update docs/guides/writing_stubs.rst Co-authored-by: Rebecca Chen * Update docs/guides/writing_stubs.rst Co-authored-by: Rebecca Chen * add Incomplete vs Any, the Any trick sections; add reference to error suppression formats section * fix ref * format and fix link * fix backticks, add Docstrings section * fix one more backtick * fix typo * fix label * Minor style and formatting fixes Removed repeated example, fixed formatting, removed stray "the". --------- Co-authored-by: Rebecca Chen --- docs/guides/writing_stubs.rst | 215 +++++++++++++++++++++++++++++----- 1 file changed, 188 insertions(+), 27 deletions(-) diff --git a/docs/guides/writing_stubs.rst b/docs/guides/writing_stubs.rst index bde28632..47f48b40 100644 --- a/docs/guides/writing_stubs.rst +++ b/docs/guides/writing_stubs.rst @@ -93,6 +93,9 @@ Liskov substitutability or detecting problematic overloads. It may be instructive to examine `typeshed `__'s `setup for testing stubs `__. +To suppress type errors in stubs, use ``# type: ignore`` comments. Refer to the :ref:`type-checker-error-suppression` section of the style guide for +error suppression formats specific to individual typecheckers. + .. TODO: consider adding examples and configurations for specific type checkers @@ -113,18 +116,6 @@ Stub Content This section documents best practices on what elements to include or leave out of stub files. -Modules excluded from stubs ---------------------------- - -Not all modules should be included in stubs. - -It is recommended to exclude: - -1. Implementation details, with `multiprocessing/popen_spawn_win32.py `_ as a notable example -2. Modules that are not supposed to be imported, such as ``__main__.py`` -3. Protected modules that start with a single ``_`` char. However, when needed protected modules can still be added (see :ref:`undocumented-objects` section below) -4. Tests - Public Interface ---------------- @@ -138,7 +129,17 @@ The following should always be included: * All objects included in ``__all__`` (if present). Other objects may be included if they are not prefixed with an underscore -or if they are being used in practice. (See the next section.) +or if they are being used in practice. + +Modules excluded from stubs +--------------------------- + +The following should not be included in stubs: + +1. Implementation details, with `multiprocessing/popen_spawn_win32.py `_ as a notable example +2. Modules that are not supposed to be imported, such as ``__main__.py`` +3. Protected modules that start with a single ``_`` char. However, when needed protected modules can still be added (see :ref:`undocumented-objects` section below) +4. Tests .. _undocumented-objects: @@ -212,6 +213,20 @@ to use them freely to describe simple structural types. Incomplete Stubs ---------------- +When writing new stubs, it is not necessary to fully annotate all arguments, +return types, and fields. Some items may be left unannotated or +annotated with ``_typeshed.Incomplete`` (`documentation `_):: + + from _typeshed import Incomplete + + field: Incomplete # unannotated + + def foo(x): ... # unannotated argument and return type + +``_typeshed.Incomplete`` can also be used for partially known types:: + + def foo(x: Incomplete | None = None) -> list[Incomplete]: ... + Partial stubs can be useful, especially for larger packages, but they should follow the following guidelines: @@ -219,16 +234,7 @@ follow the following guidelines: can be left unannotated. * Do not use ``Any`` to mark unannotated or partially annotated values. Leave function parameters and return values unannotated. In all other cases, use - ``_typeshed.Incomplete`` - (`documentation `_):: - - from _typeshed import Incomplete - - field1: Incomplete - field2: dict[str, Incomplete] - - def foo(x): ... - + ``_typeshed.Incomplete``. * Partial classes should include a ``__getattr__()`` method marked with ``_typeshed.Incomplete`` (see example below). * Partial modules (i.e. modules that are missing some or all classes, @@ -253,6 +259,17 @@ annotated function ``bar()``:: def bar(x: str, y, *, z=...): ... +``Any`` vs. ``Incomplete`` +-------------------------- + +While ``Incomplete`` is a type alias of ``Any``, they serve different purposes: +``Incomplete`` is a placeholder where a proper type might be substituted. +It's a "to do" item and should be replaced if possible. + +``Any`` is used when it's not possible to accurately type an item using the current +type system. It should be used sparingly, as described in the :ref:`using-any` +section of the style guide. + Attribute Access ---------------- @@ -475,6 +492,28 @@ and the :ref:`best-practices`. There are a few exceptions, outlined below, that different structure of stub files into account and aim to create more concise files. +Syntax Example +-------------- + +The below is an excerpt from the types for the ``datetime`` module. + + MAXYEAR: int + MINYEAR: int + + class date: + def __new__(cls, year: SupportsIndex, month: SupportsIndex, day: SupportsIndex) -> Self: ... + @classmethod + def fromtimestamp(cls, timestamp: float, /) -> Self: ... + @classmethod + def today(cls) -> Self: ... + @classmethod + def fromordinal(cls, n: int, /) -> Self: ... + @property + def year(self) -> int: ... + def replace(self, year: SupportsIndex = ..., month: SupportsIndex = ..., day: SupportsIndex = ...) -> Self: ... + def ctime(self) -> str: ... + def weekday(self) -> int: ... + Maximum Line Length ------------------- @@ -506,7 +545,7 @@ No:: def time_func() -> None: ... - def date_func() -> None: ... # do no leave unnecessary empty lines + def date_func() -> None: ... # do not leave unnecessary empty lines def ip_func() -> None: ... @@ -563,7 +602,7 @@ Yes:: class Color(Enum): # An assignment with no type annotation is a convention used to indicate - # an enum member. + # an enum member. RED = 1 No:: @@ -633,6 +672,13 @@ No:: ... def to_int3(x: str) -> int: pass +Avoid invariant collection types (``list``, ``dict``) for function parameters, +in favor of covariant types like ``Mapping`` or ``Sequence``. + +Avoid union return types. See https://github.com/python/mypy/issues/1693 + +Use ``float`` instead of ``int | float`` for parameter annotations. See :pep:`484` for more details. + Language Features ----------------- @@ -662,6 +708,14 @@ No:: class OtherClass: ... +Use variable annotations instead of type comments, even for stubs that target +older versions of Python. + +Platform-dependent APIs +----------------------- + +Use :ref:`platform checks` like ``if sys.platform == 'win32'`` to denote platform-dependent APIs. + NamedTuple and TypedDict ------------------------ @@ -689,7 +743,7 @@ No:: Built-in Generics ----------------- -:pep:`585` built-in generics are supported and should be used instead +:pep:`585` built-in generics (such as ``list``, ``dict``, ``tuple``, ``set``) are supported and should be used instead of the corresponding types from ``typing``:: from collections import defaultdict @@ -707,8 +761,115 @@ generally possible and recommended:: Unions ------ -Declaring unions with the shorthand `|` syntax is recommended and supported by +Declaring unions with the shorthand ``|`` syntax is recommended and supported by all type checkers:: def foo(x: int | str) -> int | None: ... # recommended def foo(x: Union[int, str]) -> Optional[int]: ... # ok + +.. _using-any: + +Using ``Any`` and ``object`` +---------------------------- + +When adding type hints, avoid using the ``Any`` type when possible. Reserve +the use of ``Any`` for when: + +* the correct type cannot be expressed in the current type system; and +* to avoid union returns (see above). + +Note that ``Any`` is not the correct type to use if you want to indicate +that some function can accept literally anything: in those cases use +``object`` instead. + +When using ``Any``, document the reason for using it in a comment. Ideally, +document what types could be used. + +The ``Any`` Trick +----------------- + +In cases where a function or method can return ``None``, but where forcing the +user to explicitly check for ``None`` can be detrimental, use +``_typeshed.MaybeNone`` (an alias to ``Any``), instead of ``None``. + +Consider the following (simplified) signature of ``re.Match[str].group``:: + + class Match: + def group(self, group: str | int, /) -> str | MaybeNone: ... + +This avoid forcing the user to check for ``None``:: + + match = re.fullmatch(r"\d+_(.*)", some_string) + assert match is not None + name_group = match.group(1) # The user knows that this will never be None + return name_group.uper() # This typo will be flagged by the type checker + +In this case, the user of ``match.group()`` must be prepared to handle a ``str``, +but type checkers are happy with ``if name_group is None`` checks, because we're +saying it can also be something else than an ``str``. + +This is sometimes called "the Any trick". + +Context Managers +---------------- + +When adding type annotations for context manager classes, annotate +the return type of ``__exit__`` as bool only if the context manager +sometimes suppresses exceptions -- if it sometimes returns ``True`` +at runtime. If the context manager never suppresses exceptions, +have the return type be either ``None`` or ``bool | None``. If you +are not sure whether exceptions are suppressed or not or if the +context manager is meant to be subclassed, pick ``bool | None``. +See https://github.com/python/mypy/issues/7214 for more details. + +``__enter__`` methods and other methods that return ``self`` or ``cls(...)`` +should be annotated with ``typing.Self`` +(`example `_). + +Naming +------ + +Type variables and aliases you introduce purely for legibility reasons +should be prefixed with an underscore to make it obvious to the reader +they are not part of the stubbed API. + +A few guidelines for protocol names below. In cases that don't fall +into any of those categories, use your best judgement. + +* Use plain names for protocols that represent a clear concept + (e.g. ``Iterator``, ``Container``). +* Use ``SupportsX`` for protocols that provide callable methods (e.g. + ``SupportsInt``, ``SupportsRead``, ``SupportsReadSeek``). +* Use ``HasX`` for protocols that have readable and/or writable attributes + or getter/setter methods (e.g. ``HasItems``, ``HasFileno``). + +.. _type-checker-error-suppression: + +Type Checker Error Suppression Formats +-------------------------------------- + +* Use mypy error codes for mypy-specific ``# type: ignore`` annotations, e.g. ``# type: ignore[override]`` for Liskov Substitution Principle violations. +* Use pyright error codes for pyright-specific suppressions, e.g. ``# pyright: ignore[reportGeneralTypeIssues]``. +* If you need both on the same line, mypy's annotation needs to go first, e.g. ``# type: ignore[override] # pyright: ignore[reportGeneralTypeIssues]``. + + +``@deprecated`` +--------------- + +The ``@typing_extensions.deprecated`` decorator (``@warnings.deprecated`` +since Python 3.13) can be used to mark deprecated functionality; see +:pep:`702`. + +Keep the deprecation message concise, but try to mention the projected +version when the functionality is to be removed, and a suggested +replacement. + +Docstrings +---------- + +There are several tradeoffs around including docstrings in type stubs. Consider the intended purpose +of your stubs when deciding whether to include docstrings in your project's stubs. + +* They do not affect type checking results and will be ignored by type checkers. +* Docstrings can improve certain IDE functionality, such as hover info. +* Duplicating docstrings between source code and stubs requires extra work to keep them in sync. From e52371772936ad45dca9677dd5232910a85efa2e Mon Sep 17 00:00:00 2001 From: Eric Traut Date: Fri, 20 Dec 2024 10:32:35 -0800 Subject: [PATCH 29/29] =?UTF-8?q?Updated=20conformance=20test=20results=20?= =?UTF-8?q?for=20the=20latest=20versions=20of=20type=20chec=E2=80=A6=20(#1?= =?UTF-8?q?904)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated conformance test results for the latest versions of type checkers. Mypy 1.14: * Added support for @deprecated * Added support for default TypeVar values * Fixed conformance issues with enums * Fixed conformance issues with generics (constrained TypeVars and ParamSpecs) * Fixed conformance issues with TypedDict ReadOnly Pyright 1.1.391: * No changes --- .../results/mypy/directives_deprecated.toml | 31 ++++++++---------- conformance/results/mypy/enums_members.toml | 4 +-- conformance/results/mypy/generics_basic.toml | 9 ++---- .../results/mypy/generics_defaults.toml | 2 +- .../mypy/generics_defaults_referential.toml | 2 +- .../generics_defaults_specialization.toml | 2 +- .../mypy/generics_paramspec_basic.toml | 10 +++--- .../results/mypy/narrowing_typeguard.toml | 1 + .../results/mypy/narrowing_typeis.toml | 1 + conformance/results/mypy/overloads_basic.toml | 2 +- .../results/mypy/qualifiers_annotated.toml | 4 --- .../results/mypy/typeddicts_readonly.toml | 11 ++----- .../mypy/typeddicts_readonly_consistency.toml | 9 ++---- .../results/mypy/typeddicts_required.toml | 11 ++----- conformance/results/mypy/version.toml | 4 +-- conformance/results/pyre/version.toml | 2 +- conformance/results/pyright/version.toml | 4 +-- .../results/pytype/specialtypes_never.toml | 7 ++-- conformance/results/pytype/version.toml | 2 +- conformance/results/results.html | 32 +++++++++---------- conformance/src/type_checker.py | 2 ++ 21 files changed, 64 insertions(+), 88 deletions(-) diff --git a/conformance/results/mypy/directives_deprecated.toml b/conformance/results/mypy/directives_deprecated.toml index 2442ee8f..153d58c5 100644 --- a/conformance/results/mypy/directives_deprecated.toml +++ b/conformance/results/mypy/directives_deprecated.toml @@ -1,21 +1,18 @@ -conformant = "Unsupported" -notes = """ -Does not support @deprecated. -""" -conformance_automated = "Fail" +conformant = "Pass" +conformance_automated = "Pass" errors_diff = """ -Line 18: Expected 1 errors -Line 24: Expected 1 errors -Line 25: Expected 1 errors -Line 30: Expected 1 errors -Line 41: Expected 1 errors -Line 42: Expected 1 errors -Line 44: Expected 1 errors -Line 47: Expected 1 errors -Line 48: Expected 1 errors -Line 58: Expected 1 errors -Line 69: Expected 1 errors -Line 98: Expected 1 errors """ output = """ +directives_deprecated.py:18: error: class _directives_deprecated_library.Ham is deprecated: Use Spam instead [deprecated] +directives_deprecated.py:24: error: function _directives_deprecated_library.norwegian_blue is deprecated: It is pining for the fjords [deprecated] +directives_deprecated.py:25: error: function _directives_deprecated_library.norwegian_blue is deprecated: It is pining for the fjords [deprecated] +directives_deprecated.py:30: error: overload def (x: builtins.int) -> builtins.str of function _directives_deprecated_library.foo is deprecated: Only str will be allowed [deprecated] +directives_deprecated.py:41: error: function _directives_deprecated_library.Spam.__add__ is deprecated: There is enough spam in the world [deprecated] +directives_deprecated.py:42: error: function _directives_deprecated_library.Spam.__add__ is deprecated: There is enough spam in the world [deprecated] +directives_deprecated.py:44: error: function _directives_deprecated_library.Spam.greasy is deprecated: All spam will be equally greasy [deprecated] +directives_deprecated.py:47: error: function _directives_deprecated_library.Spam.shape is deprecated: Shapes are becoming immutable [deprecated] +directives_deprecated.py:48: error: function _directives_deprecated_library.Spam.shape is deprecated: Shapes are becoming immutable [deprecated] +directives_deprecated.py:58: error: function directives_deprecated.Invocable.__call__ is deprecated: Deprecated [deprecated] +directives_deprecated.py:69: error: function directives_deprecated.lorem is deprecated: Deprecated [deprecated] +directives_deprecated.py:98: error: function directives_deprecated.SupportsFoo1.foo is deprecated: Deprecated [deprecated] """ diff --git a/conformance/results/mypy/enums_members.toml b/conformance/results/mypy/enums_members.toml index ebac634c..3678b123 100644 --- a/conformance/results/mypy/enums_members.toml +++ b/conformance/results/mypy/enums_members.toml @@ -1,7 +1,6 @@ conformant = "Partial" notes = """ Does not treat attribute with annotation and no assignment as non-member. -Does not reject use of annotation with enum member. Does not treat callables as non-members. Does not honor `enum.member` as method decorator. Does not properly handle aliased enum members. @@ -10,7 +9,6 @@ Does not treat attributes with private names as non-members. """ conformance_automated = "Fail" errors_diff = """ -Line 50: Expected 1 errors Line 82: Expected 1 errors Line 83: Expected 1 errors Line 129: Expected 1 errors @@ -26,6 +24,8 @@ enums_members.py:27: error: Expression is of type "Literal[Pet.genus]", not "str enums_members.py:28: error: Expression is of type "Literal[Pet.species]", not "str" [assert-type] enums_members.py:35: error: Expression is of type "Literal[Pet2.genus]", not "str" [assert-type] enums_members.py:36: error: Expression is of type "Literal[Pet2.species]", not "str" [assert-type] +enums_members.py:50: error: Enum members must be left unannotated [misc] +enums_members.py:50: note: See https://typing.readthedocs.io/en/latest/spec/enums.html#defining-members enums_members.py:84: error: Expression is of type "Callable[[Pet4], str]", not "Any" [assert-type] enums_members.py:84: error: Parameter 1 of Literal[...] is invalid [valid-type] enums_members.py:85: error: Expression is of type "Callable[[Pet4], None]", not "Any" [assert-type] diff --git a/conformance/results/mypy/generics_basic.toml b/conformance/results/mypy/generics_basic.toml index 78cbd2ee..322d9ff7 100644 --- a/conformance/results/mypy/generics_basic.toml +++ b/conformance/results/mypy/generics_basic.toml @@ -1,11 +1,9 @@ -conformant = "Partial" -notes = """ -Does not reject the use of a constraint parameterized by another type variable. -""" +conformant = "Pass" output = """ generics_basic.py:40: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:41: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:49: error: Type variable must have at least two constrained types [misc] +generics_basic.py:55: error: TypeVar constraint type cannot be parametrized by type variables [misc] generics_basic.py:69: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index] @@ -19,7 +17,6 @@ generics_basic.py:208: error: Type variable "generics_basic.T" is unbound [vali generics_basic.py:208: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_basic.py:208: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 55: Expected 1 errors """ diff --git a/conformance/results/mypy/generics_defaults.toml b/conformance/results/mypy/generics_defaults.toml index b8fb5b0f..e7e5536b 100644 --- a/conformance/results/mypy/generics_defaults.toml +++ b/conformance/results/mypy/generics_defaults.toml @@ -1,4 +1,4 @@ -conformant = "Unsupported" +conformant = "Partial" output = """ generics_defaults.py:24: error: "T" cannot appear after "DefaultStrT" in type parameter list because it has no default type [misc] generics_defaults.py:30: error: Expression is of type "type[NoNonDefaults[Any, Any]]", not "type[NoNonDefaults[str, int]]" [assert-type] diff --git a/conformance/results/mypy/generics_defaults_referential.toml b/conformance/results/mypy/generics_defaults_referential.toml index bcf11e05..3222f9e6 100644 --- a/conformance/results/mypy/generics_defaults_referential.toml +++ b/conformance/results/mypy/generics_defaults_referential.toml @@ -1,4 +1,4 @@ -conformant = "Unsupported" +conformant = "Partial" output = """ generics_defaults_referential.py:23: error: Expression is of type "type[slice[Any, Any, Any]]", not "type[slice[int, int, int | None]]" [assert-type] generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type] diff --git a/conformance/results/mypy/generics_defaults_specialization.toml b/conformance/results/mypy/generics_defaults_specialization.toml index 95472edc..321faa38 100644 --- a/conformance/results/mypy/generics_defaults_specialization.toml +++ b/conformance/results/mypy/generics_defaults_specialization.toml @@ -1,4 +1,4 @@ -conformant = "Unsupported" +conformant = "Partial" output = """ generics_defaults_specialization.py:30: error: Bad number of arguments for type alias, expected between 0 and 1, given 2 [type-arg] generics_defaults_specialization.py:45: error: Expression is of type "type[Bar[Any]]", not "type[Bar[str]]" [assert-type] diff --git a/conformance/results/mypy/generics_paramspec_basic.toml b/conformance/results/mypy/generics_paramspec_basic.toml index 53fd4f5e..538f6de4 100644 --- a/conformance/results/mypy/generics_paramspec_basic.toml +++ b/conformance/results/mypy/generics_paramspec_basic.toml @@ -1,9 +1,8 @@ -conformant = "Partial" -notes = """ -Does not reject ParamSpec when used "bare" in type alias definition. -""" +conformant = "Pass" output = """ generics_paramspec_basic.py:10: error: String argument 1 "NotIt" to ParamSpec(...) does not match variable name "WrongName" [misc] +generics_paramspec_basic.py:15: error: Invalid location for ParamSpec "P" [valid-type] +generics_paramspec_basic.py:15: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" generics_paramspec_basic.py:23: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:23: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" generics_paramspec_basic.py:27: error: Invalid location for Concatenate [valid-type] @@ -15,7 +14,6 @@ generics_paramspec_basic.py:35: note: You can use ParamSpec as the first argumen generics_paramspec_basic.py:39: error: Invalid location for ParamSpec "P" [valid-type] generics_paramspec_basic.py:39: note: You can use ParamSpec as the first argument to Callable, e.g., "Callable[P, int]" """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 15: Expected 1 errors """ diff --git a/conformance/results/mypy/narrowing_typeguard.toml b/conformance/results/mypy/narrowing_typeguard.toml index f4a9a666..12cc80af 100644 --- a/conformance/results/mypy/narrowing_typeguard.toml +++ b/conformance/results/mypy/narrowing_typeguard.toml @@ -4,6 +4,7 @@ narrowing_typeguard.py:102: error: TypeGuard functions must have a positional ar narrowing_typeguard.py:107: error: TypeGuard functions must have a positional argument [valid-type] narrowing_typeguard.py:128: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], str]" [arg-type] narrowing_typeguard.py:148: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "CallableStrProto" [arg-type] +narrowing_typeguard.py:148: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]" """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/mypy/narrowing_typeis.toml b/conformance/results/mypy/narrowing_typeis.toml index f1673002..b913aa17 100644 --- a/conformance/results/mypy/narrowing_typeis.toml +++ b/conformance/results/mypy/narrowing_typeis.toml @@ -4,6 +4,7 @@ narrowing_typeis.py:105: error: "TypeIs" functions must have a positional argume narrowing_typeis.py:110: error: "TypeIs" functions must have a positional argument [valid-type] narrowing_typeis.py:132: error: Argument 1 to "takes_callable_str" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], str]" [arg-type] narrowing_typeis.py:152: error: Argument 1 to "takes_callable_str_proto" has incompatible type "Callable[[object], TypeIs[int]]"; expected "CallableStrProto" [arg-type] +narrowing_typeis.py:152: note: "CallableStrProto.__call__" has type "Callable[[Arg(object, 'val')], str]" narrowing_typeis.py:169: error: Argument 1 to "takes_typeguard" has incompatible type "Callable[[object], TypeIs[int]]"; expected "Callable[[object], TypeGuard[int]]" [arg-type] narrowing_typeis.py:170: error: Argument 1 to "takes_typeis" has incompatible type "Callable[[object], TypeGuard[int]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] narrowing_typeis.py:191: error: Argument 1 to "takes_int_typeis" has incompatible type "Callable[[object], TypeIs[bool]]"; expected "Callable[[object], TypeIs[int]]" [arg-type] diff --git a/conformance/results/mypy/overloads_basic.toml b/conformance/results/mypy/overloads_basic.toml index 6a796696..c42562c9 100644 --- a/conformance/results/mypy/overloads_basic.toml +++ b/conformance/results/mypy/overloads_basic.toml @@ -3,7 +3,7 @@ output = """ overloads_basic.py:37: error: No overload variant of "__getitem__" of "Bytes" matches argument type "str" [call-overload] overloads_basic.py:37: note: Possible overload variants: overloads_basic.py:37: note: def __getitem__(self, int, /) -> int -overloads_basic.py:37: note: def __getitem__(self, slice, /) -> bytes +overloads_basic.py:37: note: def __getitem__(self, slice[Any, Any, Any], /) -> bytes overloads_basic.py:62: error: Single overload definition, multiple required [misc] overloads_basic.py:74: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] """ diff --git a/conformance/results/mypy/qualifiers_annotated.toml b/conformance/results/mypy/qualifiers_annotated.toml index f2a37363..b93e964a 100644 --- a/conformance/results/mypy/qualifiers_annotated.toml +++ b/conformance/results/mypy/qualifiers_annotated.toml @@ -28,8 +28,6 @@ qualifiers_annotated.py:91: error: "" not callable [operat qualifiers_annotated.py:92: error: "" not callable [operator] qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type] qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type] -qualifiers_annotated.py:110: error: Required[] can be only used in a TypedDict definition [valid-type] -qualifiers_annotated.py:112: error: NotRequired[] can be only used in a TypedDict definition [valid-type] qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc] qualifiers_annotated.py:119: error: Invalid assignment target [misc] """ @@ -40,7 +38,5 @@ Line 85: Expected 1 errors Line 93: Expected 1 errors Line 98: Unexpected errors ['qualifiers_annotated.py:98: error: Invalid type: ClassVar nested inside other type [valid-type]'] Line 100: Unexpected errors ['qualifiers_annotated.py:100: error: Final can be only used as an outermost qualifier in a variable annotation [valid-type]'] -Line 110: Unexpected errors ['qualifiers_annotated.py:110: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 112: Unexpected errors ['qualifiers_annotated.py:112: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] Line 119: Unexpected errors ['qualifiers_annotated.py:119: error: Cannot redefine "T" as a type variable [misc]', 'qualifiers_annotated.py:119: error: Invalid assignment target [misc]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly.toml b/conformance/results/mypy/typeddicts_readonly.toml index 6dc58bb6..882ee1b8 100644 --- a/conformance/results/mypy/typeddicts_readonly.toml +++ b/conformance/results/mypy/typeddicts_readonly.toml @@ -1,17 +1,12 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects NotRequired directive when used in an Annotated annotation. -""" +conformant = "Pass" output = """ typeddicts_readonly.py:24: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly.py:36: error: ReadOnly TypedDict key "members" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly.py:50: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] typeddicts_readonly.py:51: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated] -typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_readonly.py:60: error: ReadOnly TypedDict key "title" TypedDict is mutated [typeddict-readonly-mutated] +typeddicts_readonly.py:61: error: ReadOnly TypedDict key "year" TypedDict is mutated [typeddict-readonly-mutated] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 61: Expected 1 errors -Line 56: Unexpected errors ['typeddicts_readonly.py:56: error: NotRequired[] can be only used in a TypedDict definition [valid-type]'] """ diff --git a/conformance/results/mypy/typeddicts_readonly_consistency.toml b/conformance/results/mypy/typeddicts_readonly_consistency.toml index ea01b2dc..803f1bbd 100644 --- a/conformance/results/mypy/typeddicts_readonly_consistency.toml +++ b/conformance/results/mypy/typeddicts_readonly_consistency.toml @@ -1,18 +1,13 @@ -conformant = "Partial" -notes = """ -Incorrectly rejects assignment of required item to not-required read-only item. -""" +conformant = "Pass" output = """ typeddicts_readonly_consistency.py:37: error: Incompatible types in assignment (expression has type "A1", variable has type "B1") [assignment] typeddicts_readonly_consistency.py:38: error: Incompatible types in assignment (expression has type "C1", variable has type "B1") [assignment] typeddicts_readonly_consistency.py:40: error: Incompatible types in assignment (expression has type "A1", variable has type "C1") [assignment] -typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment] typeddicts_readonly_consistency.py:81: error: Incompatible types in assignment (expression has type "A2", variable has type "B2") [assignment] typeddicts_readonly_consistency.py:82: error: Incompatible types in assignment (expression has type "C2", variable has type "B2") [assignment] typeddicts_readonly_consistency.py:84: error: Incompatible types in assignment (expression has type "A2", variable has type "C2") [assignment] typeddicts_readonly_consistency.py:85: error: Incompatible types in assignment (expression has type "B2", variable has type "C2") [assignment] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 79: Unexpected errors ['typeddicts_readonly_consistency.py:79: error: Incompatible types in assignment (expression has type "C2", variable has type "A2") [assignment]'] """ diff --git a/conformance/results/mypy/typeddicts_required.toml b/conformance/results/mypy/typeddicts_required.toml index 7cf6994d..96ef5007 100644 --- a/conformance/results/mypy/typeddicts_required.toml +++ b/conformance/results/mypy/typeddicts_required.toml @@ -1,17 +1,10 @@ -conformant = "Partial" -notes = """ -Does not support nesting of `Annotated` and `Required` or `NotRequired`. -""" +conformant = "Pass" output = """ typeddicts_required.py:12: error: Required[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:19: error: NotRequired[] can be only used in a TypedDict definition [valid-type] typeddicts_required.py:62: error: "Required[]" type cannot be nested [valid-type] typeddicts_required.py:63: error: "NotRequired[]" type cannot be nested [valid-type] -typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type] -typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type] """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 68: Unexpected errors ['typeddicts_required.py:68: error: Required[] can be only used in a TypedDict definition [valid-type]'] -Line 70: Unexpected errors ['typeddicts_required.py:70: error: Required[] can be only used in a TypedDict definition [valid-type]'] """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index c328270a..3d498066 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ -version = "mypy 1.13.0" -test_duration = 2.5 +version = "mypy 1.14.0" +test_duration = 1.6 diff --git a/conformance/results/pyre/version.toml b/conformance/results/pyre/version.toml index 3ed7e73c..94de3055 100644 --- a/conformance/results/pyre/version.toml +++ b/conformance/results/pyre/version.toml @@ -1,2 +1,2 @@ version = "pyre 0.9.23" -test_duration = 4.3 +test_duration = 7.3 diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index 6269389b..e8e963b7 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.389" -test_duration = 2.5 +version = "pyright 1.1.391" +test_duration = 1.2 diff --git a/conformance/results/pytype/specialtypes_never.toml b/conformance/results/pytype/specialtypes_never.toml index be27a72a..7a231858 100644 --- a/conformance/results/pytype/specialtypes_never.toml +++ b/conformance/results/pytype/specialtypes_never.toml @@ -8,10 +8,11 @@ specialtypes_never.py:11:8: \u001b[1m\u001b[31merror\u001b[39m\u001b[0m: in : argument "covariant" to TypeVar not supported yet [not-supported-yet]'] -Line 21: Unexpected errors ['specialtypes_never.py:21:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] +Line 21: Unexpected errors ['specialtypes_never.py:21:8: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func1: bad return type [bad-return-type]'] Line 68: Unexpected errors ['specialtypes_never.py:68:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v1 does not match type of assignment [annotation-type-mismatch]'] Line 69: Unexpected errors ['specialtypes_never.py:69:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v2 does not match type of assignment [annotation-type-mismatch]'] Line 70: Unexpected errors ['specialtypes_never.py:70:5: \\x1b[1m\\x1b[31merror\\x1b[39m\\x1b[0m: in func6: Type annotation for v3 does not match type of assignment [annotation-type-mismatch]'] diff --git a/conformance/results/pytype/version.toml b/conformance/results/pytype/version.toml index d7a8701e..94cd5eee 100644 --- a/conformance/results/pytype/version.toml +++ b/conformance/results/pytype/version.toml @@ -1,2 +1,2 @@ version = "pytype 2024.10.11" -test_duration = 45.2 +test_duration = 37.2 diff --git a/conformance/results/results.html b/conformance/results/results.html index 26eb1c70..e388ee38 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,17 +158,17 @@

Python Type System Conformance Test Results

 
mypy 1.13.0
-
2.7sec
+
2.5sec
pyright 1.1.386
-
2.0sec
+
pyright 1.1.389
+
2.5sec
pyre 0.9.23
-
9.1sec
+
4.3sec
pytype 2024.10.11
-
50.2sec
+
45.2sec
@@ -241,16 +241,16 @@

Python Type System Conformance Test Results

Generics
     generics_base_class
Partial

Does not detect inconsistent type variable ordering.

PassPass
Partial

Does not reject illegal use of Generic.

Does not allow using generic in assert_type expression.

Partial

False negative on passing SymbolTable to dict[str, list[object]].

Does not reject illegal use of Generic.

Partial

Does not reject illegal use of Generic.

Does not allow using generic in assert_type expression.

Does not detect inconsistent type variable ordering.

Partial

False negative on passing SymbolTable to dict[str, list[object]].

Does not reject illegal use of Generic.

Wrong type variable order when inheriting from multiple generic base classes.

     generics_basic
Partial

Does not reject the use of a constraint parameterized by another type variable.

Pass
Partial

False positives in examples using constrained type variables.

False negative for constraint parameterized by a type variable.

False negative in custom map example.

False positive using `iter`.

False negative for generic metaclass.

Partial

False positives in examples using constrained type variables.

False negative for generic metaclass.

Partial

False positives in examples using constrained type variables.

False negative for constraint parameterized by a type variable.

False negative in custom map example.

False positive using `iter`.

False negative for bad type arguments to Generic/Protocol.

False negative for generic metaclass.

Partial

False positives in examples using constrained type variables.

Argument 'covariant' to TypeVar not supported.

False negative for type variables missing from Generic/Protocol base class.

False negative for generic metaclass.

     generics_defaults Unsupported
- - - + - + - + - + - + @@ -808,13 +808,13 @@

Python Type System Conformance Test Results

- + - + @@ -838,7 +838,7 @@

Python Type System Conformance Test Results

- + @@ -937,7 +937,7 @@

Python Type System Conformance Test Results

- + @@ -973,7 +973,7 @@

Python Type System Conformance Test Results

- + diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 185a3a0c..b6b60fe7 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -111,6 +111,8 @@ def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: ".", "--disable-error-code", "empty-body", + "--enable-error-code", + "deprecated", ] proc = run(command, stdout=PIPE, text=True) lines = proc.stdout.split("\n")
 
mypy 1.13.0
-
2.5sec
+
mypy 1.14.0
+
1.6sec
pyright 1.1.389
-
2.5sec
+
pyright 1.1.391
+
1.2sec
pyre 0.9.23
-
4.3sec
+
7.3sec
pytype 2024.10.11
-
45.2sec
+
37.2sec
@@ -247,31 +247,31 @@

Python Type System Conformance Test Results

Partial

False negative on passing SymbolTable to dict[str, list[object]].

Does not reject illegal use of Generic.

Wrong type variable order when inheriting from multiple generic base classes.

     generics_basic
Partial

Does not reject the use of a constraint parameterized by another type variable.

Pass Pass
Partial

False positives in examples using constrained type variables.

False negative for constraint parameterized by a type variable.

False negative in custom map example.

False positive using `iter`.

False negative for bad type arguments to Generic/Protocol.

False negative for generic metaclass.

Partial

False positives in examples using constrained type variables.

Argument 'covariant' to TypeVar not supported.

False negative for type variables missing from Generic/Protocol base class.

False negative for generic metaclass.

     generics_defaultsUnsupportedPartial Pass
Unsupported

Does not support generic defaults.

Unsupported
     generics_defaults_referentialUnsupportedPartial Pass Unsupported Unsupported
     generics_defaults_specializationUnsupportedPartial Pass
Unsupported

Does not support generic defaults.

Unsupported
     generics_paramspec_basic
Partial

Does not reject ParamSpec when used "bare" in type alias definition.

Pass Pass
Partial

Does not enforce name consistency for ParamSpec assigned to identifier.

Incorrectly reports error for legitimate use of ParamSpec in generic type alias.

Does not reject ParamSpec when used in various invalid locations.

Unsupported

Does not support ParamSpec.

Partial

Does not report type violation with TypedDict value assignment.

Does not report reference to unknown key in TypedDict.

Does not reject `clear` method on TypedDict with required keys.

Does not reject delete operation for required key in TypedDict.

     typeddicts_readonly
Partial

Incorrectly rejects NotRequired directive when used in an Annotated annotation.

Pass Pass Pass Unsupported
     typeddicts_readonly_consistency
Partial

Incorrectly rejects assignment of required item to not-required read-only item.

Pass Pass Pass Unsupported Unsupported
     typeddicts_required
Partial

Does not support nesting of `Annotated` and `Required` or `NotRequired`.

Pass Pass
Partial

Does not reject use of `Required` in function parameter annotation.

Does not reject nested use of `Required` in type annotation.

Does not support recursive TypedDict definitions.

Incorrectly complains about uninitialized attributes on TypedDict definitions.

Incorrectly generates "attribute not initialized" errors for TypedDict fields.

Partial

Does not reject use of `Required` in non-TypedDict class.

Does not reject use of `Required` in function parameter annotation.

Does not reject nested use of `Required` in type annotation.

Partial

Does not enforce declared type of `_value_`.

Does not correctly enforce assigned tuple types for enum members (optional).

Does not evaluate literal types for enum member values (optional).

Does not evaluate literal types for auto values (optional).

     enums_members
Partial

Does not treat attribute with annotation and no assignment as non-member.

Does not reject use of annotation with enum member.

Does not treat callables as non-members.

Does not honor `enum.member` as method decorator.

Does not properly handle aliased enum members.

Does not support `_ignore_` mechanism (optional).

Does not treat attributes with private names as non-members.

Partial

Does not treat attribute with annotation and no assignment as non-member.

Does not treat callables as non-members.

Does not honor `enum.member` as method decorator.

Does not properly handle aliased enum members.

Does not support `_ignore_` mechanism (optional).

Does not treat attributes with private names as non-members.

Pass*

Does not support `_ignore_` mechanism (optional).

Partial

Does not reject use of annotation with enum member.

Does not treat callables as non-members.

Does not treat annotated attributes as non-members.

Does not honor `enum.nonmember` to define non-member attribute.

Does not honor `enum.member` as method decorator.

Does not properly handle aliased enum members.

Rejects use of `_ignore_`.

Does not support `_ignore_` mechanism (optional).

Partial

Does not reject use of annotation with enum member.

Does not support `enum.member` and `enum.nonmember`.

Does not support `_ignore_` mechanism (optional).

Partial

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

     directives_deprecated
Unsupported

Does not support @deprecated.

Pass Pass
Unsupported

Does not support @deprecated.

Unsupported

Does not support @deprecated.