From 2d461371ac028a53786b051040ab70aa9b3be53b Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 26 Feb 2026 14:12:00 +0000 Subject: [PATCH 01/11] add infrastructure for reporting ty results --- conformance/README.md | 2 +- conformance/requirements.txt | 1 + conformance/src/type_checker.py | 74 +++++++++++++++++++++++++++++++-- conformance/tests/ty.toml | 8 ++++ 4 files changed, 80 insertions(+), 5 deletions(-) create mode 100644 conformance/tests/ty.toml diff --git a/conformance/README.md b/conformance/README.md index e0302c806..d43fcfef8 100644 --- a/conformance/README.md +++ b/conformance/README.md @@ -80,7 +80,7 @@ Note that some type checkers may not run on some platforms. If a type checker fa Different type checkers report errors in different ways (with different wording in error messages and different line numbers or character ranges for errors). This variation makes it difficult to fully automate test validation given that tests will want to check for both false positive and false negative type errors. Some level of manual inspection will therefore be needed to determine whether a type checker is fully conformant with all tests in any given test file. This "scoring" process is required only when the output of a test changes — e.g. when a new version of that type checker is released and the tests are rerun. We assume that the output of a type checker will be the same from one run to the next unless/until a new version is released that fixes or introduces a bug. In this case, the output will need to be manually inspected and the conformance results re-scored for those tests whose output has changed. -Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, and zuban. It is the goal and desire to add additional type checkers over time. +Conformance results are reported and summarized for each supported type checker. Currently, results are reported for mypy, pyrefly, pyright, zuban and ty. It is the goal and desire to add additional type checkers over time. ## Adding a New Test Case diff --git a/conformance/requirements.txt b/conformance/requirements.txt index eac56a058..705af6b0a 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -5,3 +5,4 @@ mypy pip zuban pyrefly +ty diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 7406a8ac0..cdf5ff56a 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -2,14 +2,13 @@ Classes that abstract differences between type checkers. """ -from abc import ABC, abstractmethod import json -from pathlib import Path -import os import re import shutil -from subprocess import PIPE, CalledProcessError, run import sys +from abc import ABC, abstractmethod +from pathlib import Path +from subprocess import PIPE, CalledProcessError, run from typing import Sequence @@ -201,6 +200,72 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: return line_to_errors +class TyTypeChecker(TypeChecker): + @property + def name(self) -> str: + return "ty" + + def install(self) -> bool: + try: + # Uninstall any old version if present. + run( + [sys.executable, "-m", "pip", "uninstall", "ty", "-y"], + check=True, + ) + # Install the latest version. + run( + [sys.executable, "-m", "pip", "install", "ty"], + check=True, + ) + return True + except CalledProcessError: + print("Unable to install ty") + return False + + def get_version(self) -> str: + proc = run([sys.executable, "-m", "ty", "--version"], stdout=PIPE, text=True) + return proc.stdout.strip() + + def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: + command = [ + sys.executable, + "-m", + "ty", + "check", + ".", + "--output-format=concise", + "--color=never", + "--config-file=./ty.toml", + ] + proc = run(command, stdout=PIPE, text=True, encoding="utf-8") + results_dict = {} + for line in proc.stdout.splitlines(): + if not line.strip(): + continue + file_name = line.split(":")[0].strip() + results_dict[file_name] = results_dict.get(file_name, "") + line + "\n" + return results_dict + + def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: + # narrowing_typeguard.py:102:23: error[invalid-type-guard-definition] `TypeGuard` function must have a parameter to narrow + line_to_errors: dict[int, list[str]] = {} + for line in output: + line = line.strip() + if ( + not line + or line == "All checks passed!" + or re.fullmatch(r"Found \d+ diagnostics?", line) + ): + continue + assert line.count(":") >= 3, f"Failed to parse line: {line!r}" + _, lineno, _, rest = line.split(":", maxsplit=3) + kind = rest.split("[")[0].strip() + if kind != "error": + continue + line_to_errors.setdefault(int(lineno), []).append(line) + return line_to_errors + + class ZubanLSTypeChecker(MypyTypeChecker): @property def name(self) -> str: @@ -343,4 +408,5 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: PyrightTypeChecker(), ZubanLSTypeChecker(), PyreflyTypeChecker(), + TyTypeChecker(), ) diff --git a/conformance/tests/ty.toml b/conformance/tests/ty.toml new file mode 100644 index 000000000..5fddd62be --- /dev/null +++ b/conformance/tests/ty.toml @@ -0,0 +1,8 @@ +[environment] +python-version = "3.12" + +[rules] +deprecated = "error" +invalid-legacy-positional-parameter = "error" +redundant-final-classvar = "error" +assert-type-unspellable-subtype = "ignore" From cfc3fba2e36a7f1f1c7337fd8ac704c84edd78b2 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Thu, 26 Feb 2026 14:12:24 +0000 Subject: [PATCH 02/11] automated results for ty --- conformance/results/results.html | 181 ++++++++++++++++-- conformance/results/ty/aliases_explicit.toml | 28 +++ conformance/results/ty/aliases_implicit.toml | 29 +++ conformance/results/ty/aliases_newtype.toml | 19 ++ conformance/results/ty/aliases_recursive.toml | 16 ++ .../results/ty/aliases_type_statement.toml | 37 ++++ .../results/ty/aliases_typealiastype.toml | 29 +++ conformance/results/ty/aliases_variance.toml | 9 + .../results/ty/annotations_coroutines.toml | 5 + .../results/ty/annotations_forward_refs.toml | 36 ++++ .../results/ty/annotations_generators.toml | 15 ++ .../results/ty/annotations_methods.toml | 6 + .../results/ty/annotations_typeexpr.toml | 21 ++ .../results/ty/callables_annotation.toml | 27 +++ conformance/results/ty/callables_kwargs.toml | 27 +++ .../results/ty/callables_protocol.toml | 22 +++ .../results/ty/callables_subtyping.toml | 37 ++++ conformance/results/ty/classes_classvar.toml | 22 +++ conformance/results/ty/classes_override.toml | 10 + .../results/ty/constructors_call_init.toml | 14 ++ .../ty/constructors_call_metaclass.toml | 12 ++ .../results/ty/constructors_call_new.toml | 23 +++ .../results/ty/constructors_call_type.toml | 14 ++ .../results/ty/constructors_callable.toml | 43 +++++ .../results/ty/constructors_consistency.toml | 5 + .../results/ty/dataclasses_descriptors.toml | 9 + conformance/results/ty/dataclasses_final.toml | 10 + .../results/ty/dataclasses_frozen.toml | 9 + conformance/results/ty/dataclasses_hash.toml | 7 + .../results/ty/dataclasses_inheritance.toml | 7 + .../results/ty/dataclasses_kwonly.toml | 8 + .../results/ty/dataclasses_match_args.toml | 8 + conformance/results/ty/dataclasses_order.toml | 6 + .../results/ty/dataclasses_postinit.toml | 9 + conformance/results/ty/dataclasses_slots.toml | 10 + .../ty/dataclasses_transform_class.toml | 13 ++ .../ty/dataclasses_transform_converter.toml | 51 +++++ .../ty/dataclasses_transform_field.toml | 8 + .../ty/dataclasses_transform_func.toml | 12 ++ .../ty/dataclasses_transform_meta.toml | 13 ++ conformance/results/ty/dataclasses_usage.toml | 16 ++ .../results/ty/directives_assert_type.toml | 12 ++ conformance/results/ty/directives_cast.toml | 8 + .../results/ty/directives_deprecated.toml | 18 ++ .../results/ty/directives_no_type_check.toml | 9 + .../results/ty/directives_reveal_type.toml | 11 ++ .../results/ty/directives_type_checking.toml | 7 + .../results/ty/directives_type_ignore.toml | 5 + .../ty/directives_type_ignore_file1.toml | 7 + .../ty/directives_type_ignore_file2.toml | 9 + .../ty/directives_version_platform.toml | 17 ++ conformance/results/ty/enums_behaviors.toml | 8 + conformance/results/ty/enums_definition.toml | 5 + conformance/results/ty/enums_expansion.toml | 8 + .../results/ty/enums_member_names.toml | 6 + .../results/ty/enums_member_values.toml | 11 ++ conformance/results/ty/enums_members.toml | 17 ++ .../ty/exceptions_context_managers.toml | 9 + .../results/ty/generics_base_class.toml | 12 ++ conformance/results/ty/generics_basic.toml | 18 ++ conformance/results/ty/generics_defaults.toml | 21 ++ .../ty/generics_defaults_referential.toml | 14 ++ .../ty/generics_defaults_specialization.toml | 7 + .../results/ty/generics_paramspec_basic.toml | 12 ++ .../ty/generics_paramspec_components.toml | 25 +++ .../ty/generics_paramspec_semantics.toml | 20 ++ .../ty/generics_paramspec_specialization.toml | 10 + conformance/results/ty/generics_scoping.toml | 20 ++ .../results/ty/generics_self_advanced.toml | 5 + .../results/ty/generics_self_attributes.toml | 7 + .../results/ty/generics_self_basic.toml | 8 + .../results/ty/generics_self_protocols.toml | 7 + .../results/ty/generics_self_usage.toml | 17 ++ .../ty/generics_syntax_compatibility.toml | 7 + .../ty/generics_syntax_declarations.toml | 15 ++ .../ty/generics_syntax_infer_variance.toml | 37 ++++ .../results/ty/generics_syntax_scoping.toml | 12 ++ .../results/ty/generics_type_erasure.toml | 12 ++ .../ty/generics_typevartuple_args.toml | 20 ++ .../ty/generics_typevartuple_basic.toml | 22 +++ .../ty/generics_typevartuple_callable.toml | 12 ++ .../ty/generics_typevartuple_concat.toml | 7 + .../ty/generics_typevartuple_overloads.toml | 5 + .../generics_typevartuple_specialization.toml | 43 +++++ .../ty/generics_typevartuple_unpack.toml | 6 + .../results/ty/generics_upper_bound.toml | 14 ++ conformance/results/ty/generics_variance.toml | 18 ++ .../ty/generics_variance_inference.toml | 28 +++ .../results/ty/historical_positional.toml | 10 + .../results/ty/literals_interactions.toml | 13 ++ .../results/ty/literals_literalstring.toml | 15 ++ .../ty/literals_parameterizations.toml | 22 +++ .../results/ty/literals_semantics.toml | 9 + .../results/ty/namedtuples_define_class.toml | 19 ++ .../ty/namedtuples_define_functional.toml | 19 ++ .../results/ty/namedtuples_type_compat.toml | 7 + conformance/results/ty/namedtuples_usage.toml | 13 ++ .../results/ty/narrowing_typeguard.toml | 9 + conformance/results/ty/narrowing_typeis.toml | 16 ++ conformance/results/ty/overloads_basic.toml | 6 + .../results/ty/overloads_consistency.toml | 7 + .../results/ty/overloads_definitions.toml | 17 ++ .../ty/overloads_definitions_stub.toml | 13 ++ .../results/ty/overloads_evaluation.toml | 9 + .../results/ty/protocols_class_objects.toml | 15 ++ .../results/ty/protocols_definition.toml | 26 +++ .../results/ty/protocols_explicit.toml | 11 ++ conformance/results/ty/protocols_generic.toml | 14 ++ conformance/results/ty/protocols_merging.toml | 11 ++ conformance/results/ty/protocols_modules.toml | 12 ++ .../results/ty/protocols_recursive.toml | 7 + .../ty/protocols_runtime_checkable.toml | 11 ++ conformance/results/ty/protocols_self.toml | 5 + .../results/ty/protocols_subtyping.toml | 12 ++ .../results/ty/protocols_variance.toml | 12 ++ .../results/ty/qualifiers_annotated.toml | 27 +++ .../ty/qualifiers_final_annotation.toml | 33 ++++ .../ty/qualifiers_final_decorator.toml | 16 ++ conformance/results/ty/specialtypes_any.toml | 5 + .../results/ty/specialtypes_never.toml | 8 + conformance/results/ty/specialtypes_none.toml | 8 + .../results/ty/specialtypes_promotions.toml | 6 + conformance/results/ty/specialtypes_type.toml | 36 ++++ .../results/ty/tuples_type_compat.toml | 29 +++ conformance/results/ty/tuples_type_form.toml | 16 ++ conformance/results/ty/tuples_unpacked.toml | 10 + .../results/ty/typeddicts_alt_syntax.toml | 9 + .../results/ty/typeddicts_class_syntax.toml | 10 + .../results/ty/typeddicts_extra_items.toml | 77 ++++++++ conformance/results/ty/typeddicts_final.toml | 5 + .../results/ty/typeddicts_inheritance.toml | 8 + .../results/ty/typeddicts_operations.toml | 16 ++ .../results/ty/typeddicts_readonly.toml | 11 ++ .../ty/typeddicts_readonly_consistency.toml | 12 ++ .../ty/typeddicts_readonly_inheritance.toml | 16 ++ .../ty/typeddicts_readonly_kwargs.toml | 6 + .../ty/typeddicts_readonly_update.toml | 6 + .../results/ty/typeddicts_required.toml | 9 + .../ty/typeddicts_type_consistency.toml | 15 ++ conformance/results/ty/typeddicts_usage.toml | 11 ++ conformance/results/ty/version.toml | 1 + 141 files changed, 2237 insertions(+), 20 deletions(-) create mode 100644 conformance/results/ty/aliases_explicit.toml create mode 100644 conformance/results/ty/aliases_implicit.toml create mode 100644 conformance/results/ty/aliases_newtype.toml create mode 100644 conformance/results/ty/aliases_recursive.toml create mode 100644 conformance/results/ty/aliases_type_statement.toml create mode 100644 conformance/results/ty/aliases_typealiastype.toml create mode 100644 conformance/results/ty/aliases_variance.toml create mode 100644 conformance/results/ty/annotations_coroutines.toml create mode 100644 conformance/results/ty/annotations_forward_refs.toml create mode 100644 conformance/results/ty/annotations_generators.toml create mode 100644 conformance/results/ty/annotations_methods.toml create mode 100644 conformance/results/ty/annotations_typeexpr.toml create mode 100644 conformance/results/ty/callables_annotation.toml create mode 100644 conformance/results/ty/callables_kwargs.toml create mode 100644 conformance/results/ty/callables_protocol.toml create mode 100644 conformance/results/ty/callables_subtyping.toml create mode 100644 conformance/results/ty/classes_classvar.toml create mode 100644 conformance/results/ty/classes_override.toml create mode 100644 conformance/results/ty/constructors_call_init.toml create mode 100644 conformance/results/ty/constructors_call_metaclass.toml create mode 100644 conformance/results/ty/constructors_call_new.toml create mode 100644 conformance/results/ty/constructors_call_type.toml create mode 100644 conformance/results/ty/constructors_callable.toml create mode 100644 conformance/results/ty/constructors_consistency.toml create mode 100644 conformance/results/ty/dataclasses_descriptors.toml create mode 100644 conformance/results/ty/dataclasses_final.toml create mode 100644 conformance/results/ty/dataclasses_frozen.toml create mode 100644 conformance/results/ty/dataclasses_hash.toml create mode 100644 conformance/results/ty/dataclasses_inheritance.toml create mode 100644 conformance/results/ty/dataclasses_kwonly.toml create mode 100644 conformance/results/ty/dataclasses_match_args.toml create mode 100644 conformance/results/ty/dataclasses_order.toml create mode 100644 conformance/results/ty/dataclasses_postinit.toml create mode 100644 conformance/results/ty/dataclasses_slots.toml create mode 100644 conformance/results/ty/dataclasses_transform_class.toml create mode 100644 conformance/results/ty/dataclasses_transform_converter.toml create mode 100644 conformance/results/ty/dataclasses_transform_field.toml create mode 100644 conformance/results/ty/dataclasses_transform_func.toml create mode 100644 conformance/results/ty/dataclasses_transform_meta.toml create mode 100644 conformance/results/ty/dataclasses_usage.toml create mode 100644 conformance/results/ty/directives_assert_type.toml create mode 100644 conformance/results/ty/directives_cast.toml create mode 100644 conformance/results/ty/directives_deprecated.toml create mode 100644 conformance/results/ty/directives_no_type_check.toml create mode 100644 conformance/results/ty/directives_reveal_type.toml create mode 100644 conformance/results/ty/directives_type_checking.toml create mode 100644 conformance/results/ty/directives_type_ignore.toml create mode 100644 conformance/results/ty/directives_type_ignore_file1.toml create mode 100644 conformance/results/ty/directives_type_ignore_file2.toml create mode 100644 conformance/results/ty/directives_version_platform.toml create mode 100644 conformance/results/ty/enums_behaviors.toml create mode 100644 conformance/results/ty/enums_definition.toml create mode 100644 conformance/results/ty/enums_expansion.toml create mode 100644 conformance/results/ty/enums_member_names.toml create mode 100644 conformance/results/ty/enums_member_values.toml create mode 100644 conformance/results/ty/enums_members.toml create mode 100644 conformance/results/ty/exceptions_context_managers.toml create mode 100644 conformance/results/ty/generics_base_class.toml create mode 100644 conformance/results/ty/generics_basic.toml create mode 100644 conformance/results/ty/generics_defaults.toml create mode 100644 conformance/results/ty/generics_defaults_referential.toml create mode 100644 conformance/results/ty/generics_defaults_specialization.toml create mode 100644 conformance/results/ty/generics_paramspec_basic.toml create mode 100644 conformance/results/ty/generics_paramspec_components.toml create mode 100644 conformance/results/ty/generics_paramspec_semantics.toml create mode 100644 conformance/results/ty/generics_paramspec_specialization.toml create mode 100644 conformance/results/ty/generics_scoping.toml create mode 100644 conformance/results/ty/generics_self_advanced.toml create mode 100644 conformance/results/ty/generics_self_attributes.toml create mode 100644 conformance/results/ty/generics_self_basic.toml create mode 100644 conformance/results/ty/generics_self_protocols.toml create mode 100644 conformance/results/ty/generics_self_usage.toml create mode 100644 conformance/results/ty/generics_syntax_compatibility.toml create mode 100644 conformance/results/ty/generics_syntax_declarations.toml create mode 100644 conformance/results/ty/generics_syntax_infer_variance.toml create mode 100644 conformance/results/ty/generics_syntax_scoping.toml create mode 100644 conformance/results/ty/generics_type_erasure.toml create mode 100644 conformance/results/ty/generics_typevartuple_args.toml create mode 100644 conformance/results/ty/generics_typevartuple_basic.toml create mode 100644 conformance/results/ty/generics_typevartuple_callable.toml create mode 100644 conformance/results/ty/generics_typevartuple_concat.toml create mode 100644 conformance/results/ty/generics_typevartuple_overloads.toml create mode 100644 conformance/results/ty/generics_typevartuple_specialization.toml create mode 100644 conformance/results/ty/generics_typevartuple_unpack.toml create mode 100644 conformance/results/ty/generics_upper_bound.toml create mode 100644 conformance/results/ty/generics_variance.toml create mode 100644 conformance/results/ty/generics_variance_inference.toml create mode 100644 conformance/results/ty/historical_positional.toml create mode 100644 conformance/results/ty/literals_interactions.toml create mode 100644 conformance/results/ty/literals_literalstring.toml create mode 100644 conformance/results/ty/literals_parameterizations.toml create mode 100644 conformance/results/ty/literals_semantics.toml create mode 100644 conformance/results/ty/namedtuples_define_class.toml create mode 100644 conformance/results/ty/namedtuples_define_functional.toml create mode 100644 conformance/results/ty/namedtuples_type_compat.toml create mode 100644 conformance/results/ty/namedtuples_usage.toml create mode 100644 conformance/results/ty/narrowing_typeguard.toml create mode 100644 conformance/results/ty/narrowing_typeis.toml create mode 100644 conformance/results/ty/overloads_basic.toml create mode 100644 conformance/results/ty/overloads_consistency.toml create mode 100644 conformance/results/ty/overloads_definitions.toml create mode 100644 conformance/results/ty/overloads_definitions_stub.toml create mode 100644 conformance/results/ty/overloads_evaluation.toml create mode 100644 conformance/results/ty/protocols_class_objects.toml create mode 100644 conformance/results/ty/protocols_definition.toml create mode 100644 conformance/results/ty/protocols_explicit.toml create mode 100644 conformance/results/ty/protocols_generic.toml create mode 100644 conformance/results/ty/protocols_merging.toml create mode 100644 conformance/results/ty/protocols_modules.toml create mode 100644 conformance/results/ty/protocols_recursive.toml create mode 100644 conformance/results/ty/protocols_runtime_checkable.toml create mode 100644 conformance/results/ty/protocols_self.toml create mode 100644 conformance/results/ty/protocols_subtyping.toml create mode 100644 conformance/results/ty/protocols_variance.toml create mode 100644 conformance/results/ty/qualifiers_annotated.toml create mode 100644 conformance/results/ty/qualifiers_final_annotation.toml create mode 100644 conformance/results/ty/qualifiers_final_decorator.toml create mode 100644 conformance/results/ty/specialtypes_any.toml create mode 100644 conformance/results/ty/specialtypes_never.toml create mode 100644 conformance/results/ty/specialtypes_none.toml create mode 100644 conformance/results/ty/specialtypes_promotions.toml create mode 100644 conformance/results/ty/specialtypes_type.toml create mode 100644 conformance/results/ty/tuples_type_compat.toml create mode 100644 conformance/results/ty/tuples_type_form.toml create mode 100644 conformance/results/ty/tuples_unpacked.toml create mode 100644 conformance/results/ty/typeddicts_alt_syntax.toml create mode 100644 conformance/results/ty/typeddicts_class_syntax.toml create mode 100644 conformance/results/ty/typeddicts_extra_items.toml create mode 100644 conformance/results/ty/typeddicts_final.toml create mode 100644 conformance/results/ty/typeddicts_inheritance.toml create mode 100644 conformance/results/ty/typeddicts_operations.toml create mode 100644 conformance/results/ty/typeddicts_readonly.toml create mode 100644 conformance/results/ty/typeddicts_readonly_consistency.toml create mode 100644 conformance/results/ty/typeddicts_readonly_inheritance.toml create mode 100644 conformance/results/ty/typeddicts_readonly_kwargs.toml create mode 100644 conformance/results/ty/typeddicts_readonly_update.toml create mode 100644 conformance/results/ty/typeddicts_required.toml create mode 100644 conformance/results/ty/typeddicts_type_consistency.toml create mode 100644 conformance/results/ty/typeddicts_usage.toml create mode 100644 conformance/results/ty/version.toml diff --git a/conformance/results/results.html b/conformance/results/results.html index 980ba8d8b..4073349f4 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -180,8 +180,10 @@

Python Type System Conformance Test Results

pyrefly 0.53.0
+
ty 0.0.19 (ae10022c2 2026-02-26)
+ - + Type annotations      annotations_coroutines @@ -189,32 +191,37 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      annotations_forward_refs
Partial

Does not report error for a forward reference that is not enclosed in quotes.

Does not report error for use of quoted type with "|" operator (runtime error).

Incorrectly generates error for quoted type defined in class scope.

Pass
Partial

Incorrectly generates error for quoted type defined in class scope.

Partial

Types in quotes incorrectly refer to shadowing class member.

Does not reject some type forms that require quotes.

+Unknown      annotations_generators
Partial

Does not report incompatible Generator type in `yield from` statement.

Pass Pass
Partial

Does not detect that invalid yield is unreachable

+Unknown      annotations_methods
Pass*

Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings.

Pass*

Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings.

Pass Pass +Pass      annotations_typeexpr Pass Pass Pass Pass +Pass - + Special types in annotations      specialtypes_any @@ -222,32 +229,37 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      specialtypes_never Pass Pass Pass Pass +Pass      specialtypes_none Pass Pass Pass Pass +Pass      specialtypes_promotions Pass Pass Pass Pass +Pass      specialtypes_type
Partial

Does not treat `type` same as `type[Any]` for assert_type.

Does not allow access to unknown attributes from object of type `type[Any]`.

Pass Pass Pass +Unknown - + Generics      generics_base_class @@ -255,182 +267,212 @@

Python Type System Conformance Test Results

Pass Pass Pass +Unknown      generics_basic Pass Pass Pass
Partial

Incorrect rejects + between two AnyStr

Constrained type var resolves to subtype instead of explcitly listed constraint

+Unknown      generics_defaults Partial Pass Pass Pass +Unknown      generics_defaults_referential Partial Pass Pass Pass +Unknown      generics_defaults_specialization Partial Pass Pass Pass +Unknown      generics_paramspec_basic Pass Pass Pass Pass +Unknown      generics_paramspec_components Pass Pass Pass
Partial

Does not reject usage of args/kwargs for out-of-scope ParamSpec

+Unknown      generics_paramspec_semantics Pass
Pass*

Constraint solver doesn't find common type for two signatures captured by a single ParamSpec (allowed).

Pass Pass +Unknown      generics_paramspec_specialization Pass Pass Pass Pass +Pass      generics_scoping Pass Pass Partial
Partial

Does not implement several scoping checks/restrictions for generics

+Unknown      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

Doesn't allow accessing `Self` in a classmethod

Pass*

Treats attributes not initialized on the class as instance-only

+Pass      generics_self_attributes Pass Pass Pass Pass +Pass      generics_self_basic Pass Pass Pass
Partial

Return annotation of Self allows returning the concrete instance of the current class.

+Pass      generics_self_protocols Pass Pass Pass Pass +Pass      generics_self_usage Pass Pass Pass
Partial

Does not implement some restrictions on where Self can be used

+Unknown      generics_syntax_compatibility Pass Pass Pass Pass +Unknown      generics_syntax_declarations Pass Pass Pass Pass +Pass      generics_syntax_infer_variance
Unsupported

Type parameter syntax not yet supported.

Pass Pass Pass +Unknown      generics_syntax_scoping
Partial

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

Pass Pass Pass +Unknown      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 Pass Pass +Unknown      generics_typevartuple_args
Partial

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

Pass Pass Pass +Unknown      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 Pass
Partial

TypeVarTuple is pinned too early when calling generic function

+Unknown      generics_typevartuple_callable Pass Pass Pass Pass +Unknown      generics_typevartuple_concat Pass Pass Pass Pass +Unknown      generics_typevartuple_overloads Pass Pass Pass Pass +Pass      generics_typevartuple_specialization
Partial

Incorrectly specializes generic alias that includes a TypeVar and TypeVarTuple if no type arguments are provided.

Rejects specialization of generic type alias defined as a tuple containing a TypeVar.

Pass Pass
Partial

Sometimes specializes to tuple[Any, ...] instead of empty tuple

+Unknown      generics_typevartuple_unpack Pass Pass Pass Pass +Unknown      generics_upper_bound
Partial

Does not reject use of type variable within an upper bound.

Pass Pass Pass +Unknown      generics_variance
Partial

Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

Pass Pass Pass +Unknown      generics_variance_inference Pass Pass Pass Pass +Pass - + Type qualifiers      qualifiers_annotated @@ -438,20 +480,23 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Allows Annotated in some contexts where it should not be allowed

+Pass      qualifiers_final_annotation
Partial

Does not treat use of Final name as if it was replaced by the literal in NamedTuple definition.

Does not allow conditional assignment of Final instance variable in __init__ method.

Does not allow redefinition of private class variable that is marked Final in parent class.

Does not report modification of local Final variable via "for" statement.

Pass Pass
Partial

Final attributes not initialized on the class can be assigned to

+Unknown      qualifiers_final_decorator Pass Pass Pass Pass +Unknown - + Class type compatibility      classes_classvar @@ -459,14 +504,16 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      classes_override Pass Pass Pass Pass +Pass - + Type aliases      aliases_explicit @@ -474,44 +521,51 @@

Python Type System Conformance Test Results

Pass Pass Pass +Unknown      aliases_implicit Pass Pass Pass
Partial

Does not reject invalid syntax in implicit type aliases.

+Unknown      aliases_newtype
Partial

`NewType`s are incorrectly considered to be classes.

Pass Pass Pass +Pass      aliases_recursive Pass Pass Pass Pass +Unknown      aliases_type_statement
Partial

Does not reject type alias defined in function scope.

Pass Pass Pass +Unknown      aliases_typealiastype
Partial

Incorrectly rejects some recursive type aliases using TypeAliasType.

Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

Pass Pass
Partial

Does not detect circular definitions.

+Unknown      aliases_variance Pass Pass Pass Pass +Unknown - + Literals      literals_interactions @@ -519,26 +573,30 @@

Python Type System Conformance Test Results

Pass Pass Pass +Unknown      literals_literalstring
Unsupported

Support for `LiteralString` is not implemented.

Pass Pass Pass +Pass      literals_parameterizations
Partial

Does not reject tuple within Literal.

Pass Pass Pass +Pass      literals_semantics Pass Pass Pass Pass +Pass - + Protocols      protocols_class_objects @@ -546,68 +604,79 @@

Python Type System Conformance Test Results

Pass Pass Pass +Unknown      protocols_definition
Partial

Does not detect protocol mismatch if concrete method is missing annotations.

Does not detect protocol mismatch if concrete method's parameters are position-only.

Pass Pass Pass +Unknown      protocols_explicit
Pass*

Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

Pass Pass Pass +Unknown      protocols_generic Pass Pass Pass Pass +Unknown      protocols_merging Pass Pass Pass Pass +Unknown      protocols_modules Pass Pass Pass
Partial

Fails one subtyping example of protocol modules

+Unknown      protocols_recursive Pass Pass Pass Pass +Unknown      protocols_runtime_checkable
Partial

Does not report unsafe overlap for runtime_checkable protocol.

Pass Pass Pass +Unknown      protocols_self Pass Pass Pass Pass +Pass      protocols_subtyping Pass Pass Pass Pass +Pass      protocols_variance Pass Pass Pass Pass +Unknown - + Callables      callables_annotation @@ -615,26 +684,30 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Parameter names are lost when resolving ParamSpec

+Unknown      callables_kwargs
Partial

Allows callable without kwargs to be assigned to callable with unpacked kwargs

Pass Pass Pass +Unknown      callables_protocol Pass Pass Pass Pass +Pass      callables_subtyping Pass Pass Pass Pass +Unknown - + Constructors      constructors_call_init @@ -642,38 +715,44 @@

Python Type System Conformance Test Results

Pass Pass Pass +Unknown      constructors_call_metaclass
Unupported

Does not honor metaclass __call__ method when evaluating constructor call.

Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

Pass Pass Pass +Unknown      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 Pass Pass +Unknown      constructors_call_type
Partial

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

Pass Pass Pass +Unknown      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 Pass
Partial

Converting constructor to callable does not preserve class-scoped type params.

Converting constructor to callable does not substitute Self in __new__

Converting constructor to callable uses __new__ signature instead of __init__

+Unknown      constructors_consistency
Pass*

Does not report inconsistency between __new__ and __init__ (optional).

Pass Pass Pass +Pass - + Overloads      overloads_basic @@ -681,32 +760,37 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      overloads_consistency Pass Pass Pass Pass +Unknown      overloads_definitions
Partial

Allows @override to be on all overloads and implementation, instead of just implementation.

Pass Pass Pass +Pass      overloads_definitions_stub
Partial

Allows @override to appear in a stub file not on the first overload.

Pass Pass Pass +Pass      overloads_evaluation
Partial

Does not expand boolean arguments to Literal[True] and Literal[False].

Does not expand enum arguments to literal variants.

Does not expand tuple arguments to possible combinations.

Does not evaluate Any in some cases where overload is ambiguous.

Evaluates Any in some cases where overload is not ambiguous.

Partial

Does not evaluate Any in some cases where overload is ambiguous.

Pass Pass +Pass - + Exceptions      exceptions_context_managers @@ -714,8 +798,9 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Some error suppressing context managers are not detected

+Unknown - + Dataclasses      dataclasses_descriptors @@ -723,98 +808,114 @@

Python Type System Conformance Test Results

Pass Pass
Partial

* Assumes descriptor behavior only when field is assigned in class body

* Doesn't allow non-data descriptors or data descriptors with differing `__get__` and `__set__` types

+Unknown      dataclasses_final
Partial

Wrongly requires a Final dataclass field to be initialized at class level.

Doesn't support Final nested inside ClassVar.

Pass Pass Pass +Pass      dataclasses_frozen Pass Pass Pass Pass +Pass      dataclasses_hash
Partial

Does not report when dataclass is not compatible with Hashable protocol.

Pass Pass Pass +Unknown      dataclasses_inheritance Pass Pass Pass Pass +Unknown      dataclasses_kwonly Pass Pass Pass Pass +Pass      dataclasses_match_args Pass Pass Pass Pass +Unknown      dataclasses_order Pass Pass Pass Pass +Pass      dataclasses_postinit Pass Pass Pass Pass +Pass      dataclasses_slots
Partial

Does not reject write to instance variable that is not defined in __slots__.

Pass Pass
Partial

__slots__ is generated but not checked during attribute assignment

+Unknown      dataclasses_transform_class Pass Pass Pass Pass +Unknown      dataclasses_transform_converter
Unsupported

Converter parameter not yet supported.

Pass Pass Pass +Unknown      dataclasses_transform_field
Partial

Does not properly handle field constructor that has default value for `kw_only` or `init` parameter.

Pass Pass Pass +Pass      dataclasses_transform_func
Partial

Does not handle `kw_only=False` override when `kw_only_default=True`.

Does not report error when `order=False` and comparison operators are used.

Pass Pass Pass +Pass      dataclasses_transform_meta Pass Pass Pass Pass +Unknown      dataclasses_usage
Pass*

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

Pass Pass Pass +Pass - + Typed dictionaries      typeddicts_alt_syntax @@ -822,86 +923,100 @@

Python Type System Conformance Test Results

Pass Pass Pass +Unknown      typeddicts_class_syntax Pass Pass Pass Pass +Pass      typeddicts_extra_items
Unsupported

Not supported.

Pass Pass Pass +Unknown      typeddicts_final Pass Pass Pass Pass +Pass      typeddicts_inheritance Pass Pass Pass Pass +Unknown      typeddicts_operations Pass Pass Pass Pass +Pass      typeddicts_readonly Pass Pass Pass Pass +Unknown      typeddicts_readonly_consistency Pass Pass Pass Pass +Pass      typeddicts_readonly_inheritance
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 Pass Pass +Unknown      typeddicts_readonly_kwargs Pass Pass Pass Pass +Unknown      typeddicts_readonly_update
Partial

Incorrectly allows update of ReadOnly item.

Incorrectly rejects update involving an item with Never type.

Pass Pass Pass +Unknown      typeddicts_required Pass Pass Pass Pass +Unknown      typeddicts_type_consistency Pass Pass Pass Pass +Pass      typeddicts_usage Pass Pass Pass Pass +Pass - + Tuples      tuples_type_compat @@ -909,20 +1024,23 @@

Python Type System Conformance Test Results

Partial

Incorrectly marks a match case as unreachable.

Pass Pass +Pass      tuples_type_form Pass Pass Pass Pass +Pass      tuples_unpacked
Partial

"More than one unpack" error is missing in some cases.

Pass Pass Pass +Unknown - + Named tuples      namedtuples_define_class @@ -930,26 +1048,30 @@

Python Type System Conformance Test Results

Pass Pass Pass +Unknown      namedtuples_define_functional Pass Pass Pass Pass +Pass      namedtuples_type_compat Pass Pass Pass Pass +Pass      namedtuples_usage
Partial

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

Pass Pass Pass +Unknown - + Enumerations      enums_behaviors @@ -957,38 +1079,44 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      enums_definition Pass Pass Pass Pass +Pass      enums_expansion
Partial

Improperly applies narrowing to Flag subclass.

Pass Pass Pass +Unknown      enums_member_names
Pass*

Does not support special-cased handling of member name literal types in some cases (optional).

Pass Pass Pass +Pass      enums_member_values
Partial

Does not enforce declared type of `_value_`.

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

Pass Pass Pass +Pass      enums_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).

Pass Pass +Unknown - + Type narrowing      narrowing_typeguard @@ -996,14 +1124,16 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      narrowing_typeis Pass Pass Pass Pass +Unknown - + Type checker directives      directives_assert_type @@ -1011,62 +1141,72 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass      directives_cast Pass Pass Pass Pass +Pass      directives_deprecated Pass Pass Pass Pass +Unknown      directives_no_type_check
Partial

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

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

Pass*

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

Pass Pass +Pass      directives_reveal_type Pass Pass Pass Pass +Pass      directives_type_checking Pass Pass Pass Pass +Unknown      directives_type_ignore
Partial

Does not honor "# type: ignore" comment if comment includes additional text.

Pass
Partial

Does not honor "# type: ignore" comment if comment includes additional text.

Pass +Pass      directives_type_ignore_file1 Pass Pass Pass Pass +Pass      directives_type_ignore_file2 Pass Pass Pass Pass +Pass      directives_version_platform
Pass*

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

Does not understand os.name checks.

Pass Pass Pass +Unknown - + Historical and deprecated features      historical_positional @@ -1074,6 +1214,7 @@

Python Type System Conformance Test Results

Pass Pass Pass +Pass diff --git a/conformance/results/ty/aliases_explicit.toml b/conformance/results/ty/aliases_explicit.toml new file mode 100644 index 000000000..d3c88d190 --- /dev/null +++ b/conformance/results/ty/aliases_explicit.toml @@ -0,0 +1,28 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 87: Expected 1 errors +Line 100: Expected 1 errors +Line 57: Unexpected errors ['aliases_explicit.py:57:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`'] +""" +output = """ +aliases_explicit.py:57:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None` +aliases_explicit.py:67:9: error[not-subscriptable] Cannot subscript non-generic type `` +aliases_explicit.py:68:9: error[not-subscriptable] Cannot subscript non-generic type `` +aliases_explicit.py:69:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 +aliases_explicit.py:70:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 +aliases_explicit.py:71:24: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` +aliases_explicit.py:79:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:80:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:81:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:82:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:83:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:84:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:85:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:86:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:88:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:89:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:90:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:91:1: error[invalid-type-form] Invalid right-hand side for `typing.TypeAlias` assignment +aliases_explicit.py:101:6: error[call-non-callable] Object of type `UnionType` is not callable +aliases_explicit.py:102:5: error[not-subscriptable] Cannot subscript non-generic type `` +""" diff --git a/conformance/results/ty/aliases_implicit.toml b/conformance/results/ty/aliases_implicit.toml new file mode 100644 index 000000000..5e961a906 --- /dev/null +++ b/conformance/results/ty/aliases_implicit.toml @@ -0,0 +1,29 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 106: Expected 1 errors +Line 111: Expected 1 errors +Line 112: Expected 1 errors +Line 113: Expected 1 errors +Line 117: Expected 1 errors +Line 68: Unexpected errors ['aliases_implicit.py:68:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None`'] +""" +output = """ +aliases_implicit.py:68:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `(int, str, str, /) -> None` +aliases_implicit.py:76:9: error[not-subscriptable] Cannot subscript non-generic type `` +aliases_implicit.py:77:9: error[not-subscriptable] Cannot subscript non-generic type `` +aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 +aliases_implicit.py:79:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 +aliases_implicit.py:80:24: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` +aliases_implicit.py:81:25: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int | float` of type variable `TFloat@GoodTypeAlias12` +aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[Unknown | | ]` is not allowed in a type expression +aliases_implicit.py:108:9: error[invalid-type-form] Variable of type `tuple[tuple[, ]]` is not allowed in a type expression +aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[Unknown | ]` is not allowed in a type expression +aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[Unknown | str, Unknown | str]` is not allowed in a type expression +aliases_implicit.py:114:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression +aliases_implicit.py:115:10: error[invalid-type-form] Variable of type `Literal[True]` is not allowed in a type expression +aliases_implicit.py:116:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression +aliases_implicit.py:118:10: error[invalid-type-form] Variable of type `Literal["int"]` is not allowed in a type expression +aliases_implicit.py:119:10: error[invalid-type-form] Variable of type `Literal["int | str"]` is not allowed in a type expression +aliases_implicit.py:133:6: error[call-non-callable] Object of type `UnionType` is not callable +aliases_implicit.py:135:5: error[not-subscriptable] Cannot subscript non-generic type `` +""" diff --git a/conformance/results/ty/aliases_newtype.toml b/conformance/results/ty/aliases_newtype.toml new file mode 100644 index 000000000..92a9a4094 --- /dev/null +++ b/conformance/results/ty/aliases_newtype.toml @@ -0,0 +1,19 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +aliases_newtype.py:11:8: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["user"]` +aliases_newtype.py:12:14: error[invalid-assignment] Object of type `Literal[42]` is not assignable to `UserId` +aliases_newtype.py:18:11: error[invalid-assignment] Object of type `` is not assignable to `type` +aliases_newtype.py:23:16: error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `type | UnionType | tuple[Divergent, ...]`, found `` +aliases_newtype.py:26:21: error[invalid-base] Cannot subclass an instance of NewType +aliases_newtype.py:35:1: error[invalid-newtype] The name of a `NewType` (`BadName`) must match the name of the variable it is assigned to (`GoodName`) +aliases_newtype.py:41:6: error[invalid-type-form] `GoodNewType1` is a `NewType` and cannot be specialized +aliases_newtype.py:47:38: error[invalid-newtype] invalid base for `typing.NewType`: type `int | str` +aliases_newtype.py:50:38: error[invalid-newtype] invalid base for `typing.NewType`: A `NewType` base cannot be generic +aliases_newtype.py:52:38: error[invalid-newtype] invalid base for `typing.NewType`: type `Hashable` +aliases_newtype.py:54:38: error[invalid-newtype] invalid base for `typing.NewType`: type `Literal[7]` +aliases_newtype.py:61:38: error[invalid-newtype] invalid base for `typing.NewType`: type `TD1` +aliases_newtype.py:63:15: error[invalid-newtype] Wrong number of arguments in `NewType` creation: expected 2, found 3 +aliases_newtype.py:65:38: error[invalid-newtype] invalid base for `typing.NewType`: type `Any` +""" diff --git a/conformance/results/ty/aliases_recursive.toml b/conformance/results/ty/aliases_recursive.toml new file mode 100644 index 000000000..536250ecd --- /dev/null +++ b/conformance/results/ty/aliases_recursive.toml @@ -0,0 +1,16 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 19: Expected 1 errors +Line 20: Expected 1 errors +Line 38: Expected 1 errors +Line 39: Expected 1 errors +Line 50: Expected 1 errors +Line 51: Expected 1 errors +Line 52: Expected 1 errors +Line 63: Expected 1 errors +Line 69: Expected 1 errors +Line 72: Expected 1 errors +Line 75: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml new file mode 100644 index 000000000..c51088f05 --- /dev/null +++ b/conformance/results/ty/aliases_type_statement.toml @@ -0,0 +1,37 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 56: Expected 1 errors +Line 62: Expected 1 errors +Line 67: Expected 1 errors +Line 84: Expected 1 errors +Lines 51, 52: Expected error (tag 'TA14') +Line 10: Unexpected errors ['aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3'] +""" +output = """ +aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3 +aliases_type_statement.py:17:1: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `bit_count` +aliases_type_statement.py:19:1: error[call-non-callable] Object of type `TypeAliasType` is not callable +aliases_type_statement.py:23:7: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `other_attrib` +aliases_type_statement.py:26:18: error[invalid-base] Invalid class base with type `TypeAliasType` +aliases_type_statement.py:31:22: error[invalid-argument-type] Argument to function `isinstance` is incorrect: Expected `type | UnionType | tuple[Divergent, ...]`, found `TypeAliasType` +aliases_type_statement.py:37:22: error[invalid-type-form] Function calls are not allowed in type expressions +aliases_type_statement.py:38:22: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +aliases_type_statement.py:39:22: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression +aliases_type_statement.py:39:23: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +aliases_type_statement.py:40:22: error[invalid-type-form] List comprehensions are not allowed in type expressions +aliases_type_statement.py:41:22: error[invalid-type-form] Dict literals are not allowed in type expressions +aliases_type_statement.py:42:22: error[invalid-type-form] Function calls are not allowed in type expressions +aliases_type_statement.py:43:22: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +aliases_type_statement.py:43:28: error[invalid-type-form] Int literals are not allowed in this context in a type expression +aliases_type_statement.py:44:22: error[invalid-type-form] `if` expressions are not allowed in type expressions +aliases_type_statement.py:45:22: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression +aliases_type_statement.py:46:23: error[invalid-type-form] Boolean literals are not allowed in this context in a type expression +aliases_type_statement.py:47:23: error[invalid-type-form] Int literals are not allowed in this context in a type expression +aliases_type_statement.py:48:23: error[invalid-type-form] Boolean operations are not allowed in type expressions +aliases_type_statement.py:49:23: error[fstring-type-annotation] Type expressions cannot use f-strings +aliases_type_statement.py:77:27: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int` of type variable `S@RecursiveTypeAlias2` +aliases_type_statement.py:79:32: error[invalid-type-arguments] Type `int` is not assignable to upper bound `str` of type variable `T@RecursiveTypeAlias2` +aliases_type_statement.py:82:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias3` +aliases_type_statement.py:88:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias6` +aliases_type_statement.py:89:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias7` +""" diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml new file mode 100644 index 000000000..2196d8a12 --- /dev/null +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -0,0 +1,29 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 40: 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 +""" +output = """ +aliases_typealiastype.py:32:7: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `other_attrib` +aliases_typealiastype.py:52:40: error[invalid-type-form] Function calls are not allowed in type expressions +aliases_typealiastype.py:53:40: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +aliases_typealiastype.py:54:42: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression +aliases_typealiastype.py:54:43: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +aliases_typealiastype.py:55:42: error[invalid-type-form] List comprehensions are not allowed in type expressions +aliases_typealiastype.py:56:42: error[invalid-type-form] Dict literals are not allowed in type expressions +aliases_typealiastype.py:57:42: error[invalid-type-form] Function calls are not allowed in type expressions +aliases_typealiastype.py:58:42: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +aliases_typealiastype.py:58:48: error[invalid-type-form] Int literals are not allowed in this context in a type expression +aliases_typealiastype.py:59:42: error[invalid-type-form] `if` expressions are not allowed in type expressions +aliases_typealiastype.py:60:42: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression +aliases_typealiastype.py:61:42: error[invalid-type-form] Boolean literals are not allowed in this context in a type expression +aliases_typealiastype.py:62:42: error[invalid-type-form] Int literals are not allowed in this context in a type expression +aliases_typealiastype.py:63:42: error[invalid-type-form] Boolean operations are not allowed in type expressions +aliases_typealiastype.py:64:42: error[invalid-type-form] F-strings are not allowed in type expressions +aliases_typealiastype.py:66:47: error[unresolved-reference] Name `BadAlias21` used when not defined +""" diff --git a/conformance/results/ty/aliases_variance.toml b/conformance/results/ty/aliases_variance.toml new file mode 100644 index 000000000..5add77e80 --- /dev/null +++ b/conformance/results/ty/aliases_variance.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 24: Expected 1 errors +Line 28: Expected 1 errors +Line 32: Expected 1 errors +Line 44: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/annotations_coroutines.toml b/conformance/results/ty/annotations_coroutines.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/ty/annotations_coroutines.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/ty/annotations_forward_refs.toml b/conformance/results/ty/annotations_forward_refs.toml new file mode 100644 index 000000000..b16f07c95 --- /dev/null +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -0,0 +1,36 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 82: Unexpected errors ['annotations_forward_refs.py:82:11: error[invalid-type-form] Variable of type `Literal[""]` is not allowed in a type expression'] +Line 87: Unexpected errors ['annotations_forward_refs.py:87:9: error[invalid-type-form] Function `int` is not valid in a type expression'] +Line 95: Unexpected errors ['annotations_forward_refs.py:95:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `str`'] +Line 96: Unexpected errors ['annotations_forward_refs.py:96:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `int`'] +""" +output = """ +annotations_forward_refs.py:22:7: error[unresolved-reference] Name `ClassA` used when not defined +annotations_forward_refs.py:23:12: error[unresolved-reference] Name `ClassA` used when not defined +annotations_forward_refs.py:41:10: error[invalid-type-form] Function calls are not allowed in type expressions +annotations_forward_refs.py:42:10: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +annotations_forward_refs.py:43:10: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +annotations_forward_refs.py:44:10: error[invalid-type-form] List comprehensions are not allowed in type expressions +annotations_forward_refs.py:45:10: error[invalid-type-form] Dict literals are not allowed in type expressions +annotations_forward_refs.py:46:10: error[invalid-type-form] Function calls are not allowed in type expressions +annotations_forward_refs.py:47:10: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +annotations_forward_refs.py:47:16: error[invalid-type-form] Int literals are not allowed in this context in a type expression +annotations_forward_refs.py:48:10: error[invalid-type-form] `if` expressions are not allowed in type expressions +annotations_forward_refs.py:49:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression +annotations_forward_refs.py:50:11: error[invalid-type-form] Boolean literals are not allowed in this context in a type expression +annotations_forward_refs.py:51:11: error[invalid-type-form] Int literals are not allowed in this context in a type expression +annotations_forward_refs.py:52:11: error[invalid-type-form] Unary operations are not allowed in type expressions +annotations_forward_refs.py:53:11: error[invalid-type-form] Boolean operations are not allowed in type expressions +annotations_forward_refs.py:54:11: error[fstring-type-annotation] Type expressions cannot use f-strings +annotations_forward_refs.py:55:11: error[invalid-type-form] Module `types` is not valid in a type expression +annotations_forward_refs.py:66:26: error[unresolved-reference] Name `ClassB` used when not defined +annotations_forward_refs.py:80:14: error[unresolved-reference] Name `ClassF` used when not defined +annotations_forward_refs.py:82:11: error[invalid-type-form] Variable of type `Literal[""]` is not allowed in a type expression +annotations_forward_refs.py:87:9: error[invalid-type-form] Function `int` is not valid in a type expression +annotations_forward_refs.py:89:8: error[invalid-type-form] Function `int` is not valid in a type expression +annotations_forward_refs.py:95:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `str` +annotations_forward_refs.py:96:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `int` +""" diff --git a/conformance/results/ty/annotations_generators.toml b/conformance/results/ty/annotations_generators.toml new file mode 100644 index 000000000..dd16a7b7e --- /dev/null +++ b/conformance/results/ty/annotations_generators.toml @@ -0,0 +1,15 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 51: Expected 1 errors +Line 54: Expected 1 errors +Line 57: Expected 1 errors +Line 66: Expected 1 errors +Line 75: Expected 1 errors +Line 118: Expected 1 errors +Line 119: Expected 1 errors +Line 135: Expected 1 errors +""" +output = """ +annotations_generators.py:86:21: error[invalid-return-type] Return type does not match returned value: expected `int`, found `types.GeneratorType` +annotations_generators.py:91:27: error[invalid-return-type] Return type does not match returned value: expected `int`, found `types.AsyncGeneratorType` +""" diff --git a/conformance/results/ty/annotations_methods.toml b/conformance/results/ty/annotations_methods.toml new file mode 100644 index 000000000..5800c037c --- /dev/null +++ b/conformance/results/ty/annotations_methods.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_methods.py:42:1: error[type-assertion-failure] Type `B` does not match asserted type `A` +""" diff --git a/conformance/results/ty/annotations_typeexpr.toml b/conformance/results/ty/annotations_typeexpr.toml new file mode 100644 index 000000000..d000bd099 --- /dev/null +++ b/conformance/results/ty/annotations_typeexpr.toml @@ -0,0 +1,21 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_typeexpr.py:88:9: error[invalid-type-form] Function calls are not allowed in type expressions +annotations_typeexpr.py:89:9: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +annotations_typeexpr.py:90:9: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +annotations_typeexpr.py:91:9: error[invalid-type-form] List comprehensions are not allowed in type expressions +annotations_typeexpr.py:92:9: error[invalid-type-form] Dict literals are not allowed in type expressions +annotations_typeexpr.py:93:9: error[invalid-type-form] Function calls are not allowed in type expressions +annotations_typeexpr.py:94:9: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +annotations_typeexpr.py:94:15: error[invalid-type-form] Int literals are not allowed in this context in a type expression +annotations_typeexpr.py:95:9: error[invalid-type-form] `if` expressions are not allowed in type expressions +annotations_typeexpr.py:96:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression +annotations_typeexpr.py:97:10: error[invalid-type-form] Boolean literals are not allowed in this context in a type expression +annotations_typeexpr.py:98:10: error[invalid-type-form] Int literals are not allowed in this context in a type expression +annotations_typeexpr.py:99:10: error[invalid-type-form] Unary operations are not allowed in type expressions +annotations_typeexpr.py:100:10: error[invalid-type-form] Boolean operations are not allowed in type expressions +annotations_typeexpr.py:101:10: error[fstring-type-annotation] Type expressions cannot use f-strings +annotations_typeexpr.py:102:10: error[invalid-type-form] Module `types` is not valid in a type expression +""" diff --git a/conformance/results/ty/callables_annotation.toml b/conformance/results/ty/callables_annotation.toml new file mode 100644 index 000000000..f1eafe14c --- /dev/null +++ b/conformance/results/ty/callables_annotation.toml @@ -0,0 +1,27 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 59: Expected 1 errors +Line 91: Expected 1 errors +Line 93: Expected 1 errors +Line 159: Expected 1 errors +Line 172: Expected 1 errors +Line 187: Expected 1 errors +Line 189: Expected 1 errors +Line 157: Unexpected errors ['callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6`'] +""" +output = """ +callables_annotation.py:25:5: error[missing-argument] No argument provided for required parameter 2 +callables_annotation.py:26:11: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `Literal[2]` +callables_annotation.py:27:15: error[too-many-positional-arguments] Too many positional arguments: expected 2, got 3 +callables_annotation.py:29:5: error[missing-argument] No arguments provided for required parameters 1, 2 +callables_annotation.py:29:8: error[unknown-argument] Argument `a` does not match any known parameter +callables_annotation.py:29:13: error[unknown-argument] Argument `b` does not match any known parameter +callables_annotation.py:35:8: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 1 +callables_annotation.py:55:5: error[invalid-type-form] Special form `typing.Callable` expected exactly two arguments (parameter types and return type) +callables_annotation.py:55:14: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` +callables_annotation.py:56:14: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` +callables_annotation.py:57:18: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[int]`? +callables_annotation.py:58:5: error[invalid-type-form] Special form `typing.Callable` expected exactly two arguments (parameter types and return type) +callables_annotation.py:58:14: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` +callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6` +""" diff --git a/conformance/results/ty/callables_kwargs.toml b/conformance/results/ty/callables_kwargs.toml new file mode 100644 index 000000000..fcf1820d0 --- /dev/null +++ b/conformance/results/ty/callables_kwargs.toml @@ -0,0 +1,27 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 46: Expected 1 errors +Line 51: Expected 1 errors +Line 58: Expected 1 errors +Line 63: Expected 1 errors +Line 65: Expected 1 errors +Line 101: Expected 1 errors +Line 102: Expected 1 errors +Line 111: Expected 1 errors +Line 122: Expected 1 errors +Line 24: Unexpected errors ['callables_kwargs.py:24:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `int`'] +Line 32: Unexpected errors ['callables_kwargs.py:32:9: error[type-assertion-failure] Type `@Todo` does not match asserted type `str`'] +Line 35: Unexpected errors ['callables_kwargs.py:35:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `str`'] +Line 41: Unexpected errors ['callables_kwargs.py:41:5: error[type-assertion-failure] Type `dict[str, @Todo]` does not match asserted type `TD1`'] +""" +output = """ +callables_kwargs.py:24:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `int` +callables_kwargs.py:32:9: error[type-assertion-failure] Type `@Todo` does not match asserted type `str` +callables_kwargs.py:35:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `str` +callables_kwargs.py:41:5: error[type-assertion-failure] Type `dict[str, @Todo]` does not match asserted type `TD1` +callables_kwargs.py:52:11: error[too-many-positional-arguments] Too many positional arguments to function `func1`: expected 0, got 3 +callables_kwargs.py:64:11: error[invalid-argument-type] Argument to function `func2` is incorrect: Expected `str`, found `Literal[1]` +callables_kwargs.py:64:14: error[parameter-already-assigned] Multiple values provided for parameter `v3` of function `func2` +callables_kwargs.py:103:19: error[invalid-assignment] Object of type `def func1(**kwargs: @Todo) -> None` is not assignable to `TDProtocol5` +callables_kwargs.py:134:19: error[invalid-assignment] Object of type `def func7(*, v1: int, v3: str, v2: str = "") -> None` is not assignable to `TDProtocol6` +""" diff --git a/conformance/results/ty/callables_protocol.toml b/conformance/results/ty/callables_protocol.toml new file mode 100644 index 000000000..23b8e9cf3 --- /dev/null +++ b/conformance/results/ty/callables_protocol.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_protocol.py:35:7: error[invalid-assignment] Object of type `def cb1_bad1(*vals: bytes, *, max_items: int | None) -> list[bytes]` is not assignable to `Proto1` +callables_protocol.py:36:7: error[invalid-assignment] Object of type `def cb1_bad2(*vals: bytes) -> list[bytes]` is not assignable to `Proto1` +callables_protocol.py:37:7: error[invalid-assignment] Object of type `def cb1_bad3(*vals: bytes, *, max_len: str | None) -> list[bytes]` is not assignable to `Proto1` +callables_protocol.py:67:7: error[invalid-assignment] Object of type `def cb2_bad1(*a: bytes) -> Unknown` is not assignable to `Proto2` +callables_protocol.py:68:7: error[invalid-assignment] Object of type `def cb2_bad2(*a: str, **b: str) -> Unknown` is not assignable to `Proto2` +callables_protocol.py:69:7: error[invalid-assignment] Object of type `def cb2_bad3(*a: bytes, **b: bytes) -> Unknown` is not assignable to `Proto2` +callables_protocol.py:70:7: error[invalid-assignment] Object of type `def cb2_bad4(**b: str) -> Unknown` is not assignable to `Proto2` +callables_protocol.py:97:16: error[invalid-assignment] Object of type `def cb4_bad1(x: int) -> None` is not assignable to `Proto4` +callables_protocol.py:121:18: error[invalid-assignment] Object of type `def cb6_bad1(*vals: bytes, *, max_len: int | None = None) -> list[bytes]` is not assignable to `NotProto6` +callables_protocol.py:169:7: error[invalid-assignment] Object of type `def cb8_bad1(x: int) -> Any` is not assignable to `Proto8` +callables_protocol.py:186:5: error[invalid-assignment] Object of type `Literal["str"]` is not assignable to attribute `other_attribute` of type `int` +callables_protocol.py:187:5: error[unresolved-attribute] Unresolved attribute `xxx` on type `Proto9[P@decorator1, R@decorator1]` +callables_protocol.py:197:7: error[unresolved-attribute] Object of type `Proto9[(x: int), str]` has no attribute `other_attribute2` +callables_protocol.py:238:8: error[invalid-assignment] Object of type `def cb11_bad1(x: int, y: str, /) -> Any` is not assignable to `Proto11` +callables_protocol.py:260:8: error[invalid-assignment] Object of type `def cb12_bad1(*args: Any, *, kwarg0: Any) -> None` is not assignable to `Proto12` +callables_protocol.py:284:27: error[invalid-assignment] Object of type `def cb13_no_default(path: str) -> str` is not assignable to `Proto13_Default` +callables_protocol.py:311:27: error[invalid-assignment] Object of type `def cb14_no_default(*, path: str) -> str` is not assignable to `Proto14_Default` +""" diff --git a/conformance/results/ty/callables_subtyping.toml b/conformance/results/ty/callables_subtyping.toml new file mode 100644 index 000000000..9ddae7225 --- /dev/null +++ b/conformance/results/ty/callables_subtyping.toml @@ -0,0 +1,37 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 125: Expected 1 errors +""" +output = """ +callables_subtyping.py:26:36: error[invalid-assignment] Object of type `(int, /) -> int` is not assignable to `(int | float, /) -> int | float` +callables_subtyping.py:29:32: error[invalid-assignment] Object of type `(int | float, /) -> int | float` is not assignable to `(int, /) -> int` +callables_subtyping.py:51:21: error[invalid-assignment] Object of type `PosOnly2` is not assignable to `Standard2` +callables_subtyping.py:52:21: error[invalid-assignment] Object of type `KwOnly2` is not assignable to `Standard2` +callables_subtyping.py:55:20: error[invalid-assignment] Object of type `KwOnly2` is not assignable to `PosOnly2` +callables_subtyping.py:58:19: error[invalid-assignment] Object of type `PosOnly2` is not assignable to `KwOnly2` +callables_subtyping.py:82:20: error[invalid-assignment] Object of type `NoArgs3` is not assignable to `IntArgs3` +callables_subtyping.py:85:22: error[invalid-assignment] Object of type `NoArgs3` is not assignable to `FloatArgs3` +callables_subtyping.py:86:22: error[invalid-assignment] Object of type `IntArgs3` is not assignable to `FloatArgs3` +callables_subtyping.py:116:20: error[invalid-assignment] Object of type `IntArgs4` is not assignable to `PosOnly4` +callables_subtyping.py:119:23: error[invalid-assignment] Object of type `StrArgs4` is not assignable to `IntStrArgs4` +callables_subtyping.py:120:23: error[invalid-assignment] Object of type `IntArgs4` is not assignable to `IntStrArgs4` +callables_subtyping.py:122:20: error[invalid-assignment] Object of type `IntArgs4` is not assignable to `StrArgs4` +callables_subtyping.py:124:20: error[invalid-assignment] Object of type `StrArgs4` is not assignable to `IntArgs4` +callables_subtyping.py:126:22: error[invalid-assignment] Object of type `StrArgs4` is not assignable to `Standard4` +callables_subtyping.py:151:22: error[invalid-assignment] Object of type `NoKwargs5` is not assignable to `IntKwargs5` +callables_subtyping.py:154:24: error[invalid-assignment] Object of type `NoKwargs5` is not assignable to `FloatKwargs5` +callables_subtyping.py:155:24: error[invalid-assignment] Object of type `IntKwargs5` is not assignable to `FloatKwargs5` +callables_subtyping.py:187:19: error[invalid-assignment] Object of type `IntKwargs6` is not assignable to `KwOnly6` +callables_subtyping.py:190:25: error[invalid-assignment] Object of type `StrKwargs6` is not assignable to `IntStrKwargs6` +callables_subtyping.py:191:25: error[invalid-assignment] Object of type `IntKwargs6` is not assignable to `IntStrKwargs6` +callables_subtyping.py:193:22: error[invalid-assignment] Object of type `IntKwargs6` is not assignable to `StrKwargs6` +callables_subtyping.py:195:22: error[invalid-assignment] Object of type `StrKwargs6` is not assignable to `IntKwargs6` +callables_subtyping.py:196:22: error[invalid-assignment] Object of type `IntStrKwargs6` is not assignable to `Standard6` +callables_subtyping.py:197:22: error[invalid-assignment] Object of type `StrKwargs6` is not assignable to `Standard6` +callables_subtyping.py:236:23: error[invalid-assignment] Object of type `NoDefaultArg8` is not assignable to `DefaultArg8` +callables_subtyping.py:237:23: error[invalid-assignment] Object of type `NoX8` is not assignable to `DefaultArg8` +callables_subtyping.py:240:25: error[invalid-assignment] Object of type `NoX8` is not assignable to `NoDefaultArg8` +callables_subtyping.py:243:16: error[invalid-assignment] Object of type `NoDefaultArg8` is not assignable to `NoX8` +callables_subtyping.py:273:21: error[invalid-assignment] Object of type `Overloaded9` is not assignable to `FloatArg9` +callables_subtyping.py:297:24: error[invalid-assignment] Object of type `StrArg10` is not assignable to `Overloaded10` +""" diff --git a/conformance/results/ty/classes_classvar.toml b/conformance/results/ty/classes_classvar.toml new file mode 100644 index 000000000..67419c869 --- /dev/null +++ b/conformance/results/ty/classes_classvar.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +classes_classvar.py:38:11: error[invalid-type-form] Type qualifier `typing.ClassVar` expected exactly 1 argument, got 2 +classes_classvar.py:39:14: error[invalid-type-form] Int literals are not allowed in this context in a type expression +classes_classvar.py:40:14: error[unresolved-reference] Name `var` used when not defined +classes_classvar.py:45:11: error[invalid-type-form] `ClassVar` cannot contain type variables +classes_classvar.py:46:11: error[invalid-type-form] `ClassVar` cannot contain type variables +classes_classvar.py:47:11: error[invalid-type-form] `ClassVar` cannot contain type variables +classes_classvar.py:52:33: error[invalid-assignment] Object of type `dict[Unknown, Unknown]` is not assignable to `list[str]` +classes_classvar.py:54:11: error[redundant-final-classvar] `Combining `ClassVar` and `Final` is redundant +classes_classvar.py:55:17: error[invalid-type-form] Type qualifier `typing.ClassVar` is not allowed in type expressions (only in annotation expressions) +classes_classvar.py:69:23: error[invalid-type-form] `ClassVar` is not allowed in function parameter annotations +classes_classvar.py:70:12: error[invalid-type-form] `ClassVar` annotations are only allowed in class-body scopes +classes_classvar.py:71:18: error[invalid-type-form] `ClassVar` annotations are not allowed for non-name targets +classes_classvar.py:73:26: error[invalid-type-form] `ClassVar` is not allowed in function return type annotations +classes_classvar.py:77:8: error[invalid-type-form] `ClassVar` annotations are only allowed in class-body scopes +classes_classvar.py:78:20: error[invalid-type-form] Type qualifiers are not allowed in type alias definitions +classes_classvar.py:111:1: error[invalid-attribute-access] Cannot assign to ClassVar `stats` from an instance of type `Starship` +classes_classvar.py:140:13: error[invalid-assignment] Object of type `ProtoAImpl` is not assignable to `ProtoA` +""" diff --git a/conformance/results/ty/classes_override.toml b/conformance/results/ty/classes_override.toml new file mode 100644 index 000000000..52cef47dd --- /dev/null +++ b/conformance/results/ty/classes_override.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +classes_override.py:53:9: error[invalid-explicit-override] Method `method3` is decorated with `@override` but does not override anything +classes_override.py:65:9: error[invalid-explicit-override] Method `method4` is decorated with `@override` but does not override anything +classes_override.py:79:9: error[invalid-explicit-override] Method `static_method1` is decorated with `@override` but does not override anything +classes_override.py:84:9: error[invalid-explicit-override] Method `class_method1` is decorated with `@override` but does not override anything +classes_override.py:89:9: error[invalid-explicit-override] Method `property1` is decorated with `@override` but does not override anything +""" diff --git a/conformance/results/ty/constructors_call_init.toml b/conformance/results/ty/constructors_call_init.toml new file mode 100644 index 000000000..7d23e6fed --- /dev/null +++ b/conformance/results/ty/constructors_call_init.toml @@ -0,0 +1,14 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 42: Expected 1 errors +Line 107: Expected 1 errors +Line 91: Unexpected errors ['constructors_call_init.py:91:1: error[type-assertion-failure] Type `Class6[Unknown, Unknown]` does not match asserted type `Class6[int, str]`'] +Line 99: Unexpected errors ['constructors_call_init.py:99:1: error[type-assertion-failure] Type `Class7[Unknown, Unknown]` does not match asserted type `Class7[str, int]`'] +""" +output = """ +constructors_call_init.py:21:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `float` +constructors_call_init.py:56:1: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `Class4[int]`, found `Class4[str]` +constructors_call_init.py:91:1: error[type-assertion-failure] Type `Class6[Unknown, Unknown]` does not match asserted type `Class6[int, str]` +constructors_call_init.py:99:1: error[type-assertion-failure] Type `Class7[Unknown, Unknown]` does not match asserted type `Class7[str, int]` +constructors_call_init.py:130:9: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2 +""" diff --git a/conformance/results/ty/constructors_call_metaclass.toml b/conformance/results/ty/constructors_call_metaclass.toml new file mode 100644 index 000000000..c5ca3b7bb --- /dev/null +++ b/conformance/results/ty/constructors_call_metaclass.toml @@ -0,0 +1,12 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 39: Unexpected errors ['constructors_call_metaclass.py:39:1: error[type-assertion-failure] Type `Class2` does not match asserted type `int | Meta2`', 'constructors_call_metaclass.py:39:13: error[missing-argument] No argument provided for required parameter `x` of function `__new__`'] +Line 46: Unexpected errors ["constructors_call_metaclass.py:46:16: error[invalid-super-argument] `type[T@__call__]` is not an instance or subclass of `` in `super(, type[T@__call__])` call"] +""" +output = """ +constructors_call_metaclass.py:39:1: error[type-assertion-failure] Type `Class2` does not match asserted type `int | Meta2` +constructors_call_metaclass.py:39:13: error[missing-argument] No argument provided for required parameter `x` of function `__new__` +constructors_call_metaclass.py:46:16: error[invalid-super-argument] `type[T@__call__]` is not an instance or subclass of `` in `super(, type[T@__call__])` call +constructors_call_metaclass.py:54:1: error[missing-argument] No argument provided for required parameter `x` of function `__new__` +constructors_call_metaclass.py:68:1: error[missing-argument] No argument provided for required parameter `x` of function `__new__` +""" diff --git a/conformance/results/ty/constructors_call_new.toml b/conformance/results/ty/constructors_call_new.toml new file mode 100644 index 000000000..17fd1abbb --- /dev/null +++ b/conformance/results/ty/constructors_call_new.toml @@ -0,0 +1,23 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 49: Unexpected errors ['constructors_call_new.py:49:1: error[type-assertion-failure] Type `Class3` does not match asserted type `int`', 'constructors_call_new.py:49:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`'] +Line 64: Unexpected errors ['constructors_call_new.py:64:1: error[type-assertion-failure] Type `Class4` does not match asserted type `Class4 | Any`', 'constructors_call_new.py:64:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`'] +Line 76: Unexpected errors ['constructors_call_new.py:76:5: error[type-assertion-failure] Type `Class5` does not match asserted type `Never`', 'constructors_call_new.py:76:17: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`'] +Line 89: Unexpected errors ['constructors_call_new.py:89:1: error[type-assertion-failure] Type `Class6` does not match asserted type `int | Class6`', 'constructors_call_new.py:89:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`'] +Line 117: Unexpected errors ['constructors_call_new.py:117:1: error[type-assertion-failure] Type `Class8[int]` does not match asserted type `Class8[list[int]]`'] +Line 118: Unexpected errors ['constructors_call_new.py:118:1: error[type-assertion-failure] Type `Class8[str]` does not match asserted type `Class8[list[str]]`'] +""" +output = """ +constructors_call_new.py:21:13: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `int`, found `float` +constructors_call_new.py:49:1: error[type-assertion-failure] Type `Class3` does not match asserted type `int` +constructors_call_new.py:49:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__` +constructors_call_new.py:64:1: error[type-assertion-failure] Type `Class4` does not match asserted type `Class4 | Any` +constructors_call_new.py:64:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__` +constructors_call_new.py:76:5: error[type-assertion-failure] Type `Class5` does not match asserted type `Never` +constructors_call_new.py:76:17: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__` +constructors_call_new.py:89:1: error[type-assertion-failure] Type `Class6` does not match asserted type `int | Class6` +constructors_call_new.py:89:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__` +constructors_call_new.py:117:1: error[type-assertion-failure] Type `Class8[int]` does not match asserted type `Class8[list[int]]` +constructors_call_new.py:118:1: error[type-assertion-failure] Type `Class8[str]` does not match asserted type `Class8[list[str]]` +constructors_call_new.py:148:1: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `type[Class11[int]]`, found `` +""" diff --git a/conformance/results/ty/constructors_call_type.toml b/conformance/results/ty/constructors_call_type.toml new file mode 100644 index 000000000..3ad574c8f --- /dev/null +++ b/conformance/results/ty/constructors_call_type.toml @@ -0,0 +1,14 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 30: Expected 1 errors +Line 64: Expected 1 errors +Line 72: Expected 1 errors +""" +output = """ +constructors_call_type.py:19:55: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive +constructors_call_type.py:40:5: error[missing-argument] No arguments provided for required parameters `x`, `y` of function `__new__` +constructors_call_type.py:50:5: error[missing-argument] No arguments provided for required parameters `x`, `y` of bound method `__init__` +constructors_call_type.py:59:9: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2 +constructors_call_type.py:81:5: error[missing-argument] No argument provided for required parameter `y` of function `__new__` +constructors_call_type.py:82:12: error[invalid-argument-type] Argument to function `__new__` is incorrect: Expected `str`, found `Literal[2]` +""" diff --git a/conformance/results/ty/constructors_callable.toml b/conformance/results/ty/constructors_callable.toml new file mode 100644 index 000000000..7d82f401f --- /dev/null +++ b/conformance/results/ty/constructors_callable.toml @@ -0,0 +1,43 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 66: Expected 1 errors +Line 67: Expected 1 errors +Line 68: Expected 1 errors +Line 186: Expected 1 errors +Line 197: Expected 1 errors +Line 102: Unexpected errors ['constructors_callable.py:102:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`'] +Line 107: Unexpected errors ['constructors_callable.py:107:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`'] +Line 143: Unexpected errors ["constructors_callable.py:143:27: error[invalid-argument-type] Argument to function `accepts_callable` is incorrect: Expected `() -> Any | Class6Any`, found ``"] +Line 145: Unexpected errors ['constructors_callable.py:145:1: error[type-assertion-failure] Type `Any | Class6Any` does not match asserted type `Any`'] +Line 166: Unexpected errors ['constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]`'] +Line 167: Unexpected errors ['constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]`'] +Line 185: Unexpected errors ['constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]`'] +""" +output = """ +constructors_callable.py:36:13: info[revealed-type] Revealed type: `(x: int) -> Class1` +constructors_callable.py:38:1: error[missing-argument] No argument provided for required parameter `x` +constructors_callable.py:39:1: error[missing-argument] No argument provided for required parameter `x` +constructors_callable.py:39:4: error[unknown-argument] Argument `y` does not match any known parameter +constructors_callable.py:49:13: info[revealed-type] Revealed type: `() -> Class2` +constructors_callable.py:51:4: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 1 +constructors_callable.py:64:13: info[revealed-type] Revealed type: `(...) -> Class3` +constructors_callable.py:79:13: info[revealed-type] Revealed type: `(x: int) -> int` +constructors_callable.py:81:1: error[missing-argument] No argument provided for required parameter `x` +constructors_callable.py:82:1: error[missing-argument] No argument provided for required parameter `x` +constructors_callable.py:82:4: error[unknown-argument] Argument `y` does not match any known parameter +constructors_callable.py:99:13: info[revealed-type] Revealed type: `(...) -> Unknown` +constructors_callable.py:102:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never` +constructors_callable.py:107:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never` +constructors_callable.py:127:13: info[revealed-type] Revealed type: `() -> Class6Proxy` +constructors_callable.py:129:4: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 1 +constructors_callable.py:143:27: error[invalid-argument-type] Argument to function `accepts_callable` is incorrect: Expected `() -> Any | Class6Any`, found `` +constructors_callable.py:144:13: info[revealed-type] Revealed type: `() -> Any | Class6Any` +constructors_callable.py:145:1: error[type-assertion-failure] Type `Any | Class6Any` does not match asserted type `Any` +constructors_callable.py:146:8: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 1 +constructors_callable.py:164:5: info[revealed-type] Revealed type: `Overload[[T](x: int) -> Class7[int] | Class7[str], [T](x: str) -> Class7[int] | Class7[str]]` +constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]` +constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]` +constructors_callable.py:184:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class8[T]` +constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]` +constructors_callable.py:195:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class9` +""" diff --git a/conformance/results/ty/constructors_consistency.toml b/conformance/results/ty/constructors_consistency.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/ty/constructors_consistency.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/ty/dataclasses_descriptors.toml b/conformance/results/ty/dataclasses_descriptors.toml new file mode 100644 index 000000000..83b9a940a --- /dev/null +++ b/conformance/results/ty/dataclasses_descriptors.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 66: Unexpected errors ['dataclasses_descriptors.py:66:1: error[type-assertion-failure] Type `int | Desc2[int]` does not match asserted type `int`'] +Line 67: Unexpected errors ['dataclasses_descriptors.py:67:1: error[type-assertion-failure] Type `str | Desc2[str]` does not match asserted type `str`'] +""" +output = """ +dataclasses_descriptors.py:66:1: error[type-assertion-failure] Type `int | Desc2[int]` does not match asserted type `int` +dataclasses_descriptors.py:67:1: error[type-assertion-failure] Type `str | Desc2[str]` does not match asserted type `str` +""" diff --git a/conformance/results/ty/dataclasses_final.toml b/conformance/results/ty/dataclasses_final.toml new file mode 100644 index 000000000..cc9a5eb79 --- /dev/null +++ b/conformance/results/ty/dataclasses_final.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_final.py:27:1: error[invalid-assignment] Cannot assign to final attribute `final_classvar` on type `` +dataclasses_final.py:35:1: error[invalid-assignment] Cannot assign to final attribute `final_no_default` on type `D` +dataclasses_final.py:36:1: error[invalid-assignment] Cannot assign to final attribute `final_with_default` on type `D` +dataclasses_final.py:37:1: error[invalid-assignment] Cannot assign to final attribute `final_no_default` on type `` +dataclasses_final.py:38:1: error[invalid-assignment] Cannot assign to final attribute `final_with_default` on type `` +""" diff --git a/conformance/results/ty/dataclasses_frozen.toml b/conformance/results/ty/dataclasses_frozen.toml new file mode 100644 index 000000000..410316402 --- /dev/null +++ b/conformance/results/ty/dataclasses_frozen.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_frozen.py:16:1: error[invalid-assignment] Property `a` defined in `DC1` is read-only +dataclasses_frozen.py:17:1: error[invalid-assignment] Property `b` defined in `DC1` is read-only +dataclasses_frozen.py:23:7: error[invalid-frozen-dataclass-subclass] Non-frozen dataclass `DC2` cannot inherit from frozen dataclass `DC1` +dataclasses_frozen.py:33:7: error[invalid-frozen-dataclass-subclass] Frozen dataclass `DC4` cannot inherit from non-frozen dataclass `DC3` +""" diff --git a/conformance/results/ty/dataclasses_hash.toml b/conformance/results/ty/dataclasses_hash.toml new file mode 100644 index 000000000..a7f264ee3 --- /dev/null +++ b/conformance/results/ty/dataclasses_hash.toml @@ -0,0 +1,7 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 32: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/dataclasses_inheritance.toml b/conformance/results/ty/dataclasses_inheritance.toml new file mode 100644 index 000000000..6973d93fa --- /dev/null +++ b/conformance/results/ty/dataclasses_inheritance.toml @@ -0,0 +1,7 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 62: Expected 1 errors +Line 66: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/dataclasses_kwonly.toml b/conformance/results/ty/dataclasses_kwonly.toml new file mode 100644 index 000000000..902795f6f --- /dev/null +++ b/conformance/results/ty/dataclasses_kwonly.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_kwonly.py:23:11: error[too-many-positional-arguments] Too many positional arguments: expected 1, got 2 +dataclasses_kwonly.py:38:11: error[too-many-positional-arguments] Too many positional arguments: expected 1, got 2 +dataclasses_kwonly.py:53:11: error[too-many-positional-arguments] Too many positional arguments: expected 1, got 2 +""" diff --git a/conformance/results/ty/dataclasses_match_args.toml b/conformance/results/ty/dataclasses_match_args.toml new file mode 100644 index 000000000..60c3e1755 --- /dev/null +++ b/conformance/results/ty/dataclasses_match_args.toml @@ -0,0 +1,8 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 49: Unexpected errors ['dataclasses_match_args.py:49:1: error[type-assertion-failure] Type `Unknown | tuple[()]` does not match asserted type `tuple[()]`'] +""" +output = """ +dataclasses_match_args.py:42:1: error[unresolved-attribute] Class `DC4` has no attribute `__match_args__` +dataclasses_match_args.py:49:1: error[type-assertion-failure] Type `Unknown | tuple[()]` does not match asserted type `tuple[()]` +""" diff --git a/conformance/results/ty/dataclasses_order.toml b/conformance/results/ty/dataclasses_order.toml new file mode 100644 index 000000000..cd0a0cb47 --- /dev/null +++ b/conformance/results/ty/dataclasses_order.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_order.py:50:4: error[unsupported-operator] Operator `<` is not supported between objects of type `DC1` and `DC2` +""" diff --git a/conformance/results/ty/dataclasses_postinit.toml b/conformance/results/ty/dataclasses_postinit.toml new file mode 100644 index 000000000..83f2f2416 --- /dev/null +++ b/conformance/results/ty/dataclasses_postinit.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_postinit.py:19:9: error[invalid-dataclass] Invalid `__post_init__` signature for dataclass `DC1` +dataclasses_postinit.py:28:7: error[unresolved-attribute] Object of type `DC1` has no attribute `x` +dataclasses_postinit.py:29:7: error[unresolved-attribute] Object of type `DC1` has no attribute `y` +dataclasses_postinit.py:36:9: error[invalid-dataclass] Invalid `__post_init__` signature for dataclass `DC2` +""" diff --git a/conformance/results/ty/dataclasses_slots.toml b/conformance/results/ty/dataclasses_slots.toml new file mode 100644 index 000000000..188d72cc7 --- /dev/null +++ b/conformance/results/ty/dataclasses_slots.toml @@ -0,0 +1,10 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 25: Expected 1 errors +Line 38: Expected 1 errors +Lines 10, 11: Expected error (tag 'DC1') +""" +output = """ +dataclasses_slots.py:66:1: error[unresolved-attribute] Class `DC6` has no attribute `__slots__` +dataclasses_slots.py:69:1: error[unresolved-attribute] Object of type `DC6` has no attribute `__slots__` +""" diff --git a/conformance/results/ty/dataclasses_transform_class.toml b/conformance/results/ty/dataclasses_transform_class.toml new file mode 100644 index 000000000..190c94232 --- /dev/null +++ b/conformance/results/ty/dataclasses_transform_class.toml @@ -0,0 +1,13 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 51: Expected 1 errors +""" +output = """ +dataclasses_transform_class.py:63:1: error[invalid-assignment] Property `id` defined in `Customer1` is read-only +dataclasses_transform_class.py:66:8: error[missing-argument] No arguments provided for required parameters `id`, `name` +dataclasses_transform_class.py:66:18: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 2 +dataclasses_transform_class.py:72:6: error[unsupported-operator] Operator `<` is not supported between two objects of type `Customer1` +dataclasses_transform_class.py:82:8: error[missing-argument] No argument provided for required parameter `id` +dataclasses_transform_class.py:82:18: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 2 +dataclasses_transform_class.py:122:1: error[invalid-assignment] Property `id` defined in `Customer3` is read-only +""" diff --git a/conformance/results/ty/dataclasses_transform_converter.toml b/conformance/results/ty/dataclasses_transform_converter.toml new file mode 100644 index 000000000..7afd57b2c --- /dev/null +++ b/conformance/results/ty/dataclasses_transform_converter.toml @@ -0,0 +1,51 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 118: Expected 1 errors +Line 102: Unexpected errors ["dataclasses_transform_converter.py:102:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | bytes, /) -> ConverterClass`, found ``"] +Line 103: Unexpected errors ['dataclasses_transform_converter.py:103:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | list[str], /) -> int`, found `Overload[(s: str) -> int, (s: list[str]) -> int]`'] +Line 104: Unexpected errors ['dataclasses_transform_converter.py:104:30: error[invalid-assignment] Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]`', "dataclasses_transform_converter.py:104:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found ``"] +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]`', 'dataclasses_transform_converter.py:112:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`', 'dataclasses_transform_converter.py:112:23: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`', 'dataclasses_transform_converter.py:112:29: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f6"]`', 'dataclasses_transform_converter.py:112:36: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]`'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:1: error[invalid-assignment] Object of type `Literal["f1"]` is not assignable to attribute `field0` of type `int`'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:1: error[invalid-assignment] Object of type `Literal["f6"]` is not assignable to attribute `field3` of type `ConverterClass`'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:1: error[invalid-assignment] Object of type `Literal[b"f6"]` is not assignable to attribute `field3` of type `ConverterClass`'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]`', 'dataclasses_transform_converter.py:121:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`', 'dataclasses_transform_converter.py:121:23: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`', 'dataclasses_transform_converter.py:121:29: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal["f6"]`', 'dataclasses_transform_converter.py:121:35: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["1"]`', 'dataclasses_transform_converter.py:121:40: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]`'] +""" +output = """ +dataclasses_transform_converter.py:48:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Unknown, /) -> Unknown`, found `def bad_converter1() -> int` +dataclasses_transform_converter.py:49:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Unknown, /) -> Unknown`, found `def bad_converter2(*, x: int) -> int` +dataclasses_transform_converter.py:102:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | bytes, /) -> ConverterClass`, found `` +dataclasses_transform_converter.py:103:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | list[str], /) -> int`, found `Overload[(s: str) -> int, (s: list[str]) -> int]` +dataclasses_transform_converter.py:104:30: error[invalid-assignment] Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]` +dataclasses_transform_converter.py:104:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found `` +dataclasses_transform_converter.py:107:8: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` +dataclasses_transform_converter.py:107:14: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` +dataclasses_transform_converter.py:107:20: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f3"]` +dataclasses_transform_converter.py:107:27: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]` +dataclasses_transform_converter.py:108:5: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]` +dataclasses_transform_converter.py:108:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` +dataclasses_transform_converter.py:108:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` +dataclasses_transform_converter.py:108:23: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[1]` +dataclasses_transform_converter.py:108:26: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]` +dataclasses_transform_converter.py:109:5: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]` +dataclasses_transform_converter.py:109:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` +dataclasses_transform_converter.py:109:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` +dataclasses_transform_converter.py:109:23: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal["f3"]` +dataclasses_transform_converter.py:109:29: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `complex` +dataclasses_transform_converter.py:112:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]` +dataclasses_transform_converter.py:112:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` +dataclasses_transform_converter.py:112:23: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` +dataclasses_transform_converter.py:112:29: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f6"]` +dataclasses_transform_converter.py:112:36: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]` +dataclasses_transform_converter.py:114:1: error[invalid-assignment] Object of type `Literal["f1"]` is not assignable to attribute `field0` of type `int` +dataclasses_transform_converter.py:115:1: error[invalid-assignment] Object of type `Literal["f6"]` is not assignable to attribute `field3` of type `ConverterClass` +dataclasses_transform_converter.py:116:1: error[invalid-assignment] Object of type `Literal[b"f6"]` is not assignable to attribute `field3` of type `ConverterClass` +dataclasses_transform_converter.py:119:1: error[invalid-assignment] Object of type `Literal[1]` is not assignable to attribute `field3` of type `ConverterClass` +dataclasses_transform_converter.py:121:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]` +dataclasses_transform_converter.py:121:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` +dataclasses_transform_converter.py:121:23: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]` +dataclasses_transform_converter.py:121:29: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal["f6"]` +dataclasses_transform_converter.py:121:35: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["1"]` +dataclasses_transform_converter.py:121:40: error[invalid-argument-type] Argument is incorrect: Expected `dict[str, str]`, found `tuple[tuple[Literal["a"], Literal["1"]], tuple[Literal["b"], Literal["2"]]]` +dataclasses_transform_converter.py:130:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | Literal[1], /) -> int`, found `def converter_simple(s: str) -> int` +dataclasses_transform_converter.py:133:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | int, /) -> int`, found `def converter_simple(s: str) -> int` +""" diff --git a/conformance/results/ty/dataclasses_transform_field.toml b/conformance/results/ty/dataclasses_transform_field.toml new file mode 100644 index 000000000..62ef62792 --- /dev/null +++ b/conformance/results/ty/dataclasses_transform_field.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_field.py:64:16: error[unknown-argument] Argument `id` does not match any known parameter +dataclasses_transform_field.py:75:1: error[missing-argument] No argument provided for required parameter `name` +dataclasses_transform_field.py:75:16: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 1 +""" diff --git a/conformance/results/ty/dataclasses_transform_func.toml b/conformance/results/ty/dataclasses_transform_func.toml new file mode 100644 index 000000000..2355c3387 --- /dev/null +++ b/conformance/results/ty/dataclasses_transform_func.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_transform_func.py:56:1: error[invalid-assignment] Object of type `Literal[3]` is not assignable to attribute `name` of type `str` +dataclasses_transform_func.py:60:6: error[unsupported-operator] Operator `<` is not supported between two objects of type `Customer1` +dataclasses_transform_func.py:64:36: error[unknown-argument] Argument `salary` does not match any known parameter +dataclasses_transform_func.py:70:8: error[missing-argument] No arguments provided for required parameters `id`, `name` +dataclasses_transform_func.py:70:18: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 2 +dataclasses_transform_func.py:89:7: error[invalid-frozen-dataclass-subclass] Non-frozen dataclass `Customer3Subclass` cannot inherit from frozen dataclass `Customer3` +dataclasses_transform_func.py:96:1: error[invalid-assignment] Property `id` defined in `Customer3` is read-only +""" diff --git a/conformance/results/ty/dataclasses_transform_meta.toml b/conformance/results/ty/dataclasses_transform_meta.toml new file mode 100644 index 000000000..5d0269e6d --- /dev/null +++ b/conformance/results/ty/dataclasses_transform_meta.toml @@ -0,0 +1,13 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 51: Expected 1 errors +""" +output = """ +dataclasses_transform_meta.py:63:1: error[invalid-assignment] Property `id` defined in `Customer1` is read-only +dataclasses_transform_meta.py:66:8: error[missing-argument] No arguments provided for required parameters `id`, `name` +dataclasses_transform_meta.py:66:18: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 2 +dataclasses_transform_meta.py:73:6: error[unsupported-operator] Operator `<` is not supported between two objects of type `Customer1` +dataclasses_transform_meta.py:83:8: error[missing-argument] No argument provided for required parameter `id` +dataclasses_transform_meta.py:83:18: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 2 +dataclasses_transform_meta.py:103:1: error[invalid-assignment] Property `id` defined in `Customer3` is read-only +""" diff --git a/conformance/results/ty/dataclasses_usage.toml b/conformance/results/ty/dataclasses_usage.toml new file mode 100644 index 000000000..60aa85017 --- /dev/null +++ b/conformance/results/ty/dataclasses_usage.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_usage.py:50:6: error[missing-argument] No argument provided for required parameter `unit_price` +dataclasses_usage.py:51:28: error[invalid-argument-type] Argument is incorrect: Expected `int | float`, found `Literal["price"]` +dataclasses_usage.py:52:36: error[too-many-positional-arguments] Too many positional arguments: expected 3, got 4 +dataclasses_usage.py:61:5: error[dataclass-field-order] Required field `b` cannot be defined after fields with default values +dataclasses_usage.py:67:5: error[dataclass-field-order] Required field `b` cannot be defined after fields with default values +dataclasses_usage.py:73:5: error[dataclass-field-order] Required field `b` cannot be defined after fields with default values +dataclasses_usage.py:83:13: error[too-many-positional-arguments] Too many positional arguments: expected 1, got 2 +dataclasses_usage.py:88:14: error[invalid-assignment] Object of type `dataclasses.Field[str]` is not assignable to `int` +dataclasses_usage.py:127:8: error[too-many-positional-arguments] Too many positional arguments: expected 1, got 2 +dataclasses_usage.py:130:1: error[missing-argument] No argument provided for required parameter `y` of bound method `__init__` +dataclasses_usage.py:179:6: error[too-many-positional-arguments] Too many positional arguments to bound method `__init__`: expected 1, got 2 +""" diff --git a/conformance/results/ty/directives_assert_type.toml b/conformance/results/ty/directives_assert_type.toml new file mode 100644 index 000000000..75907e11e --- /dev/null +++ b/conformance/results/ty/directives_assert_type.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_assert_type.py:27:5: error[type-assertion-failure] Type `int | str` does not match asserted type `int` +directives_assert_type.py:28:5: error[type-assertion-failure] Type `int | str` does not match asserted type `Any` +directives_assert_type.py:29:5: error[type-assertion-failure] Type `Any` does not match asserted type `int` +directives_assert_type.py:30:5: error[type-assertion-failure] Type `Literal[4]` does not match asserted type `int` +directives_assert_type.py:32:5: error[missing-argument] No arguments provided for required parameters `value`, `type` of function `assert_type` +directives_assert_type.py:33:5: error[type-assertion-failure] Type `Literal[""]` does not match asserted type `int` +directives_assert_type.py:34:31: error[too-many-positional-arguments] Too many positional arguments to function `assert_type`: expected 2, got 3 +""" diff --git a/conformance/results/ty/directives_cast.toml b/conformance/results/ty/directives_cast.toml new file mode 100644 index 000000000..98dabb139 --- /dev/null +++ b/conformance/results/ty/directives_cast.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_cast.py:15:8: error[missing-argument] No arguments provided for required parameters `typ`, `val` of function `cast` +directives_cast.py:16:13: error[invalid-type-form] Int literals are not allowed in this context in a type expression +directives_cast.py:17:22: error[too-many-positional-arguments] Too many positional arguments to function `cast`: expected 2, got 3 +""" diff --git a/conformance/results/ty/directives_deprecated.toml b/conformance/results/ty/directives_deprecated.toml new file mode 100644 index 000000000..e8fdedeb4 --- /dev/null +++ b/conformance/results/ty/directives_deprecated.toml @@ -0,0 +1,18 @@ +conformance_automated = "Fail" +errors_diff = """ +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 +""" +output = """ +directives_deprecated.py:18:44: error[deprecated] The class `Ham` is deprecated: Use Spam instead +directives_deprecated.py:24:9: error[deprecated] The function `norwegian_blue` is deprecated: It is pining for the fjords +directives_deprecated.py:25:13: error[deprecated] The function `norwegian_blue` is deprecated: It is pining for the fjords +directives_deprecated.py:34:7: error[deprecated] The class `Ham` is deprecated: Use Spam instead +directives_deprecated.py:69:1: error[deprecated] The function `lorem` is deprecated: Deprecated +directives_deprecated.py:98:7: error[deprecated] The function `foo` is deprecated: Deprecated +""" diff --git a/conformance/results/ty/directives_no_type_check.toml b/conformance/results/ty/directives_no_type_check.toml new file mode 100644 index 000000000..bbaa658bc --- /dev/null +++ b/conformance/results/ty/directives_no_type_check.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_no_type_check.py:15:14: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +directives_no_type_check.py:29:7: error[invalid-argument-type] Argument to function `func1` is incorrect: Expected `int`, found `Literal[b"invalid"]` +directives_no_type_check.py:29:19: error[invalid-argument-type] Argument to function `func1` is incorrect: Expected `str`, found `Literal[b"arguments"]` +directives_no_type_check.py:32:1: error[missing-argument] No arguments provided for required parameters `a`, `b` of function `func1` +""" diff --git a/conformance/results/ty/directives_reveal_type.toml b/conformance/results/ty/directives_reveal_type.toml new file mode 100644 index 000000000..aa525cb4c --- /dev/null +++ b/conformance/results/ty/directives_reveal_type.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_reveal_type.py:14:17: info[revealed-type] Revealed type: `int | str` +directives_reveal_type.py:15:17: info[revealed-type] Revealed type: `list[int]` +directives_reveal_type.py:16:17: info[revealed-type] Revealed type: `Any` +directives_reveal_type.py:17:17: info[revealed-type] Revealed type: `ForwardReference` +directives_reveal_type.py:19:5: error[missing-argument] No argument provided for required parameter `obj` of function `reveal_type` +directives_reveal_type.py:20:20: error[too-many-positional-arguments] Too many positional arguments to function `reveal_type`: expected 1, got 2 +""" diff --git a/conformance/results/ty/directives_type_checking.toml b/conformance/results/ty/directives_type_checking.toml new file mode 100644 index 000000000..1192ebf6f --- /dev/null +++ b/conformance/results/ty/directives_type_checking.toml @@ -0,0 +1,7 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 11: Unexpected errors ['directives_type_checking.py:11:14: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] +""" +output = """ +directives_type_checking.py:11:14: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +""" diff --git a/conformance/results/ty/directives_type_ignore.toml b/conformance/results/ty/directives_type_ignore.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/ty/directives_type_ignore.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/ty/directives_type_ignore_file1.toml b/conformance/results/ty/directives_type_ignore_file1.toml new file mode 100644 index 000000000..4c7c7e858 --- /dev/null +++ b/conformance/results/ty/directives_type_ignore_file1.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_type_ignore_file1.py:11:7: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive +directives_type_ignore_file1.py:14:17: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive +""" diff --git a/conformance/results/ty/directives_type_ignore_file2.toml b/conformance/results/ty/directives_type_ignore_file2.toml new file mode 100644 index 000000000..76fb1fde2 --- /dev/null +++ b/conformance/results/ty/directives_type_ignore_file2.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_type_ignore_file2.py:7:1: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive +directives_type_ignore_file2.py:9:7: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive +directives_type_ignore_file2.py:12:17: warning[unused-type-ignore-comment] Unused blanket `type: ignore` directive +directives_type_ignore_file2.py:14:10: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +""" diff --git a/conformance/results/ty/directives_version_platform.toml b/conformance/results/ty/directives_version_platform.toml new file mode 100644 index 000000000..d1f6e414e --- /dev/null +++ b/conformance/results/ty/directives_version_platform.toml @@ -0,0 +1,17 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 14: Unexpected errors ['directives_version_platform.py:14:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] +Line 22: Unexpected errors ['directives_version_platform.py:22:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] +Line 31: Unexpected errors ['directives_version_platform.py:31:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] +Line 36: Unexpected errors ['directives_version_platform.py:36:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] +""" +output = """ +directives_version_platform.py:14:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +directives_version_platform.py:19:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +directives_version_platform.py:22:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +directives_version_platform.py:27:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +directives_version_platform.py:31:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +directives_version_platform.py:36:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +directives_version_platform.py:40:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +directives_version_platform.py:45:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +""" diff --git a/conformance/results/ty/enums_behaviors.toml b/conformance/results/ty/enums_behaviors.toml new file mode 100644 index 000000000..2a9f002be --- /dev/null +++ b/conformance/results/ty/enums_behaviors.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_behaviors.py:28:1: error[type-assertion-failure] Type `Color` does not match asserted type `Literal[Color.RED]` +enums_behaviors.py:32:1: error[type-assertion-failure] Type `Color` does not match asserted type `Literal[Color.BLUE]` +enums_behaviors.py:44:21: error[subclass-of-final-class] Class `ExtendedShape` cannot inherit from final class `Shape` +""" diff --git a/conformance/results/ty/enums_definition.toml b/conformance/results/ty/enums_definition.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/ty/enums_definition.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/ty/enums_expansion.toml b/conformance/results/ty/enums_expansion.toml new file mode 100644 index 000000000..585d7b19a --- /dev/null +++ b/conformance/results/ty/enums_expansion.toml @@ -0,0 +1,8 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 53: Expected 1 errors +Line 52: Unexpected errors ['enums_expansion.py:52:9: error[type-assertion-failure] Type `Literal[CustomFlags.FLAG3]` does not match asserted type `CustomFlags`'] +""" +output = """ +enums_expansion.py:52:9: error[type-assertion-failure] Type `Literal[CustomFlags.FLAG3]` does not match asserted type `CustomFlags` +""" diff --git a/conformance/results/ty/enums_member_names.toml b/conformance/results/ty/enums_member_names.toml new file mode 100644 index 000000000..8b41fdfc0 --- /dev/null +++ b/conformance/results/ty/enums_member_names.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_member_names.py:30:5: error[type-assertion-failure] Type `Any` does not match asserted type `Literal["RED", "BLUE", "GREEN"]` +""" diff --git a/conformance/results/ty/enums_member_values.toml b/conformance/results/ty/enums_member_values.toml new file mode 100644 index 000000000..1af6cc6e4 --- /dev/null +++ b/conformance/results/ty/enums_member_values.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_member_values.py:30:5: error[type-assertion-failure] Type `Any` does not match asserted type `Literal[1, 2, 3]` +enums_member_values.py:50:5: error[invalid-assignment] Enum member `MARS` is incompatible with `__init__` +enums_member_values.py:51:5: error[invalid-assignment] Enum member `JUPITER` is incompatible with `__init__` +enums_member_values.py:54:1: error[type-assertion-failure] Type `Any` does not match asserted type `Literal[1]` +enums_member_values.py:78:5: error[invalid-assignment] Enum member `GREEN` value is not assignable to expected type +enums_member_values.py:85:9: error[invalid-assignment] Object of type `int` is not assignable to attribute `_value_` of type `str` +""" diff --git a/conformance/results/ty/enums_members.toml b/conformance/results/ty/enums_members.toml new file mode 100644 index 000000000..bcbc5875b --- /dev/null +++ b/conformance/results/ty/enums_members.toml @@ -0,0 +1,17 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 50: Expected 1 errors +""" +output = """ +enums_members.py:82:20: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +enums_members.py:83:20: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +enums_members.py:84:18: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +enums_members.py:85:16: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +enums_members.py:116:1: error[type-assertion-failure] Type `int` does not match asserted type `Unknown` +enums_members.py:116:32: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +enums_members.py:128:21: info[revealed-type] Revealed type: `Unknown | Literal[2]` +enums_members.py:129:9: error[type-assertion-failure] Type `Unknown | Literal[2]` does not match asserted type `Unknown` +enums_members.py:129:43: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +enums_members.py:146:1: error[type-assertion-failure] Type `Unknown | Literal[2]` does not match asserted type `int` +enums_members.py:147:1: error[type-assertion-failure] Type `Unknown | Literal[3]` does not match asserted type `int` +""" diff --git a/conformance/results/ty/exceptions_context_managers.toml b/conformance/results/ty/exceptions_context_managers.toml new file mode 100644 index 000000000..4f4d312e0 --- /dev/null +++ b/conformance/results/ty/exceptions_context_managers.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 50: Unexpected errors ['exceptions_context_managers.py:50:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str`'] +Line 57: Unexpected errors ['exceptions_context_managers.py:57:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str`'] +""" +output = """ +exceptions_context_managers.py:50:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str` +exceptions_context_managers.py:57:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str` +""" diff --git a/conformance/results/ty/generics_base_class.toml b/conformance/results/ty/generics_base_class.toml new file mode 100644 index 000000000..ef05867ba --- /dev/null +++ b/conformance/results/ty/generics_base_class.toml @@ -0,0 +1,12 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 98: Expected 1 errors +""" +output = """ +generics_base_class.py:26:26: error[invalid-argument-type] Argument to function `takes_dict_incorrect` is incorrect: Expected `dict[str, list[object]]`, found `SymbolTable` +generics_base_class.py:29:14: error[invalid-type-form] `typing.Generic` is not allowed in type expressions +generics_base_class.py:30:8: error[invalid-type-form] `typing.Generic` is not allowed in type expressions +generics_base_class.py:49:38: error[invalid-type-arguments] Too many type arguments to class `LinkedList`: expected 1, got 2 +generics_base_class.py:61:30: error[invalid-type-arguments] Too many type arguments to class `MyDict`: expected 1, got 2 +generics_base_class.py:68:17: error[invalid-generic-class] Type parameter `T` cannot appear multiple times in `Generic` subscription +""" diff --git a/conformance/results/ty/generics_basic.toml b/conformance/results/ty/generics_basic.toml new file mode 100644 index 000000000..58ef3281c --- /dev/null +++ b/conformance/results/ty/generics_basic.toml @@ -0,0 +1,18 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 69: Expected 1 errors +Line 208: Expected 1 errors +""" +output = """ +generics_basic.py:49:44: error[invalid-legacy-type-variable] A `TypeVar` cannot have exactly one constraint +generics_basic.py:55:53: error[invalid-type-variable-constraints] TypeVar constraint cannot be generic +generics_basic.py:121:13: error[invalid-generic-class] Type parameter `T` cannot appear multiple times in `Generic` subscription +generics_basic.py:157:5: error[invalid-argument-type] Method `__getitem__` of type `bound method MyMap1[str, int].__getitem__(key: str, /) -> int` cannot be called with key of type `Literal[0]` on object of type `MyMap1[str, int]` +generics_basic.py:158:5: error[invalid-argument-type] Method `__getitem__` of type `bound method MyMap2[int, str].__getitem__(key: str, /) -> int` cannot be called with key of type `Literal[0]` on object of type `MyMap2[int, str]` +generics_basic.py:162:12: error[invalid-argument-type] `` is not a valid argument to `Generic` +generics_basic.py:163:12: error[invalid-argument-type] `` is not a valid argument to `Protocol` +generics_basic.py:171:1: error[invalid-generic-class] `Generic` base class must include all type variables used in other base classes +generics_basic.py:172:1: error[invalid-generic-class] `Generic` base class must include all type variables used in other base classes +""" diff --git a/conformance/results/ty/generics_defaults.toml b/conformance/results/ty/generics_defaults.toml new file mode 100644 index 000000000..9e18d905d --- /dev/null +++ b/conformance/results/ty/generics_defaults.toml @@ -0,0 +1,21 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 143: Expected 1 errors +Line 45: Unexpected errors ["generics_defaults.py:45:1: error[type-assertion-failure] Type `` does not match asserted type `type[AllTheDefaults[Any, Any, str, int, bool]]`"] +Line 94: Unexpected errors ["generics_defaults.py:94:1: error[type-assertion-failure] Type `` does not match asserted type `@Todo`"] +Line 95: Unexpected errors ['generics_defaults.py:95:1: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo`'] +Line 156: Unexpected errors ['generics_defaults.py:156:49: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[int | float, bool]`?'] +Line 157: Unexpected errors ['generics_defaults.py:157:58: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`?'] +""" +output = """ +generics_defaults.py:24:40: error[invalid-generic-class] Type parameter `T` without a default cannot follow earlier parameter `DefaultStrT` with a default +generics_defaults.py:45:1: error[type-assertion-failure] Type `` does not match asserted type `type[AllTheDefaults[Any, Any, str, int, bool]]` +generics_defaults.py:50:1: error[invalid-type-arguments] No type argument provided for required type variable `T2` of class `AllTheDefaults` +generics_defaults.py:94:1: error[type-assertion-failure] Type `` does not match asserted type `@Todo` +generics_defaults.py:95:1: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo` +generics_defaults.py:107:51: error[invalid-type-variable-default] TypeVar default is not assignable to the TypeVar's upper bound +generics_defaults.py:114:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: `int` is not one of the constraints of `Invalid2` +generics_defaults.py:132:1: error[type-assertion-failure] Type `int` does not match asserted type `Any` +generics_defaults.py:156:49: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[int | float, bool]`? +generics_defaults.py:157:58: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`? +""" diff --git a/conformance/results/ty/generics_defaults_referential.toml b/conformance/results/ty/generics_defaults_referential.toml new file mode 100644 index 000000000..0334c08a3 --- /dev/null +++ b/conformance/results/ty/generics_defaults_referential.toml @@ -0,0 +1,14 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 53: Expected 1 errors +Line 60: Expected 1 errors +Line 94: Unexpected errors ["generics_defaults_referential.py:94:1: error[type-assertion-failure] Type `` does not match asserted type `type[Bar[Any, list[Any]]]`"] +""" +output = """ +generics_defaults_referential.py:36:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Literal[""]` +generics_defaults_referential.py:37:10: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Literal[""]` +generics_defaults_referential.py:68:40: error[invalid-type-variable-default] Default `X1` of TypeVar `Invalid1` is not assignable to upper bound `str` of `Invalid1` because its upper bound `int` is not assignable to `str` +generics_defaults_referential.py:74:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: Bounded TypeVar cannot be used as the default for a constrained TypeVar +generics_defaults_referential.py:78:63: error[invalid-type-variable-default] Default `Y2` of TypeVar `AlsoInvalid2` is inconsistent with its constraints `AlsoInvalid2` because constraint `int` of `Y2` is not one of the constraints of `AlsoInvalid2` +generics_defaults_referential.py:94:1: error[type-assertion-failure] Type `` does not match asserted type `type[Bar[Any, list[Any]]]` +""" diff --git a/conformance/results/ty/generics_defaults_specialization.toml b/conformance/results/ty/generics_defaults_specialization.toml new file mode 100644 index 000000000..764c8cad7 --- /dev/null +++ b/conformance/results/ty/generics_defaults_specialization.toml @@ -0,0 +1,7 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 55: Expected 1 errors +""" +output = """ +generics_defaults_specialization.py:30:15: error[invalid-type-arguments] Too many type arguments: expected between 0 and 1, got 2 +""" diff --git a/conformance/results/ty/generics_paramspec_basic.toml b/conformance/results/ty/generics_paramspec_basic.toml new file mode 100644 index 000000000..678668fbf --- /dev/null +++ b/conformance/results/ty/generics_paramspec_basic.toml @@ -0,0 +1,12 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 23: Expected 1 errors +Line 27: Expected 1 errors +Line 31: Expected 1 errors +Line 35: Expected 1 errors +Line 39: Expected 1 errors +""" +output = """ +generics_paramspec_basic.py:10:1: error[invalid-paramspec] The name of a `ParamSpec` (`NotIt`) must match the name of the variable it is assigned to (`WrongName`) +""" diff --git a/conformance/results/ty/generics_paramspec_components.toml b/conformance/results/ty/generics_paramspec_components.toml new file mode 100644 index 000000000..b08366026 --- /dev/null +++ b/conformance/results/ty/generics_paramspec_components.toml @@ -0,0 +1,25 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 20: Expected 1 errors +Line 26: Expected 1 errors +Line 30: Expected 1 errors +Line 35: Expected 1 errors +Line 36: Expected 1 errors +Line 38: Expected 1 errors +Line 41: Expected 1 errors +Line 60: Expected 1 errors +Line 70: Expected 1 errors +Line 72: Expected 1 errors +""" +output = """ +generics_paramspec_components.py:17:25: error[invalid-type-form] `P.kwargs` is valid only in `**kwargs` annotation: Did you mean `P.args`? +generics_paramspec_components.py:17:45: error[invalid-type-form] `P.args` is valid only in `*args` annotation: Did you mean `P.kwargs`? +generics_paramspec_components.py:23:46: error[invalid-type-form] `P.args` is valid only in `*args` annotation: Did you mean `P.kwargs`? +generics_paramspec_components.py:49:11: error[invalid-argument-type] Argument is incorrect: Expected `P@decorator.args`, found `P@decorator.kwargs` +generics_paramspec_components.py:49:20: error[invalid-argument-type] Argument is incorrect: Expected `P@decorator.kwargs`, found `P@decorator.args` +generics_paramspec_components.py:51:11: error[invalid-argument-type] Argument is incorrect: Expected `P@decorator.args`, found `Literal[1]` +generics_paramspec_components.py:83:18: error[invalid-argument-type] Argument to function `foo` is incorrect: Expected `int`, found `(...)` +generics_paramspec_components.py:83:18: error[parameter-already-assigned] Multiple values provided for parameter 1 (`x`) of function `foo` +generics_paramspec_components.py:98:20: error[invalid-argument-type] Argument to function `twice` is incorrect: Expected `int`, found `Literal["A"]` +generics_paramspec_components.py:98:25: error[invalid-argument-type] Argument to function `twice` is incorrect: Expected `str`, found `Literal[1]` +""" diff --git a/conformance/results/ty/generics_paramspec_semantics.toml b/conformance/results/ty/generics_paramspec_semantics.toml new file mode 100644 index 000000000..141601712 --- /dev/null +++ b/conformance/results/ty/generics_paramspec_semantics.toml @@ -0,0 +1,20 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 98: Expected 1 errors +Line 120: Expected 1 errors +Line 127: Expected 1 errors +Line 132: Expected 1 errors +Line 137: Expected 1 errors +Line 106: Unexpected errors ['generics_paramspec_semantics.py:106:13: error[missing-argument] No argument provided for required parameter `**kwargs`'] +Line 107: Unexpected errors ['generics_paramspec_semantics.py:107:13: error[missing-argument] No arguments provided for required parameters `*args`, `**kwargs`'] +""" +output = """ +generics_paramspec_semantics.py:26:4: error[positional-only-parameter-as-kwarg] Positional-only parameter 1 (`a`) passed as keyword argument +generics_paramspec_semantics.py:26:11: error[positional-only-parameter-as-kwarg] Positional-only parameter 2 (`b`) passed as keyword argument +generics_paramspec_semantics.py:27:9: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `Literal["A"]` +generics_paramspec_semantics.py:46:17: error[invalid-argument-type] Argument to function `func1` is incorrect: Expected `(x: int, y: str) -> int`, found `def y_x(y: int, x: str) -> int` +generics_paramspec_semantics.py:61:23: error[invalid-argument-type] Argument to function `func1` is incorrect: Expected `(*, x: int) -> int`, found `def keyword_only_y(*, y: int) -> int` +generics_paramspec_semantics.py:106:13: error[missing-argument] No argument provided for required parameter `**kwargs` +generics_paramspec_semantics.py:107:13: error[missing-argument] No arguments provided for required parameters `*args`, `**kwargs` +generics_paramspec_semantics.py:108:1: error[missing-argument] No argument provided for required parameter `**kwargs` +""" diff --git a/conformance/results/ty/generics_paramspec_specialization.toml b/conformance/results/ty/generics_paramspec_specialization.toml new file mode 100644 index 000000000..b95502032 --- /dev/null +++ b/conformance/results/ty/generics_paramspec_specialization.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_paramspec_specialization.py:44:27: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` +generics_paramspec_specialization.py:54:9: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[""]` +generics_paramspec_specialization.py:55:16: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `Literal[""]` +generics_paramspec_specialization.py:60:9: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[""]` +generics_paramspec_specialization.py:61:16: error[invalid-argument-type] Argument is incorrect: Expected `bool`, found `Literal[""]` +""" diff --git a/conformance/results/ty/generics_scoping.toml b/conformance/results/ty/generics_scoping.toml new file mode 100644 index 000000000..2762f716e --- /dev/null +++ b/conformance/results/ty/generics_scoping.toml @@ -0,0 +1,20 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 61: Expected 1 errors +Line 65: Expected 1 errors +Line 89: Expected 1 errors +Line 98: Expected 1 errors +Line 105: Expected 1 errors +Line 106: Expected 1 errors +Line 107: Expected 1 errors +""" +output = """ +generics_scoping.py:15:1: error[type-assertion-failure] Type `Literal[1]` does not match asserted type `int` +generics_scoping.py:19:1: error[type-assertion-failure] Type `Literal["a"]` does not match asserted type `str` +generics_scoping.py:34:10: error[invalid-argument-type] Argument to bound method `meth_2` is incorrect: Expected `int`, found `Literal["a"]` +generics_scoping.py:49:1: error[type-assertion-failure] Type `Literal["abc"]` does not match asserted type `str` +generics_scoping.py:53:1: error[type-assertion-failure] Type `Literal[b"abc"]` does not match asserted type `bytes` +generics_scoping.py:76:11: error[invalid-generic-class] Generic class `MyGeneric` must not reference type variables bound in an enclosing scope: `T` referenced in class definition here +generics_scoping.py:76:11: error[invalid-generic-class] Generic class `MyGeneric` must not reference type variables bound in an enclosing scope: `T` referenced in class definition here +generics_scoping.py:86:11: error[invalid-generic-class] Generic class `Bad` must not reference type variables bound in an enclosing scope: `T` referenced in class definition here +""" diff --git a/conformance/results/ty/generics_self_advanced.toml b/conformance/results/ty/generics_self_advanced.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/ty/generics_self_advanced.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/ty/generics_self_attributes.toml b/conformance/results/ty/generics_self_attributes.toml new file mode 100644 index 000000000..cca34273e --- /dev/null +++ b/conformance/results/ty/generics_self_attributes.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_attributes.py:26:33: error[invalid-argument-type] Argument is incorrect: Expected `OrdinalLinkedList | None`, found `LinkedList[int]` +generics_self_attributes.py:32:5: error[invalid-assignment] Object of type `LinkedList[int]` is not assignable to attribute `next` of type `OrdinalLinkedList | None` +""" diff --git a/conformance/results/ty/generics_self_basic.toml b/conformance/results/ty/generics_self_basic.toml new file mode 100644 index 000000000..7e56f458c --- /dev/null +++ b/conformance/results/ty/generics_self_basic.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_basic.py:20:16: error[invalid-return-type] Return type does not match returned value: expected `Self@method2`, found `Shape` +generics_self_basic.py:33:16: error[invalid-return-type] Return type does not match returned value: expected `Self@cls_method2`, found `Shape` +generics_self_basic.py:68:26: error[invalid-type-form] Special form `typing.Self` expected no type parameter +""" diff --git a/conformance/results/ty/generics_self_protocols.toml b/conformance/results/ty/generics_self_protocols.toml new file mode 100644 index 000000000..5d9cc9a00 --- /dev/null +++ b/conformance/results/ty/generics_self_protocols.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_self_protocols.py:61:19: error[invalid-argument-type] Argument to function `accepts_shape` is incorrect: Expected `ShapeProtocol`, found `BadReturnType` +generics_self_protocols.py:64:19: error[invalid-argument-type] Argument to function `accepts_shape` is incorrect: Expected `ShapeProtocol`, found `ReturnDifferentClass` +""" diff --git a/conformance/results/ty/generics_self_usage.toml b/conformance/results/ty/generics_self_usage.toml new file mode 100644 index 000000000..7dcb83dbe --- /dev/null +++ b/conformance/results/ty/generics_self_usage.toml @@ -0,0 +1,17 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 82: Expected 1 errors +Line 113: Expected 1 errors +Line 118: Expected 1 errors +Line 123: Expected 1 errors +Line 127: Expected 1 errors +""" +output = """ +generics_self_usage.py:73:14: error[invalid-type-form] Variable of type `` is not allowed in a type expression +generics_self_usage.py:73:23: error[invalid-type-form] Variable of type `` is not allowed in a type expression +generics_self_usage.py:76:6: error[invalid-type-form] Variable of type `` is not allowed in a type expression +generics_self_usage.py:87:16: error[invalid-return-type] Return type does not match returned value: expected `Self@return_concrete_type`, found `Foo3` +generics_self_usage.py:103:15: error[invalid-type-form] Variable of type `` is not allowed in a type expression +generics_self_usage.py:105:12: error[invalid-base] Invalid class base with type `` +generics_self_usage.py:108:30: error[invalid-type-form] Variable of type `` is not allowed in a type expression +""" diff --git a/conformance/results/ty/generics_syntax_compatibility.toml b/conformance/results/ty/generics_syntax_compatibility.toml new file mode 100644 index 000000000..c2a2f515c --- /dev/null +++ b/conformance/results/ty/generics_syntax_compatibility.toml @@ -0,0 +1,7 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 14: Expected 1 errors +Line 26: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/generics_syntax_declarations.toml b/conformance/results/ty/generics_syntax_declarations.toml new file mode 100644 index 000000000..aa91df3bd --- /dev/null +++ b/conformance/results/ty/generics_syntax_declarations.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_syntax_declarations.py:17:1: error[invalid-generic-class] Cannot both inherit from `typing.Generic` and use PEP 695 type variables +generics_syntax_declarations.py:25:20: error[invalid-generic-class] Cannot both inherit from subscripted `Protocol` and use PEP 695 type variables +generics_syntax_declarations.py:32:9: error[unresolved-attribute] Object of type `T@ClassD` has no attribute `is_integer` +generics_syntax_declarations.py:44:21: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic +generics_syntax_declarations.py:48:17: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[str, int]`? +generics_syntax_declarations.py:60:17: error[invalid-type-variable-constraints] TypeVar must have at least two constrained types +generics_syntax_declarations.py:64:17: error[invalid-type-variable-constraints] TypeVar must have at least two constrained types +generics_syntax_declarations.py:71:17: error[invalid-type-form] Variable of type `tuple[, ]` is not allowed in a type expression +generics_syntax_declarations.py:75:18: error[invalid-type-form] Int literals are not allowed in this context in a type expression +generics_syntax_declarations.py:79:23: error[unresolved-reference] Name `S` used when not defined +""" diff --git a/conformance/results/ty/generics_syntax_infer_variance.toml b/conformance/results/ty/generics_syntax_infer_variance.toml new file mode 100644 index 000000000..40c81d14a --- /dev/null +++ b/conformance/results/ty/generics_syntax_infer_variance.toml @@ -0,0 +1,37 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 15: Expected 1 errors +Line 17: Expected 1 errors +Line 28: Unexpected errors ['generics_syntax_infer_variance.py:28:37: error[invalid-assignment] Object of type `ShouldBeCovariant1[int]` is not assignable to `ShouldBeCovariant1[int | float]`'] +Line 46: Unexpected errors ['generics_syntax_infer_variance.py:46:37: error[invalid-assignment] Object of type `ShouldBeCovariant2[int]` is not assignable to `ShouldBeCovariant2[int | float]`'] +Line 55: Unexpected errors ['generics_syntax_infer_variance.py:55:37: error[invalid-assignment] Object of type `ShouldBeCovariant3[int]` is not assignable to `ShouldBeCovariant3[int | float]`'] +Line 84: Unexpected errors ['generics_syntax_infer_variance.py:84:36: error[invalid-assignment] Object of type `ShouldBeCovariant5[int]` is not assignable to `ShouldBeCovariant5[int | float]`'] +Line 92: Unexpected errors ['generics_syntax_infer_variance.py:92:9: error[invalid-assignment] Cannot assign to final attribute `x` on type `Self@__init__`'] +Line 95: Unexpected errors ['generics_syntax_infer_variance.py:95:36: error[invalid-assignment] Object of type `ShouldBeCovariant6[int]` is not assignable to `ShouldBeCovariant6[int | float]`'] +Line 166: Unexpected errors ['generics_syntax_infer_variance.py:166:43: error[invalid-assignment] Object of type `ShouldBeContravariant1[int | float]` is not assignable to `ShouldBeContravariant1[int]`'] +""" +output = """ +generics_syntax_infer_variance.py:28:37: error[invalid-assignment] Object of type `ShouldBeCovariant1[int]` is not assignable to `ShouldBeCovariant1[int | float]` +generics_syntax_infer_variance.py:29:35: error[invalid-assignment] Object of type `ShouldBeCovariant1[int | float]` is not assignable to `ShouldBeCovariant1[int]` +generics_syntax_infer_variance.py:46:37: error[invalid-assignment] Object of type `ShouldBeCovariant2[int]` is not assignable to `ShouldBeCovariant2[int | float]` +generics_syntax_infer_variance.py:47:35: error[invalid-assignment] Object of type `ShouldBeCovariant2[int | float]` is not assignable to `ShouldBeCovariant2[int]` +generics_syntax_infer_variance.py:55:37: error[invalid-assignment] Object of type `ShouldBeCovariant3[int]` is not assignable to `ShouldBeCovariant3[int | float]` +generics_syntax_infer_variance.py:56:35: error[invalid-assignment] Object of type `ShouldBeCovariant3[int | float]` is not assignable to `ShouldBeCovariant3[int]` +generics_syntax_infer_variance.py:84:36: error[invalid-assignment] Object of type `ShouldBeCovariant5[int]` is not assignable to `ShouldBeCovariant5[int | float]` +generics_syntax_infer_variance.py:85:34: error[invalid-assignment] Object of type `ShouldBeCovariant5[int | float]` is not assignable to `ShouldBeCovariant5[int]` +generics_syntax_infer_variance.py:92:9: error[invalid-assignment] Cannot assign to final attribute `x` on type `Self@__init__` +generics_syntax_infer_variance.py:95:36: error[invalid-assignment] Object of type `ShouldBeCovariant6[int]` is not assignable to `ShouldBeCovariant6[int | float]` +generics_syntax_infer_variance.py:96:34: error[invalid-assignment] Object of type `ShouldBeCovariant6[int | float]` is not assignable to `ShouldBeCovariant6[int]` +generics_syntax_infer_variance.py:112:38: error[invalid-assignment] Object of type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[int | float]` +generics_syntax_infer_variance.py:113:36: error[invalid-assignment] Object of type `ShouldBeInvariant1[int | float]` is not assignable to `ShouldBeInvariant1[int]` +generics_syntax_infer_variance.py:127:38: error[invalid-assignment] Object of type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[int | float]` +generics_syntax_infer_variance.py:128:36: error[invalid-assignment] Object of type `ShouldBeInvariant2[int | float]` is not assignable to `ShouldBeInvariant2[int]` +generics_syntax_infer_variance.py:135:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[int | float, str]` +generics_syntax_infer_variance.py:136:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[int | float, str]` is not assignable to `ShouldBeInvariant3[int, str]` +generics_syntax_infer_variance.py:137:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, int | float]` +generics_syntax_infer_variance.py:138:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int | float]` is not assignable to `ShouldBeInvariant3[str, int]` +generics_syntax_infer_variance.py:146:38: error[invalid-assignment] Object of type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[int | float]` +generics_syntax_infer_variance.py:154:38: error[invalid-assignment] Object of type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[int | float]` +generics_syntax_infer_variance.py:165:45: error[invalid-assignment] Object of type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[int | float]` +generics_syntax_infer_variance.py:166:43: error[invalid-assignment] Object of type `ShouldBeContravariant1[int | float]` is not assignable to `ShouldBeContravariant1[int]` +""" diff --git a/conformance/results/ty/generics_syntax_scoping.toml b/conformance/results/ty/generics_syntax_scoping.toml new file mode 100644 index 000000000..11e34439c --- /dev/null +++ b/conformance/results/ty/generics_syntax_scoping.toml @@ -0,0 +1,12 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 92: Expected 1 errors +Line 95: Expected 1 errors +Line 98: Expected 1 errors +""" +output = """ +generics_syntax_scoping.py:14:20: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic +generics_syntax_scoping.py:18:17: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic +generics_syntax_scoping.py:35:7: error[unresolved-reference] Name `T` used when not defined +generics_syntax_scoping.py:44:17: error[unresolved-reference] Name `T` used when not defined +""" diff --git a/conformance/results/ty/generics_type_erasure.toml b/conformance/results/ty/generics_type_erasure.toml new file mode 100644 index 000000000..5e252648e --- /dev/null +++ b/conformance/results/ty/generics_type_erasure.toml @@ -0,0 +1,12 @@ +conformance_automated = "Fail" +errors_diff = """ +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 +""" +output = """ +generics_type_erasure.py:38:16: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int | None`, found `Literal[""]` +generics_type_erasure.py:40:16: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `str | None`, found `Literal[0]` +""" diff --git a/conformance/results/ty/generics_typevartuple_args.toml b/conformance/results/ty/generics_typevartuple_args.toml new file mode 100644 index 000000000..44146c044 --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_args.toml @@ -0,0 +1,20 @@ +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 20: Unexpected errors ['generics_typevartuple_args.py:20:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]`'] +Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[()]`'] +Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]`'] +""" +output = """ +generics_typevartuple_args.py:20:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]` +generics_typevartuple_args.py:31:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[()]` +generics_typevartuple_args.py:32:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]` +""" diff --git a/conformance/results/ty/generics_typevartuple_basic.toml b/conformance/results/ty/generics_typevartuple_basic.toml new file mode 100644 index 000000000..aacbef1c4 --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_basic.toml @@ -0,0 +1,22 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 43: Expected 1 errors +Line 53: Expected 1 errors +Line 56: Expected 1 errors +Line 59: Expected 1 errors +Line 89: Expected 1 errors +Line 90: Expected 1 errors +Line 99: Expected 1 errors +Line 100: Expected 1 errors +Line 106: Expected 1 errors +Lines 44, 45: Expected error (tag 'v6') +Line 84: Unexpected errors ['generics_typevartuple_basic.py:84:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int]`'] +""" +output = """ +generics_typevartuple_basic.py:42:34: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `tuple[@Todo(TypeVarTuple), ...]`, found `Height` +generics_typevartuple_basic.py:52:14: error[invalid-generic-class] `TypeVarTuple` must be unpacked with `*` or `Unpack[]` when used as an argument to `Generic` +generics_typevartuple_basic.py:65:27: error[unknown-argument] Argument `covariant` does not match any known parameter of function `__new__` +generics_typevartuple_basic.py:66:27: error[too-many-positional-arguments] Too many positional arguments to function `__new__`: expected 2, got 4 +generics_typevartuple_basic.py:67:27: error[unknown-argument] Argument `bound` does not match any known parameter of function `__new__` +generics_typevartuple_basic.py:84:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int]` +""" diff --git a/conformance/results/ty/generics_typevartuple_callable.toml b/conformance/results/ty/generics_typevartuple_callable.toml new file mode 100644 index 000000000..5cad16119 --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_callable.toml @@ -0,0 +1,12 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 26: Expected 1 errors +Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int, int | float | complex]`'] +Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str]`'] +Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float, str, int | float | complex]`'] +""" +output = """ +generics_typevartuple_callable.py:41:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int, int | float | complex]` +generics_typevartuple_callable.py:42:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str]` +generics_typevartuple_callable.py:49:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float, str, int | float | complex]` +""" diff --git a/conformance/results/ty/generics_typevartuple_concat.toml b/conformance/results/ty/generics_typevartuple_concat.toml new file mode 100644 index 000000000..64048f4a0 --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_concat.toml @@ -0,0 +1,7 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 52: Unexpected errors ['generics_typevartuple_concat.py:52:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, bool, str]`'] +""" +output = """ +generics_typevartuple_concat.py:52:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, bool, str]` +""" diff --git a/conformance/results/ty/generics_typevartuple_overloads.toml b/conformance/results/ty/generics_typevartuple_overloads.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_overloads.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/ty/generics_typevartuple_specialization.toml b/conformance/results/ty/generics_typevartuple_specialization.toml new file mode 100644 index 000000000..0e5d1621c --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_specialization.toml @@ -0,0 +1,43 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 109: Expected 1 errors +Line 110: Expected 1 errors +Line 127: Expected 1 errors +Line 163: Expected 1 errors +Line 45: Unexpected errors ["generics_typevartuple_specialization.py:45:40: error[not-subscriptable] Cannot subscript non-generic type ``"] +Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, int | float, bool]`'] +Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `tuple[str, @Todo]`'] +Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int]`'] +Line 52: Unexpected errors ['generics_typevartuple_specialization.py:52:37: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression: Did you mean `tuple[()]`?'] +Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]`'] +Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float]`'] +Line 95: Unexpected errors ['generics_typevartuple_specialization.py:95:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[Any, *tuple[Any, ...]]`'] +Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[()], str, bool]`'] +Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[str], bool, int | float]`'] +Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[str, bool], int | float, int]`'] +Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown, Unknown]` does not match asserted type `tuple[tuple[()], str, bool, int | float]`'] +Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown, Unknown]` does not match asserted type `tuple[tuple[bool], str, int | float, int]`'] +Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], int]`'] +Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], str]`'] +Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], str]`'] +""" +output = """ +generics_typevartuple_specialization.py:45:40: error[not-subscriptable] Cannot subscript non-generic type `` +generics_typevartuple_specialization.py:46:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, int | float, bool]` +generics_typevartuple_specialization.py:47:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `tuple[str, @Todo]` +generics_typevartuple_specialization.py:51:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int]` +generics_typevartuple_specialization.py:52:37: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression: Did you mean `tuple[()]`? +generics_typevartuple_specialization.py:93:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]` +generics_typevartuple_specialization.py:94:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float]` +generics_typevartuple_specialization.py:95:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[Any, *tuple[Any, ...]]` +generics_typevartuple_specialization.py:121:7: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization +generics_typevartuple_specialization.py:122:7: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization +generics_typevartuple_specialization.py:135:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[()], str, bool]` +generics_typevartuple_specialization.py:136:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[str], bool, int | float]` +generics_typevartuple_specialization.py:137:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown]` does not match asserted type `tuple[tuple[str, bool], int | float, int]` +generics_typevartuple_specialization.py:148:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown, Unknown]` does not match asserted type `tuple[tuple[()], str, bool, int | float]` +generics_typevartuple_specialization.py:149:5: error[type-assertion-failure] Type `tuple[tuple[@Todo(TypeVarTuple), ...], Unknown, Unknown, Unknown]` does not match asserted type `tuple[tuple[bool], str, int | float, int]` +generics_typevartuple_specialization.py:157:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], int]` +generics_typevartuple_specialization.py:158:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], str]` +generics_typevartuple_specialization.py:159:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[*tuple[int, ...], str]` +""" diff --git a/conformance/results/ty/generics_typevartuple_unpack.toml b/conformance/results/ty/generics_typevartuple_unpack.toml new file mode 100644 index 000000000..0ad3bee37 --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_unpack.toml @@ -0,0 +1,6 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 30: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/generics_upper_bound.toml b/conformance/results/ty/generics_upper_bound.toml new file mode 100644 index 000000000..ad098019b --- /dev/null +++ b/conformance/results/ty/generics_upper_bound.toml @@ -0,0 +1,14 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 37: Unexpected errors ['generics_upper_bound.py:37:1: error[type-assertion-failure] Type `list[Unknown | int]` does not match asserted type `list[int]`'] +Line 38: Unexpected errors ['generics_upper_bound.py:38:1: error[type-assertion-failure] Type `set[Unknown | int]` does not match asserted type `set[int]`'] +""" +output = """ +generics_upper_bound.py:24:32: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic +generics_upper_bound.py:37:1: error[type-assertion-failure] Type `list[Unknown | int]` does not match asserted type `list[int]` +generics_upper_bound.py:38:1: error[type-assertion-failure] Type `set[Unknown | int]` does not match asserted type `set[int]` +generics_upper_bound.py:43:1: error[type-assertion-failure] Type `list[Unknown | int] | set[Unknown | int]` does not match asserted type `list[int] | set[int]` +generics_upper_bound.py:51:8: error[invalid-argument-type] Argument to function `longer` is incorrect: Argument type `Literal[3]` does not satisfy upper bound `Sized` of type variable `ST` +generics_upper_bound.py:51:11: error[invalid-argument-type] Argument to function `longer` is incorrect: Argument type `Literal[3]` does not satisfy upper bound `Sized` of type variable `ST` +generics_upper_bound.py:56:10: error[invalid-legacy-type-variable] A `TypeVar` cannot have both a bound and constraints +""" diff --git a/conformance/results/ty/generics_variance.toml b/conformance/results/ty/generics_variance.toml new file mode 100644 index 000000000..4d1ea82f1 --- /dev/null +++ b/conformance/results/ty/generics_variance.toml @@ -0,0 +1,18 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 77: Expected 1 errors +Line 81: Expected 1 errors +Line 93: Expected 1 errors +Line 105: Expected 1 errors +Line 113: Expected 1 errors +Line 163: Expected 1 errors +Line 167: Expected 1 errors +Line 191: Expected 1 errors +Lines 125, 126: Expected error (tag 'CoContra_Child2') +Lines 131, 132: Expected error (tag 'CoContra_Child3') +Lines 141, 142: Expected error (tag 'CoContra_Child5') +Lines 195, 196: Expected error (tag 'ContraToContraToContra_WithTA') +""" +output = """ +generics_variance.py:14:6: error[invalid-legacy-type-variable] A `TypeVar` cannot be both covariant and contravariant +""" diff --git a/conformance/results/ty/generics_variance_inference.toml b/conformance/results/ty/generics_variance_inference.toml new file mode 100644 index 000000000..1c637eecf --- /dev/null +++ b/conformance/results/ty/generics_variance_inference.toml @@ -0,0 +1,28 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +generics_variance_inference.py:24:33: error[invalid-assignment] Object of type `ClassA[int | float, int, int]` is not assignable to `ClassA[int, int, int]` +generics_variance_inference.py:25:37: error[invalid-assignment] Object of type `ClassA[int | float, int, int]` is not assignable to `ClassA[int | float, int | float, int]` +generics_variance_inference.py:28:33: error[invalid-assignment] Object of type `ClassA[int, int | float, int | float]` is not assignable to `ClassA[int, int, int]` +generics_variance_inference.py:41:35: error[invalid-assignment] Object of type `ShouldBeCovariant1[int | float]` is not assignable to `ShouldBeCovariant1[int]` +generics_variance_inference.py:49:35: error[invalid-assignment] Object of type `ShouldBeCovariant2[int | float]` is not assignable to `ShouldBeCovariant2[int]` +generics_variance_inference.py:58:35: error[invalid-assignment] Object of type `ShouldBeCovariant3[int | float]` is not assignable to `ShouldBeCovariant3[int]` +generics_variance_inference.py:67:34: error[invalid-assignment] Object of type `ShouldBeCovariant4[int | float]` is not assignable to `ShouldBeCovariant4[int]` +generics_variance_inference.py:80:34: error[invalid-assignment] Object of type `ShouldBeCovariant5[int | float]` is not assignable to `ShouldBeCovariant5[int]` +generics_variance_inference.py:96:38: error[invalid-assignment] Object of type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[int | float]` +generics_variance_inference.py:97:36: error[invalid-assignment] Object of type `ShouldBeInvariant1[int | float]` is not assignable to `ShouldBeInvariant1[int]` +generics_variance_inference.py:111:38: error[invalid-assignment] Object of type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[int | float]` +generics_variance_inference.py:112:36: error[invalid-assignment] Object of type `ShouldBeInvariant2[int | float]` is not assignable to `ShouldBeInvariant2[int]` +generics_variance_inference.py:119:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[int | float, str]` +generics_variance_inference.py:120:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[int | float, str]` is not assignable to `ShouldBeInvariant3[int, str]` +generics_variance_inference.py:121:43: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, int | float]` +generics_variance_inference.py:122:41: error[invalid-assignment] Object of type `ShouldBeInvariant3[str, int | float]` is not assignable to `ShouldBeInvariant3[str, int]` +generics_variance_inference.py:130:38: error[invalid-assignment] Object of type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[int | float]` +generics_variance_inference.py:138:38: error[invalid-assignment] Object of type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[int | float]` +generics_variance_inference.py:149:45: error[invalid-assignment] Object of type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[int | float]` +generics_variance_inference.py:169:31: error[invalid-assignment] Object of type `ShouldBeInvariant6[int | float]` is not assignable to `ShouldBeInvariant6[int]` +generics_variance_inference.py:170:33: error[invalid-assignment] Object of type `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[int | float]` +generics_variance_inference.py:181:31: error[invalid-assignment] Object of type `ShouldBeCovariant6[int | float]` is not assignable to `ShouldBeCovariant6[int]` +generics_variance_inference.py:194:37: error[invalid-assignment] Object of type `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[int | float]` +""" diff --git a/conformance/results/ty/historical_positional.toml b/conformance/results/ty/historical_positional.toml new file mode 100644 index 000000000..bef650305 --- /dev/null +++ b/conformance/results/ty/historical_positional.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +historical_positional.py:18:4: error[positional-only-parameter-as-kwarg] Positional-only parameter 1 (`__x`) passed as keyword argument of function `f1` +historical_positional.py:26:16: error[invalid-legacy-positional-parameter] Invalid use of the legacy convention for positional-only parameters: Parameter name begins with `__` but will not be treated as positional-only +historical_positional.py:45:28: error[invalid-legacy-positional-parameter] Invalid use of the legacy convention for positional-only parameters: Parameter name begins with `__` but will not be treated as positional-only +historical_positional.py:54:26: error[invalid-legacy-positional-parameter] Invalid use of the legacy convention for positional-only parameters: Parameter name begins with `__` but will not be treated as positional-only +historical_positional.py:59:6: error[positional-only-parameter-as-kwarg] Positional-only parameter 2 (`__x`) passed as keyword argument of bound method `m1` +""" diff --git a/conformance/results/ty/literals_interactions.toml b/conformance/results/ty/literals_interactions.toml new file mode 100644 index 000000000..a2751f9c2 --- /dev/null +++ b/conformance/results/ty/literals_interactions.toml @@ -0,0 +1,13 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 106: Unexpected errors ['literals_interactions.py:106:35: error[invalid-argument-type] Argument to function `expects_bad_status` is incorrect: Expected `Literal["MALFORMED", "ABORTED"]`, found `str`'] +Line 109: Unexpected errors ['literals_interactions.py:109:32: error[invalid-argument-type] Argument to function `expects_pending_status` is incorrect: Expected `Literal["PENDING"]`, found `str`'] +""" +output = """ +literals_interactions.py:15:5: error[index-out-of-bounds] Index 5 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 +literals_interactions.py:16:5: error[index-out-of-bounds] Index -5 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 +literals_interactions.py:17:5: error[index-out-of-bounds] Index 4 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 +literals_interactions.py:18:5: error[index-out-of-bounds] Index -4 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 +literals_interactions.py:106:35: error[invalid-argument-type] Argument to function `expects_bad_status` is incorrect: Expected `Literal["MALFORMED", "ABORTED"]`, found `str` +literals_interactions.py:109:32: error[invalid-argument-type] Argument to function `expects_pending_status` is incorrect: Expected `Literal["PENDING"]`, found `str` +""" diff --git a/conformance/results/ty/literals_literalstring.toml b/conformance/results/ty/literals_literalstring.toml new file mode 100644 index 000000000..052d2d4c3 --- /dev/null +++ b/conformance/results/ty/literals_literalstring.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_literalstring.py:36:29: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_literalstring.py:37:22: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_literalstring.py:43:23: error[invalid-assignment] Object of type `Literal["two"]` is not assignable to `Literal[""]` +literals_literalstring.py:65:25: error[invalid-assignment] Object of type `str` is not assignable to `LiteralString` +literals_literalstring.py:73:25: error[invalid-assignment] Object of type `Literal[3]` is not assignable to `LiteralString` +literals_literalstring.py:74:25: error[invalid-assignment] Object of type `Literal[b"test"]` is not assignable to `LiteralString` +literals_literalstring.py:119:22: error[invalid-argument-type] Argument to function `literal_identity` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `TLiteral` +literals_literalstring.py:133:51: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Argument type `str` does not satisfy upper bound `LiteralString` of type variable `T` +literals_literalstring.py:133:51: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `LiteralString`, found `str` +literals_literalstring.py:170:21: error[invalid-assignment] Object of type `list[LiteralString]` is not assignable to `list[str]` +""" diff --git a/conformance/results/ty/literals_parameterizations.toml b/conformance/results/ty/literals_parameterizations.toml new file mode 100644 index 000000000..27f64295d --- /dev/null +++ b/conformance/results/ty/literals_parameterizations.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_parameterizations.py:41:15: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:42:15: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:43:15: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:44:15: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:45:15: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:46:15: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:47:15: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:48:15: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:49:15: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:50:16: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:51:16: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:52:16: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:53:16: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:56:28: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:60:4: error[invalid-type-form] `typing.Literal` requires at least one argument when used in a type expression +literals_parameterizations.py:61:12: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member +literals_parameterizations.py:65:32: error[invalid-assignment] Object of type `Literal[Color.RED]` is not assignable to `Literal["Color.RED"]` +""" diff --git a/conformance/results/ty/literals_semantics.toml b/conformance/results/ty/literals_semantics.toml new file mode 100644 index 000000000..f0a0bb5f6 --- /dev/null +++ b/conformance/results/ty/literals_semantics.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_semantics.py:10:18: error[invalid-assignment] Object of type `Literal[4]` is not assignable to `Literal[3]` +literals_semantics.py:24:26: error[invalid-assignment] Object of type `Literal[0]` is not assignable to `Literal[False]` +literals_semantics.py:25:22: error[invalid-assignment] Object of type `Literal[False]` is not assignable to `Literal[0]` +literals_semantics.py:33:5: error[invalid-assignment] Object of type `Literal[6, 7, 8]` is not assignable to `Literal[3, 4, 5]` +""" diff --git a/conformance/results/ty/namedtuples_define_class.toml b/conformance/results/ty/namedtuples_define_class.toml new file mode 100644 index 000000000..9eacb03d3 --- /dev/null +++ b/conformance/results/ty/namedtuples_define_class.toml @@ -0,0 +1,19 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 106: Expected 1 errors +""" +output = """ +namedtuples_define_class.py:32:7: error[index-out-of-bounds] Index 3 is out of bounds for tuple `Point` with length 3 +namedtuples_define_class.py:33:7: error[index-out-of-bounds] Index -4 is out of bounds for tuple `Point` with length 3 +namedtuples_define_class.py:44:6: error[missing-argument] No argument provided for required parameter `y` +namedtuples_define_class.py:45:6: error[missing-argument] No argument provided for required parameter `y` +namedtuples_define_class.py:46:15: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[""]` +namedtuples_define_class.py:47:18: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `Literal[3]` +namedtuples_define_class.py:48:22: error[too-many-positional-arguments] Too many positional arguments: expected 4, got 5 +namedtuples_define_class.py:49:23: error[unknown-argument] Argument `other` does not match any known parameter +namedtuples_define_class.py:69:20: error[too-many-positional-arguments] Too many positional arguments: expected 3, got 4 +namedtuples_define_class.py:76:5: error[invalid-named-tuple] NamedTuple field `_y` cannot start with an underscore +namedtuples_define_class.py:86:5: error[invalid-named-tuple] NamedTuple field without default value cannot follow field(s) with default value(s): Field `latitude` defined here without a default value +namedtuples_define_class.py:125:19: error[invalid-argument-type] Argument is incorrect: Expected `str`, found `float` +namedtuples_define_class.py:132:24: error[invalid-named-tuple] NamedTuple class `Unit` cannot use multiple inheritance except with `Generic[]` +""" diff --git a/conformance/results/ty/namedtuples_define_functional.toml b/conformance/results/ty/namedtuples_define_functional.toml new file mode 100644 index 000000000..dc85a1e4b --- /dev/null +++ b/conformance/results/ty/namedtuples_define_functional.toml @@ -0,0 +1,19 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_define_functional.py:16:8: error[missing-argument] No argument provided for required parameter `y` +namedtuples_define_functional.py:21:8: error[missing-argument] No arguments provided for required parameters `x`, `y` +namedtuples_define_functional.py:26:21: error[too-many-positional-arguments] Too many positional arguments: expected 3, got 4 +namedtuples_define_functional.py:31:8: error[missing-argument] No argument provided for required parameter `y` +namedtuples_define_functional.py:31:18: error[unknown-argument] Argument `z` does not match any known parameter +namedtuples_define_functional.py:36:18: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["1"]` +namedtuples_define_functional.py:37:21: error[too-many-positional-arguments] Too many positional arguments: expected 3, got 4 +namedtuples_define_functional.py:42:18: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["1"]` +namedtuples_define_functional.py:43:15: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `float` +namedtuples_define_functional.py:52:25: error[invalid-named-tuple] Duplicate field name `a` in `namedtuple()`: Field `a` already defined; will raise `ValueError` at runtime +namedtuples_define_functional.py:53:25: error[invalid-named-tuple] Field name `def` in `namedtuple()` cannot be a Python keyword: Will raise `ValueError` at runtime +namedtuples_define_functional.py:54:25: error[invalid-named-tuple] Field name `def` in `namedtuple()` cannot be a Python keyword: Will raise `ValueError` at runtime +namedtuples_define_functional.py:55:25: error[invalid-named-tuple] Field name `_d` in `namedtuple()` cannot start with an underscore: Will raise `ValueError` at runtime +namedtuples_define_functional.py:69:1: error[missing-argument] No argument provided for required parameter `a` +""" diff --git a/conformance/results/ty/namedtuples_type_compat.toml b/conformance/results/ty/namedtuples_type_compat.toml new file mode 100644 index 000000000..1003a3256 --- /dev/null +++ b/conformance/results/ty/namedtuples_type_compat.toml @@ -0,0 +1,7 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +namedtuples_type_compat.py:22:23: error[invalid-assignment] Object of type `Point` is not assignable to `tuple[int, int]` +namedtuples_type_compat.py:23:28: error[invalid-assignment] Object of type `Point` is not assignable to `tuple[int, str, str]` +""" diff --git a/conformance/results/ty/namedtuples_usage.toml b/conformance/results/ty/namedtuples_usage.toml new file mode 100644 index 000000000..d220608d5 --- /dev/null +++ b/conformance/results/ty/namedtuples_usage.toml @@ -0,0 +1,13 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 42: Expected 1 errors +""" +output = """ +namedtuples_usage.py:34:7: error[index-out-of-bounds] Index 3 is out of bounds for tuple `Point` with length 3 +namedtuples_usage.py:35:7: error[index-out-of-bounds] Index -4 is out of bounds for tuple `Point` with length 3 +namedtuples_usage.py:40:1: error[invalid-assignment] Cannot assign to read-only property `x` on object of type `Point` +namedtuples_usage.py:41:1: error[invalid-assignment] Cannot assign to a subscript on an object of type `Point` +namedtuples_usage.py:43:5: error[not-subscriptable] Cannot delete subscript on object of type `Point` with no `__delitem__` method +namedtuples_usage.py:52:1: error[invalid-assignment] Too many values to unpack: Expected 2 +namedtuples_usage.py:53:1: error[invalid-assignment] Not enough values to unpack: Expected 4 +""" diff --git a/conformance/results/ty/narrowing_typeguard.toml b/conformance/results/ty/narrowing_typeguard.toml new file mode 100644 index 000000000..196a41941 --- /dev/null +++ b/conformance/results/ty/narrowing_typeguard.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +narrowing_typeguard.py:102:23: error[invalid-type-guard-definition] `TypeGuard` function must have a parameter to narrow +narrowing_typeguard.py:107:22: error[invalid-type-guard-definition] `TypeGuard` function must have a parameter to narrow +narrowing_typeguard.py:128:20: error[invalid-argument-type] Argument to function `takes_callable_str` is incorrect: Expected `(object, /) -> str`, found `def simple_typeguard(val: object) -> TypeGuard[int]` +narrowing_typeguard.py:148:26: error[invalid-argument-type] Argument to function `takes_callable_str_proto` is incorrect: Expected `CallableStrProto`, found `def simple_typeguard(val: object) -> TypeGuard[int]` +""" diff --git a/conformance/results/ty/narrowing_typeis.toml b/conformance/results/ty/narrowing_typeis.toml new file mode 100644 index 000000000..a3488ae53 --- /dev/null +++ b/conformance/results/ty/narrowing_typeis.toml @@ -0,0 +1,16 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 35: Unexpected errors ['narrowing_typeis.py:35:18: error[invalid-assignment] Object of type `object` is not assignable to `int`'] +""" +output = """ +narrowing_typeis.py:35:18: error[invalid-assignment] Object of type `object` is not assignable to `int` +narrowing_typeis.py:105:23: error[invalid-type-guard-definition] `TypeIs` function must have a parameter to narrow +narrowing_typeis.py:110:22: error[invalid-type-guard-definition] `TypeIs` function must have a parameter to narrow +narrowing_typeis.py:132:20: error[invalid-argument-type] Argument to function `takes_callable_str` is incorrect: Expected `(object, /) -> str`, found `def simple_typeguard(val: object) -> TypeIs[int]` +narrowing_typeis.py:152:26: error[invalid-argument-type] Argument to function `takes_callable_str_proto` is incorrect: Expected `CallableStrProto`, found `def simple_typeguard(val: object) -> TypeIs[int]` +narrowing_typeis.py:169:17: error[invalid-argument-type] Argument to function `takes_typeguard` is incorrect: Expected `(object, /) -> TypeGuard[int]`, found `def is_int_typeis(val: object) -> TypeIs[int]` +narrowing_typeis.py:170:14: error[invalid-argument-type] Argument to function `takes_typeis` is incorrect: Expected `(object, /) -> TypeIs[int]`, found `def is_int_typeguard(val: object) -> TypeGuard[int]` +narrowing_typeis.py:191:18: error[invalid-argument-type] Argument to function `takes_int_typeis` is incorrect: Expected `(object, /) -> TypeIs[int]`, found `def bool_typeis(val: object) -> TypeIs[bool]` +narrowing_typeis.py:195:27: error[invalid-type-guard-definition] Narrowed type `str` is not assignable to the declared parameter type `int` +narrowing_typeis.py:199:45: error[invalid-type-guard-definition] Narrowed type `list[int]` is not assignable to the declared parameter type `list[object]` +""" diff --git a/conformance/results/ty/overloads_basic.toml b/conformance/results/ty/overloads_basic.toml new file mode 100644 index 000000000..eb874c741 --- /dev/null +++ b/conformance/results/ty/overloads_basic.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_basic.py:39:1: error[invalid-argument-type] Method `__getitem__` of type `Overload[(__i: int, /) -> int, (__s: slice[Any, Any, Any], /) -> bytes]` cannot be called with key of type `Literal[""]` on object of type `Bytes` +""" diff --git a/conformance/results/ty/overloads_consistency.toml b/conformance/results/ty/overloads_consistency.toml new file mode 100644 index 000000000..e389cd61b --- /dev/null +++ b/conformance/results/ty/overloads_consistency.toml @@ -0,0 +1,7 @@ +conformance_automated = "Fail" +errors_diff = """ +Lines 25, 28: Expected error (tag 'return_type') +Lines 41, 44: Expected error (tag 'parameter_type') +""" +output = """ +""" diff --git a/conformance/results/ty/overloads_definitions.toml b/conformance/results/ty/overloads_definitions.toml new file mode 100644 index 000000000..090f8fdf0 --- /dev/null +++ b/conformance/results/ty/overloads_definitions.toml @@ -0,0 +1,17 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_definitions.py:16:5: error[invalid-overload] Overloaded function `func1` requires at least two overloads: Only one overload defined here +overloads_definitions.py:28:5: error[invalid-overload] Overloads for function `func2` must be followed by a non-`@overload`-decorated implementation function +overloads_definitions.py:59:9: error[invalid-overload] Overloads for function `not_abstract` must be followed by a non-`@overload`-decorated implementation function +overloads_definitions.py:81:9: error[invalid-overload] Overloaded function `func5` does not use the `@staticmethod` decorator consistently +overloads_definitions.py:94:9: error[invalid-overload] Overloaded function `func6` does not use the `@classmethod` decorator consistently +overloads_definitions.py:124:9: error[invalid-overload] `@final` decorator should be applied only to the overload implementation +overloads_definitions.py:139:9: error[invalid-overload] `@final` decorator should be applied only to the overload implementation +overloads_definitions.py:144:9: error[invalid-overload] `@final` decorator should be applied only to the overload implementation +overloads_definitions.py:186:9: error[override-of-final-method] Cannot override final member `final_method` from superclass `Base` +overloads_definitions.py:203:9: error[invalid-explicit-override] Method `bad_override` is decorated with `@override` but does not override anything +overloads_definitions.py:228:9: error[invalid-overload] `@override` decorator should be applied only to the overload implementation +overloads_definitions.py:232:9: error[invalid-overload] `@override` decorator should be applied only to the overload implementation +""" diff --git a/conformance/results/ty/overloads_definitions_stub.toml b/conformance/results/ty/overloads_definitions_stub.toml new file mode 100644 index 000000000..43ec8feea --- /dev/null +++ b/conformance/results/ty/overloads_definitions_stub.toml @@ -0,0 +1,13 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_definitions_stub.pyi:14:5: error[invalid-overload] Overloaded function `func1` requires at least two overloads: Only one overload defined here +overloads_definitions_stub.pyi:37:9: error[invalid-overload] Overloaded function `func5` does not use the `@staticmethod` decorator consistently +overloads_definitions_stub.pyi:44:9: error[invalid-overload] Overloaded function `func6` does not use the `@classmethod` decorator consistently +overloads_definitions_stub.pyi:73:9: error[invalid-overload] `@final` decorator should be applied only to the first overload +overloads_definitions_stub.pyi:86:9: error[invalid-overload] `@final` decorator should be applied only to the first overload +overloads_definitions_stub.pyi:111:9: error[override-of-final-method] Cannot override final member `final_method` from superclass `Base` +overloads_definitions_stub.pyi:122:9: error[invalid-explicit-override] Method `bad_override` is decorated with `@override` but does not override anything +overloads_definitions_stub.pyi:147:9: error[invalid-overload] `@override` decorator should be applied only to the first overload +""" diff --git a/conformance/results/ty/overloads_evaluation.toml b/conformance/results/ty/overloads_evaluation.toml new file mode 100644 index 000000000..3a9a963c2 --- /dev/null +++ b/conformance/results/ty/overloads_evaluation.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_evaluation.py:38:1: error[no-matching-overload] No overload of function `example1_1` matches arguments +overloads_evaluation.py:46:15: error[invalid-argument-type] Argument to function `example1_1` is incorrect: Expected `str`, found `Literal[1]` +overloads_evaluation.py:51:12: error[invalid-argument-type] Argument to function `example1_1` is incorrect: Expected `str`, found `Literal[1]` +overloads_evaluation.py:116:5: error[no-matching-overload] No overload of function `example2` matches arguments +""" diff --git a/conformance/results/ty/protocols_class_objects.toml b/conformance/results/ty/protocols_class_objects.toml new file mode 100644 index 000000000..092a4d873 --- /dev/null +++ b/conformance/results/ty/protocols_class_objects.toml @@ -0,0 +1,15 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 29: Expected 1 errors +Line 34: Expected 1 errors +Line 74: Expected 1 errors +Line 104: Expected 1 errors +Line 106: Expected 1 errors +Line 107: Expected 1 errors +Line 108: Expected 1 errors +Line 59: Unexpected errors ["protocols_class_objects.py:59:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoA2`"] +""" +output = """ +protocols_class_objects.py:58:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoA1` +protocols_class_objects.py:59:16: error[invalid-assignment] Object of type `` is not assignable to `ProtoA2` +""" diff --git a/conformance/results/ty/protocols_definition.toml b/conformance/results/ty/protocols_definition.toml new file mode 100644 index 000000000..f6a010329 --- /dev/null +++ b/conformance/results/ty/protocols_definition.toml @@ -0,0 +1,26 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 67: Expected 1 errors +Line 117: Expected 1 errors +Line 157: Expected 1 errors +Line 158: Expected 1 errors +Line 218: Expected 1 errors +Line 339: Expected 1 errors +Line 340: Expected 1 errors +Line 341: Expected 1 errors +""" +output = """ +protocols_definition.py:30:11: error[invalid-argument-type] Argument to function `close_all` is incorrect: Expected `Iterable[SupportsClose]`, found `list[int]` +protocols_definition.py:114:22: error[invalid-assignment] Object of type `Concrete2_Bad1` is not assignable to `Template2` +protocols_definition.py:115:22: error[invalid-assignment] Object of type `Concrete2_Bad2` is not assignable to `Template2` +protocols_definition.py:116:22: error[invalid-assignment] Object of type `Concrete2_Bad3` is not assignable to `Template2` +protocols_definition.py:156:22: error[invalid-assignment] Object of type `Concrete3_Bad1` is not assignable to `Template3` +protocols_definition.py:159:22: error[invalid-assignment] Object of type `Concrete3_Bad4` is not assignable to `Template3` +protocols_definition.py:160:22: error[invalid-assignment] Object of type `Concrete3_Bad5` is not assignable to `Template3` +protocols_definition.py:219:22: error[invalid-assignment] Object of type `Concrete4_Bad2` is not assignable to `Template4` +protocols_definition.py:285:22: error[invalid-assignment] Object of type `Concrete5_Bad1` is not assignable to `Template5` +protocols_definition.py:286:22: error[invalid-assignment] Object of type `Concrete5_Bad2` is not assignable to `Template5` +protocols_definition.py:287:22: error[invalid-assignment] Object of type `Concrete5_Bad3` is not assignable to `Template5` +protocols_definition.py:288:22: error[invalid-assignment] Object of type `Concrete5_Bad4` is not assignable to `Template5` +protocols_definition.py:289:22: error[invalid-assignment] Object of type `Concrete5_Bad5` is not assignable to `Template5` +""" diff --git a/conformance/results/ty/protocols_explicit.toml b/conformance/results/ty/protocols_explicit.toml new file mode 100644 index 000000000..17ae4032e --- /dev/null +++ b/conformance/results/ty/protocols_explicit.toml @@ -0,0 +1,11 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 27: Expected 1 errors +Line 60: Expected 1 errors +Line 89: Expected 1 errors +Line 134: Expected 1 errors +Line 164: Expected 1 errors +""" +output = """ +protocols_explicit.py:56:9: error[invalid-assignment] Object of type `tuple[int, int, str]` is not assignable to attribute `rgb` of type `tuple[int, int, int]` +""" diff --git a/conformance/results/ty/protocols_generic.toml b/conformance/results/ty/protocols_generic.toml new file mode 100644 index 000000000..d7effdc64 --- /dev/null +++ b/conformance/results/ty/protocols_generic.toml @@ -0,0 +1,14 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 145: Expected 1 errors +Line 146: Expected 1 errors +Line 147: Expected 1 errors +""" +output = """ +protocols_generic.py:40:24: error[invalid-assignment] Object of type `Concrete1` is not assignable to `Proto1[int, str]` +protocols_generic.py:44:14: error[invalid-generic-class] Cannot both inherit from subscripted `Protocol` and subscripted `Generic` +protocols_generic.py:56:20: error[invalid-assignment] Object of type `Box[int | float]` is not assignable to `Box[int]` +protocols_generic.py:66:25: error[invalid-assignment] Object of type `Sender[int]` is not assignable to `Sender[int | float]` +protocols_generic.py:74:28: error[invalid-assignment] Object of type `AttrProto[int]` is not assignable to `AttrProto[int | float]` +protocols_generic.py:75:26: error[invalid-assignment] Object of type `AttrProto[int | float]` is not assignable to `AttrProto[int]` +""" diff --git a/conformance/results/ty/protocols_merging.toml b/conformance/results/ty/protocols_merging.toml new file mode 100644 index 000000000..f587cf34f --- /dev/null +++ b/conformance/results/ty/protocols_merging.toml @@ -0,0 +1,11 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 82: Expected 1 errors +""" +output = """ +protocols_merging.py:52:25: error[invalid-assignment] Object of type `SCConcrete2` is not assignable to `SizedAndClosable1` +protocols_merging.py:53:25: error[invalid-assignment] Object of type `SCConcrete2` is not assignable to `SizedAndClosable2` +protocols_merging.py:54:25: error[invalid-assignment] Object of type `SCConcrete2` is not assignable to `SizedAndClosable3` +protocols_merging.py:67:16: error[invalid-protocol] Protocol class `BadProto` cannot inherit from non-protocol class `SizedAndClosable3` +protocols_merging.py:83:24: error[invalid-assignment] Object of type `SCConcrete1` is not assignable to `SizedAndClosable4` +""" diff --git a/conformance/results/ty/protocols_modules.toml b/conformance/results/ty/protocols_modules.toml new file mode 100644 index 000000000..2ce3cba59 --- /dev/null +++ b/conformance/results/ty/protocols_modules.toml @@ -0,0 +1,12 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 25: Unexpected errors ["protocols_modules.py:25:17: error[invalid-assignment] Object of type `` is not assignable to `Options1`"] +Line 47: Unexpected errors ["protocols_modules.py:47:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter1`"] +""" +output = """ +protocols_modules.py:25:17: error[invalid-assignment] Object of type `` is not assignable to `Options1` +protocols_modules.py:26:17: error[invalid-assignment] Object of type `` is not assignable to `Options2` +protocols_modules.py:47:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter1` +protocols_modules.py:48:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter2` +protocols_modules.py:49:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter3` +""" diff --git a/conformance/results/ty/protocols_recursive.toml b/conformance/results/ty/protocols_recursive.toml new file mode 100644 index 000000000..458085edc --- /dev/null +++ b/conformance/results/ty/protocols_recursive.toml @@ -0,0 +1,7 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 81: Unexpected errors ['protocols_recursive.py:81:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `list[int]`'] +""" +output = """ +protocols_recursive.py:81:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `list[int]` +""" diff --git a/conformance/results/ty/protocols_runtime_checkable.toml b/conformance/results/ty/protocols_runtime_checkable.toml new file mode 100644 index 000000000..5d23a7e63 --- /dev/null +++ b/conformance/results/ty/protocols_runtime_checkable.toml @@ -0,0 +1,11 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 61: Expected 1 errors +Line 88: Expected 1 errors +Line 92: Expected 1 errors +Line 96: Expected 1 errors +""" +output = """ +protocols_runtime_checkable.py:23:8: error[isinstance-against-protocol] Class `Proto1` cannot be used as the second argument to `isinstance`: This call will raise `TypeError` at runtime +protocols_runtime_checkable.py:55:8: error[isinstance-against-protocol] `DataProtocol` cannot be used as the second argument to `issubclass` as it is a protocol with non-method members +""" diff --git a/conformance/results/ty/protocols_self.toml b/conformance/results/ty/protocols_self.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/ty/protocols_self.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/ty/protocols_subtyping.toml b/conformance/results/ty/protocols_subtyping.toml new file mode 100644 index 000000000..b75d7d453 --- /dev/null +++ b/conformance/results/ty/protocols_subtyping.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_subtyping.py:16:6: error[call-non-callable] Cannot instantiate class `Proto1`: This call will raise `TypeError` at runtime +protocols_subtyping.py:38:21: error[invalid-assignment] Object of type `Proto2` is not assignable to `Concrete2` +protocols_subtyping.py:55:18: error[invalid-assignment] Object of type `Proto2` is not assignable to `Proto3` +protocols_subtyping.py:79:30: error[invalid-assignment] Object of type `Proto5[int]` is not assignable to `Proto4[int, int | float]` +protocols_subtyping.py:80:25: error[invalid-assignment] Object of type `Proto4[int, int]` is not assignable to `Proto5[int | float]` +protocols_subtyping.py:102:30: error[invalid-assignment] Object of type `Proto6[int | float, int | float]` is not assignable to `Proto7[int, int | float]` +protocols_subtyping.py:103:33: error[invalid-assignment] Object of type `Proto6[int | float, int | float]` is not assignable to `Proto7[int | float, object]` +""" diff --git a/conformance/results/ty/protocols_variance.toml b/conformance/results/ty/protocols_variance.toml new file mode 100644 index 000000000..a5f099546 --- /dev/null +++ b/conformance/results/ty/protocols_variance.toml @@ -0,0 +1,12 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 21: Expected 1 errors +Line 40: Expected 1 errors +Line 56: Expected 1 errors +Line 66: Expected 1 errors +Line 104: Expected 1 errors +Lines 61, 62: Expected error (tag 'covariant_in_input') +Lines 71, 72: Expected error (tag 'contravariant_in_output') +""" +output = """ +""" diff --git a/conformance/results/ty/qualifiers_annotated.toml b/conformance/results/ty/qualifiers_annotated.toml new file mode 100644 index 000000000..7877ed0c7 --- /dev/null +++ b/conformance/results/ty/qualifiers_annotated.toml @@ -0,0 +1,27 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +qualifiers_annotated.py:38:17: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +qualifiers_annotated.py:39:17: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression +qualifiers_annotated.py:39:18: error[invalid-type-form] Tuple literals are not allowed in this context in a type expression: Did you mean `tuple[int, str]`? +qualifiers_annotated.py:40:17: error[invalid-type-form] List comprehensions are not allowed in type expressions +qualifiers_annotated.py:41:17: error[invalid-type-form] Dict literals are not allowed in type expressions +qualifiers_annotated.py:42:17: error[invalid-type-form] Function calls are not allowed in type expressions +qualifiers_annotated.py:43:17: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +qualifiers_annotated.py:43:23: error[invalid-type-form] Int literals are not allowed in this context in a type expression +qualifiers_annotated.py:44:17: error[invalid-type-form] `if` expressions are not allowed in type expressions +qualifiers_annotated.py:45:17: error[unresolved-reference] Name `var1` used when not defined +qualifiers_annotated.py:46:17: error[invalid-type-form] Boolean literals are not allowed in this context in a type expression +qualifiers_annotated.py:47:18: error[invalid-type-form] Int literals are not allowed in this context in a type expression +qualifiers_annotated.py:48:18: error[invalid-type-form] Boolean operations are not allowed in type expressions +qualifiers_annotated.py:49:18: error[fstring-type-annotation] Type expressions cannot use f-strings +qualifiers_annotated.py:59:8: error[invalid-type-form] Special form `typing.Annotated` expected at least 2 arguments (one type and at least one metadata element) +qualifiers_annotated.py:71:24: error[invalid-assignment] Object of type `]'>` is not assignable to `type[Any]` +qualifiers_annotated.py:72:24: error[invalid-assignment] Object of type `]'>` is not assignable to `type[Any]` +qualifiers_annotated.py:79:7: error[invalid-argument-type] Argument to function `func4` is incorrect: Expected `type[Unknown]`, found `]'>` +qualifiers_annotated.py:80:7: error[invalid-argument-type] Argument to function `func4` is incorrect: Expected `type[Unknown]`, found `]'>` +qualifiers_annotated.py:86:1: error[call-non-callable] Object of type `` is not callable +qualifiers_annotated.py:87:1: error[call-non-callable] Object of type `GenericAlias` is not callable +qualifiers_annotated.py:88:1: error[call-non-callable] Object of type `GenericAlias` is not callable +""" diff --git a/conformance/results/ty/qualifiers_final_annotation.toml b/conformance/results/ty/qualifiers_final_annotation.toml new file mode 100644 index 000000000..2b17b7d4f --- /dev/null +++ b/conformance/results/ty/qualifiers_final_annotation.toml @@ -0,0 +1,33 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 62: Expected 1 errors +Line 63: Expected 1 errors +Line 67: Expected 1 errors +""" +output = """ +qualifiers_final_annotation.py:16:1: error[final-without-value] `Final` symbol `BAD1` is not assigned a value +qualifiers_final_annotation.py:18:7: error[invalid-type-form] Type qualifier `typing.Final` expected exactly 1 argument, got 2 +qualifiers_final_annotation.py:34:5: error[final-without-value] `Final` symbol `ID2` is not assigned a value +qualifiers_final_annotation.py:38:5: error[final-without-value] `Final` symbol `ID3` is not assigned a value +qualifiers_final_annotation.py:54:9: error[invalid-assignment] Cannot assign to final attribute `ID5` in `__init__` because it already has a value at class level +qualifiers_final_annotation.py:65:9: error[invalid-assignment] Cannot assign to final attribute `ID7` on type `Self@method1` +qualifiers_final_annotation.py:71:1: error[invalid-assignment] Reassignment of `Final` symbol `RATE` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:81:1: error[invalid-assignment] Cannot assign to final attribute `DEFAULT_ID` on type `` +qualifiers_final_annotation.py:94:5: error[override-of-final-variable] Cannot override final variable `BORDER_WIDTH` from superclass `ClassC` +qualifiers_final_annotation.py:107:13: error[redundant-final-classvar] `Combining `ClassVar` and `Final` is redundant +qualifiers_final_annotation.py:108:13: error[redundant-final-classvar] `Combining `ClassVar` and `Final` is redundant +qualifiers_final_annotation.py:118:9: error[invalid-type-form] Type qualifier `typing.Final` is not allowed in type expressions (only in annotation expressions) +qualifiers_final_annotation.py:121:11: error[invalid-type-form] `Final` is not allowed in function parameter annotations +qualifiers_final_annotation.py:134:1: error[missing-argument] No arguments provided for required parameters `x`, `y` +qualifiers_final_annotation.py:134:3: error[unknown-argument] Argument `a` does not match any known parameter +qualifiers_final_annotation.py:135:3: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[""]` +qualifiers_final_annotation.py:135:9: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal[""]` +qualifiers_final_annotation.py:141:5: error[invalid-assignment] Reassignment of `Final` symbol `ID1` is not allowed: Reassignment of `Final` symbol +qualifiers_final_annotation.py:145:5: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:147:10: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:149:9: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:152:30: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:155:9: error[invalid-assignment] Reassignment of `Final` symbol `x` is not allowed: Symbol later reassigned here +qualifiers_final_annotation.py:166:1: error[invalid-assignment] Reassignment of `Final` symbol `TEN` is not allowed: Reassignment of `Final` symbol +qualifiers_final_annotation.py:170:1: error[invalid-assignment] Reassignment of `Final` symbol `PI` is not allowed: Reassignment of `Final` symbol +""" diff --git a/conformance/results/ty/qualifiers_final_decorator.toml b/conformance/results/ty/qualifiers_final_decorator.toml new file mode 100644 index 000000000..7e4205afe --- /dev/null +++ b/conformance/results/ty/qualifiers_final_decorator.toml @@ -0,0 +1,16 @@ +conformance_automated = "Fail" +errors_diff = """ +Lines 125, 126: Expected error (tag 'func') +""" +output = """ +qualifiers_final_decorator.py:21:16: error[subclass-of-final-class] Class `Derived1` cannot inherit from final class `Base1` +qualifiers_final_decorator.py:56:9: error[override-of-final-method] Cannot override final member `method1` from superclass `Base2` +qualifiers_final_decorator.py:60:9: error[override-of-final-method] Cannot override final member `method2` from superclass `Base2` +qualifiers_final_decorator.py:64:9: error[override-of-final-method] Cannot override final member `method3` from superclass `Base2` +qualifiers_final_decorator.py:75:9: error[override-of-final-method] Cannot override final member `method4` from superclass `Base2` +qualifiers_final_decorator.py:86:9: error[invalid-overload] `@final` decorator should be applied only to the overload implementation +qualifiers_final_decorator.py:89:9: error[override-of-final-method] Cannot override final member `method` from superclass `Base3` +qualifiers_final_decorator.py:102:9: error[override-of-final-method] Cannot override final member `method` from superclass `Base4` +qualifiers_final_decorator.py:118:9: error[invalid-method-override] Invalid override of method `method`: Definition is incompatible with `Base5_2.method` +qualifiers_final_decorator.py:118:9: error[override-of-final-method] Cannot override final member `method` from superclass `Base5_2` +""" diff --git a/conformance/results/ty/specialtypes_any.toml b/conformance/results/ty/specialtypes_any.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/ty/specialtypes_any.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/ty/specialtypes_never.toml b/conformance/results/ty/specialtypes_never.toml new file mode 100644 index 000000000..9f528bb43 --- /dev/null +++ b/conformance/results/ty/specialtypes_never.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_never.py:19:22: error[invalid-return-type] Function always implicitly returns `None`, which is not assignable to return type `Never` +specialtypes_never.py:85:21: error[invalid-assignment] Object of type `list[Never]` is not assignable to `list[int]` +specialtypes_never.py:104:12: error[invalid-return-type] Return type does not match returned value: expected `ClassC[U@func10]`, found `ClassC[Never]` +""" diff --git a/conformance/results/ty/specialtypes_none.toml b/conformance/results/ty/specialtypes_none.toml new file mode 100644 index 000000000..9801c5cc7 --- /dev/null +++ b/conformance/results/ty/specialtypes_none.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_none.py:21:7: error[invalid-argument-type] Argument to function `func1` is incorrect: Expected `None`, found `` +specialtypes_none.py:27:19: error[invalid-assignment] Object of type `None` is not assignable to `Iterable[Unknown]` +specialtypes_none.py:41:7: error[invalid-argument-type] Argument to function `func2` is incorrect: Expected ``, found `None` +""" diff --git a/conformance/results/ty/specialtypes_promotions.toml b/conformance/results/ty/specialtypes_promotions.toml new file mode 100644 index 000000000..5dea49f83 --- /dev/null +++ b/conformance/results/ty/specialtypes_promotions.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_promotions.py:13:5: error[unresolved-attribute] Attribute `numerator` is not defined on `float` in union `int | float` +""" diff --git a/conformance/results/ty/specialtypes_type.toml b/conformance/results/ty/specialtypes_type.toml new file mode 100644 index 000000000..2832b3224 --- /dev/null +++ b/conformance/results/ty/specialtypes_type.toml @@ -0,0 +1,36 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 144: Expected 1 errors +Line 146: Expected 1 errors +Line 84: Unexpected errors ['specialtypes_type.py:84:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]`'] +Line 99: Unexpected errors ['specialtypes_type.py:99:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] +Line 100: Unexpected errors ['specialtypes_type.py:100:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] +Line 102: Unexpected errors ['specialtypes_type.py:102:5: error[type-assertion-failure] Type `Any` does not match asserted type `tuple[type, ...]`'] +Line 107: Unexpected errors ['specialtypes_type.py:107:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] +Line 108: Unexpected errors ['specialtypes_type.py:108:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] +Line 110: Unexpected errors ['specialtypes_type.py:110:5: error[type-assertion-failure] Type `Any` does not match asserted type `tuple[type, ...]`'] +Line 137: Unexpected errors ['specialtypes_type.py:137:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]`'] +Line 139: Unexpected errors ['specialtypes_type.py:139:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]`'] +Line 169: Unexpected errors ['specialtypes_type.py:169:21: error[invalid-assignment] Object of type `type` is not assignable to `type[int]`'] +Line 175: Unexpected errors ['specialtypes_type.py:175:16: error[invalid-return-type] Return type does not match returned value: expected `type[T@ClassA]`, found `type`'] +""" +output = """ +specialtypes_type.py:56:7: error[invalid-argument-type] Argument to function `func4` is incorrect: Expected `type[BasicUser | ProUser]`, found `` +specialtypes_type.py:70:7: error[invalid-argument-type] Argument to function `func5` is incorrect: Expected `type[Unknown]`, found `` +specialtypes_type.py:76:17: error[invalid-type-form] type[...] must have exactly one type argument +specialtypes_type.py:84:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]` +specialtypes_type.py:99:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown` +specialtypes_type.py:100:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown` +specialtypes_type.py:102:5: error[type-assertion-failure] Type `Any` does not match asserted type `tuple[type, ...]` +specialtypes_type.py:107:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown` +specialtypes_type.py:108:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown` +specialtypes_type.py:110:5: error[type-assertion-failure] Type `Any` does not match asserted type `tuple[type, ...]` +specialtypes_type.py:117:5: error[unresolved-attribute] Object of type `type` has no attribute `unknown` +specialtypes_type.py:120:5: error[unresolved-attribute] Object of type `type` has no attribute `unknown` +specialtypes_type.py:137:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]` +specialtypes_type.py:139:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]` +specialtypes_type.py:143:1: error[unresolved-attribute] Special form `typing.Type` has no attribute `unknown` +specialtypes_type.py:145:1: error[unresolved-attribute] Class `type` has no attribute `unknown` +specialtypes_type.py:169:21: error[invalid-assignment] Object of type `type` is not assignable to `type[int]` +specialtypes_type.py:175:16: error[invalid-return-type] Return type does not match returned value: expected `type[T@ClassA]`, found `type` +""" diff --git a/conformance/results/ty/tuples_type_compat.toml b/conformance/results/ty/tuples_type_compat.toml new file mode 100644 index 000000000..e908be4b9 --- /dev/null +++ b/conformance/results/ty/tuples_type_compat.toml @@ -0,0 +1,29 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +tuples_type_compat.py:15:27: error[invalid-assignment] Object of type `tuple[int | float, int | float | complex]` is not assignable to `tuple[int, int]` +tuples_type_compat.py:29:10: error[invalid-assignment] Object of type `tuple[int, ...]` is not assignable to `tuple[int, *tuple[int, ...]]` +tuples_type_compat.py:32:10: error[invalid-assignment] Object of type `tuple[int, *tuple[int, ...]]` is not assignable to `tuple[int]` +tuples_type_compat.py:33:10: error[invalid-assignment] Object of type `tuple[int, ...]` is not assignable to `tuple[int]` +tuples_type_compat.py:43:22: error[invalid-assignment] Object of type `tuple[int, ...]` is not assignable to `tuple[int]` +tuples_type_compat.py:62:26: error[invalid-assignment] Object of type `tuple[int, ...]` is not assignable to `tuple[int, int]` +tuples_type_compat.py:75:9: error[type-assertion-failure] Type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` does not match asserted type `tuple[int]` +tuples_type_compat.py:80:9: error[type-assertion-failure] Type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` does not match asserted type `tuple[str, str] | tuple[int, int]` +tuples_type_compat.py:85:9: error[type-assertion-failure] Type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` does not match asserted type `tuple[int, str, int]` +tuples_type_compat.py:101:13: error[type-assertion-failure] Type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` does not match asserted type `tuple[int]` +tuples_type_compat.py:106:13: error[type-assertion-failure] Type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` does not match asserted type `tuple[str, str] | tuple[int, int]` +tuples_type_compat.py:111:13: error[type-assertion-failure] Type `tuple[int] | tuple[str, str] | tuple[int, *tuple[str, ...], int]` does not match asserted type `tuple[int, str, int]` +tuples_type_compat.py:126:13: error[type-assertion-failure] Type `tuple[int | str, int | str]` does not match asserted type `tuple[int | str, str]` +tuples_type_compat.py:129:13: error[type-assertion-failure] Type `tuple[int | str, int | str]` does not match asserted type `tuple[int | str, int]` +tuples_type_compat.py:157:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[""]]` is not assignable to `tuple[int, str]` +tuples_type_compat.py:162:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[1], Literal[""]]` is not assignable to `tuple[int, *tuple[str, ...]]` +tuples_type_compat.py:163:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[1]]` is not assignable to `tuple[int, *tuple[str, ...]]` +tuples_type_compat.py:169:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[""]]` is not assignable to `tuple[int, *tuple[str, ...], int]` +tuples_type_compat.py:170:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[""], float]` is not assignable to `tuple[int, *tuple[str, ...], int]` +tuples_type_compat.py:175:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""], Literal[1]]` is not assignable to `tuple[*tuple[str, ...], int]` +tuples_type_compat.py:176:6: error[invalid-assignment] Object of type `tuple[Literal[""], Literal[""], float]` is not assignable to `tuple[*tuple[str, ...], int]` +tuples_type_compat.py:181:40: error[invalid-assignment] Object of type `tuple[str, str]` is not assignable to `tuple[str, str, int]` +tuples_type_compat.py:184:50: error[invalid-assignment] Object of type `tuple[str, str]` is not assignable to `tuple[str, str, str, *tuple[str, ...]]` +tuples_type_compat.py:188:50: error[invalid-assignment] Object of type `tuple[str, str]` is not assignable to `tuple[*tuple[str, ...], str, str, str]` +""" diff --git a/conformance/results/ty/tuples_type_form.toml b/conformance/results/ty/tuples_type_form.toml new file mode 100644 index 000000000..1a50c81a7 --- /dev/null +++ b/conformance/results/ty/tuples_type_form.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +tuples_type_form.py:12:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[2]]` is not assignable to `tuple[int]` +tuples_type_form.py:14:6: error[invalid-assignment] Object of type `tuple[Literal[1]]` is not assignable to `tuple[int, int]` +tuples_type_form.py:15:6: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[""]]` is not assignable to `tuple[int, int]` +tuples_type_form.py:25:7: error[invalid-assignment] Object of type `tuple[Literal[1]]` is not assignable to `tuple[()]` +tuples_type_form.py:36:7: error[invalid-assignment] Object of type `tuple[Literal[1], Literal[2], Literal[3], Literal[""]]` is not assignable to `tuple[int, ...]` +tuples_type_form.py:40:6: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization +tuples_type_form.py:41:6: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization +tuples_type_form.py:42:6: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization +tuples_type_form.py:43:6: error[invalid-type-form] Invalid `tuple` specialization: `...` can only be used as the second element in a two-element `tuple` specialization +tuples_type_form.py:44:6: error[invalid-type-form] Invalid `tuple` specialization: `...` cannot be used after an unpacked element +tuples_type_form.py:45:6: error[invalid-type-form] Invalid `tuple` specialization: `...` cannot be used after an unpacked element +""" diff --git a/conformance/results/ty/tuples_unpacked.toml b/conformance/results/ty/tuples_unpacked.toml new file mode 100644 index 000000000..d7033c1a8 --- /dev/null +++ b/conformance/results/ty/tuples_unpacked.toml @@ -0,0 +1,10 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 59: Expected 1 errors +Lines 60, 61: Expected error (tag 't14') +""" +output = """ +tuples_unpacked.py:40:5: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization +tuples_unpacked.py:41:5: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization +tuples_unpacked.py:51:9: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization +""" diff --git a/conformance/results/ty/typeddicts_alt_syntax.toml b/conformance/results/ty/typeddicts_alt_syntax.toml new file mode 100644 index 000000000..d39d314cc --- /dev/null +++ b/conformance/results/ty/typeddicts_alt_syntax.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 23: Expected 1 errors +Line 27: Expected 1 errors +Line 31: Expected 1 errors +Line 35: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/typeddicts_class_syntax.toml b/conformance/results/ty/typeddicts_class_syntax.toml new file mode 100644 index 000000000..691787e7c --- /dev/null +++ b/conformance/results/ty/typeddicts_class_syntax.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_class_syntax.py:29:5: error[invalid-typed-dict-statement] TypedDict class cannot have methods +typeddicts_class_syntax.py:33:5: error[invalid-typed-dict-statement] TypedDict class cannot have methods +typeddicts_class_syntax.py:38:5: error[invalid-typed-dict-statement] TypedDict class cannot have methods +typeddicts_class_syntax.py:44:32: error[invalid-typed-dict-header] Custom metaclasses are not supported in `TypedDict` definitions +typeddicts_class_syntax.py:49:32: error[unknown-argument] Unknown keyword argument `other` in `TypedDict` definition +""" diff --git a/conformance/results/ty/typeddicts_extra_items.toml b/conformance/results/ty/typeddicts_extra_items.toml new file mode 100644 index 000000000..2a353a588 --- /dev/null +++ b/conformance/results/ty/typeddicts_extra_items.toml @@ -0,0 +1,77 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 22: Expected 1 errors +Line 49: Expected 1 errors +Line 67: Expected 1 errors +Line 73: Expected 1 errors +Line 109: Expected 1 errors +Line 114: Expected 1 errors +Line 117: Expected 1 errors +Line 143: Expected 1 errors +Line 174: Expected 1 errors +Line 215: Expected 1 errors +Line 222: Expected 1 errors +Line 242: Expected 1 errors +Line 256: Expected 1 errors +Line 257: Expected 1 errors +Line 268: Expected 1 errors +Lines 91, 92: Expected error (tag 'MovieC') +Lines 94, 95: Expected error (tag 'MovieD') +Lines 184, 185: Expected error (tag 'MovieRequiredYear') +Lines 187, 188: Expected error (tag 'MovieNotRequiredYear') +Lines 196, 197: Expected error (tag 'BookWithPublisher') +Line 14: Unexpected errors ['typeddicts_extra_items.py:14:37: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`: Unknown key "novel_adaptation"'] +Line 29: Unexpected errors ['typeddicts_extra_items.py:29:5: error[type-assertion-failure] Type `str` does not match asserted type `bool`', 'typeddicts_extra_items.py:29:23: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`: Unknown key "novel_adaptation"'] +Line 43: Unexpected errors ['typeddicts_extra_items.py:43:5: error[invalid-key] Unknown key "other_extra_key" for TypedDict `InheritedMovie`: Unknown key "other_extra_key"'] +Line 129: Unexpected errors ['typeddicts_extra_items.py:129:15: error[invalid-argument-type] Cannot delete unknown key "year" from TypedDict `MovieEI`'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254:63: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year"'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255:63: error[invalid-key] Unknown key "description" for TypedDict `MovieExtraStr`: Unknown key "description"'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266:64: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year"'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284:43: error[invalid-key] Unknown key "year" for TypedDict `ExtraMovie`: Unknown key "year"'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299:54: error[invalid-key] Unknown key "summary" for TypedDict `MovieExtraStr`: Unknown key "summary"'] +Line 300: Unexpected errors ['typeddicts_extra_items.py:300:34: error[invalid-assignment] Object of type `MovieExtraStr` is not assignable to `Mapping[str, str]`'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302:54: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year"'] +Line 304: Unexpected errors ['typeddicts_extra_items.py:304:44: error[invalid-assignment] Object of type `MovieExtraInt` is not assignable to `Mapping[str, int | str]`'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310:5: error[type-assertion-failure] Type `list[tuple[str, object]]` does not match asserted type `list[tuple[str, int | str]]`'] +Line 311: Unexpected errors ['typeddicts_extra_items.py:311:5: error[type-assertion-failure] Type `list[object]` does not match asserted type `list[int | str]`'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326:25: error[invalid-assignment] Object of type `IntDict` is not assignable to `dict[str, int]`'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329:52: error[invalid-key] Unknown key "bar" for TypedDict `IntDictWithNum`: Unknown key "bar"'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330:32: error[invalid-assignment] Object of type `IntDictWithNum` is not assignable to `dict[str, int]`'] +Line 337: Unexpected errors ['typeddicts_extra_items.py:337:1: error[unresolved-attribute] Object of type `IntDictWithNum` has no attribute `clear`'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `tuple[str, int]`', 'typeddicts_extra_items.py:339:13: error[unresolved-attribute] Object of type `IntDictWithNum` has no attribute `popitem`'] +Line 342: Unexpected errors ['typeddicts_extra_items.py:342:27: error[invalid-key] TypedDict `IntDictWithNum` can only be subscripted with a string literal key, got key of type `str`.'] +Line 343: Unexpected errors ['typeddicts_extra_items.py:343:9: error[invalid-argument-type] Method `__delitem__` of type `(key: Literal["num"], /) -> None` cannot be called with key of type `str` on object of type `IntDictWithNum`'] +""" +output = """ +typeddicts_extra_items.py:14:37: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`: Unknown key "novel_adaptation" +typeddicts_extra_items.py:15:37: error[invalid-key] Unknown key "year" for TypedDict `Movie`: Unknown key "year" +typeddicts_extra_items.py:29:5: error[type-assertion-failure] Type `str` does not match asserted type `bool` +typeddicts_extra_items.py:29:23: error[invalid-key] Unknown key "novel_adaptation" for TypedDict `Movie`: Unknown key "novel_adaptation" +typeddicts_extra_items.py:39:54: error[invalid-argument-type] Invalid argument to key "year" with declared type `int` on TypedDict `InheritedMovie`: value of type `None` +typeddicts_extra_items.py:43:5: error[invalid-key] Unknown key "other_extra_key" for TypedDict `InheritedMovie`: Unknown key "other_extra_key" +typeddicts_extra_items.py:128:15: error[invalid-argument-type] Cannot delete required key "name" from TypedDict `MovieEI` +typeddicts_extra_items.py:129:15: error[invalid-argument-type] Cannot delete unknown key "year" from TypedDict `MovieEI` +typeddicts_extra_items.py:254:63: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year" +typeddicts_extra_items.py:255:63: error[invalid-key] Unknown key "description" for TypedDict `MovieExtraStr`: Unknown key "description" +typeddicts_extra_items.py:266:64: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year" +typeddicts_extra_items.py:278:47: error[invalid-key] Unknown key "year" for TypedDict `NonClosedMovie`: Unknown key "year" +typeddicts_extra_items.py:284:43: error[invalid-key] Unknown key "year" for TypedDict `ExtraMovie`: Unknown key "year" +typeddicts_extra_items.py:285:43: error[invalid-key] Unknown key "language" for TypedDict `ExtraMovie`: Unknown key "language" +typeddicts_extra_items.py:293:44: error[invalid-key] Unknown key "year" for TypedDict `ClosedMovie`: Unknown key "year" +typeddicts_extra_items.py:299:54: error[invalid-key] Unknown key "summary" for TypedDict `MovieExtraStr`: Unknown key "summary" +typeddicts_extra_items.py:300:34: error[invalid-assignment] Object of type `MovieExtraStr` is not assignable to `Mapping[str, str]` +typeddicts_extra_items.py:302:54: error[invalid-key] Unknown key "year" for TypedDict `MovieExtraInt`: Unknown key "year" +typeddicts_extra_items.py:303:34: error[invalid-assignment] Object of type `MovieExtraInt` is not assignable to `Mapping[str, int]` +typeddicts_extra_items.py:304:44: error[invalid-assignment] Object of type `MovieExtraInt` is not assignable to `Mapping[str, int | str]` +typeddicts_extra_items.py:310:5: error[type-assertion-failure] Type `list[tuple[str, object]]` does not match asserted type `list[tuple[str, int | str]]` +typeddicts_extra_items.py:311:5: error[type-assertion-failure] Type `list[object]` does not match asserted type `list[int | str]` +typeddicts_extra_items.py:326:25: error[invalid-assignment] Object of type `IntDict` is not assignable to `dict[str, int]` +typeddicts_extra_items.py:329:52: error[invalid-key] Unknown key "bar" for TypedDict `IntDictWithNum`: Unknown key "bar" +typeddicts_extra_items.py:330:32: error[invalid-assignment] Object of type `IntDictWithNum` is not assignable to `dict[str, int]` +typeddicts_extra_items.py:337:1: error[unresolved-attribute] Object of type `IntDictWithNum` has no attribute `clear` +typeddicts_extra_items.py:339:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `tuple[str, int]` +typeddicts_extra_items.py:339:13: error[unresolved-attribute] Object of type `IntDictWithNum` has no attribute `popitem` +typeddicts_extra_items.py:342:27: error[invalid-key] TypedDict `IntDictWithNum` can only be subscripted with a string literal key, got key of type `str`. +typeddicts_extra_items.py:343:9: error[invalid-argument-type] Method `__delitem__` of type `(key: Literal["num"], /) -> None` cannot be called with key of type `str` on object of type `IntDictWithNum` +typeddicts_extra_items.py:352:25: error[invalid-assignment] Object of type `dict[str, int]` is not assignable to `IntDict` +""" diff --git a/conformance/results/ty/typeddicts_final.toml b/conformance/results/ty/typeddicts_final.toml new file mode 100644 index 000000000..cdd4d0cd9 --- /dev/null +++ b/conformance/results/ty/typeddicts_final.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" diff --git a/conformance/results/ty/typeddicts_inheritance.toml b/conformance/results/ty/typeddicts_inheritance.toml new file mode 100644 index 000000000..b551d6f7f --- /dev/null +++ b/conformance/results/ty/typeddicts_inheritance.toml @@ -0,0 +1,8 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 65: Expected 1 errors +Lines 54, 55: Expected error (tag 'Y1') +""" +output = """ +typeddicts_inheritance.py:44:31: error[invalid-typed-dict-header] TypedDict class `BadTypedDict` can only inherit from TypedDict classes: `NonTypedDict` is not a `TypedDict` class +""" diff --git a/conformance/results/ty/typeddicts_operations.toml b/conformance/results/ty/typeddicts_operations.toml new file mode 100644 index 000000000..80d83117c --- /dev/null +++ b/conformance/results/ty/typeddicts_operations.toml @@ -0,0 +1,16 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_operations.py:22:17: error[invalid-assignment] Invalid assignment to key "name" with declared type `str` on TypedDict `Movie`: value of type `Literal[1982]` +typeddicts_operations.py:23:17: error[invalid-assignment] Invalid assignment to key "year" with declared type `int` on TypedDict `Movie`: value of type `Literal[""]` +typeddicts_operations.py:24:7: error[invalid-key] Unknown key "other" for TypedDict `Movie`: Unknown key "other" +typeddicts_operations.py:26:13: error[invalid-key] Unknown key "other" for TypedDict `Movie`: Unknown key "other" +typeddicts_operations.py:28:9: error[missing-typed-dict-key] Missing required key 'year' in TypedDict `Movie` constructor +typeddicts_operations.py:29:42: error[invalid-argument-type] Invalid argument to key "year" with declared type `int` on TypedDict `Movie`: value of type `float` +typeddicts_operations.py:32:36: error[invalid-key] Unknown key "other" for TypedDict `Movie`: Unknown key "other" +typeddicts_operations.py:37:20: error[missing-typed-dict-key] Missing required key 'name' in TypedDict `Movie` constructor +typeddicts_operations.py:47:1: error[unresolved-attribute] Object of type `Movie` has no attribute `clear` +typeddicts_operations.py:49:11: error[invalid-argument-type] Cannot delete required key "name" from TypedDict `Movie` +typeddicts_operations.py:62:1: error[unresolved-attribute] Object of type `MovieOptional` has no attribute `clear` +""" diff --git a/conformance/results/ty/typeddicts_readonly.toml b/conformance/results/ty/typeddicts_readonly.toml new file mode 100644 index 000000000..61b7ce008 --- /dev/null +++ b/conformance/results/ty/typeddicts_readonly.toml @@ -0,0 +1,11 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 36: Expected 1 errors +""" +output = """ +typeddicts_readonly.py:24:4: error[invalid-assignment] Cannot assign to key "members" on TypedDict `Band`: key is marked read-only +typeddicts_readonly.py:50:4: error[invalid-assignment] Cannot assign to key "title" on TypedDict `Movie1`: key is marked read-only +typeddicts_readonly.py:51:4: error[invalid-assignment] Cannot assign to key "year" on TypedDict `Movie1`: key is marked read-only +typeddicts_readonly.py:60:4: error[invalid-assignment] Cannot assign to key "title" on TypedDict `Movie2`: key is marked read-only +typeddicts_readonly.py:61:4: error[invalid-assignment] Cannot assign to key "year" on TypedDict `Movie2`: key is marked read-only +""" diff --git a/conformance/results/ty/typeddicts_readonly_consistency.toml b/conformance/results/ty/typeddicts_readonly_consistency.toml new file mode 100644 index 000000000..b289d22e6 --- /dev/null +++ b/conformance/results/ty/typeddicts_readonly_consistency.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_readonly_consistency.py:37:14: error[invalid-assignment] Object of type `A1` is not assignable to `B1` +typeddicts_readonly_consistency.py:38:14: error[invalid-assignment] Object of type `C1` is not assignable to `B1` +typeddicts_readonly_consistency.py:40:14: error[invalid-assignment] Object of type `A1` is not assignable to `C1` +typeddicts_readonly_consistency.py:81:14: error[invalid-assignment] Object of type `A2` is not assignable to `B2` +typeddicts_readonly_consistency.py:82:14: error[invalid-assignment] Object of type `C2` is not assignable to `B2` +typeddicts_readonly_consistency.py:84:14: error[invalid-assignment] Object of type `A2` is not assignable to `C2` +typeddicts_readonly_consistency.py:85:14: error[invalid-assignment] Object of type `B2` is not assignable to `C2` +""" diff --git a/conformance/results/ty/typeddicts_readonly_inheritance.toml b/conformance/results/ty/typeddicts_readonly_inheritance.toml new file mode 100644 index 000000000..e5517fa53 --- /dev/null +++ b/conformance/results/ty/typeddicts_readonly_inheritance.toml @@ -0,0 +1,16 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 50: Expected 1 errors +Line 94: Expected 1 errors +Line 98: Expected 1 errors +Line 106: Expected 1 errors +Line 119: Expected 1 errors +Line 132: Expected 1 errors +""" +output = """ +typeddicts_readonly_inheritance.py:36:4: error[invalid-assignment] Cannot assign to key "name" on TypedDict `Album2`: key is marked read-only +typeddicts_readonly_inheritance.py:65:19: error[missing-typed-dict-key] Missing required key 'name' in TypedDict `RequiredName` constructor +typeddicts_readonly_inheritance.py:82:14: error[invalid-assignment] Invalid assignment to key "ident" with declared type `str` on TypedDict `User`: value of type `Literal[3]` +typeddicts_readonly_inheritance.py:83:15: error[invalid-argument-type] Invalid argument to key "ident" with declared type `str` on TypedDict `User`: value of type `Literal[3]` +typeddicts_readonly_inheritance.py:84:5: error[missing-typed-dict-key] Missing required key 'ident' in TypedDict `User` constructor +""" diff --git a/conformance/results/ty/typeddicts_readonly_kwargs.toml b/conformance/results/ty/typeddicts_readonly_kwargs.toml new file mode 100644 index 000000000..ff5101052 --- /dev/null +++ b/conformance/results/ty/typeddicts_readonly_kwargs.toml @@ -0,0 +1,6 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 33: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/typeddicts_readonly_update.toml b/conformance/results/ty/typeddicts_readonly_update.toml new file mode 100644 index 000000000..c614899ef --- /dev/null +++ b/conformance/results/ty/typeddicts_readonly_update.toml @@ -0,0 +1,6 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 23: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/typeddicts_required.toml b/conformance/results/ty/typeddicts_required.toml new file mode 100644 index 000000000..8336b0745 --- /dev/null +++ b/conformance/results/ty/typeddicts_required.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 12: Expected 1 errors +Line 59: Expected 1 errors +Line 60: Expected 1 errors +""" +output = """ +typeddicts_required.py:16:5: error[invalid-type-form] `NotRequired` is not allowed in function parameter annotations +""" diff --git a/conformance/results/ty/typeddicts_type_consistency.toml b/conformance/results/ty/typeddicts_type_consistency.toml new file mode 100644 index 000000000..1048e6cb3 --- /dev/null +++ b/conformance/results/ty/typeddicts_type_consistency.toml @@ -0,0 +1,15 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_type_consistency.py:21:10: error[invalid-assignment] Object of type `B1` is not assignable to `A1` +typeddicts_type_consistency.py:38:10: error[invalid-assignment] Object of type `B2` is not assignable to `A2` +typeddicts_type_consistency.py:65:6: error[invalid-assignment] Object of type `A3` is not assignable to `B3` +typeddicts_type_consistency.py:69:21: error[invalid-key] Unknown key "y" for TypedDict `A3`: Unknown key "y" +typeddicts_type_consistency.py:76:22: error[invalid-assignment] Object of type `B3` is not assignable to `dict[str, int]` +typeddicts_type_consistency.py:77:25: error[invalid-assignment] Object of type `B3` is not assignable to `dict[str, object]` +typeddicts_type_consistency.py:78:22: error[invalid-assignment] Object of type `B3` is not assignable to `dict[Any, Any]` +typeddicts_type_consistency.py:82:25: error[invalid-assignment] Object of type `B3` is not assignable to `Mapping[str, int]` +typeddicts_type_consistency.py:101:14: error[invalid-assignment] Object of type `Unknown | None` is not assignable to `str` +typeddicts_type_consistency.py:126:56: error[invalid-argument-type] Invalid argument to key "inner_key" with declared type `str` on TypedDict `Inner1`: value of type `Literal[1]` +""" diff --git a/conformance/results/ty/typeddicts_usage.toml b/conformance/results/ty/typeddicts_usage.toml new file mode 100644 index 000000000..fe40d6182 --- /dev/null +++ b/conformance/results/ty/typeddicts_usage.toml @@ -0,0 +1,11 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +typeddicts_usage.py:23:7: error[invalid-key] Unknown key "director" for TypedDict `Movie`: Unknown key "director" +typeddicts_usage.py:24:17: error[invalid-assignment] Invalid assignment to key "year" with declared type `int` on TypedDict `Movie`: value of type `Literal["1982"]` +typeddicts_usage.py:28:17: error[missing-typed-dict-key] Missing required key 'name' in TypedDict `Movie` constructor +typeddicts_usage.py:28:18: error[invalid-key] Unknown key "title" for TypedDict `Movie`: Unknown key "title" +typeddicts_usage.py:35:4: error[isinstance-against-typed-dict] `TypedDict` class `Movie` cannot be used as the second argument to `isinstance`: This call will raise `TypeError` at runtime +typeddicts_usage.py:40:24: error[invalid-type-form] The special form `typing.TypedDict` is not allowed in type expressions +""" diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml new file mode 100644 index 000000000..4404b9897 --- /dev/null +++ b/conformance/results/ty/version.toml @@ -0,0 +1 @@ +version = "ty 0.0.19 (ae10022c2 2026-02-26)" From c7f653327513f0c2b62ec59744d211f498fa1dff Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 27 Feb 2026 13:38:10 +0000 Subject: [PATCH 03/11] manual overrides --- conformance/results/results.html | 154 +++++++++--------- conformance/results/ty/aliases_explicit.toml | 2 + conformance/results/ty/aliases_implicit.toml | 5 + conformance/results/ty/aliases_recursive.toml | 1 + .../results/ty/aliases_type_statement.toml | 8 + .../results/ty/aliases_typealiastype.toml | 7 + conformance/results/ty/aliases_variance.toml | 1 + .../results/ty/annotations_forward_refs.toml | 5 + .../results/ty/annotations_generators.toml | 1 + .../results/ty/callables_annotation.toml | 7 + conformance/results/ty/callables_kwargs.toml | 1 + .../results/ty/callables_subtyping.toml | 4 + .../results/ty/constructors_call_init.toml | 6 + .../ty/constructors_call_metaclass.toml | 1 + .../results/ty/constructors_call_new.toml | 1 + .../results/ty/constructors_call_type.toml | 5 + .../results/ty/constructors_callable.toml | 1 + .../results/ty/dataclasses_descriptors.toml | 4 + conformance/results/ty/dataclasses_hash.toml | 4 + .../results/ty/dataclasses_inheritance.toml | 2 + .../results/ty/dataclasses_match_args.toml | 3 + conformance/results/ty/dataclasses_slots.toml | 4 + .../ty/dataclasses_transform_class.toml | 4 + .../ty/dataclasses_transform_meta.toml | 4 + .../results/ty/directives_deprecated.toml | 6 + .../results/ty/directives_type_checking.toml | 4 + .../ty/directives_version_platform.toml | 4 + conformance/results/ty/enums_expansion.toml | 2 + conformance/results/ty/enums_members.toml | 4 + .../ty/exceptions_context_managers.toml | 1 + .../results/ty/generics_base_class.toml | 4 + conformance/results/ty/generics_basic.toml | 5 + conformance/results/ty/generics_defaults.toml | 6 + .../ty/generics_defaults_referential.toml | 6 + .../ty/generics_defaults_specialization.toml | 4 + .../results/ty/generics_paramspec_basic.toml | 10 ++ .../ty/generics_paramspec_components.toml | 4 + .../ty/generics_paramspec_semantics.toml | 4 + conformance/results/ty/generics_scoping.toml | 6 + .../results/ty/generics_self_usage.toml | 5 + .../ty/generics_syntax_compatibility.toml | 1 + .../ty/generics_syntax_infer_variance.toml | 1 + .../results/ty/generics_syntax_scoping.toml | 4 + .../results/ty/generics_type_erasure.toml | 4 + .../ty/generics_typevartuple_args.toml | 4 + .../ty/generics_typevartuple_basic.toml | 1 + .../ty/generics_typevartuple_callable.toml | 1 + .../ty/generics_typevartuple_concat.toml | 1 + .../generics_typevartuple_specialization.toml | 1 + .../ty/generics_typevartuple_unpack.toml | 1 + .../results/ty/generics_upper_bound.toml | 4 + conformance/results/ty/generics_variance.toml | 1 + .../results/ty/literals_interactions.toml | 4 + .../results/ty/namedtuples_define_class.toml | 4 + conformance/results/ty/namedtuples_usage.toml | 4 + conformance/results/ty/narrowing_typeis.toml | 4 + .../results/ty/overloads_consistency.toml | 1 + .../results/ty/protocols_class_objects.toml | 7 + .../results/ty/protocols_definition.toml | 7 + .../results/ty/protocols_explicit.toml | 5 + conformance/results/ty/protocols_generic.toml | 4 + conformance/results/ty/protocols_merging.toml | 4 + conformance/results/ty/protocols_modules.toml | 4 + .../results/ty/protocols_recursive.toml | 4 + .../ty/protocols_runtime_checkable.toml | 5 + .../results/ty/protocols_variance.toml | 1 + .../ty/qualifiers_final_annotation.toml | 5 + .../ty/qualifiers_final_decorator.toml | 4 + conformance/results/ty/specialtypes_type.toml | 6 + conformance/results/ty/tuples_unpacked.toml | 4 + .../results/ty/typeddicts_alt_syntax.toml | 1 + .../results/ty/typeddicts_extra_items.toml | 1 + .../results/ty/typeddicts_inheritance.toml | 4 + .../results/ty/typeddicts_readonly.toml | 4 + .../ty/typeddicts_readonly_inheritance.toml | 4 + .../ty/typeddicts_readonly_kwargs.toml | 1 + .../ty/typeddicts_readonly_update.toml | 1 + .../results/ty/typeddicts_required.toml | 5 + 78 files changed, 355 insertions(+), 77 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 4073349f4..5fcdb04b0 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -198,14 +198,14 @@

Python Type System Conformance Test Results

Pass
Partial

Incorrectly generates error for quoted type defined in class scope.

Partial

Types in quotes incorrectly refer to shadowing class member.

Does not reject some type forms that require quotes.

-Unknown +
Partial

Does not detect runtime errors from partially stringified PEP-604 unions.

Resolves references in type annotations as referring to end-of-scope types (https://discuss.python.org/t/annotation-string-references-in-class-scope-in-conformance-tests/105439)

     annotations_generators
Partial

Does not report incompatible Generator type in `yield from` statement.

Pass Pass
Partial

Does not detect that invalid yield is unreachable

-Unknown +Unsupported      annotations_methods
Pass*

Type evaluation differs from other type checkers because of ambiguity in the spec related to method bindings.

@@ -257,7 +257,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Allows arbitrary attributes to be accessed on `TA` where `TA = typing.Type[typing.Any]` or `TA = type[typing.Any]`.

Treats `type` equivalently to `type[object]` rather than `type[typing.Any]`.

Incorrectly infers `b.__mro__` as having type `typing.Any` rather than `tuple[type, ...]` if `b` has type `type[typing.Any]` or `typing.Type[typing.Any]`.

Generics @@ -267,56 +267,56 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Does not report an error when the type variable order is inconsistent between base classes.

     generics_basic Pass Pass Pass
Partial

Incorrect rejects + between two AnyStr

Constrained type var resolves to subtype instead of explcitly listed constraint

-Unknown +
Partial

Incorrectly allows constrained type variables to be solved to a union of their constraints.

Permits generic metaclasses.

     generics_defaults Partial Pass Pass Pass -Unknown +
Partial

Does not forbid a `TypeVar` immediately following a `TypeVarTuple` in a parameter list from having a default.

Infers a more precise type than `type[]` for class objects.

Incorrectly rejects list literals in specializations if a class is generic over a `TypeVarTuple` and a `ParamSpec`.

     generics_defaults_referential Partial Pass Pass Pass -Unknown +
Partial

Does not reject class definitions where a type variable `T2` that has `T1` as its default comes before `T1`.

Does not reject using a type parameter from an outer scope as a default for a type parameter in an inner scope.

Infers a more precise type than `type[]` for class objects.

     generics_defaults_specialization Partial Pass Pass Pass -Unknown +
Partial

Does not reject subscription of an already-specialized generic class.

     generics_paramspec_basic Pass Pass Pass Pass -Unknown +
Unsupported

Supports `ParamSpec` but is missing many validation checks.

Does not support `Concatenate`.

Does not reject using a bare `ParamSpec` as a type alias value.

Incorrectly allows type variables to be specialized with `ParamSpec`s.

Allows bare variables to be annotated with `ParamSpec`.

Allows `ParamSpec` to be used in the return type of a `Callable` annotation.

     generics_paramspec_components Pass Pass Pass
Partial

Does not reject usage of args/kwargs for out-of-scope ParamSpec

-Unknown +
Partial

Supports `ParamSpec` but is missing several validation checks around correct usage.

     generics_paramspec_semantics Pass
Pass*

Constraint solver doesn't find common type for two signatures captured by a single ParamSpec (allowed).

Pass Pass -Unknown +
Partial

Does not support `Concatenate`.

     generics_paramspec_specialization Pass @@ -330,7 +330,7 @@

Python Type System Conformance Test Results

Pass Partial
Partial

Does not implement several scoping checks/restrictions for generics

-Unknown +
Partial

Does not reject unbound type variables appearing in the bodies of generic functions or classes.

Does not reject a generic attribute in an inner class reusing a type variable scoped to an outer class.

Does not reject unbound type variables used in global-scope annotations.

     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]`.

@@ -365,14 +365,14 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Does not implement some restrictions on where Self can be used

-Unknown +
Partial

Does not reject `Self` used in a return annotation when `self` is annotated using another type variable.

Does not reject `Self` used in staticmethods or metaclasses.

     generics_syntax_compatibility Pass Pass Pass Pass -Unknown +Unsupported      generics_syntax_declarations Pass @@ -386,49 +386,49 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +Unsupported      generics_syntax_scoping
Partial

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

Pass Pass Pass -Unknown +
Partial

Does not reject type variables bound in outer scopes from being rebound in inner scopes.

     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 Pass Pass -Unknown +
Partial

Does not reject access of generic instance variable from the class object.

     generics_typevartuple_args
Partial

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

Pass Pass Pass -Unknown +
Partial

Supports PEP-646 unpacked tuples but not 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 Pass
Partial

TypeVarTuple is pinned too early when calling generic function

-Unknown +Unsupported      generics_typevartuple_callable Pass Pass Pass Pass -Unknown +Unsupported      generics_typevartuple_concat Pass Pass Pass Pass -Unknown +Unsupported      generics_typevartuple_overloads Pass @@ -442,28 +442,28 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Sometimes specializes to tuple[Any, ...] instead of empty tuple

-Unknown +Unsupported      generics_typevartuple_unpack Pass Pass Pass Pass -Unknown +Unsupported      generics_upper_bound
Partial

Does not reject use of type variable within an upper bound.

Pass Pass Pass -Unknown +
Pass*

Infers list[set | Unknown]` for `[1, 2]` and `set[Unknown | int]` for `{1, 2}`, leading to type-assertion failures for spurious reasons despite the type variables being accurately solved.

     generics_variance
Partial

Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

Pass Pass Pass -Unknown +Unsupported      generics_variance_inference Pass @@ -487,14 +487,14 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Final attributes not initialized on the class can be assigned to

-Unknown +
Partial

Does not forbid `Final`-annotated assignments to attributes on `self` in non-`__init__` methods.

Does not flag modifications of `Final`-annotated attributes via augmented assignment.

     qualifiers_final_decorator Pass Pass Pass Pass -Unknown +
Partial

Does not reject using `@final` on a non-method function.

Class type compatibility @@ -521,14 +521,14 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

`Concatenate` in type aliases is currently unsupported

     aliases_implicit Pass Pass Pass
Partial

Does not reject invalid syntax in implicit type aliases.

-Unknown +
Partial

Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases.

Does not support `Concatenate` in type aliases.

     aliases_newtype
Partial

`NewType`s are incorrectly considered to be classes.

@@ -542,28 +542,28 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +Unsupported      aliases_type_statement
Partial

Does not reject type alias defined in function scope.

Pass Pass Pass -Unknown +
Partial

Does not reject use of the `type` statement inside functions.

Does not reject attempts to use legacy type variables in new-tyle type aliases.

Does not reject circular definitions of type aliases.

Does not reject redeclarations of type aliases.

Does not support `type` statements generic over `TypeVarTuple`s.

     aliases_typealiastype
Partial

Incorrectly rejects some recursive type aliases using TypeAliasType.

Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

Pass Pass
Partial

Does not detect circular definitions.

-Unknown +
Partial

Does not reject specializing a type parameter in a generic type alias with a type inconsistent with the parameter's upper bound.

Does not reject declaring a type alias with a type variable that is not in scope.

Does not reject declaring a type alias with a non-literal tuple passed to the `type_params` parameter.

Does not reject cyclically defined type aliases.

     aliases_variance Pass Pass Pass Pass -Unknown +Unsupported Literals @@ -573,7 +573,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Deliberately does not allow `str` to be narrowed to literal string types through equality or containment checks due to the possibility of `str` subclasses that could have unexpected equality semantics.

     literals_literalstring
Unsupported

Support for `LiteralString` is not implemented.

@@ -604,56 +604,56 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Unsupported

`type[Proto]` is not yet supported.

`ClassVar` protocol members are not yet supported.

`@property` protocol members are only partially supported.

A class object `C` is only considered to inhabit a protocol type with a method member `f` if `f` exists as an attribute on the metaclass of `C`.

     protocols_definition
Partial

Does not detect protocol mismatch if concrete method is missing annotations.

Does not detect protocol mismatch if concrete method's parameters are position-only.

Pass Pass Pass -Unknown +
Partial

Does not reject implicit instance attributes in `Protocol` methods.

Does not support `ClassVar` protocol members.

Incorrectly considers `ClassVar` attributes on concrete classes as satisfying non-`ClassVar` attribute members on protocols.

Only has partial support for `@property` protocol members.

     protocols_explicit
Pass*

Does not report unimplemented attributes for class that explicitly derives from protocol until it is instantiated.

Pass Pass Pass -Unknown +
Unsupported

Allows implicitly abstract protocol methods to be called via `super()` on a protocol subclass.

Allows instantiation of abstract subclasses of protocol classes.

     protocols_generic Pass Pass Pass Pass -Unknown +
Partial

Only partially supports `@property` protocol members.

     protocols_merging Pass Pass Pass Pass -Unknown +
Partial

Does not reject attempted instantiation of abstract subclasses of protocols.

     protocols_modules Pass Pass Pass
Partial

Fails one subtyping example of protocol modules

-Unknown +
Partial

Never considers a module as satisfying a protocol with a method member due to the fact that the method will never exist on the class `types.ModuleType`, only on a given specific module instance.

     protocols_recursive Pass Pass Pass Pass -Unknown +
Partial

Fails to solve a type variable involving a recursive generic protocol.

     protocols_runtime_checkable
Partial

Does not report unsafe overlap for runtime_checkable protocol.

Pass Pass Pass -Unknown +
Partial

Detects invalid `isinstance()`/`issubclass()` calls of the form `isinstance(x, P)` but not of the form `isinstance(x, (P1, P2))`.

Does not reject `isinstance()` or `issubclass()` calls against runtime-checkable protocols where there is an unsafe overlap between the type of the first argument and the protocol.

     protocols_self Pass @@ -674,7 +674,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +Unsupported Callables @@ -684,14 +684,14 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Parameter names are lost when resolving ParamSpec

-Unknown +
Partial

Does not reject `Callable[[...], int]` in a type expression.

Does not support `Concatenate`.

Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`.

Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`.

     callables_kwargs
Partial

Allows callable without kwargs to be assigned to callable with unpacked kwargs

Pass Pass Pass -Unknown +Unsupported      callables_protocol Pass @@ -705,7 +705,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Does not reject assigning a callable with a single variadic positional parameter to a variable declared with a `Callable` type that accepts certain specific keyword arguments.

Constructors @@ -715,35 +715,35 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Does not reject invalid argument types to an inherited constructor in a specialized subclass of a generic superclass.

Does not reject class-scoped type variables used in the `self` annotation.

Does not support inferring type variables for generic classes where the `__init__` method uses method-scoped type variables.

     constructors_call_metaclass
Unupported

Does not honor metaclass __call__ method when evaluating constructor call.

Does not skip evaluation of __new__ and __init__ if custom metaclass call returns non-class.

Pass Pass Pass -Unknown +Unsupported      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 Pass Pass -Unknown +Unsupported      constructors_call_type
Partial

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

Pass Pass Pass -Unknown +
Partial

Does not support metaclass `__call__`.

Has overly lenient handling of calls to `type[T]` if `T` is a type variable without an upper bound.

     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 Pass
Partial

Converting constructor to callable does not preserve class-scoped type params.

Converting constructor to callable does not substitute Self in __new__

Converting constructor to callable uses __new__ signature instead of __init__

-Unknown +Unsupported      constructors_consistency
Pass*

Does not report inconsistency between __new__ and __init__ (optional).

@@ -767,7 +767,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +Unsupported      overloads_definitions
Partial

Allows @override to be on all overloads and implementation, instead of just implementation.

@@ -798,7 +798,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Some error suppressing context managers are not detected

-Unknown +Unsupported Dataclasses @@ -808,7 +808,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

* Assumes descriptor behavior only when field is assigned in class body

* Doesn't allow non-data descriptors or data descriptors with differing `__get__` and `__set__` types

-Unknown +
Partial

Only infers a descriptor `__get__` method as being called when a descriptor attribute is accessed on an instance if the descriptor attribute is present in the class namespace.

     dataclasses_final
Partial

Wrongly requires a Final dataclass field to be initialized at class level.

Doesn't support Final nested inside ClassVar.

@@ -829,14 +829,14 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Unsupported

Infers all objects as being hashable.

     dataclasses_inheritance Pass Pass Pass Pass -Unknown +
Unsupported

Currently only enforces the Liskov Substitution Principle for methods.

     dataclasses_kwonly Pass @@ -850,7 +850,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Pass*

Infers `__match_args__` as having type `tuple[()] | Unknown` for `__match_args__ = ()`

     dataclasses_order Pass @@ -871,14 +871,14 @@

Python Type System Conformance Test Results

Pass Pass
Partial

__slots__ is generated but not checked during attribute assignment

-Unknown +
Partial

Synthesizes a `__slots__` attribute but does not validate attribute assignments against `__slots__`.

     dataclasses_transform_class Pass Pass Pass Pass -Unknown +
Partial

Does not detect non-frozen `dataclass_transform` dataclasses invalidly inheriting from frozen ones.

     dataclasses_transform_converter
Unsupported

Converter parameter not yet supported.

@@ -906,7 +906,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Does not detect non-frozen `dataclass_transform` dataclasses invalidly inheriting from frozen ones.

     dataclasses_usage
Pass*

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

@@ -923,7 +923,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +Unsupported      typeddicts_class_syntax Pass @@ -937,7 +937,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +Unsupported      typeddicts_final Pass @@ -951,7 +951,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Does not validate overrides of `TypedDict` fields in subclasses.

     typeddicts_operations Pass @@ -965,7 +965,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Supports `ReadOnly`, but not the functional syntax for `TypedDict`s currently, leading to one assertion failing.

     typeddicts_readonly_consistency Pass @@ -979,28 +979,28 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Does not validate overrides of `TypedDict` keys.

     typeddicts_readonly_kwargs Pass Pass Pass Pass -Unknown +Unsupported      typeddicts_readonly_update
Partial

Incorrectly allows update of ReadOnly item.

Incorrectly rejects update involving an item with Never type.

Pass Pass Pass -Unknown +Unsupported      typeddicts_required Pass Pass Pass Pass -Unknown +
Partial

Does not reject use of `Required` and `NotRequired` in non-`TypedDict` classes.

Does not reject nested use such as `Required[Required[int]]`.

     typeddicts_type_consistency Pass @@ -1038,7 +1038,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Only supports the new syntax using `*`, not `typing.Unpack`.

Named tuples @@ -1048,7 +1048,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Permits subclasses of `NamedTuple` classes to override read-only attributes in the class body of the subclass.

     namedtuples_define_functional Pass @@ -1069,7 +1069,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Does not detect runtime errors from attempting to delete namedtuple attributes.

Enumerations @@ -1093,7 +1093,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Does not support `enum.Flag`.

     enums_member_names
Pass*

Does not support special-cased handling of member name literal types in some cases (optional).

@@ -1114,7 +1114,7 @@

Python Type System Conformance Test Results

Pass*

Does not support `_ignore_` mechanism (optional).

Pass Pass -Unknown +
Partial

Does not reject explicitly annotated enum members.

Type narrowing @@ -1131,7 +1131,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Intersects the pre-existing type with the top materialization of the bracketed type rather than the bracketed type itself.

Type checker directives @@ -1155,7 +1155,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Does not detect calls to deprecated overloads.

Does not detect implicit calls to deprecated dunder methods, for example via operators.

Does not detect accesses of, or attempts to set, deprecated properties.

     directives_no_type_check
Partial

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

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

@@ -1176,7 +1176,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Attempts to detect some errors even in blocks it determines to be unreachable, including in `if not TYPE_CHECKING` blocks.

     directives_type_ignore
Partial

Does not honor "# type: ignore" comment if comment includes additional text.

@@ -1204,7 +1204,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -Unknown +
Partial

Attempts to detect basic errors even in blocks it determines to be unreachable.

Historical and deprecated features diff --git a/conformance/results/ty/aliases_explicit.toml b/conformance/results/ty/aliases_explicit.toml index d3c88d190..07ed552a6 100644 --- a/conformance/results/ty/aliases_explicit.toml +++ b/conformance/results/ty/aliases_explicit.toml @@ -1,4 +1,6 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = "`Concatenate` in type aliases is currently unsupported" errors_diff = """ Line 87: Expected 1 errors Line 100: Expected 1 errors diff --git a/conformance/results/ty/aliases_implicit.toml b/conformance/results/ty/aliases_implicit.toml index 5e961a906..9419afb9e 100644 --- a/conformance/results/ty/aliases_implicit.toml +++ b/conformance/results/ty/aliases_implicit.toml @@ -1,4 +1,9 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject variables with `Any` or `Unknown` types when used as implicit type aliases. +Does not support `Concatenate` in type aliases. +""" errors_diff = """ Line 106: Expected 1 errors Line 111: Expected 1 errors diff --git a/conformance/results/ty/aliases_recursive.toml b/conformance/results/ty/aliases_recursive.toml index 536250ecd..b74c97b2a 100644 --- a/conformance/results/ty/aliases_recursive.toml +++ b/conformance/results/ty/aliases_recursive.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 19: Expected 1 errors Line 20: Expected 1 errors diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml index c51088f05..48c423d60 100644 --- a/conformance/results/ty/aliases_type_statement.toml +++ b/conformance/results/ty/aliases_type_statement.toml @@ -1,4 +1,12 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject use of the `type` statement inside functions. +Does not reject attempts to use legacy type variables in new-tyle type aliases. +Does not reject circular definitions of type aliases. +Does not reject redeclarations of type aliases. +Does not support `type` statements generic over `TypeVarTuple`s. +""" errors_diff = """ Line 56: Expected 1 errors Line 62: Expected 1 errors diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml index 2196d8a12..9e5470da3 100644 --- a/conformance/results/ty/aliases_typealiastype.toml +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -1,4 +1,11 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject specializing a type parameter in a generic type alias with a type inconsistent with the parameter's upper bound. +Does not reject declaring a type alias with a type variable that is not in scope. +Does not reject declaring a type alias with a non-literal tuple passed to the `type_params` parameter. +Does not reject cyclically defined type aliases. +""" errors_diff = """ Line 40: Expected 1 errors Line 43: Expected 1 errors diff --git a/conformance/results/ty/aliases_variance.toml b/conformance/results/ty/aliases_variance.toml index 5add77e80..435955993 100644 --- a/conformance/results/ty/aliases_variance.toml +++ b/conformance/results/ty/aliases_variance.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 24: Expected 1 errors Line 28: Expected 1 errors diff --git a/conformance/results/ty/annotations_forward_refs.toml b/conformance/results/ty/annotations_forward_refs.toml index b16f07c95..0c6f922da 100644 --- a/conformance/results/ty/annotations_forward_refs.toml +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -1,4 +1,9 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not detect runtime errors from partially stringified PEP-604 unions. +Resolves references in type annotations as referring to end-of-scope types (https://discuss.python.org/t/annotation-string-references-in-class-scope-in-conformance-tests/105439) +""" errors_diff = """ Line 24: Expected 1 errors Line 25: Expected 1 errors diff --git a/conformance/results/ty/annotations_generators.toml b/conformance/results/ty/annotations_generators.toml index dd16a7b7e..f2b2b5e27 100644 --- a/conformance/results/ty/annotations_generators.toml +++ b/conformance/results/ty/annotations_generators.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 51: Expected 1 errors Line 54: Expected 1 errors diff --git a/conformance/results/ty/callables_annotation.toml b/conformance/results/ty/callables_annotation.toml index f1eafe14c..634b55bf7 100644 --- a/conformance/results/ty/callables_annotation.toml +++ b/conformance/results/ty/callables_annotation.toml @@ -1,4 +1,11 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject `Callable[[...], int]` in a type expression. +Does not support `Concatenate`. +Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`. +Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`. +""" errors_diff = """ Line 59: Expected 1 errors Line 91: Expected 1 errors diff --git a/conformance/results/ty/callables_kwargs.toml b/conformance/results/ty/callables_kwargs.toml index fcf1820d0..610256cb3 100644 --- a/conformance/results/ty/callables_kwargs.toml +++ b/conformance/results/ty/callables_kwargs.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 46: Expected 1 errors Line 51: Expected 1 errors diff --git a/conformance/results/ty/callables_subtyping.toml b/conformance/results/ty/callables_subtyping.toml index 9ddae7225..d410bf7e6 100644 --- a/conformance/results/ty/callables_subtyping.toml +++ b/conformance/results/ty/callables_subtyping.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject assigning a callable with a single variadic positional parameter to a variable declared with a `Callable` type that accepts certain specific keyword arguments. +""" errors_diff = """ Line 125: Expected 1 errors """ diff --git a/conformance/results/ty/constructors_call_init.toml b/conformance/results/ty/constructors_call_init.toml index 7d23e6fed..3e0fc1e71 100644 --- a/conformance/results/ty/constructors_call_init.toml +++ b/conformance/results/ty/constructors_call_init.toml @@ -1,4 +1,10 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject invalid argument types to an inherited constructor in a specialized subclass of a generic superclass. +Does not reject class-scoped type variables used in the `self` annotation. +Does not support inferring type variables for generic classes where the `__init__` method uses method-scoped type variables. +""" errors_diff = """ Line 42: Expected 1 errors Line 107: Expected 1 errors diff --git a/conformance/results/ty/constructors_call_metaclass.toml b/conformance/results/ty/constructors_call_metaclass.toml index c5ca3b7bb..f1ea87250 100644 --- a/conformance/results/ty/constructors_call_metaclass.toml +++ b/conformance/results/ty/constructors_call_metaclass.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 39: Unexpected errors ['constructors_call_metaclass.py:39:1: error[type-assertion-failure] Type `Class2` does not match asserted type `int | Meta2`', 'constructors_call_metaclass.py:39:13: error[missing-argument] No argument provided for required parameter `x` of function `__new__`'] Line 46: Unexpected errors ["constructors_call_metaclass.py:46:16: error[invalid-super-argument] `type[T@__call__]` is not an instance or subclass of `` in `super(, type[T@__call__])` call"] diff --git a/conformance/results/ty/constructors_call_new.toml b/conformance/results/ty/constructors_call_new.toml index 17fd1abbb..c075fbba1 100644 --- a/conformance/results/ty/constructors_call_new.toml +++ b/conformance/results/ty/constructors_call_new.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 49: Unexpected errors ['constructors_call_new.py:49:1: error[type-assertion-failure] Type `Class3` does not match asserted type `int`', 'constructors_call_new.py:49:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`'] Line 64: Unexpected errors ['constructors_call_new.py:64:1: error[type-assertion-failure] Type `Class4` does not match asserted type `Class4 | Any`', 'constructors_call_new.py:64:13: error[missing-argument] No argument provided for required parameter `x` of bound method `__init__`'] diff --git a/conformance/results/ty/constructors_call_type.toml b/conformance/results/ty/constructors_call_type.toml index 3ad574c8f..1a77533de 100644 --- a/conformance/results/ty/constructors_call_type.toml +++ b/conformance/results/ty/constructors_call_type.toml @@ -1,4 +1,9 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not support metaclass `__call__`. +Has overly lenient handling of calls to `type[T]` if `T` is a type variable without an upper bound. +""" errors_diff = """ Line 30: Expected 1 errors Line 64: Expected 1 errors diff --git a/conformance/results/ty/constructors_callable.toml b/conformance/results/ty/constructors_callable.toml index 7d82f401f..40f1de614 100644 --- a/conformance/results/ty/constructors_callable.toml +++ b/conformance/results/ty/constructors_callable.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 66: Expected 1 errors Line 67: Expected 1 errors diff --git a/conformance/results/ty/dataclasses_descriptors.toml b/conformance/results/ty/dataclasses_descriptors.toml index 83b9a940a..91ad20b90 100644 --- a/conformance/results/ty/dataclasses_descriptors.toml +++ b/conformance/results/ty/dataclasses_descriptors.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Only infers a descriptor `__get__` method as being called when a descriptor attribute is accessed on an instance if the descriptor attribute is present in the class namespace. +""" errors_diff = """ Line 66: Unexpected errors ['dataclasses_descriptors.py:66:1: error[type-assertion-failure] Type `int | Desc2[int]` does not match asserted type `int`'] Line 67: Unexpected errors ['dataclasses_descriptors.py:67:1: error[type-assertion-failure] Type `str | Desc2[str]` does not match asserted type `str`'] diff --git a/conformance/results/ty/dataclasses_hash.toml b/conformance/results/ty/dataclasses_hash.toml index a7f264ee3..bc6eb1eaf 100644 --- a/conformance/results/ty/dataclasses_hash.toml +++ b/conformance/results/ty/dataclasses_hash.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Unsupported" +notes = """ +Infers all objects as being hashable. +""" errors_diff = """ Line 15: Expected 1 errors Line 32: Expected 1 errors diff --git a/conformance/results/ty/dataclasses_inheritance.toml b/conformance/results/ty/dataclasses_inheritance.toml index 6973d93fa..d342acf72 100644 --- a/conformance/results/ty/dataclasses_inheritance.toml +++ b/conformance/results/ty/dataclasses_inheritance.toml @@ -1,4 +1,6 @@ conformance_automated = "Fail" +conformant = "Unsupported" +notes = """Currently only enforces the Liskov Substitution Principle for methods.""" errors_diff = """ Line 62: Expected 1 errors Line 66: Expected 1 errors diff --git a/conformance/results/ty/dataclasses_match_args.toml b/conformance/results/ty/dataclasses_match_args.toml index 60c3e1755..7c80a2e84 100644 --- a/conformance/results/ty/dataclasses_match_args.toml +++ b/conformance/results/ty/dataclasses_match_args.toml @@ -1,4 +1,7 @@ conformance_automated = "Fail" +conformant = "Pass" +notes = """ +Infers `__match_args__` as having type `tuple[()] | Unknown` for `__match_args__ = ()`""" errors_diff = """ Line 49: Unexpected errors ['dataclasses_match_args.py:49:1: error[type-assertion-failure] Type `Unknown | tuple[()]` does not match asserted type `tuple[()]`'] """ diff --git a/conformance/results/ty/dataclasses_slots.toml b/conformance/results/ty/dataclasses_slots.toml index 188d72cc7..818e9cd48 100644 --- a/conformance/results/ty/dataclasses_slots.toml +++ b/conformance/results/ty/dataclasses_slots.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Synthesizes a `__slots__` attribute but does not validate attribute assignments against `__slots__`. +""" errors_diff = """ Line 25: Expected 1 errors Line 38: Expected 1 errors diff --git a/conformance/results/ty/dataclasses_transform_class.toml b/conformance/results/ty/dataclasses_transform_class.toml index 190c94232..f971c9041 100644 --- a/conformance/results/ty/dataclasses_transform_class.toml +++ b/conformance/results/ty/dataclasses_transform_class.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not detect non-frozen `dataclass_transform` dataclasses invalidly inheriting from frozen ones. +""" errors_diff = """ Line 51: Expected 1 errors """ diff --git a/conformance/results/ty/dataclasses_transform_meta.toml b/conformance/results/ty/dataclasses_transform_meta.toml index 5d0269e6d..c39f9851b 100644 --- a/conformance/results/ty/dataclasses_transform_meta.toml +++ b/conformance/results/ty/dataclasses_transform_meta.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not detect non-frozen `dataclass_transform` dataclasses invalidly inheriting from frozen ones. +""" errors_diff = """ Line 51: Expected 1 errors """ diff --git a/conformance/results/ty/directives_deprecated.toml b/conformance/results/ty/directives_deprecated.toml index e8fdedeb4..45177b364 100644 --- a/conformance/results/ty/directives_deprecated.toml +++ b/conformance/results/ty/directives_deprecated.toml @@ -1,4 +1,10 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not detect calls to deprecated overloads. +Does not detect implicit calls to deprecated dunder methods, for example via operators. +Does not detect accesses of, or attempts to set, deprecated properties. +""" errors_diff = """ Line 30: Expected 1 errors Line 41: Expected 1 errors diff --git a/conformance/results/ty/directives_type_checking.toml b/conformance/results/ty/directives_type_checking.toml index 1192ebf6f..a9ad6809b 100644 --- a/conformance/results/ty/directives_type_checking.toml +++ b/conformance/results/ty/directives_type_checking.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Attempts to detect some errors even in blocks it determines to be unreachable, including in `if not TYPE_CHECKING` blocks. +""" errors_diff = """ Line 11: Unexpected errors ['directives_type_checking.py:11:14: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] """ diff --git a/conformance/results/ty/directives_version_platform.toml b/conformance/results/ty/directives_version_platform.toml index d1f6e414e..b86f074ed 100644 --- a/conformance/results/ty/directives_version_platform.toml +++ b/conformance/results/ty/directives_version_platform.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Attempts to detect basic errors even in blocks it determines to be unreachable. +""" errors_diff = """ Line 14: Unexpected errors ['directives_version_platform.py:14:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] Line 22: Unexpected errors ['directives_version_platform.py:22:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] diff --git a/conformance/results/ty/enums_expansion.toml b/conformance/results/ty/enums_expansion.toml index 585d7b19a..5e5e1f0de 100644 --- a/conformance/results/ty/enums_expansion.toml +++ b/conformance/results/ty/enums_expansion.toml @@ -1,4 +1,6 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """Does not support `enum.Flag`.""" errors_diff = """ Line 53: Expected 1 errors Line 52: Unexpected errors ['enums_expansion.py:52:9: error[type-assertion-failure] Type `Literal[CustomFlags.FLAG3]` does not match asserted type `CustomFlags`'] diff --git a/conformance/results/ty/enums_members.toml b/conformance/results/ty/enums_members.toml index bcbc5875b..b594675a3 100644 --- a/conformance/results/ty/enums_members.toml +++ b/conformance/results/ty/enums_members.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject explicitly annotated enum members. +""" errors_diff = """ Line 50: Expected 1 errors """ diff --git a/conformance/results/ty/exceptions_context_managers.toml b/conformance/results/ty/exceptions_context_managers.toml index 4f4d312e0..8ba800645 100644 --- a/conformance/results/ty/exceptions_context_managers.toml +++ b/conformance/results/ty/exceptions_context_managers.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 50: Unexpected errors ['exceptions_context_managers.py:50:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str`'] Line 57: Unexpected errors ['exceptions_context_managers.py:57:5: error[type-assertion-failure] Type `str` does not match asserted type `int | str`'] diff --git a/conformance/results/ty/generics_base_class.toml b/conformance/results/ty/generics_base_class.toml index ef05867ba..1068b1ca8 100644 --- a/conformance/results/ty/generics_base_class.toml +++ b/conformance/results/ty/generics_base_class.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not report an error when the type variable order is inconsistent between base classes. +""" errors_diff = """ Line 98: Expected 1 errors """ diff --git a/conformance/results/ty/generics_basic.toml b/conformance/results/ty/generics_basic.toml index 58ef3281c..e2f98ef90 100644 --- a/conformance/results/ty/generics_basic.toml +++ b/conformance/results/ty/generics_basic.toml @@ -1,4 +1,9 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Incorrectly allows constrained type variables to be solved to a union of their constraints. +Permits generic metaclasses. +""" errors_diff = """ Line 40: Expected 1 errors Line 41: Expected 1 errors diff --git a/conformance/results/ty/generics_defaults.toml b/conformance/results/ty/generics_defaults.toml index 9e18d905d..2b6ffb91e 100644 --- a/conformance/results/ty/generics_defaults.toml +++ b/conformance/results/ty/generics_defaults.toml @@ -1,4 +1,10 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not forbid a `TypeVar` immediately following a `TypeVarTuple` in a parameter list from having a default. +Infers a more precise type than `type[]` for class objects. +Incorrectly rejects list literals in specializations if a class is generic over a `TypeVarTuple` and a `ParamSpec`. +""" errors_diff = """ Line 143: Expected 1 errors Line 45: Unexpected errors ["generics_defaults.py:45:1: error[type-assertion-failure] Type `` does not match asserted type `type[AllTheDefaults[Any, Any, str, int, bool]]`"] diff --git a/conformance/results/ty/generics_defaults_referential.toml b/conformance/results/ty/generics_defaults_referential.toml index 0334c08a3..198ed2c42 100644 --- a/conformance/results/ty/generics_defaults_referential.toml +++ b/conformance/results/ty/generics_defaults_referential.toml @@ -1,4 +1,10 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject class definitions where a type variable `T2` that has `T1` as its default comes before `T1`. +Does not reject using a type parameter from an outer scope as a default for a type parameter in an inner scope. +Infers a more precise type than `type[]` for class objects. +""" errors_diff = """ Line 53: Expected 1 errors Line 60: Expected 1 errors diff --git a/conformance/results/ty/generics_defaults_specialization.toml b/conformance/results/ty/generics_defaults_specialization.toml index 764c8cad7..3f8748258 100644 --- a/conformance/results/ty/generics_defaults_specialization.toml +++ b/conformance/results/ty/generics_defaults_specialization.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject subscription of an already-specialized generic class. +""" errors_diff = """ Line 55: Expected 1 errors """ diff --git a/conformance/results/ty/generics_paramspec_basic.toml b/conformance/results/ty/generics_paramspec_basic.toml index 678668fbf..4dc3f6fa2 100644 --- a/conformance/results/ty/generics_paramspec_basic.toml +++ b/conformance/results/ty/generics_paramspec_basic.toml @@ -1,4 +1,14 @@ conformance_automated = "Fail" +conformant = "Unsupported" +notes = """ +Supports `ParamSpec` but is missing many validation checks. + +Does not support `Concatenate`. +Does not reject using a bare `ParamSpec` as a type alias value. +Incorrectly allows type variables to be specialized with `ParamSpec`s. +Allows bare variables to be annotated with `ParamSpec`. +Allows `ParamSpec` to be used in the return type of a `Callable` annotation. +""" errors_diff = """ Line 15: Expected 1 errors Line 23: Expected 1 errors diff --git a/conformance/results/ty/generics_paramspec_components.toml b/conformance/results/ty/generics_paramspec_components.toml index b08366026..69a9152fc 100644 --- a/conformance/results/ty/generics_paramspec_components.toml +++ b/conformance/results/ty/generics_paramspec_components.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Supports `ParamSpec` but is missing several validation checks around correct usage. +""" errors_diff = """ Line 20: Expected 1 errors Line 26: Expected 1 errors diff --git a/conformance/results/ty/generics_paramspec_semantics.toml b/conformance/results/ty/generics_paramspec_semantics.toml index 141601712..b8806e5b9 100644 --- a/conformance/results/ty/generics_paramspec_semantics.toml +++ b/conformance/results/ty/generics_paramspec_semantics.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not support `Concatenate`. +""" errors_diff = """ Line 98: Expected 1 errors Line 120: Expected 1 errors diff --git a/conformance/results/ty/generics_scoping.toml b/conformance/results/ty/generics_scoping.toml index 2762f716e..e9868f312 100644 --- a/conformance/results/ty/generics_scoping.toml +++ b/conformance/results/ty/generics_scoping.toml @@ -1,4 +1,10 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject unbound type variables appearing in the bodies of generic functions or classes. +Does not reject a generic attribute in an inner class reusing a type variable scoped to an outer class. +Does not reject unbound type variables used in global-scope annotations. +""" errors_diff = """ Line 61: Expected 1 errors Line 65: Expected 1 errors diff --git a/conformance/results/ty/generics_self_usage.toml b/conformance/results/ty/generics_self_usage.toml index 7dcb83dbe..570bd1724 100644 --- a/conformance/results/ty/generics_self_usage.toml +++ b/conformance/results/ty/generics_self_usage.toml @@ -1,4 +1,9 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject `Self` used in a return annotation when `self` is annotated using another type variable. +Does not reject `Self` used in staticmethods or metaclasses. +""" errors_diff = """ Line 82: Expected 1 errors Line 113: Expected 1 errors diff --git a/conformance/results/ty/generics_syntax_compatibility.toml b/conformance/results/ty/generics_syntax_compatibility.toml index c2a2f515c..51432fe82 100644 --- a/conformance/results/ty/generics_syntax_compatibility.toml +++ b/conformance/results/ty/generics_syntax_compatibility.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 14: Expected 1 errors Line 26: Expected 1 errors diff --git a/conformance/results/ty/generics_syntax_infer_variance.toml b/conformance/results/ty/generics_syntax_infer_variance.toml index 40c81d14a..2a6065e89 100644 --- a/conformance/results/ty/generics_syntax_infer_variance.toml +++ b/conformance/results/ty/generics_syntax_infer_variance.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 15: Expected 1 errors Line 17: Expected 1 errors diff --git a/conformance/results/ty/generics_syntax_scoping.toml b/conformance/results/ty/generics_syntax_scoping.toml index 11e34439c..3f724daeb 100644 --- a/conformance/results/ty/generics_syntax_scoping.toml +++ b/conformance/results/ty/generics_syntax_scoping.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject type variables bound in outer scopes from being rebound in inner scopes. +""" errors_diff = """ Line 92: Expected 1 errors Line 95: Expected 1 errors diff --git a/conformance/results/ty/generics_type_erasure.toml b/conformance/results/ty/generics_type_erasure.toml index 5e252648e..552d29887 100644 --- a/conformance/results/ty/generics_type_erasure.toml +++ b/conformance/results/ty/generics_type_erasure.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject access of generic instance variable from the class object. +""" errors_diff = """ Line 42: Expected 1 errors Line 43: Expected 1 errors diff --git a/conformance/results/ty/generics_typevartuple_args.toml b/conformance/results/ty/generics_typevartuple_args.toml index 44146c044..d2161b6fe 100644 --- a/conformance/results/ty/generics_typevartuple_args.toml +++ b/conformance/results/ty/generics_typevartuple_args.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Supports PEP-646 unpacked tuples but not TypeVarTuple. +""" errors_diff = """ Line 33: Expected 1 errors Line 34: Expected 1 errors diff --git a/conformance/results/ty/generics_typevartuple_basic.toml b/conformance/results/ty/generics_typevartuple_basic.toml index aacbef1c4..5274b4bab 100644 --- a/conformance/results/ty/generics_typevartuple_basic.toml +++ b/conformance/results/ty/generics_typevartuple_basic.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 43: Expected 1 errors Line 53: Expected 1 errors diff --git a/conformance/results/ty/generics_typevartuple_callable.toml b/conformance/results/ty/generics_typevartuple_callable.toml index 5cad16119..f4004bd2a 100644 --- a/conformance/results/ty/generics_typevartuple_callable.toml +++ b/conformance/results/ty/generics_typevartuple_callable.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 26: Expected 1 errors Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int, int | float | complex]`'] diff --git a/conformance/results/ty/generics_typevartuple_concat.toml b/conformance/results/ty/generics_typevartuple_concat.toml index 64048f4a0..6d04be1f1 100644 --- a/conformance/results/ty/generics_typevartuple_concat.toml +++ b/conformance/results/ty/generics_typevartuple_concat.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 52: Unexpected errors ['generics_typevartuple_concat.py:52:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, bool, str]`'] """ diff --git a/conformance/results/ty/generics_typevartuple_specialization.toml b/conformance/results/ty/generics_typevartuple_specialization.toml index 0e5d1621c..02c7eac98 100644 --- a/conformance/results/ty/generics_typevartuple_specialization.toml +++ b/conformance/results/ty/generics_typevartuple_specialization.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 109: Expected 1 errors Line 110: Expected 1 errors diff --git a/conformance/results/ty/generics_typevartuple_unpack.toml b/conformance/results/ty/generics_typevartuple_unpack.toml index 0ad3bee37..d22971b51 100644 --- a/conformance/results/ty/generics_typevartuple_unpack.toml +++ b/conformance/results/ty/generics_typevartuple_unpack.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 30: Expected 1 errors """ diff --git a/conformance/results/ty/generics_upper_bound.toml b/conformance/results/ty/generics_upper_bound.toml index ad098019b..436f90e7d 100644 --- a/conformance/results/ty/generics_upper_bound.toml +++ b/conformance/results/ty/generics_upper_bound.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Pass" +notes = """ +Infers list[set | Unknown]` for `[1, 2]` and `set[Unknown | int]` for `{1, 2}`, leading to type-assertion failures for spurious reasons despite the type variables being accurately solved. +""" errors_diff = """ Line 37: Unexpected errors ['generics_upper_bound.py:37:1: error[type-assertion-failure] Type `list[Unknown | int]` does not match asserted type `list[int]`'] Line 38: Unexpected errors ['generics_upper_bound.py:38:1: error[type-assertion-failure] Type `set[Unknown | int]` does not match asserted type `set[int]`'] diff --git a/conformance/results/ty/generics_variance.toml b/conformance/results/ty/generics_variance.toml index 4d1ea82f1..4193f749d 100644 --- a/conformance/results/ty/generics_variance.toml +++ b/conformance/results/ty/generics_variance.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 77: Expected 1 errors Line 81: Expected 1 errors diff --git a/conformance/results/ty/literals_interactions.toml b/conformance/results/ty/literals_interactions.toml index a2751f9c2..354e5a8fe 100644 --- a/conformance/results/ty/literals_interactions.toml +++ b/conformance/results/ty/literals_interactions.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Deliberately does not allow `str` to be narrowed to literal string types through equality or containment checks due to the possibility of `str` subclasses that could have unexpected equality semantics. +""" errors_diff = """ Line 106: Unexpected errors ['literals_interactions.py:106:35: error[invalid-argument-type] Argument to function `expects_bad_status` is incorrect: Expected `Literal["MALFORMED", "ABORTED"]`, found `str`'] Line 109: Unexpected errors ['literals_interactions.py:109:32: error[invalid-argument-type] Argument to function `expects_pending_status` is incorrect: Expected `Literal["PENDING"]`, found `str`'] diff --git a/conformance/results/ty/namedtuples_define_class.toml b/conformance/results/ty/namedtuples_define_class.toml index 9eacb03d3..df2ada368 100644 --- a/conformance/results/ty/namedtuples_define_class.toml +++ b/conformance/results/ty/namedtuples_define_class.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Permits subclasses of `NamedTuple` classes to override read-only attributes in the class body of the subclass. +""" errors_diff = """ Line 106: Expected 1 errors """ diff --git a/conformance/results/ty/namedtuples_usage.toml b/conformance/results/ty/namedtuples_usage.toml index d220608d5..c7c4e087e 100644 --- a/conformance/results/ty/namedtuples_usage.toml +++ b/conformance/results/ty/namedtuples_usage.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not detect runtime errors from attempting to delete namedtuple attributes. +""" errors_diff = """ Line 42: Expected 1 errors """ diff --git a/conformance/results/ty/narrowing_typeis.toml b/conformance/results/ty/narrowing_typeis.toml index a3488ae53..5cabfbbc0 100644 --- a/conformance/results/ty/narrowing_typeis.toml +++ b/conformance/results/ty/narrowing_typeis.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Intersects the pre-existing type with the top materialization of the bracketed type rather than the bracketed type itself. +""" errors_diff = """ Line 35: Unexpected errors ['narrowing_typeis.py:35:18: error[invalid-assignment] Object of type `object` is not assignable to `int`'] """ diff --git a/conformance/results/ty/overloads_consistency.toml b/conformance/results/ty/overloads_consistency.toml index e389cd61b..85fcf0d27 100644 --- a/conformance/results/ty/overloads_consistency.toml +++ b/conformance/results/ty/overloads_consistency.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Lines 25, 28: Expected error (tag 'return_type') Lines 41, 44: Expected error (tag 'parameter_type') diff --git a/conformance/results/ty/protocols_class_objects.toml b/conformance/results/ty/protocols_class_objects.toml index 092a4d873..fcc3ec8a1 100644 --- a/conformance/results/ty/protocols_class_objects.toml +++ b/conformance/results/ty/protocols_class_objects.toml @@ -1,4 +1,11 @@ conformance_automated = "Fail" +conformant = "Unsupported" +notes = """ +`type[Proto]` is not yet supported. +`ClassVar` protocol members are not yet supported. +`@property` protocol members are only partially supported. +A class object `C` is only considered to inhabit a protocol type with a method member `f` if `f` exists as an attribute on the metaclass of `C`. +""" errors_diff = """ Line 29: Expected 1 errors Line 34: Expected 1 errors diff --git a/conformance/results/ty/protocols_definition.toml b/conformance/results/ty/protocols_definition.toml index f6a010329..5f8ae7f3c 100644 --- a/conformance/results/ty/protocols_definition.toml +++ b/conformance/results/ty/protocols_definition.toml @@ -1,4 +1,11 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject implicit instance attributes in `Protocol` methods. +Does not support `ClassVar` protocol members. +Incorrectly considers `ClassVar` attributes on concrete classes as satisfying non-`ClassVar` attribute members on protocols. +Only has partial support for `@property` protocol members. +""" errors_diff = """ Line 67: Expected 1 errors Line 117: Expected 1 errors diff --git a/conformance/results/ty/protocols_explicit.toml b/conformance/results/ty/protocols_explicit.toml index 17ae4032e..24f1e8541 100644 --- a/conformance/results/ty/protocols_explicit.toml +++ b/conformance/results/ty/protocols_explicit.toml @@ -1,4 +1,9 @@ conformance_automated = "Fail" +conformant = "Unsupported" +notes = """ +Allows implicitly abstract protocol methods to be called via `super()` on a protocol subclass. +Allows instantiation of abstract subclasses of protocol classes. +""" errors_diff = """ Line 27: Expected 1 errors Line 60: Expected 1 errors diff --git a/conformance/results/ty/protocols_generic.toml b/conformance/results/ty/protocols_generic.toml index d7effdc64..96e3dbdca 100644 --- a/conformance/results/ty/protocols_generic.toml +++ b/conformance/results/ty/protocols_generic.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Only partially supports `@property` protocol members. +""" errors_diff = """ Line 145: Expected 1 errors Line 146: Expected 1 errors diff --git a/conformance/results/ty/protocols_merging.toml b/conformance/results/ty/protocols_merging.toml index f587cf34f..f3229e3fc 100644 --- a/conformance/results/ty/protocols_merging.toml +++ b/conformance/results/ty/protocols_merging.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject attempted instantiation of abstract subclasses of protocols. +""" errors_diff = """ Line 82: Expected 1 errors """ diff --git a/conformance/results/ty/protocols_modules.toml b/conformance/results/ty/protocols_modules.toml index 2ce3cba59..ff470754f 100644 --- a/conformance/results/ty/protocols_modules.toml +++ b/conformance/results/ty/protocols_modules.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Never considers a module as satisfying a protocol with a method member due to the fact that the method will never exist on the class `types.ModuleType`, only on a given specific module instance. +""" errors_diff = """ Line 25: Unexpected errors ["protocols_modules.py:25:17: error[invalid-assignment] Object of type `` is not assignable to `Options1`"] Line 47: Unexpected errors ["protocols_modules.py:47:18: error[invalid-assignment] Object of type `` is not assignable to `Reporter1`"] diff --git a/conformance/results/ty/protocols_recursive.toml b/conformance/results/ty/protocols_recursive.toml index 458085edc..f6bfd7871 100644 --- a/conformance/results/ty/protocols_recursive.toml +++ b/conformance/results/ty/protocols_recursive.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Fails to solve a type variable involving a recursive generic protocol. +""" errors_diff = """ Line 81: Unexpected errors ['protocols_recursive.py:81:1: error[type-assertion-failure] Type `Unknown` does not match asserted type `list[int]`'] """ diff --git a/conformance/results/ty/protocols_runtime_checkable.toml b/conformance/results/ty/protocols_runtime_checkable.toml index 5d23a7e63..098d535c7 100644 --- a/conformance/results/ty/protocols_runtime_checkable.toml +++ b/conformance/results/ty/protocols_runtime_checkable.toml @@ -1,4 +1,9 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Detects invalid `isinstance()`/`issubclass()` calls of the form `isinstance(x, P)` but not of the form `isinstance(x, (P1, P2))`. +Does not reject `isinstance()` or `issubclass()` calls against runtime-checkable protocols where there is an unsafe overlap between the type of the first argument and the protocol. +""" errors_diff = """ Line 61: Expected 1 errors Line 88: Expected 1 errors diff --git a/conformance/results/ty/protocols_variance.toml b/conformance/results/ty/protocols_variance.toml index a5f099546..303056e98 100644 --- a/conformance/results/ty/protocols_variance.toml +++ b/conformance/results/ty/protocols_variance.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 21: Expected 1 errors Line 40: Expected 1 errors diff --git a/conformance/results/ty/qualifiers_final_annotation.toml b/conformance/results/ty/qualifiers_final_annotation.toml index 2b17b7d4f..82b09cbef 100644 --- a/conformance/results/ty/qualifiers_final_annotation.toml +++ b/conformance/results/ty/qualifiers_final_annotation.toml @@ -1,4 +1,9 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not forbid `Final`-annotated assignments to attributes on `self` in non-`__init__` methods. +Does not flag modifications of `Final`-annotated attributes via augmented assignment. +""" errors_diff = """ Line 62: Expected 1 errors Line 63: Expected 1 errors diff --git a/conformance/results/ty/qualifiers_final_decorator.toml b/conformance/results/ty/qualifiers_final_decorator.toml index 7e4205afe..62746398d 100644 --- a/conformance/results/ty/qualifiers_final_decorator.toml +++ b/conformance/results/ty/qualifiers_final_decorator.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject using `@final` on a non-method function. +""" errors_diff = """ Lines 125, 126: Expected error (tag 'func') """ diff --git a/conformance/results/ty/specialtypes_type.toml b/conformance/results/ty/specialtypes_type.toml index 2832b3224..cf381ae79 100644 --- a/conformance/results/ty/specialtypes_type.toml +++ b/conformance/results/ty/specialtypes_type.toml @@ -1,4 +1,10 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Allows arbitrary attributes to be accessed on `TA` where `TA = typing.Type[typing.Any]` or `TA = type[typing.Any]`. +Treats `type` equivalently to `type[object]` rather than `type[typing.Any]`. +Incorrectly infers `b.__mro__` as having type `typing.Any` rather than `tuple[type, ...]` if `b` has type `type[typing.Any]` or `typing.Type[typing.Any]`. +""" errors_diff = """ Line 144: Expected 1 errors Line 146: Expected 1 errors diff --git a/conformance/results/ty/tuples_unpacked.toml b/conformance/results/ty/tuples_unpacked.toml index d7033c1a8..0920a8546 100644 --- a/conformance/results/ty/tuples_unpacked.toml +++ b/conformance/results/ty/tuples_unpacked.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Only supports the new syntax using `*`, not `typing.Unpack`. +""" errors_diff = """ Line 59: Expected 1 errors Lines 60, 61: Expected error (tag 't14') diff --git a/conformance/results/ty/typeddicts_alt_syntax.toml b/conformance/results/ty/typeddicts_alt_syntax.toml index d39d314cc..31db9e351 100644 --- a/conformance/results/ty/typeddicts_alt_syntax.toml +++ b/conformance/results/ty/typeddicts_alt_syntax.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 23: Expected 1 errors Line 27: Expected 1 errors diff --git a/conformance/results/ty/typeddicts_extra_items.toml b/conformance/results/ty/typeddicts_extra_items.toml index 2a353a588..989146a4c 100644 --- a/conformance/results/ty/typeddicts_extra_items.toml +++ b/conformance/results/ty/typeddicts_extra_items.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 22: Expected 1 errors Line 49: Expected 1 errors diff --git a/conformance/results/ty/typeddicts_inheritance.toml b/conformance/results/ty/typeddicts_inheritance.toml index b551d6f7f..4a5bd74e0 100644 --- a/conformance/results/ty/typeddicts_inheritance.toml +++ b/conformance/results/ty/typeddicts_inheritance.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not validate overrides of `TypedDict` fields in subclasses. +""" errors_diff = """ Line 65: Expected 1 errors Lines 54, 55: Expected error (tag 'Y1') diff --git a/conformance/results/ty/typeddicts_readonly.toml b/conformance/results/ty/typeddicts_readonly.toml index 61b7ce008..4fbd4fd06 100644 --- a/conformance/results/ty/typeddicts_readonly.toml +++ b/conformance/results/ty/typeddicts_readonly.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Supports `ReadOnly`, but not the functional syntax for `TypedDict`s currently, leading to one assertion failing. +""" errors_diff = """ Line 36: Expected 1 errors """ diff --git a/conformance/results/ty/typeddicts_readonly_inheritance.toml b/conformance/results/ty/typeddicts_readonly_inheritance.toml index e5517fa53..7b60a1703 100644 --- a/conformance/results/ty/typeddicts_readonly_inheritance.toml +++ b/conformance/results/ty/typeddicts_readonly_inheritance.toml @@ -1,4 +1,8 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not validate overrides of `TypedDict` keys. +""" errors_diff = """ Line 50: Expected 1 errors Line 94: Expected 1 errors diff --git a/conformance/results/ty/typeddicts_readonly_kwargs.toml b/conformance/results/ty/typeddicts_readonly_kwargs.toml index ff5101052..2795b28d8 100644 --- a/conformance/results/ty/typeddicts_readonly_kwargs.toml +++ b/conformance/results/ty/typeddicts_readonly_kwargs.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 33: Expected 1 errors """ diff --git a/conformance/results/ty/typeddicts_readonly_update.toml b/conformance/results/ty/typeddicts_readonly_update.toml index c614899ef..267649f84 100644 --- a/conformance/results/ty/typeddicts_readonly_update.toml +++ b/conformance/results/ty/typeddicts_readonly_update.toml @@ -1,4 +1,5 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 23: Expected 1 errors """ diff --git a/conformance/results/ty/typeddicts_required.toml b/conformance/results/ty/typeddicts_required.toml index 8336b0745..64b4cc1a4 100644 --- a/conformance/results/ty/typeddicts_required.toml +++ b/conformance/results/ty/typeddicts_required.toml @@ -1,4 +1,9 @@ conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Does not reject use of `Required` and `NotRequired` in non-`TypedDict` classes. +Does not reject nested use such as `Required[Required[int]]`. +""" errors_diff = """ Line 12: Expected 1 errors Line 59: Expected 1 errors From c8b2a346c76c79d1177125466e8163042acada74 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 6 Mar 2026 18:06:54 +0000 Subject: [PATCH 04/11] update results for the latest ty version and the new conformance infrastructure --- conformance/pyproject.toml | 1 + conformance/results/results.html | 62 +++++++++---------- conformance/results/ty/aliases_implicit.toml | 6 +- .../results/ty/aliases_type_statement.toml | 10 +-- .../results/ty/aliases_typealiastype.toml | 2 +- .../results/ty/annotations_forward_refs.toml | 4 +- .../results/ty/annotations_typeexpr.toml | 2 +- .../results/ty/callables_annotation.toml | 3 +- .../results/ty/callables_subtyping.toml | 8 +-- .../results/ty/constructors_callable.toml | 8 +-- conformance/results/ty/dataclasses_hash.toml | 10 +-- .../ty/dataclasses_transform_class.toml | 8 +-- .../ty/dataclasses_transform_converter.toml | 5 +- .../ty/dataclasses_transform_meta.toml | 8 +-- .../ty/directives_version_platform.toml | 23 ++----- .../results/ty/enums_member_names.toml | 1 - .../results/ty/enums_member_values.toml | 1 - conformance/results/ty/enums_members.toml | 8 +-- .../results/ty/generics_base_class.toml | 8 +-- conformance/results/ty/generics_basic.toml | 3 +- conformance/results/ty/generics_defaults.toml | 42 ++++++++----- .../ty/generics_defaults_referential.toml | 14 +---- .../results/ty/generics_paramspec_basic.toml | 19 +++--- .../ty/generics_paramspec_components.toml | 18 +++--- conformance/results/ty/generics_scoping.toml | 21 +++---- .../results/ty/generics_syntax_scoping.toml | 12 ++-- .../ty/generics_typevartuple_args.toml | 12 ++-- .../ty/generics_typevartuple_callable.toml | 4 +- .../results/ty/generics_upper_bound.toml | 18 ++---- .../ty/protocols_runtime_checkable.toml | 3 +- .../results/ty/qualifiers_annotated.toml | 2 +- .../ty/qualifiers_final_decorator.toml | 8 +-- conformance/results/ty/specialtypes_type.toml | 5 -- conformance/results/ty/tuples_unpacked.toml | 10 +-- .../results/ty/typeddicts_required.toml | 13 ++-- conformance/results/ty/version.toml | 2 +- conformance/src/type_checker.py | 18 ++---- conformance/tests/ty.toml | 1 + conformance/uv.lock | 26 ++++++++ 39 files changed, 191 insertions(+), 238 deletions(-) diff --git a/conformance/pyproject.toml b/conformance/pyproject.toml index 9b5119331..7483444be 100644 --- a/conformance/pyproject.toml +++ b/conformance/pyproject.toml @@ -9,6 +9,7 @@ dependencies = [ "tomli", "tomlkit", "zuban", + "ty", ] [tool.uv] diff --git a/conformance/results/results.html b/conformance/results/results.html index 5fcdb04b0..94c8be983 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -176,11 +176,11 @@

Python Type System Conformance Test Results

pyright 1.1.408
-
zuban 0.6.0
+
zuban 0.6.1
-
pyrefly 0.53.0
+
pyrefly 0.54.0
-
ty 0.0.19 (ae10022c2 2026-02-26)
+
ty 0.0.21 (c1ad9f281 2026-03-06)
@@ -198,7 +198,7 @@

Python Type System Conformance Test Results

Pass
Partial

Incorrectly generates error for quoted type defined in class scope.

Partial

Types in quotes incorrectly refer to shadowing class member.

Does not reject some type forms that require quotes.

-
Partial

Does not detect runtime errors from partially stringified PEP-604 unions.

Resolves references in type annotations as referring to end-of-scope types (https://discuss.python.org/t/annotation-string-references-in-class-scope-in-conformance-tests/105439)

+
Partial

Does not detect runtime errors from partially stringified PEP-604 unions.

Resolves references in type annotations as referring to end-of-scope types (https://discuss.python.org/t/annotation-string-references-in-class-scope-in-conformance-tests/105439, https://github.com/python/typing/pull/2144)

     annotations_generators
Partial

Does not report incompatible Generator type in `yield from` statement.

@@ -257,7 +257,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Allows arbitrary attributes to be accessed on `TA` where `TA = typing.Type[typing.Any]` or `TA = type[typing.Any]`.

Treats `type` equivalently to `type[object]` rather than `type[typing.Any]`.

Incorrectly infers `b.__mro__` as having type `typing.Any` rather than `tuple[type, ...]` if `b` has type `type[typing.Any]` or `typing.Type[typing.Any]`.

+
Partial

Allows arbitrary attributes to be accessed on `TA` where `TA = typing.Type[typing.Any]` or `TA = type[typing.Any]`.

Treats `type` equivalently to `type[object]` rather than `type[typing.Any]`.

Generics @@ -267,28 +267,28 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Does not report an error when the type variable order is inconsistent between base classes.

+Pass      generics_basic Pass Pass Pass
Partial

Incorrect rejects + between two AnyStr

Constrained type var resolves to subtype instead of explcitly listed constraint

-
Partial

Incorrectly allows constrained type variables to be solved to a union of their constraints.

Permits generic metaclasses.

+
Partial

Incorrectly allows constrained type variables to be solved to a union of their constraints.

     generics_defaults Partial Pass Pass Pass -
Partial

Does not forbid a `TypeVar` immediately following a `TypeVarTuple` in a parameter list from having a default.

Infers a more precise type than `type[]` for class objects.

Incorrectly rejects list literals in specializations if a class is generic over a `TypeVarTuple` and a `ParamSpec`.

+
Partial

Does not forbid a `TypeVar` immediately following a `TypeVarTuple` in a parameter list from having a default.

Does not support `TypeVarTuple`.

Does not fully support defaults for `ParamSpec`s.

     generics_defaults_referential Partial Pass Pass Pass -
Partial

Does not reject class definitions where a type variable `T2` that has `T1` as its default comes before `T1`.

Does not reject using a type parameter from an outer scope as a default for a type parameter in an inner scope.

Infers a more precise type than `type[]` for class objects.

+Pass      generics_defaults_specialization Partial @@ -302,14 +302,14 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Unsupported

Supports `ParamSpec` but is missing many validation checks.

Does not support `Concatenate`.

Does not reject using a bare `ParamSpec` as a type alias value.

Incorrectly allows type variables to be specialized with `ParamSpec`s.

Allows bare variables to be annotated with `ParamSpec`.

Allows `ParamSpec` to be used in the return type of a `Callable` annotation.

+
Partial

Does not reject using a bare `ParamSpec` as a type alias value.

Does not support `Concatenate`.

     generics_paramspec_components Pass Pass Pass
Partial

Does not reject usage of args/kwargs for out-of-scope ParamSpec

-
Partial

Supports `ParamSpec` but is missing several validation checks around correct usage.

+
Partial

Incorrectly allows using `*args: P.args` and `**kwargs: P.kwargs` when `P` has not been put into scope by any other parameter annotation or enclosing scope.

Does not support `Concatenate`.

     generics_paramspec_semantics Pass @@ -328,9 +328,9 @@

Python Type System Conformance Test Results

     generics_scoping Pass Pass -Partial +Pass
Partial

Does not implement several scoping checks/restrictions for generics

-
Partial

Does not reject unbound type variables appearing in the bodies of generic functions or classes.

Does not reject a generic attribute in an inner class reusing a type variable scoped to an outer class.

Does not reject unbound type variables used in global-scope annotations.

+
Partial

Does not reject `list[T]()` in the global scope, where `T` is an unbound type variable.

Does nto reject `alias: TypeAlias = list[T]` in the body scope of a class generic over a type variable `T`.

     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]`.

@@ -393,7 +393,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Does not reject type variables bound in outer scopes from being rebound in inner scopes.

+Pass      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).

@@ -455,8 +455,8 @@

Python Type System Conformance Test Results

Partial

Does not reject use of type variable within an upper bound.

Pass Pass +
Partial

Cannot find a common supertype of `list[int]` and `set[int]` in order to solve a type variable bound to `Sized`.

Pass -
Pass*

Infers list[set | Unknown]` for `[1, 2]` and `set[Unknown | int]` for `{1, 2}`, leading to type-assertion failures for spurious reasons despite the type variables being accurately solved.

     generics_variance
Partial

Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.

@@ -494,7 +494,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Does not reject using `@final` on a non-method function.

+Pass Class type compatibility @@ -549,13 +549,13 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Does not reject use of the `type` statement inside functions.

Does not reject attempts to use legacy type variables in new-tyle type aliases.

Does not reject circular definitions of type aliases.

Does not reject redeclarations of type aliases.

Does not support `type` statements generic over `TypeVarTuple`s.

+
Partial

Does not reject use of the `type` statement inside functions.

Does not reject circular definitions of type aliases.

Does not reject redeclarations of type aliases.

Does not support `type` statements generic over `TypeVarTuple`s.

     aliases_typealiastype
Partial

Incorrectly rejects some recursive type aliases using TypeAliasType.

Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

Pass Pass -
Partial

Does not detect circular definitions.

+Pass
Partial

Does not reject specializing a type parameter in a generic type alias with a type inconsistent with the parameter's upper bound.

Does not reject declaring a type alias with a type variable that is not in scope.

Does not reject declaring a type alias with a non-literal tuple passed to the `type_params` parameter.

Does not reject cyclically defined type aliases.

     aliases_variance @@ -653,7 +653,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Detects invalid `isinstance()`/`issubclass()` calls of the form `isinstance(x, P)` but not of the form `isinstance(x, (P1, P2))`.

Does not reject `isinstance()` or `issubclass()` calls against runtime-checkable protocols where there is an unsafe overlap between the type of the first argument and the protocol.

+
Partial

Does not reject `isinstance()` or `issubclass()` calls against runtime-checkable protocols where there is an unsafe overlap between the type of the first argument and the protocol.

     protocols_self Pass @@ -684,7 +684,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Parameter names are lost when resolving ParamSpec

-
Partial

Does not reject `Callable[[...], int]` in a type expression.

Does not support `Concatenate`.

Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`.

Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`.

+
Partial

Does not support `Concatenate`.

Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`.

Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`.

     callables_kwargs
Partial

Allows callable without kwargs to be assigned to callable with unpacked kwargs

@@ -705,7 +705,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Does not reject assigning a callable with a single variadic positional parameter to a variable declared with a `Callable` type that accepts certain specific keyword arguments.

+Pass Constructors @@ -825,11 +825,11 @@

Python Type System Conformance Test Results

Pass      dataclasses_hash -
Partial

Does not report when dataclass is not compatible with Hashable protocol.

+
Unsupported

Does not synthesize `__hash__ = None` as a class attribute for unhashable dataclasses.

Does not report when an unhashable dataclass has `__hash__` called directly on an instance.

Does not report when dataclass is not compatible with Hashable protocol.

Pass +
Partial

Does not synthesize a `__hash__ = None` class attribute for unhashable dataclasses.

Pass -Pass -
Unsupported

Infers all objects as being hashable.

+
Partial

Understands the `Hashable` protocol as equivalent to `object`.

     dataclasses_inheritance Pass @@ -878,14 +878,14 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Does not detect non-frozen `dataclass_transform` dataclasses invalidly inheriting from frozen ones.

+Pass      dataclasses_transform_converter
Unsupported

Converter parameter not yet supported.

Pass Pass Pass -Unknown +Unsupported      dataclasses_transform_field
Partial

Does not properly handle field constructor that has default value for `kw_only` or `init` parameter.

@@ -906,7 +906,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Does not detect non-frozen `dataclass_transform` dataclasses invalidly inheriting from frozen ones.

+Pass      dataclasses_usage
Pass*

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

@@ -1000,7 +1000,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Does not reject use of `Required` and `NotRequired` in non-`TypedDict` classes.

Does not reject nested use such as `Required[Required[int]]`.

+Pass      typeddicts_type_consistency Pass @@ -1038,7 +1038,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Only supports the new syntax using `*`, not `typing.Unpack`.

+Pass Named tuples @@ -1114,7 +1114,7 @@

Python Type System Conformance Test Results

Pass*

Does not support `_ignore_` mechanism (optional).

Pass Pass -
Partial

Does not reject explicitly annotated enum members.

+Pass Type narrowing @@ -1204,7 +1204,7 @@

Python Type System Conformance Test Results

Pass Pass Pass -
Partial

Attempts to detect basic errors even in blocks it determines to be unreachable.

+Pass Historical and deprecated features diff --git a/conformance/results/ty/aliases_implicit.toml b/conformance/results/ty/aliases_implicit.toml index 9419afb9e..bda018615 100644 --- a/conformance/results/ty/aliases_implicit.toml +++ b/conformance/results/ty/aliases_implicit.toml @@ -20,10 +20,10 @@ aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments aliases_implicit.py:79:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 aliases_implicit.py:80:24: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` aliases_implicit.py:81:25: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int | float` of type variable `TFloat@GoodTypeAlias12` -aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[Unknown | | ]` is not allowed in a type expression +aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[ | ]` is not allowed in a type expression aliases_implicit.py:108:9: error[invalid-type-form] Variable of type `tuple[tuple[, ]]` is not allowed in a type expression -aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[Unknown | ]` is not allowed in a type expression -aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[Unknown | str, Unknown | str]` is not allowed in a type expression +aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[]` is not allowed in a type expression +aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[str, str]` is not allowed in a type expression aliases_implicit.py:114:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression aliases_implicit.py:115:10: error[invalid-type-form] Variable of type `Literal[True]` is not allowed in a type expression aliases_implicit.py:116:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml index 48c423d60..420c17ee9 100644 --- a/conformance/results/ty/aliases_type_statement.toml +++ b/conformance/results/ty/aliases_type_statement.toml @@ -2,21 +2,19 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Does not reject use of the `type` statement inside functions. -Does not reject attempts to use legacy type variables in new-tyle type aliases. Does not reject circular definitions of type aliases. Does not reject redeclarations of type aliases. Does not support `type` statements generic over `TypeVarTuple`s. """ errors_diff = """ Line 56: Expected 1 errors -Line 62: Expected 1 errors -Line 67: Expected 1 errors Line 84: Expected 1 errors Lines 51, 52: Expected error (tag 'TA14') -Line 10: Unexpected errors ['aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3'] +Line 10: Unexpected errors ['aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3', 'aliases_type_statement.py:10:52: error[invalid-type-form] `...` is not allowed in this context in a type expression'] """ output = """ aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3 +aliases_type_statement.py:10:52: error[invalid-type-form] `...` is not allowed in this context in a type expression aliases_type_statement.py:17:1: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `bit_count` aliases_type_statement.py:19:1: error[call-non-callable] Object of type `TypeAliasType` is not callable aliases_type_statement.py:23:7: error[unresolved-attribute] Object of type `TypeAliasType` has no attribute `other_attrib` @@ -29,7 +27,7 @@ aliases_type_statement.py:39:23: error[invalid-type-form] Tuple literals are not aliases_type_statement.py:40:22: error[invalid-type-form] List comprehensions are not allowed in type expressions aliases_type_statement.py:41:22: error[invalid-type-form] Dict literals are not allowed in type expressions aliases_type_statement.py:42:22: error[invalid-type-form] Function calls are not allowed in type expressions -aliases_type_statement.py:43:22: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +aliases_type_statement.py:43:22: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression aliases_type_statement.py:43:28: error[invalid-type-form] Int literals are not allowed in this context in a type expression aliases_type_statement.py:44:22: error[invalid-type-form] `if` expressions are not allowed in type expressions aliases_type_statement.py:45:22: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression @@ -37,6 +35,8 @@ aliases_type_statement.py:46:23: error[invalid-type-form] Boolean literals are n aliases_type_statement.py:47:23: error[invalid-type-form] Int literals are not allowed in this context in a type expression aliases_type_statement.py:48:23: error[invalid-type-form] Boolean operations are not allowed in type expressions aliases_type_statement.py:49:23: error[fstring-type-annotation] Type expressions cannot use f-strings +aliases_type_statement.py:62:23: error[unbound-type-variable] Type variable `V` is not bound to any outer generic context +aliases_type_statement.py:67:17: error[unbound-type-variable] Type variable `T1` is not bound to any outer generic context aliases_type_statement.py:77:27: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int` of type variable `S@RecursiveTypeAlias2` aliases_type_statement.py:79:32: error[invalid-type-arguments] Type `int` is not assignable to upper bound `str` of type variable `T@RecursiveTypeAlias2` aliases_type_statement.py:82:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias3` diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml index 9e5470da3..0d4317cca 100644 --- a/conformance/results/ty/aliases_typealiastype.toml +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -24,7 +24,7 @@ aliases_typealiastype.py:54:43: error[invalid-type-form] Tuple literals are not aliases_typealiastype.py:55:42: error[invalid-type-form] List comprehensions are not allowed in type expressions aliases_typealiastype.py:56:42: error[invalid-type-form] Dict literals are not allowed in type expressions aliases_typealiastype.py:57:42: error[invalid-type-form] Function calls are not allowed in type expressions -aliases_typealiastype.py:58:42: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +aliases_typealiastype.py:58:42: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression aliases_typealiastype.py:58:48: error[invalid-type-form] Int literals are not allowed in this context in a type expression aliases_typealiastype.py:59:42: error[invalid-type-form] `if` expressions are not allowed in type expressions aliases_typealiastype.py:60:42: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression diff --git a/conformance/results/ty/annotations_forward_refs.toml b/conformance/results/ty/annotations_forward_refs.toml index 0c6f922da..15ee0435c 100644 --- a/conformance/results/ty/annotations_forward_refs.toml +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -2,7 +2,7 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Does not detect runtime errors from partially stringified PEP-604 unions. -Resolves references in type annotations as referring to end-of-scope types (https://discuss.python.org/t/annotation-string-references-in-class-scope-in-conformance-tests/105439) +Resolves references in type annotations as referring to end-of-scope types (https://discuss.python.org/t/annotation-string-references-in-class-scope-in-conformance-tests/105439, https://github.com/python/typing/pull/2144) """ errors_diff = """ Line 24: Expected 1 errors @@ -21,7 +21,7 @@ annotations_forward_refs.py:43:10: error[invalid-type-form] Tuple literals are n annotations_forward_refs.py:44:10: error[invalid-type-form] List comprehensions are not allowed in type expressions annotations_forward_refs.py:45:10: error[invalid-type-form] Dict literals are not allowed in type expressions annotations_forward_refs.py:46:10: error[invalid-type-form] Function calls are not allowed in type expressions -annotations_forward_refs.py:47:10: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +annotations_forward_refs.py:47:10: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression annotations_forward_refs.py:47:16: error[invalid-type-form] Int literals are not allowed in this context in a type expression annotations_forward_refs.py:48:10: error[invalid-type-form] `if` expressions are not allowed in type expressions annotations_forward_refs.py:49:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression diff --git a/conformance/results/ty/annotations_typeexpr.toml b/conformance/results/ty/annotations_typeexpr.toml index d000bd099..4bc31c01b 100644 --- a/conformance/results/ty/annotations_typeexpr.toml +++ b/conformance/results/ty/annotations_typeexpr.toml @@ -8,7 +8,7 @@ annotations_typeexpr.py:90:9: error[invalid-type-form] Tuple literals are not al annotations_typeexpr.py:91:9: error[invalid-type-form] List comprehensions are not allowed in type expressions annotations_typeexpr.py:92:9: error[invalid-type-form] Dict literals are not allowed in type expressions annotations_typeexpr.py:93:9: error[invalid-type-form] Function calls are not allowed in type expressions -annotations_typeexpr.py:94:9: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +annotations_typeexpr.py:94:9: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression annotations_typeexpr.py:94:15: error[invalid-type-form] Int literals are not allowed in this context in a type expression annotations_typeexpr.py:95:9: error[invalid-type-form] `if` expressions are not allowed in type expressions annotations_typeexpr.py:96:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression diff --git a/conformance/results/ty/callables_annotation.toml b/conformance/results/ty/callables_annotation.toml index 634b55bf7..aa616994b 100644 --- a/conformance/results/ty/callables_annotation.toml +++ b/conformance/results/ty/callables_annotation.toml @@ -1,13 +1,11 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Does not reject `Callable[[...], int]` in a type expression. Does not support `Concatenate`. Infers a callback protocol as being a gradual type if the callback has signature `__call__[T](self, *args: T, **kwargs: T)` and `T` has been explicitly specialized to `Any`. Does not infer a callback protocol as being a gradual type if the callback has signature `__call__(self, a: int, /, *args: Any, **kwargs: Any)`. """ errors_diff = """ -Line 59: Expected 1 errors Line 91: Expected 1 errors Line 93: Expected 1 errors Line 159: Expected 1 errors @@ -30,5 +28,6 @@ callables_annotation.py:56:14: error[invalid-type-form] The first argument to `C callables_annotation.py:57:18: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[int]`? callables_annotation.py:58:5: error[invalid-type-form] Special form `typing.Callable` expected exactly two arguments (parameter types and return type) callables_annotation.py:58:14: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` +callables_annotation.py:59:14: error[invalid-type-form] `[...]` is not a valid parameter list for `Callable`: Did you mean `Callable[..., int]`? callables_annotation.py:157:20: error[invalid-assignment] Object of type `Proto7` is not assignable to `Proto6` """ diff --git a/conformance/results/ty/callables_subtyping.toml b/conformance/results/ty/callables_subtyping.toml index d410bf7e6..d6d67269d 100644 --- a/conformance/results/ty/callables_subtyping.toml +++ b/conformance/results/ty/callables_subtyping.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject assigning a callable with a single variadic positional parameter to a variable declared with a `Callable` type that accepts certain specific keyword arguments. -""" +conformance_automated = "Pass" errors_diff = """ -Line 125: Expected 1 errors """ output = """ callables_subtyping.py:26:36: error[invalid-assignment] Object of type `(int, /) -> int` is not assignable to `(int | float, /) -> int | float` @@ -21,6 +16,7 @@ callables_subtyping.py:119:23: error[invalid-assignment] Object of type `StrArgs callables_subtyping.py:120:23: error[invalid-assignment] Object of type `IntArgs4` is not assignable to `IntStrArgs4` callables_subtyping.py:122:20: error[invalid-assignment] Object of type `IntArgs4` is not assignable to `StrArgs4` callables_subtyping.py:124:20: error[invalid-assignment] Object of type `StrArgs4` is not assignable to `IntArgs4` +callables_subtyping.py:125:22: error[invalid-assignment] Object of type `IntStrArgs4` is not assignable to `Standard4` callables_subtyping.py:126:22: error[invalid-assignment] Object of type `StrArgs4` is not assignable to `Standard4` callables_subtyping.py:151:22: error[invalid-assignment] Object of type `NoKwargs5` is not assignable to `IntKwargs5` callables_subtyping.py:154:24: error[invalid-assignment] Object of type `NoKwargs5` is not assignable to `FloatKwargs5` diff --git a/conformance/results/ty/constructors_callable.toml b/conformance/results/ty/constructors_callable.toml index 40f1de614..f613ad9c5 100644 --- a/conformance/results/ty/constructors_callable.toml +++ b/conformance/results/ty/constructors_callable.toml @@ -4,15 +4,12 @@ errors_diff = """ Line 66: Expected 1 errors Line 67: Expected 1 errors Line 68: Expected 1 errors -Line 186: Expected 1 errors -Line 197: Expected 1 errors Line 102: Unexpected errors ['constructors_callable.py:102:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`'] Line 107: Unexpected errors ['constructors_callable.py:107:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`'] Line 143: Unexpected errors ["constructors_callable.py:143:27: error[invalid-argument-type] Argument to function `accepts_callable` is incorrect: Expected `() -> Any | Class6Any`, found ``"] Line 145: Unexpected errors ['constructors_callable.py:145:1: error[type-assertion-failure] Type `Any | Class6Any` does not match asserted type `Any`'] Line 166: Unexpected errors ['constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]`'] Line 167: Unexpected errors ['constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]`'] -Line 185: Unexpected errors ['constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]`'] """ output = """ constructors_callable.py:36:13: info[revealed-type] Revealed type: `(x: int) -> Class1` @@ -39,6 +36,9 @@ constructors_callable.py:164:5: info[revealed-type] Revealed type: `Overload[[T] constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]` constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]` constructors_callable.py:184:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class8[T]` -constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]` +constructors_callable.py:186:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]` +constructors_callable.py:186:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]` constructors_callable.py:195:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class9` +constructors_callable.py:197:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]` +constructors_callable.py:197:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]` """ diff --git a/conformance/results/ty/dataclasses_hash.toml b/conformance/results/ty/dataclasses_hash.toml index bc6eb1eaf..8c24b29fa 100644 --- a/conformance/results/ty/dataclasses_hash.toml +++ b/conformance/results/ty/dataclasses_hash.toml @@ -1,11 +1,13 @@ conformance_automated = "Fail" -conformant = "Unsupported" +conformant = "Partial" notes = """ -Infers all objects as being hashable. +Understands the `Hashable` protocol as equivalent to `object`. """ errors_diff = """ -Line 15: Expected 1 errors -Line 32: Expected 1 errors +Line 18: Expected 1 errors +Line 40: Expected 1 errors """ output = """ +dataclasses_hash.py:17:1: error[call-non-callable] Object of type `None` is not callable +dataclasses_hash.py:39:1: error[call-non-callable] Object of type `None` is not callable """ diff --git a/conformance/results/ty/dataclasses_transform_class.toml b/conformance/results/ty/dataclasses_transform_class.toml index f971c9041..5756e69dc 100644 --- a/conformance/results/ty/dataclasses_transform_class.toml +++ b/conformance/results/ty/dataclasses_transform_class.toml @@ -1,12 +1,8 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not detect non-frozen `dataclass_transform` dataclasses invalidly inheriting from frozen ones. -""" +conformance_automated = "Pass" errors_diff = """ -Line 51: Expected 1 errors """ output = """ +dataclasses_transform_class.py:51:7: error[invalid-frozen-dataclass-subclass] Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1` dataclasses_transform_class.py:63:1: error[invalid-assignment] Property `id` defined in `Customer1` is read-only dataclasses_transform_class.py:66:8: error[missing-argument] No arguments provided for required parameters `id`, `name` dataclasses_transform_class.py:66:18: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 2 diff --git a/conformance/results/ty/dataclasses_transform_converter.toml b/conformance/results/ty/dataclasses_transform_converter.toml index 7afd57b2c..c9e0e8394 100644 --- a/conformance/results/ty/dataclasses_transform_converter.toml +++ b/conformance/results/ty/dataclasses_transform_converter.toml @@ -1,8 +1,7 @@ conformance_automated = "Fail" +conformant = "Unsupported" errors_diff = """ Line 118: Expected 1 errors -Line 102: Unexpected errors ["dataclasses_transform_converter.py:102:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | bytes, /) -> ConverterClass`, found ``"] -Line 103: Unexpected errors ['dataclasses_transform_converter.py:103:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | list[str], /) -> int`, found `Overload[(s: str) -> int, (s: list[str]) -> int]`'] Line 104: Unexpected errors ['dataclasses_transform_converter.py:104:30: error[invalid-assignment] Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]`', "dataclasses_transform_converter.py:104:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found ``"] Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:11: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f0"]`', 'dataclasses_transform_converter.py:112:17: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]`', 'dataclasses_transform_converter.py:112:23: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f2"]`', 'dataclasses_transform_converter.py:112:29: error[invalid-argument-type] Argument is incorrect: Expected `ConverterClass`, found `Literal[b"f6"]`', 'dataclasses_transform_converter.py:112:36: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `list[Unknown]`'] Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:1: error[invalid-assignment] Object of type `Literal["f1"]` is not assignable to attribute `field0` of type `int`'] @@ -13,8 +12,6 @@ Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:11: error[i output = """ dataclasses_transform_converter.py:48:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Unknown, /) -> Unknown`, found `def bad_converter1() -> int` dataclasses_transform_converter.py:49:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Unknown, /) -> Unknown`, found `def bad_converter2(*, x: int) -> int` -dataclasses_transform_converter.py:102:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | bytes, /) -> ConverterClass`, found `` -dataclasses_transform_converter.py:103:31: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(str | list[str], /) -> int`, found `Overload[(s: str) -> int, (s: list[str]) -> int]` dataclasses_transform_converter.py:104:30: error[invalid-assignment] Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]` dataclasses_transform_converter.py:104:42: error[invalid-argument-type] Argument to function `model_field` is incorrect: Expected `(Iterable[list[str]] | Iterable[list[bytes]], /) -> dict[str, str] | dict[bytes, bytes]`, found `` dataclasses_transform_converter.py:107:8: error[invalid-argument-type] Argument is incorrect: Expected `int`, found `Literal["f1"]` diff --git a/conformance/results/ty/dataclasses_transform_meta.toml b/conformance/results/ty/dataclasses_transform_meta.toml index c39f9851b..a2c5e5028 100644 --- a/conformance/results/ty/dataclasses_transform_meta.toml +++ b/conformance/results/ty/dataclasses_transform_meta.toml @@ -1,12 +1,8 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not detect non-frozen `dataclass_transform` dataclasses invalidly inheriting from frozen ones. -""" +conformance_automated = "Pass" errors_diff = """ -Line 51: Expected 1 errors """ output = """ +dataclasses_transform_meta.py:51:7: error[invalid-frozen-dataclass-subclass] Non-frozen dataclass `Customer1Subclass` cannot inherit from frozen dataclass `Customer1` dataclasses_transform_meta.py:63:1: error[invalid-assignment] Property `id` defined in `Customer1` is read-only dataclasses_transform_meta.py:66:8: error[missing-argument] No arguments provided for required parameters `id`, `name` dataclasses_transform_meta.py:66:18: error[too-many-positional-arguments] Too many positional arguments: expected 0, got 2 diff --git a/conformance/results/ty/directives_version_platform.toml b/conformance/results/ty/directives_version_platform.toml index b86f074ed..c74b90393 100644 --- a/conformance/results/ty/directives_version_platform.toml +++ b/conformance/results/ty/directives_version_platform.toml @@ -1,21 +1,10 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Attempts to detect basic errors even in blocks it determines to be unreachable. -""" +conformance_automated = "Pass" errors_diff = """ -Line 14: Unexpected errors ['directives_version_platform.py:14:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] -Line 22: Unexpected errors ['directives_version_platform.py:22:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] -Line 31: Unexpected errors ['directives_version_platform.py:31:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] -Line 36: Unexpected errors ['directives_version_platform.py:36:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int`'] """ output = """ -directives_version_platform.py:14:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` -directives_version_platform.py:19:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` -directives_version_platform.py:22:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` -directives_version_platform.py:27:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` -directives_version_platform.py:31:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` -directives_version_platform.py:36:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` -directives_version_platform.py:40:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` -directives_version_platform.py:45:17: error[invalid-assignment] Object of type `Literal[""]` is not assignable to `int` +directives_version_platform.py:33:19: error[unresolved-reference] Name `val3` used when not defined +directives_version_platform.py:50:19: error[unresolved-reference] Name `val6` used when not defined +directives_version_platform.py:59:19: error[unresolved-reference] Name `val9` used when not defined +directives_version_platform.py:66:19: error[unresolved-reference] Name `val10` used when not defined +directives_version_platform.py:75:19: error[unresolved-reference] Name `val13` used when not defined """ diff --git a/conformance/results/ty/enums_member_names.toml b/conformance/results/ty/enums_member_names.toml index 8b41fdfc0..cdd4d0cd9 100644 --- a/conformance/results/ty/enums_member_names.toml +++ b/conformance/results/ty/enums_member_names.toml @@ -2,5 +2,4 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_member_names.py:30:5: error[type-assertion-failure] Type `Any` does not match asserted type `Literal["RED", "BLUE", "GREEN"]` """ diff --git a/conformance/results/ty/enums_member_values.toml b/conformance/results/ty/enums_member_values.toml index 1af6cc6e4..2686347f9 100644 --- a/conformance/results/ty/enums_member_values.toml +++ b/conformance/results/ty/enums_member_values.toml @@ -2,7 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_member_values.py:30:5: error[type-assertion-failure] Type `Any` does not match asserted type `Literal[1, 2, 3]` enums_member_values.py:50:5: error[invalid-assignment] Enum member `MARS` is incompatible with `__init__` enums_member_values.py:51:5: error[invalid-assignment] Enum member `JUPITER` is incompatible with `__init__` enums_member_values.py:54:1: error[type-assertion-failure] Type `Any` does not match asserted type `Literal[1]` diff --git a/conformance/results/ty/enums_members.toml b/conformance/results/ty/enums_members.toml index b594675a3..ea7380da9 100644 --- a/conformance/results/ty/enums_members.toml +++ b/conformance/results/ty/enums_members.toml @@ -1,12 +1,8 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject explicitly annotated enum members. -""" +conformance_automated = "Pass" errors_diff = """ -Line 50: Expected 1 errors """ output = """ +enums_members.py:50:10: error[invalid-enum-member-annotation] Type annotation on enum member `DOG` is not allowed enums_members.py:82:20: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member enums_members.py:83:20: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member enums_members.py:84:18: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member diff --git a/conformance/results/ty/generics_base_class.toml b/conformance/results/ty/generics_base_class.toml index 1068b1ca8..d3da06529 100644 --- a/conformance/results/ty/generics_base_class.toml +++ b/conformance/results/ty/generics_base_class.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not report an error when the type variable order is inconsistent between base classes. -""" +conformance_automated = "Pass" errors_diff = """ -Line 98: Expected 1 errors """ output = """ generics_base_class.py:26:26: error[invalid-argument-type] Argument to function `takes_dict_incorrect` is incorrect: Expected `dict[str, list[object]]`, found `SymbolTable` @@ -13,4 +8,5 @@ generics_base_class.py:30:8: error[invalid-type-form] `typing.Generic` is not al generics_base_class.py:49:38: error[invalid-type-arguments] Too many type arguments to class `LinkedList`: expected 1, got 2 generics_base_class.py:61:30: error[invalid-type-arguments] Too many type arguments to class `MyDict`: expected 1, got 2 generics_base_class.py:68:17: error[invalid-generic-class] Type parameter `T` cannot appear multiple times in `Generic` subscription +generics_base_class.py:98:7: error[invalid-generic-class] Inconsistent type arguments: class cannot inherit from both `Grandparent[T2@BadChild, T1@BadChild]` and `Grandparent[T1@BadChild, T2@BadChild]` """ diff --git a/conformance/results/ty/generics_basic.toml b/conformance/results/ty/generics_basic.toml index e2f98ef90..cfeb943c2 100644 --- a/conformance/results/ty/generics_basic.toml +++ b/conformance/results/ty/generics_basic.toml @@ -2,13 +2,11 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Incorrectly allows constrained type variables to be solved to a union of their constraints. -Permits generic metaclasses. """ errors_diff = """ Line 40: Expected 1 errors Line 41: Expected 1 errors Line 69: Expected 1 errors -Line 208: Expected 1 errors """ output = """ generics_basic.py:49:44: error[invalid-legacy-type-variable] A `TypeVar` cannot have exactly one constraint @@ -20,4 +18,5 @@ generics_basic.py:162:12: error[invalid-argument-type] `` is not a generics_basic.py:163:12: error[invalid-argument-type] `` is not a valid argument to `Protocol` generics_basic.py:171:1: error[invalid-generic-class] `Generic` base class must include all type variables used in other base classes generics_basic.py:172:1: error[invalid-generic-class] `Generic` base class must include all type variables used in other base classes +generics_basic.py:208:1: error[invalid-metaclass] Generic metaclasses are not supported """ diff --git a/conformance/results/ty/generics_defaults.toml b/conformance/results/ty/generics_defaults.toml index 2b6ffb91e..8fae90d23 100644 --- a/conformance/results/ty/generics_defaults.toml +++ b/conformance/results/ty/generics_defaults.toml @@ -2,26 +2,34 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ Does not forbid a `TypeVar` immediately following a `TypeVarTuple` in a parameter list from having a default. -Infers a more precise type than `type[]` for class objects. -Incorrectly rejects list literals in specializations if a class is generic over a `TypeVarTuple` and a `ParamSpec`. +Does not support `TypeVarTuple`. +Does not fully support defaults for `ParamSpec`s. """ errors_diff = """ -Line 143: Expected 1 errors -Line 45: Unexpected errors ["generics_defaults.py:45:1: error[type-assertion-failure] Type `` does not match asserted type `type[AllTheDefaults[Any, Any, str, int, bool]]`"] -Line 94: Unexpected errors ["generics_defaults.py:94:1: error[type-assertion-failure] Type `` does not match asserted type `@Todo`"] -Line 95: Unexpected errors ['generics_defaults.py:95:1: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo`'] -Line 156: Unexpected errors ['generics_defaults.py:156:49: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[int | float, bool]`?'] -Line 157: Unexpected errors ['generics_defaults.py:157:58: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`?'] +Line 188: Expected 1 errors +Line 122: Unexpected errors ['generics_defaults.py:122:5: error[type-assertion-failure] Type `(**DefaultP@Class_ParamSpec) -> None` does not match asserted type `(str, int, /) -> None`'] +Line 139: Unexpected errors ['generics_defaults.py:139:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]`'] +Line 140: Unexpected errors ['generics_defaults.py:140:5: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo`'] +Line 200: Unexpected errors ['generics_defaults.py:200:17: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...`'] +Line 203: Unexpected errors ['generics_defaults.py:203:52: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`?'] +Line 204: Unexpected errors ['generics_defaults.py:204:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]`'] +Line 205: Unexpected errors ['generics_defaults.py:205:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(int | float, bool, /) -> None`'] +Line 207: Unexpected errors ['generics_defaults.py:207:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]`'] +Line 208: Unexpected errors ['generics_defaults.py:208:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(bytes, /) -> None`'] """ output = """ generics_defaults.py:24:40: error[invalid-generic-class] Type parameter `T` without a default cannot follow earlier parameter `DefaultStrT` with a default -generics_defaults.py:45:1: error[type-assertion-failure] Type `` does not match asserted type `type[AllTheDefaults[Any, Any, str, int, bool]]` -generics_defaults.py:50:1: error[invalid-type-arguments] No type argument provided for required type variable `T2` of class `AllTheDefaults` -generics_defaults.py:94:1: error[type-assertion-failure] Type `` does not match asserted type `@Todo` -generics_defaults.py:95:1: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo` -generics_defaults.py:107:51: error[invalid-type-variable-default] TypeVar default is not assignable to the TypeVar's upper bound -generics_defaults.py:114:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: `int` is not one of the constraints of `Invalid2` -generics_defaults.py:132:1: error[type-assertion-failure] Type `int` does not match asserted type `Any` -generics_defaults.py:156:49: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `tuple[int | float, bool]`? -generics_defaults.py:157:58: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`? +generics_defaults.py:66:8: error[invalid-type-arguments] No type argument provided for required type variable `T2` of class `AllTheDefaults` +generics_defaults.py:122:5: error[type-assertion-failure] Type `(**DefaultP@Class_ParamSpec) -> None` does not match asserted type `(str, int, /) -> None` +generics_defaults.py:139:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]` +generics_defaults.py:140:5: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo` +generics_defaults.py:152:51: error[invalid-type-variable-default] TypeVar default is not assignable to the TypeVar's upper bound +generics_defaults.py:159:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: `int` is not one of the constraints of `Invalid2` +generics_defaults.py:177:1: error[type-assertion-failure] Type `int` does not match asserted type `Any` +generics_defaults.py:200:17: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` +generics_defaults.py:203:52: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`? +generics_defaults.py:204:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]` +generics_defaults.py:205:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(int | float, bool, /) -> None` +generics_defaults.py:207:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]` +generics_defaults.py:208:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(bytes, /) -> None` """ diff --git a/conformance/results/ty/generics_defaults_referential.toml b/conformance/results/ty/generics_defaults_referential.toml index 198ed2c42..c2ad31d1e 100644 --- a/conformance/results/ty/generics_defaults_referential.toml +++ b/conformance/results/ty/generics_defaults_referential.toml @@ -1,20 +1,12 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject class definitions where a type variable `T2` that has `T1` as its default comes before `T1`. -Does not reject using a type parameter from an outer scope as a default for a type parameter in an inner scope. -Infers a more precise type than `type[]` for class objects. -""" +conformance_automated = "Pass" errors_diff = """ -Line 53: Expected 1 errors -Line 60: Expected 1 errors -Line 94: Unexpected errors ["generics_defaults_referential.py:94:1: error[type-assertion-failure] Type `` does not match asserted type `type[Bar[Any, list[Any]]]`"] """ output = """ generics_defaults_referential.py:36:13: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Literal[""]` generics_defaults_referential.py:37:10: error[invalid-argument-type] Argument to bound method `__init__` is incorrect: Expected `int`, found `Literal[""]` +generics_defaults_referential.py:53:7: error[invalid-generic-class] Default of `Start2T` cannot reference out-of-scope type variable `StopT` +generics_defaults_referential.py:60:11: error[invalid-generic-class] Default of `S2` cannot reference out-of-scope type variable `S1` generics_defaults_referential.py:68:40: error[invalid-type-variable-default] Default `X1` of TypeVar `Invalid1` is not assignable to upper bound `str` of `Invalid1` because its upper bound `int` is not assignable to `str` generics_defaults_referential.py:74:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: Bounded TypeVar cannot be used as the default for a constrained TypeVar generics_defaults_referential.py:78:63: error[invalid-type-variable-default] Default `Y2` of TypeVar `AlsoInvalid2` is inconsistent with its constraints `AlsoInvalid2` because constraint `int` of `Y2` is not one of the constraints of `AlsoInvalid2` -generics_defaults_referential.py:94:1: error[type-assertion-failure] Type `` does not match asserted type `type[Bar[Any, list[Any]]]` """ diff --git a/conformance/results/ty/generics_paramspec_basic.toml b/conformance/results/ty/generics_paramspec_basic.toml index 4dc3f6fa2..e9b05cfe9 100644 --- a/conformance/results/ty/generics_paramspec_basic.toml +++ b/conformance/results/ty/generics_paramspec_basic.toml @@ -1,22 +1,19 @@ conformance_automated = "Fail" -conformant = "Unsupported" +conformant = "Partial" notes = """ -Supports `ParamSpec` but is missing many validation checks. - -Does not support `Concatenate`. Does not reject using a bare `ParamSpec` as a type alias value. -Incorrectly allows type variables to be specialized with `ParamSpec`s. -Allows bare variables to be annotated with `ParamSpec`. -Allows `ParamSpec` to be used in the return type of a `Callable` annotation. +Does not support `Concatenate`. """ errors_diff = """ Line 15: Expected 1 errors -Line 23: Expected 1 errors Line 27: Expected 1 errors -Line 31: Expected 1 errors -Line 35: Expected 1 errors -Line 39: Expected 1 errors """ output = """ generics_paramspec_basic.py:10:1: error[invalid-paramspec] The name of a `ParamSpec` (`NotIt`) must match the name of the variable it is assigned to (`WrongName`) +generics_paramspec_basic.py:23:14: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression +generics_paramspec_basic.py:23:20: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression +generics_paramspec_basic.py:31:19: error[invalid-type-arguments] ParamSpec `P` cannot be used to specialize type variable `_T` +generics_paramspec_basic.py:35:35: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression +generics_paramspec_basic.py:39:18: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression +generics_paramspec_basic.py:39:31: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression """ diff --git a/conformance/results/ty/generics_paramspec_components.toml b/conformance/results/ty/generics_paramspec_components.toml index 69a9152fc..fedff3330 100644 --- a/conformance/results/ty/generics_paramspec_components.toml +++ b/conformance/results/ty/generics_paramspec_components.toml @@ -1,27 +1,29 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Supports `ParamSpec` but is missing several validation checks around correct usage. +Incorrectly allows using `*args: P.args` and `**kwargs: P.kwargs` when `P` has not been put into scope by any other parameter annotation or enclosing scope. +Does not support `Concatenate`. """ errors_diff = """ -Line 20: Expected 1 errors -Line 26: Expected 1 errors Line 30: Expected 1 errors -Line 35: Expected 1 errors -Line 36: Expected 1 errors -Line 38: Expected 1 errors -Line 41: Expected 1 errors -Line 60: Expected 1 errors Line 70: Expected 1 errors Line 72: Expected 1 errors """ output = """ generics_paramspec_components.py:17:25: error[invalid-type-form] `P.kwargs` is valid only in `**kwargs` annotation: Did you mean `P.args`? generics_paramspec_components.py:17:45: error[invalid-type-form] `P.args` is valid only in `*args` annotation: Did you mean `P.kwargs`? +generics_paramspec_components.py:20:23: error[invalid-paramspec] `P.args` is only valid for annotating `*args` +generics_paramspec_components.py:23:46: error[invalid-paramspec] `*args: P.args` must be accompanied by `**kwargs: P.kwargs` generics_paramspec_components.py:23:46: error[invalid-type-form] `P.args` is valid only in `*args` annotation: Did you mean `P.kwargs`? +generics_paramspec_components.py:26:46: error[invalid-paramspec] `*args: P.args` must be accompanied by `**kwargs: P.kwargs` +generics_paramspec_components.py:35:18: error[invalid-paramspec] `P.args` is only valid for annotating `*args` function parameters +generics_paramspec_components.py:36:20: error[invalid-paramspec] `P.kwargs` is only valid for annotating `**kwargs` function parameters +generics_paramspec_components.py:38:26: error[invalid-paramspec] `*args: P.args` must be accompanied by `**kwargs: P.kwargs` +generics_paramspec_components.py:41:31: error[invalid-paramspec] `**kwargs: P.kwargs` must be accompanied by `*args: P.args` generics_paramspec_components.py:49:11: error[invalid-argument-type] Argument is incorrect: Expected `P@decorator.args`, found `P@decorator.kwargs` generics_paramspec_components.py:49:20: error[invalid-argument-type] Argument is incorrect: Expected `P@decorator.kwargs`, found `P@decorator.args` generics_paramspec_components.py:51:11: error[invalid-argument-type] Argument is incorrect: Expected `P@decorator.args`, found `Literal[1]` +generics_paramspec_components.py:60:28: error[invalid-paramspec] No parameters may appear between `*args: P.args` and `**kwargs: P.kwargs` generics_paramspec_components.py:83:18: error[invalid-argument-type] Argument to function `foo` is incorrect: Expected `int`, found `(...)` generics_paramspec_components.py:83:18: error[parameter-already-assigned] Multiple values provided for parameter 1 (`x`) of function `foo` generics_paramspec_components.py:98:20: error[invalid-argument-type] Argument to function `twice` is incorrect: Expected `int`, found `Literal["A"]` diff --git a/conformance/results/ty/generics_scoping.toml b/conformance/results/ty/generics_scoping.toml index e9868f312..c8989dcbb 100644 --- a/conformance/results/ty/generics_scoping.toml +++ b/conformance/results/ty/generics_scoping.toml @@ -1,17 +1,11 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Does not reject unbound type variables appearing in the bodies of generic functions or classes. -Does not reject a generic attribute in an inner class reusing a type variable scoped to an outer class. -Does not reject unbound type variables used in global-scope annotations. +Does not reject `list[T]()` in the global scope, where `T` is an unbound type variable. +Does nto reject `alias: TypeAlias = list[T]` in the body scope of a class generic over a type variable `T`. """ errors_diff = """ -Line 61: Expected 1 errors -Line 65: Expected 1 errors -Line 89: Expected 1 errors Line 98: Expected 1 errors -Line 105: Expected 1 errors -Line 106: Expected 1 errors Line 107: Expected 1 errors """ output = """ @@ -20,7 +14,12 @@ generics_scoping.py:19:1: error[type-assertion-failure] Type `Literal["a"]` does generics_scoping.py:34:10: error[invalid-argument-type] Argument to bound method `meth_2` is incorrect: Expected `int`, found `Literal["a"]` generics_scoping.py:49:1: error[type-assertion-failure] Type `Literal["abc"]` does not match asserted type `str` generics_scoping.py:53:1: error[type-assertion-failure] Type `Literal[b"abc"]` does not match asserted type `bytes` -generics_scoping.py:76:11: error[invalid-generic-class] Generic class `MyGeneric` must not reference type variables bound in an enclosing scope: `T` referenced in class definition here -generics_scoping.py:76:11: error[invalid-generic-class] Generic class `MyGeneric` must not reference type variables bound in an enclosing scope: `T` referenced in class definition here -generics_scoping.py:86:11: error[invalid-generic-class] Generic class `Bad` must not reference type variables bound in an enclosing scope: `T` referenced in class definition here +generics_scoping.py:61:13: error[unbound-type-variable] Type variable `S` is not bound to any outer generic context +generics_scoping.py:65:19: error[unbound-type-variable] Type variable `S` is not bound to any outer generic context +generics_scoping.py:76:11: error[shadowed-type-variable] Generic class `MyGeneric` uses type variable `T` already bound by an enclosing scope +generics_scoping.py:76:11: error[shadowed-type-variable] Generic class `MyGeneric` uses type variable `T` already bound by an enclosing scope +generics_scoping.py:86:11: error[shadowed-type-variable] Generic class `Bad` uses type variable `T` already bound by an enclosing scope +generics_scoping.py:89:17: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context +generics_scoping.py:105:14: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context +generics_scoping.py:106:19: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context """ diff --git a/conformance/results/ty/generics_syntax_scoping.toml b/conformance/results/ty/generics_syntax_scoping.toml index 3f724daeb..839a9eda0 100644 --- a/conformance/results/ty/generics_syntax_scoping.toml +++ b/conformance/results/ty/generics_syntax_scoping.toml @@ -1,16 +1,12 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject type variables bound in outer scopes from being rebound in inner scopes. -""" +conformance_automated = "Pass" errors_diff = """ -Line 92: Expected 1 errors -Line 95: Expected 1 errors -Line 98: Expected 1 errors """ output = """ generics_syntax_scoping.py:14:20: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic generics_syntax_scoping.py:18:17: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic generics_syntax_scoping.py:35:7: error[unresolved-reference] Name `T` used when not defined generics_syntax_scoping.py:44:17: error[unresolved-reference] Name `T` used when not defined +generics_syntax_scoping.py:92:9: error[shadowed-type-variable] Generic function `method1` uses type variable `T` already bound by an enclosing scope +generics_syntax_scoping.py:95:9: error[shadowed-type-variable] Generic function `method2` uses type variable `T` already bound by an enclosing scope +generics_syntax_scoping.py:98:9: error[shadowed-type-variable] Generic function `method3` uses type variable `T` already bound by an enclosing scope """ diff --git a/conformance/results/ty/generics_typevartuple_args.toml b/conformance/results/ty/generics_typevartuple_args.toml index d2161b6fe..e5cdebab9 100644 --- a/conformance/results/ty/generics_typevartuple_args.toml +++ b/conformance/results/ty/generics_typevartuple_args.toml @@ -13,12 +13,12 @@ Line 59: Expected 1 errors Line 67: Expected 1 errors Line 75: Expected 1 errors Line 76: Expected 1 errors -Line 20: Unexpected errors ['generics_typevartuple_args.py:20:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]`'] -Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[()]`'] -Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]`'] +Line 29: Unexpected errors ['generics_typevartuple_args.py:29:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]`'] +Line 31: Unexpected errors ['generics_typevartuple_args.py:31:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[()]`'] +Line 32: Unexpected errors ['generics_typevartuple_args.py:32:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]`'] """ output = """ -generics_typevartuple_args.py:20:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]` -generics_typevartuple_args.py:31:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[()]` -generics_typevartuple_args.py:32:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]` +generics_typevartuple_args.py:29:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]` +generics_typevartuple_args.py:31:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[()]` +generics_typevartuple_args.py:32:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int, str]` """ diff --git a/conformance/results/ty/generics_typevartuple_callable.toml b/conformance/results/ty/generics_typevartuple_callable.toml index f4004bd2a..223d59b3a 100644 --- a/conformance/results/ty/generics_typevartuple_callable.toml +++ b/conformance/results/ty/generics_typevartuple_callable.toml @@ -4,10 +4,10 @@ errors_diff = """ Line 26: Expected 1 errors Line 41: Unexpected errors ['generics_typevartuple_callable.py:41:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int, int | float | complex]`'] Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str]`'] -Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float, str, int | float | complex]`'] +Line 50: Unexpected errors ['generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float | complex, str, int | float]`'] """ output = """ generics_typevartuple_callable.py:41:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int, int | float | complex]` generics_typevartuple_callable.py:42:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str]` -generics_typevartuple_callable.py:49:1: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float, str, int | float | complex]` +generics_typevartuple_callable.py:50:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[int | float | complex, str, int | float]` """ diff --git a/conformance/results/ty/generics_upper_bound.toml b/conformance/results/ty/generics_upper_bound.toml index 436f90e7d..47ea50c59 100644 --- a/conformance/results/ty/generics_upper_bound.toml +++ b/conformance/results/ty/generics_upper_bound.toml @@ -1,18 +1,10 @@ -conformance_automated = "Fail" -conformant = "Pass" -notes = """ -Infers list[set | Unknown]` for `[1, 2]` and `set[Unknown | int]` for `{1, 2}`, leading to type-assertion failures for spurious reasons despite the type variables being accurately solved. -""" +conformance_automated = "Pass" errors_diff = """ -Line 37: Unexpected errors ['generics_upper_bound.py:37:1: error[type-assertion-failure] Type `list[Unknown | int]` does not match asserted type `list[int]`'] -Line 38: Unexpected errors ['generics_upper_bound.py:38:1: error[type-assertion-failure] Type `set[Unknown | int]` does not match asserted type `set[int]`'] """ output = """ generics_upper_bound.py:24:32: error[invalid-type-variable-bound] TypeVar upper bound cannot be generic -generics_upper_bound.py:37:1: error[type-assertion-failure] Type `list[Unknown | int]` does not match asserted type `list[int]` -generics_upper_bound.py:38:1: error[type-assertion-failure] Type `set[Unknown | int]` does not match asserted type `set[int]` -generics_upper_bound.py:43:1: error[type-assertion-failure] Type `list[Unknown | int] | set[Unknown | int]` does not match asserted type `list[int] | set[int]` -generics_upper_bound.py:51:8: error[invalid-argument-type] Argument to function `longer` is incorrect: Argument type `Literal[3]` does not satisfy upper bound `Sized` of type variable `ST` -generics_upper_bound.py:51:11: error[invalid-argument-type] Argument to function `longer` is incorrect: Argument type `Literal[3]` does not satisfy upper bound `Sized` of type variable `ST` -generics_upper_bound.py:56:10: error[invalid-legacy-type-variable] A `TypeVar` cannot have both a bound and constraints +generics_upper_bound.py:44:5: error[type-assertion-failure] Type `list[int] | set[int]` does not match asserted type `Collection[int]` +generics_upper_bound.py:52:8: error[invalid-argument-type] Argument to function `longer` is incorrect: Argument type `Literal[3]` does not satisfy upper bound `Sized` of type variable `ST` +generics_upper_bound.py:52:11: error[invalid-argument-type] Argument to function `longer` is incorrect: Argument type `Literal[3]` does not satisfy upper bound `Sized` of type variable `ST` +generics_upper_bound.py:57:10: error[invalid-legacy-type-variable] A `TypeVar` cannot have both a bound and constraints """ diff --git a/conformance/results/ty/protocols_runtime_checkable.toml b/conformance/results/ty/protocols_runtime_checkable.toml index 098d535c7..84b9abcd3 100644 --- a/conformance/results/ty/protocols_runtime_checkable.toml +++ b/conformance/results/ty/protocols_runtime_checkable.toml @@ -1,11 +1,9 @@ conformance_automated = "Fail" conformant = "Partial" notes = """ -Detects invalid `isinstance()`/`issubclass()` calls of the form `isinstance(x, P)` but not of the form `isinstance(x, (P1, P2))`. Does not reject `isinstance()` or `issubclass()` calls against runtime-checkable protocols where there is an unsafe overlap between the type of the first argument and the protocol. """ errors_diff = """ -Line 61: Expected 1 errors Line 88: Expected 1 errors Line 92: Expected 1 errors Line 96: Expected 1 errors @@ -13,4 +11,5 @@ Line 96: Expected 1 errors output = """ protocols_runtime_checkable.py:23:8: error[isinstance-against-protocol] Class `Proto1` cannot be used as the second argument to `isinstance`: This call will raise `TypeError` at runtime protocols_runtime_checkable.py:55:8: error[isinstance-against-protocol] `DataProtocol` cannot be used as the second argument to `issubclass` as it is a protocol with non-method members +protocols_runtime_checkable.py:61:8: error[isinstance-against-protocol] `DataProtocol` cannot be used as the second argument to `issubclass` as it is a protocol with non-method members """ diff --git a/conformance/results/ty/qualifiers_annotated.toml b/conformance/results/ty/qualifiers_annotated.toml index 7877ed0c7..da1de796e 100644 --- a/conformance/results/ty/qualifiers_annotated.toml +++ b/conformance/results/ty/qualifiers_annotated.toml @@ -8,7 +8,7 @@ qualifiers_annotated.py:39:18: error[invalid-type-form] Tuple literals are not a qualifiers_annotated.py:40:17: error[invalid-type-form] List comprehensions are not allowed in type expressions qualifiers_annotated.py:41:17: error[invalid-type-form] Dict literals are not allowed in type expressions qualifiers_annotated.py:42:17: error[invalid-type-form] Function calls are not allowed in type expressions -qualifiers_annotated.py:43:17: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +qualifiers_annotated.py:43:17: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression qualifiers_annotated.py:43:23: error[invalid-type-form] Int literals are not allowed in this context in a type expression qualifiers_annotated.py:44:17: error[invalid-type-form] `if` expressions are not allowed in type expressions qualifiers_annotated.py:45:17: error[unresolved-reference] Name `var1` used when not defined diff --git a/conformance/results/ty/qualifiers_final_decorator.toml b/conformance/results/ty/qualifiers_final_decorator.toml index 62746398d..7236dc2a4 100644 --- a/conformance/results/ty/qualifiers_final_decorator.toml +++ b/conformance/results/ty/qualifiers_final_decorator.toml @@ -1,10 +1,5 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject using `@final` on a non-method function. -""" +conformance_automated = "Pass" errors_diff = """ -Lines 125, 126: Expected error (tag 'func') """ output = """ qualifiers_final_decorator.py:21:16: error[subclass-of-final-class] Class `Derived1` cannot inherit from final class `Base1` @@ -17,4 +12,5 @@ qualifiers_final_decorator.py:89:9: error[override-of-final-method] Cannot overr qualifiers_final_decorator.py:102:9: error[override-of-final-method] Cannot override final member `method` from superclass `Base4` qualifiers_final_decorator.py:118:9: error[invalid-method-override] Invalid override of method `method`: Definition is incompatible with `Base5_2.method` qualifiers_final_decorator.py:118:9: error[override-of-final-method] Cannot override final member `method` from superclass `Base5_2` +qualifiers_final_decorator.py:125:1: error[final-on-non-method] `@final` cannot be applied to non-method function `func1` """ diff --git a/conformance/results/ty/specialtypes_type.toml b/conformance/results/ty/specialtypes_type.toml index cf381ae79..20b222ad6 100644 --- a/conformance/results/ty/specialtypes_type.toml +++ b/conformance/results/ty/specialtypes_type.toml @@ -3,7 +3,6 @@ conformant = "Partial" notes = """ Allows arbitrary attributes to be accessed on `TA` where `TA = typing.Type[typing.Any]` or `TA = type[typing.Any]`. Treats `type` equivalently to `type[object]` rather than `type[typing.Any]`. -Incorrectly infers `b.__mro__` as having type `typing.Any` rather than `tuple[type, ...]` if `b` has type `type[typing.Any]` or `typing.Type[typing.Any]`. """ errors_diff = """ Line 144: Expected 1 errors @@ -11,10 +10,8 @@ Line 146: Expected 1 errors Line 84: Unexpected errors ['specialtypes_type.py:84:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]`'] Line 99: Unexpected errors ['specialtypes_type.py:99:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] Line 100: Unexpected errors ['specialtypes_type.py:100:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] -Line 102: Unexpected errors ['specialtypes_type.py:102:5: error[type-assertion-failure] Type `Any` does not match asserted type `tuple[type, ...]`'] Line 107: Unexpected errors ['specialtypes_type.py:107:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] Line 108: Unexpected errors ['specialtypes_type.py:108:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown`'] -Line 110: Unexpected errors ['specialtypes_type.py:110:5: error[type-assertion-failure] Type `Any` does not match asserted type `tuple[type, ...]`'] Line 137: Unexpected errors ['specialtypes_type.py:137:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]`'] Line 139: Unexpected errors ['specialtypes_type.py:139:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]`'] Line 169: Unexpected errors ['specialtypes_type.py:169:21: error[invalid-assignment] Object of type `type` is not assignable to `type[int]`'] @@ -27,10 +24,8 @@ specialtypes_type.py:76:17: error[invalid-type-form] type[...] must have exactly specialtypes_type.py:84:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]` specialtypes_type.py:99:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown` specialtypes_type.py:100:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown` -specialtypes_type.py:102:5: error[type-assertion-failure] Type `Any` does not match asserted type `tuple[type, ...]` specialtypes_type.py:107:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown` specialtypes_type.py:108:17: error[unresolved-attribute] Object of type `type` has no attribute `unknown` -specialtypes_type.py:110:5: error[type-assertion-failure] Type `Any` does not match asserted type `tuple[type, ...]` specialtypes_type.py:117:5: error[unresolved-attribute] Object of type `type` has no attribute `unknown` specialtypes_type.py:120:5: error[unresolved-attribute] Object of type `type` has no attribute `unknown` specialtypes_type.py:137:5: error[type-assertion-failure] Type `type` does not match asserted type `type[Any]` diff --git a/conformance/results/ty/tuples_unpacked.toml b/conformance/results/ty/tuples_unpacked.toml index 0920a8546..b45a4fd3a 100644 --- a/conformance/results/ty/tuples_unpacked.toml +++ b/conformance/results/ty/tuples_unpacked.toml @@ -1,14 +1,10 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Only supports the new syntax using `*`, not `typing.Unpack`. -""" +conformance_automated = "Pass" errors_diff = """ -Line 59: Expected 1 errors -Lines 60, 61: Expected error (tag 't14') """ output = """ tuples_unpacked.py:40:5: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization tuples_unpacked.py:41:5: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization tuples_unpacked.py:51:9: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization +tuples_unpacked.py:59:6: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization +tuples_unpacked.py:60:6: error[invalid-type-form] Multiple unpacked variadic tuples are not allowed in a `tuple` specialization """ diff --git a/conformance/results/ty/typeddicts_required.toml b/conformance/results/ty/typeddicts_required.toml index 64b4cc1a4..7bf240fdc 100644 --- a/conformance/results/ty/typeddicts_required.toml +++ b/conformance/results/ty/typeddicts_required.toml @@ -1,14 +1,9 @@ -conformance_automated = "Fail" -conformant = "Partial" -notes = """ -Does not reject use of `Required` and `NotRequired` in non-`TypedDict` classes. -Does not reject nested use such as `Required[Required[int]]`. -""" +conformance_automated = "Pass" errors_diff = """ -Line 12: Expected 1 errors -Line 59: Expected 1 errors -Line 60: Expected 1 errors """ output = """ +typeddicts_required.py:12:8: error[invalid-type-form] `Required` is only allowed in TypedDict fields typeddicts_required.py:16:5: error[invalid-type-form] `NotRequired` is not allowed in function parameter annotations +typeddicts_required.py:59:8: error[invalid-type-form] `typing.Required` cannot be nested inside `Required` or `NotRequired` +typeddicts_required.py:60:8: error[invalid-type-form] `typing.Required` cannot be nested inside `Required` or `NotRequired` """ diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 4404b9897..102e87c60 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.19 (ae10022c2 2026-02-26)" +version = "ty 0.0.21 (c1ad9f281 2026-03-06)" diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 30f8b4098..3682e009f 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -196,19 +196,13 @@ def name(self) -> str: def install(self) -> bool: try: - # Uninstall any old version if present. - run( - [sys.executable, "-m", "pip", "uninstall", "ty", "-y"], - check=True, - ) - # Install the latest version. - run( - [sys.executable, "-m", "pip", "install", "ty"], - check=True, - ) + self.get_version() return True - except CalledProcessError: - print("Unable to install ty") + except (CalledProcessError, FileNotFoundError): + print( + "Unable to run pyrefly. Install conformance dependencies with " + "'uv sync --frozen' from the conformance directory." + ) return False def get_version(self) -> str: diff --git a/conformance/tests/ty.toml b/conformance/tests/ty.toml index 5fddd62be..7fd5f298b 100644 --- a/conformance/tests/ty.toml +++ b/conformance/tests/ty.toml @@ -6,3 +6,4 @@ deprecated = "error" invalid-legacy-positional-parameter = "error" redundant-final-classvar = "error" assert-type-unspellable-subtype = "ignore" +invalid-enum-member-annotation = "error" diff --git a/conformance/uv.lock b/conformance/uv.lock index 2c2c6ba74..d81cd3963 100644 --- a/conformance/uv.lock +++ b/conformance/uv.lock @@ -127,6 +127,30 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/b5/11/87d6d29fb5d237229d67973a6c9e06e048f01cf4994dee194ab0ea841814/tomlkit-0.14.0-py3-none-any.whl", hash = "sha256:592064ed85b40fa213469f81ac584f67a4f2992509a7c3ea2d632208623a3680", size = 39310, upload-time = "2026-01-13T01:14:51.965Z" }, ] +[[package]] +name = "ty" +version = "0.0.21" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/ee/20/2ba8fd9493c89c41dfe9dbb73bc70a28b28028463bc0d2897ba8be36230a/ty-0.0.21.tar.gz", hash = "sha256:a4c2ba5d67d64df8fcdefd8b280ac1149d24a73dbda82fa953a0dff9d21400ed", size = 5297967, upload-time = "2026-03-06T01:57:13.809Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/36/70/edf38bb37517531681d1c37f5df64744e5ad02673c02eb48447eae4bea08/ty-0.0.21-py3-none-linux_armv6l.whl", hash = "sha256:7bdf2f572378de78e1f388d24691c89db51b7caf07cf90f2bfcc1d6b18b70a76", size = 10299222, upload-time = "2026-03-06T01:57:16.64Z" }, + { url = "https://files.pythonhosted.org/packages/72/62/0047b0bd19afeefbc7286f20a5f78a2aa39f92b4d89853f0d7185ab89edc/ty-0.0.21-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:7e9613994610431ab8625025bd2880dbcb77c5c9fabdd21134cda12d840a529d", size = 10130513, upload-time = "2026-03-06T01:57:29.93Z" }, + { url = "https://files.pythonhosted.org/packages/a2/20/0b93a9e91aaed23155780258cdfdb4726ef68b6985378ac069bc427291a0/ty-0.0.21-py3-none-macosx_11_0_arm64.whl", hash = "sha256:56d3b198b64dd0a19b2b66e257deaed2ecea568e722ae5352f3c6fb62027f89d", size = 9605425, upload-time = "2026-03-06T01:57:27.115Z" }, + { url = "https://files.pythonhosted.org/packages/ea/fd/9945e2fa2996a1287b1e1d7ce050e97e1f420233b271e770934bfa0880a0/ty-0.0.21-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d23d2c34f7a77d974bb08f0860ef700addc8a683d81a0319f71c08f87506cfd0", size = 10108298, upload-time = "2026-03-06T01:57:35.429Z" }, + { url = "https://files.pythonhosted.org/packages/52/e7/4ec52fcb15f3200826c9f048472c062549a05b0d1ef0b51f32d527b513c4/ty-0.0.21-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:56b01fd2519637a4ca88344f61c96225f540c98ff18bca321d4eaa7bb0f7aa2f", size = 10121556, upload-time = "2026-03-06T01:57:03.242Z" }, + { url = "https://files.pythonhosted.org/packages/ee/c0/ad457be2a8abea0f25549598bd098554540ced66229488daa0d558dad3c8/ty-0.0.21-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e9de7e11c63c6afc40f3e9ba716374add171aee7fabc70b5146a510705c6d41b", size = 10603264, upload-time = "2026-03-06T01:56:52.134Z" }, + { url = "https://files.pythonhosted.org/packages/f8/5b/2ecc7a2175243a4bcb72f5298ae41feabbb93b764bb0dc45722f3752c2c2/ty-0.0.21-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:62f7f5b235c4f7876db305c36997aea07b7af29b1a068f373d0e2547e25f32ff", size = 11196428, upload-time = "2026-03-06T01:57:32.94Z" }, + { url = "https://files.pythonhosted.org/packages/37/f5/aff507d6a901f328ef96a298032b0c11aaaf950a146ed7dd3b5bf2cd3acf/ty-0.0.21-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:ee8399f7c453a425291e6688efe430cfae7ab0ac4ffd50eba9f872bf878b54f6", size = 10866355, upload-time = "2026-03-06T01:56:57.831Z" }, + { url = "https://files.pythonhosted.org/packages/be/30/822bbcb92d55b65989aa7ed06d9585f28ade9c9447369194ed4b0fb3b5b9/ty-0.0.21-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:210e7568c9f886c4d01308d751949ee714ad7ad9d7d928d2ba90d329dd880367", size = 10738177, upload-time = "2026-03-06T01:57:11.256Z" }, + { url = "https://files.pythonhosted.org/packages/57/cc/46e7991b6469e93ac2c7e533a028983e402485580150ac864c56352a3a82/ty-0.0.21-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:53508e345b11569f78b21ba8e2b4e61df38a9754947fb3cd9f2ef574367338fb", size = 10079158, upload-time = "2026-03-06T01:57:00.516Z" }, + { url = "https://files.pythonhosted.org/packages/15/c2/0bbdadfbd008240f8f1a87dc877433cb3884436097926107ccf06e618199/ty-0.0.21-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:553e43571f4a35604c36cfd07d8b61a5eb7a714e3c67f8c4ff2cf674fefbaef9", size = 10150535, upload-time = "2026-03-06T01:57:08.815Z" }, + { url = "https://files.pythonhosted.org/packages/c5/b5/2dbdb7b57b5362200ef0a39738ebd31331726328336def0143ac097ee59d/ty-0.0.21-py3-none-musllinux_1_2_i686.whl", hash = "sha256:666f6822e3b9200abfa7e95eb0ddd576460adb8d66b550c0ad2c70abc84a2048", size = 10319803, upload-time = "2026-03-06T01:57:19.106Z" }, + { url = "https://files.pythonhosted.org/packages/72/84/70e52c0b7abc7c2086f9876ef454a73b161d3125315536d8d7e911c94ca4/ty-0.0.21-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a0854d008347ce4a5fb351af132f660a390ab2a1163444d075251d43e6f74b9b", size = 10826239, upload-time = "2026-03-06T01:57:21.727Z" }, + { url = "https://files.pythonhosted.org/packages/a1/8a/1f72480fd013bbc6cd1929002abbbcde9a0b08ead6a15154de9d7f7fa37e/ty-0.0.21-py3-none-win32.whl", hash = "sha256:bef3ab4c7b966bcc276a8ac6c11b63ba222d21355b48d471ea782c4104eee4e0", size = 9693196, upload-time = "2026-03-06T01:57:24.126Z" }, + { url = "https://files.pythonhosted.org/packages/8d/f8/1104808b875c26c640e536945753a78562d606bef4e241d9dbf3d92477f6/ty-0.0.21-py3-none-win_amd64.whl", hash = "sha256:a709d576e5bea84b745d43058d8b9cd4f27f74a0b24acb4b0cbb7d3d41e0d050", size = 10668660, upload-time = "2026-03-06T01:56:55.06Z" }, + { url = "https://files.pythonhosted.org/packages/1b/b8/25e0adc404bbf986977657b25318991f93097b49f8aea640d93c0b0db68e/ty-0.0.21-py3-none-win_arm64.whl", hash = "sha256:f72047996598ac20553fb7e21ba5741e3c82dee4e9eadf10d954551a5fe09391", size = 10104161, upload-time = "2026-03-06T01:57:06.072Z" }, +] + [[package]] name = "typing-conformance" version = "0.1.0" @@ -137,6 +161,7 @@ dependencies = [ { name = "pyright" }, { name = "tomli" }, { name = "tomlkit" }, + { name = "ty" }, { name = "zuban" }, ] @@ -147,6 +172,7 @@ requires-dist = [ { name = "pyright" }, { name = "tomli" }, { name = "tomlkit" }, + { name = "ty" }, { name = "zuban" }, ] From 4bde4aaba226b2fad3dcf3cc2379f6437acbbf7e Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 6 Mar 2026 18:22:53 +0000 Subject: [PATCH 05/11] weird, not sure why --version would give different results locally? --- conformance/results/results.html | 2 +- conformance/results/ty/version.toml | 2 +- conformance/src/type_checker.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index 94c8be983..f03226fd0 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -180,7 +180,7 @@

Python Type System Conformance Test Results

pyrefly 0.54.0
-
ty 0.0.21 (c1ad9f281 2026-03-06)
+
ty 0.0.21
diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 102e87c60..1186fdef6 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.21 (c1ad9f281 2026-03-06)" +version = "ty 0.0.21" diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 3682e009f..3c0600284 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -207,7 +207,7 @@ def install(self) -> bool: def get_version(self) -> str: proc = run([sys.executable, "-m", "ty", "--version"], stdout=PIPE, text=True) - return proc.stdout.strip() + return proc.stdout.split("(")[0].strip() def run_tests(self, test_files: Sequence[str]) -> dict[str, str]: command = [ From 00fb7d0ab06f6077da3a0d7c46c104266486277f Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 6 Mar 2026 19:10:24 +0000 Subject: [PATCH 06/11] Update conformance/src/type_checker.py --- conformance/src/type_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index 3c0600284..26aeecc2b 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -200,7 +200,7 @@ def install(self) -> bool: return True except (CalledProcessError, FileNotFoundError): print( - "Unable to run pyrefly. Install conformance dependencies with " + "Unable to run ty. Install conformance dependencies with " "'uv sync --frozen' from the conformance directory." ) return False From c3d6d56569d6367289bb11155efdd77bb861e5e6 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 6 Mar 2026 19:10:50 +0000 Subject: [PATCH 07/11] Delete conformance/tests/.pyre/pyre.stderr --- conformance/tests/.pyre/pyre.stderr | 104 ---------------------------- 1 file changed, 104 deletions(-) delete mode 100644 conformance/tests/.pyre/pyre.stderr diff --git a/conformance/tests/.pyre/pyre.stderr b/conformance/tests/.pyre/pyre.stderr deleted file mode 100644 index b820ff423..000000000 --- a/conformance/tests/.pyre/pyre.stderr +++ /dev/null @@ -1,104 +0,0 @@ -2025-08-20 16:31:38,192 [PID 9073] INFO No binary specified, looking for `pyre.bin` in PATH -2025-08-20 16:31:38,192 [PID 9073] INFO Pyre binary is located at `/Users/alexw/dev/typing/.venv/bin/pyre.bin` -2025-08-20 16:31:38,192 [PID 9073] INFO Could not determine the number of Pyre workers from configuration. Auto-set the value to 6. -2025-08-20 16:31:38,193 [PID 9073] INFO No typeshed specified, looking for it... -2025-08-20 16:31:38,193 [PID 9073] INFO Found: `/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed` -2025-08-20 16:31:38,194 [PID 9073] INFO Writing arguments into /var/folders/gd/1czdxc454j15y8gns2krv8vc0000gn/T/pyre_arguments_elmu9hl8.json... -2025-08-20 16:31:38,194 [PID 9073] DEBUG Arguments: -{ - "source_paths": { - "kind": "simple", - "paths": [ - "/Users/alexw/dev/typing/conformance/tests" - ] - }, - "search_paths": [ - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$mypy", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$packaging", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$click", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$mypyc", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$tomlkit", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$pathspec", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$libcst", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$pip", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$testslide", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$pyright", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$tomli_w", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$marshmallow", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$tomli", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$typeguard", - "/Users/alexw/dev/typing/.venv/lib/python3.12/site-packages$dataclasses_json", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stdlib", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/ExifRead", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/PyMySQL", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/PyYAML", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/aiofiles", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/chevron", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/colorama", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/ldap3", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/mysqlclient", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/paramiko", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/psycopg2", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/pycurl", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/python-dateutil", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/pytz", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/regex", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/requests", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/retry", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/tqdm", - "/Users/alexw/dev/typing/.venv/lib/pyre_check/typeshed/stubs/ujson" - ], - "excludes": [], - "checked_directory_allowlist": [ - "/Users/alexw/dev/typing/conformance/tests" - ], - "checked_directory_blocklist": [], - "extensions": [], - "log_path": "/Users/alexw/dev/typing/conformance/tests/.pyre", - "global_root": "/Users/alexw/dev/typing/conformance/tests", - "debug": false, - "python_version": { - "major": 3, - "minor": 12, - "micro": 7 - }, - "system_platform": "darwin", - "shared_memory": {}, - "parallel": true, - "number_of_workers": 6, - "additional_logging_sections": [], - "show_error_traces": false, - "strict": false -} -2025-08-20 16:31:40,379 [PID 9073] PERFORMANCE Initialized shared memory (heap size: 8589934592, dep table pow: 1, hash table pow: 26): 0.000s -2025-08-20 16:31:40,392 [PID 9073] PERFORMANCE Initialized multiprocessing workers (workers: 6): 0.014s -2025-08-20 16:31:40,392 [PID 9073] INFO Building module tracker... -2025-08-20 16:31:40,641 [PID 9073] PERFORMANCE Module tracker built: 0.250s -2025-08-20 16:31:40,641 [PID 9073] PERFORMANCE Full environment built: 0.250s -2025-08-20 16:31:40,641 [PID 9073] INFO Collecting all definitions... -2025-08-20 16:31:40,803 [PID 9073] PERFORMANCE Collected definitions (defines: 2108): 0.161s -2025-08-20 16:31:40,804 [PID 9073] INFO Checking 2108 functions... -2025-08-20 16:31:41,129 [PID 9073] INFO Processed 176 of 2108 functions -2025-08-20 16:31:41,154 [PID 9073] INFO Processed 352 of 2108 functions -2025-08-20 16:31:41,180 [PID 9073] INFO Processed 528 of 2108 functions -2025-08-20 16:31:41,255 [PID 9073] INFO Processed 704 of 2108 functions -2025-08-20 16:31:41,293 [PID 9073] INFO Processed 880 of 2108 functions -2025-08-20 16:31:41,318 [PID 9073] INFO Processed 1056 of 2108 functions -2025-08-20 16:31:41,381 [PID 9073] INFO Processed 1232 of 2108 functions -2025-08-20 16:31:41,419 [PID 9073] INFO Processed 1408 of 2108 functions -2025-08-20 16:31:41,431 [PID 9073] INFO Processed 1584 of 2108 functions -2025-08-20 16:31:41,494 [PID 9073] INFO Processed 1756 of 2108 functions -2025-08-20 16:31:43,033 [PID 9073] INFO Processed 1932 of 2108 functions -2025-08-20 16:31:43,583 [PID 9073] INFO Processed 2108 of 2108 functions -2025-08-20 16:31:43,584 [PID 9073] PERFORMANCE Check_TypeCheck: 2.778s -2025-08-20 16:31:43,584 [PID 9073] MEMORY Shared memory size post-typecheck (size: 4) -2025-08-20 16:31:43,584 [PID 9073] INFO Postprocessing 147 sources... -2025-08-20 16:31:43,659 [PID 9073] INFO Postprocessed 22 of 147 sources -2025-08-20 16:31:43,659 [PID 9073] INFO Postprocessed 47 of 147 sources -2025-08-20 16:31:43,659 [PID 9073] INFO Postprocessed 72 of 147 sources -2025-08-20 16:31:43,659 [PID 9073] INFO Postprocessed 97 of 147 sources -2025-08-20 16:31:43,659 [PID 9073] INFO Postprocessed 122 of 147 sources -2025-08-20 16:31:43,659 [PID 9073] INFO Postprocessed 147 of 147 sources -2025-08-20 16:31:43,659 [PID 9073] PERFORMANCE Check_Postprocessing: 0.084s -2025-08-20 16:31:43,659 [PID 9073] PERFORMANCE Check (request kind: FullCheck): 3.274s -2025-08-20 16:31:43,717 [PID 9073] ERROR Found 1249 type errors! From c1ab75c13813cddf5093ad7c645b5751760aa37b Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Fri, 6 Mar 2026 19:11:23 +0000 Subject: [PATCH 08/11] Delete conformance/tests/.pyre_configuration --- conformance/tests/.pyre_configuration | 1 - 1 file changed, 1 deletion(-) delete mode 100644 conformance/tests/.pyre_configuration diff --git a/conformance/tests/.pyre_configuration b/conformance/tests/.pyre_configuration deleted file mode 100644 index 55a8f62a7..000000000 --- a/conformance/tests/.pyre_configuration +++ /dev/null @@ -1 +0,0 @@ -{"site_package_search_strategy": "pep561", "source_directories": ["."]} From ca473d6f6dc29d37a93eea73ce9d6a2bc2f71cd7 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Fri, 6 Mar 2026 17:05:10 -0800 Subject: [PATCH 09/11] annotate constructors_callable results --- conformance/results/ty/constructors_callable.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/conformance/results/ty/constructors_callable.toml b/conformance/results/ty/constructors_callable.toml index f613ad9c5..a0e0c6c35 100644 --- a/conformance/results/ty/constructors_callable.toml +++ b/conformance/results/ty/constructors_callable.toml @@ -1,5 +1,11 @@ conformance_automated = "Fail" -conformant = "Unsupported" +conformant = "Partial" +notes = """ +Does not include `__init__` when `__new__` returns `Self`. +Does not respect `NoReturn` return type on metaclass `__call__`. +Does not ignore `__init__` when `__new__` returns `Any`. +Unions overload return types. +""" errors_diff = """ Line 66: Expected 1 errors Line 67: Expected 1 errors From c427147ba000ab85787612dbae6c1aa933b60a21 Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Fri, 6 Mar 2026 17:07:28 -0800 Subject: [PATCH 10/11] update results --- conformance/results/results.html | 6 +++--- conformance/results/ty/aliases_implicit.toml | 6 +++--- conformance/results/ty/aliases_type_statement.toml | 6 +++--- conformance/results/ty/aliases_typealiastype.toml | 2 +- conformance/results/ty/annotations_forward_refs.toml | 2 +- conformance/results/ty/annotations_typeexpr.toml | 2 +- conformance/results/ty/constructors_callable.toml | 8 ++++---- conformance/results/ty/enums_member_names.toml | 1 + conformance/results/ty/enums_member_values.toml | 1 + conformance/results/ty/enums_members.toml | 4 ++-- conformance/results/ty/generics_defaults.toml | 2 -- conformance/results/ty/generics_paramspec_basic.toml | 10 ++++------ conformance/results/ty/generics_scoping.toml | 10 +++++----- conformance/results/ty/qualifiers_annotated.toml | 2 +- conformance/results/ty/version.toml | 2 +- 15 files changed, 31 insertions(+), 33 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index f03226fd0..cbc9f7f6d 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -180,7 +180,7 @@

Python Type System Conformance Test Results

pyrefly 0.54.0
-
ty 0.0.21
+
ty 0.0.20
@@ -743,7 +743,7 @@

Python Type System Conformance Test Results

Pass Pass
Partial

Converting constructor to callable does not preserve class-scoped type params.

Converting constructor to callable does not substitute Self in __new__

Converting constructor to callable uses __new__ signature instead of __init__

-Unsupported +
Partial

Does not include `__init__` when `__new__` returns `Self`.

Does not respect `NoReturn` return type on metaclass `__call__`.

Does not ignore `__init__` when `__new__` returns `Any`.

Unions overload return types.

     constructors_consistency
Pass*

Does not report inconsistency between __new__ and __init__ (optional).

@@ -1114,7 +1114,7 @@

Python Type System Conformance Test Results

Pass*

Does not support `_ignore_` mechanism (optional).

Pass Pass -Pass +Unknown Type narrowing diff --git a/conformance/results/ty/aliases_implicit.toml b/conformance/results/ty/aliases_implicit.toml index bda018615..9419afb9e 100644 --- a/conformance/results/ty/aliases_implicit.toml +++ b/conformance/results/ty/aliases_implicit.toml @@ -20,10 +20,10 @@ aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments aliases_implicit.py:79:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 aliases_implicit.py:80:24: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` aliases_implicit.py:81:25: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int | float` of type variable `TFloat@GoodTypeAlias12` -aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[ | ]` is not allowed in a type expression +aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[Unknown | | ]` is not allowed in a type expression aliases_implicit.py:108:9: error[invalid-type-form] Variable of type `tuple[tuple[, ]]` is not allowed in a type expression -aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[]` is not allowed in a type expression -aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[str, str]` is not allowed in a type expression +aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[Unknown | ]` is not allowed in a type expression +aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[Unknown | str, Unknown | str]` is not allowed in a type expression aliases_implicit.py:114:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression aliases_implicit.py:115:10: error[invalid-type-form] Variable of type `Literal[True]` is not allowed in a type expression aliases_implicit.py:116:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml index 420c17ee9..2d35e581a 100644 --- a/conformance/results/ty/aliases_type_statement.toml +++ b/conformance/results/ty/aliases_type_statement.toml @@ -8,6 +8,8 @@ Does not support `type` statements generic over `TypeVarTuple`s. """ errors_diff = """ Line 56: Expected 1 errors +Line 62: Expected 1 errors +Line 67: Expected 1 errors Line 84: Expected 1 errors Lines 51, 52: Expected error (tag 'TA14') Line 10: Unexpected errors ['aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3', 'aliases_type_statement.py:10:52: error[invalid-type-form] `...` is not allowed in this context in a type expression'] @@ -27,7 +29,7 @@ aliases_type_statement.py:39:23: error[invalid-type-form] Tuple literals are not aliases_type_statement.py:40:22: error[invalid-type-form] List comprehensions are not allowed in type expressions aliases_type_statement.py:41:22: error[invalid-type-form] Dict literals are not allowed in type expressions aliases_type_statement.py:42:22: error[invalid-type-form] Function calls are not allowed in type expressions -aliases_type_statement.py:43:22: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression +aliases_type_statement.py:43:22: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression aliases_type_statement.py:43:28: error[invalid-type-form] Int literals are not allowed in this context in a type expression aliases_type_statement.py:44:22: error[invalid-type-form] `if` expressions are not allowed in type expressions aliases_type_statement.py:45:22: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression @@ -35,8 +37,6 @@ aliases_type_statement.py:46:23: error[invalid-type-form] Boolean literals are n aliases_type_statement.py:47:23: error[invalid-type-form] Int literals are not allowed in this context in a type expression aliases_type_statement.py:48:23: error[invalid-type-form] Boolean operations are not allowed in type expressions aliases_type_statement.py:49:23: error[fstring-type-annotation] Type expressions cannot use f-strings -aliases_type_statement.py:62:23: error[unbound-type-variable] Type variable `V` is not bound to any outer generic context -aliases_type_statement.py:67:17: error[unbound-type-variable] Type variable `T1` is not bound to any outer generic context aliases_type_statement.py:77:27: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int` of type variable `S@RecursiveTypeAlias2` aliases_type_statement.py:79:32: error[invalid-type-arguments] Type `int` is not assignable to upper bound `str` of type variable `T@RecursiveTypeAlias2` aliases_type_statement.py:82:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias3` diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml index 0d4317cca..9e5470da3 100644 --- a/conformance/results/ty/aliases_typealiastype.toml +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -24,7 +24,7 @@ aliases_typealiastype.py:54:43: error[invalid-type-form] Tuple literals are not aliases_typealiastype.py:55:42: error[invalid-type-form] List comprehensions are not allowed in type expressions aliases_typealiastype.py:56:42: error[invalid-type-form] Dict literals are not allowed in type expressions aliases_typealiastype.py:57:42: error[invalid-type-form] Function calls are not allowed in type expressions -aliases_typealiastype.py:58:42: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression +aliases_typealiastype.py:58:42: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression aliases_typealiastype.py:58:48: error[invalid-type-form] Int literals are not allowed in this context in a type expression aliases_typealiastype.py:59:42: error[invalid-type-form] `if` expressions are not allowed in type expressions aliases_typealiastype.py:60:42: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression diff --git a/conformance/results/ty/annotations_forward_refs.toml b/conformance/results/ty/annotations_forward_refs.toml index 15ee0435c..721ab9477 100644 --- a/conformance/results/ty/annotations_forward_refs.toml +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -21,7 +21,7 @@ annotations_forward_refs.py:43:10: error[invalid-type-form] Tuple literals are n annotations_forward_refs.py:44:10: error[invalid-type-form] List comprehensions are not allowed in type expressions annotations_forward_refs.py:45:10: error[invalid-type-form] Dict literals are not allowed in type expressions annotations_forward_refs.py:46:10: error[invalid-type-form] Function calls are not allowed in type expressions -annotations_forward_refs.py:47:10: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression +annotations_forward_refs.py:47:10: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression annotations_forward_refs.py:47:16: error[invalid-type-form] Int literals are not allowed in this context in a type expression annotations_forward_refs.py:48:10: error[invalid-type-form] `if` expressions are not allowed in type expressions annotations_forward_refs.py:49:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression diff --git a/conformance/results/ty/annotations_typeexpr.toml b/conformance/results/ty/annotations_typeexpr.toml index 4bc31c01b..d000bd099 100644 --- a/conformance/results/ty/annotations_typeexpr.toml +++ b/conformance/results/ty/annotations_typeexpr.toml @@ -8,7 +8,7 @@ annotations_typeexpr.py:90:9: error[invalid-type-form] Tuple literals are not al annotations_typeexpr.py:91:9: error[invalid-type-form] List comprehensions are not allowed in type expressions annotations_typeexpr.py:92:9: error[invalid-type-form] Dict literals are not allowed in type expressions annotations_typeexpr.py:93:9: error[invalid-type-form] Function calls are not allowed in type expressions -annotations_typeexpr.py:94:9: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression +annotations_typeexpr.py:94:9: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression annotations_typeexpr.py:94:15: error[invalid-type-form] Int literals are not allowed in this context in a type expression annotations_typeexpr.py:95:9: error[invalid-type-form] `if` expressions are not allowed in type expressions annotations_typeexpr.py:96:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression diff --git a/conformance/results/ty/constructors_callable.toml b/conformance/results/ty/constructors_callable.toml index a0e0c6c35..a6f26a40c 100644 --- a/conformance/results/ty/constructors_callable.toml +++ b/conformance/results/ty/constructors_callable.toml @@ -10,12 +10,15 @@ errors_diff = """ Line 66: Expected 1 errors Line 67: Expected 1 errors Line 68: Expected 1 errors +Line 186: Expected 1 errors +Line 197: Expected 1 errors Line 102: Unexpected errors ['constructors_callable.py:102:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`'] Line 107: Unexpected errors ['constructors_callable.py:107:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`'] Line 143: Unexpected errors ["constructors_callable.py:143:27: error[invalid-argument-type] Argument to function `accepts_callable` is incorrect: Expected `() -> Any | Class6Any`, found ``"] Line 145: Unexpected errors ['constructors_callable.py:145:1: error[type-assertion-failure] Type `Any | Class6Any` does not match asserted type `Any`'] Line 166: Unexpected errors ['constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]`'] Line 167: Unexpected errors ['constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]`'] +Line 185: Unexpected errors ['constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]`'] """ output = """ constructors_callable.py:36:13: info[revealed-type] Revealed type: `(x: int) -> Class1` @@ -42,9 +45,6 @@ constructors_callable.py:164:5: info[revealed-type] Revealed type: `Overload[[T] constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]` constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]` constructors_callable.py:184:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class8[T]` -constructors_callable.py:186:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]` -constructors_callable.py:186:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]` +constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]` constructors_callable.py:195:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class9` -constructors_callable.py:197:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]` -constructors_callable.py:197:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]` """ diff --git a/conformance/results/ty/enums_member_names.toml b/conformance/results/ty/enums_member_names.toml index cdd4d0cd9..8b41fdfc0 100644 --- a/conformance/results/ty/enums_member_names.toml +++ b/conformance/results/ty/enums_member_names.toml @@ -2,4 +2,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ +enums_member_names.py:30:5: error[type-assertion-failure] Type `Any` does not match asserted type `Literal["RED", "BLUE", "GREEN"]` """ diff --git a/conformance/results/ty/enums_member_values.toml b/conformance/results/ty/enums_member_values.toml index 2686347f9..1af6cc6e4 100644 --- a/conformance/results/ty/enums_member_values.toml +++ b/conformance/results/ty/enums_member_values.toml @@ -2,6 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ +enums_member_values.py:30:5: error[type-assertion-failure] Type `Any` does not match asserted type `Literal[1, 2, 3]` enums_member_values.py:50:5: error[invalid-assignment] Enum member `MARS` is incompatible with `__init__` enums_member_values.py:51:5: error[invalid-assignment] Enum member `JUPITER` is incompatible with `__init__` enums_member_values.py:54:1: error[type-assertion-failure] Type `Any` does not match asserted type `Literal[1]` diff --git a/conformance/results/ty/enums_members.toml b/conformance/results/ty/enums_members.toml index ea7380da9..bcbc5875b 100644 --- a/conformance/results/ty/enums_members.toml +++ b/conformance/results/ty/enums_members.toml @@ -1,8 +1,8 @@ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 50: Expected 1 errors """ output = """ -enums_members.py:50:10: error[invalid-enum-member-annotation] Type annotation on enum member `DOG` is not allowed enums_members.py:82:20: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member enums_members.py:83:20: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member enums_members.py:84:18: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member diff --git a/conformance/results/ty/generics_defaults.toml b/conformance/results/ty/generics_defaults.toml index 8fae90d23..6d5df1780 100644 --- a/conformance/results/ty/generics_defaults.toml +++ b/conformance/results/ty/generics_defaults.toml @@ -10,7 +10,6 @@ Line 188: Expected 1 errors Line 122: Unexpected errors ['generics_defaults.py:122:5: error[type-assertion-failure] Type `(**DefaultP@Class_ParamSpec) -> None` does not match asserted type `(str, int, /) -> None`'] Line 139: Unexpected errors ['generics_defaults.py:139:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]`'] Line 140: Unexpected errors ['generics_defaults.py:140:5: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo`'] -Line 200: Unexpected errors ['generics_defaults.py:200:17: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...`'] Line 203: Unexpected errors ['generics_defaults.py:203:52: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`?'] Line 204: Unexpected errors ['generics_defaults.py:204:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]`'] Line 205: Unexpected errors ['generics_defaults.py:205:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(int | float, bool, /) -> None`'] @@ -26,7 +25,6 @@ generics_defaults.py:140:5: error[type-assertion-failure] Type `Class_TypeVarTup generics_defaults.py:152:51: error[invalid-type-variable-default] TypeVar default is not assignable to the TypeVar's upper bound generics_defaults.py:159:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: `int` is not one of the constraints of `Invalid2` generics_defaults.py:177:1: error[type-assertion-failure] Type `int` does not match asserted type `Any` -generics_defaults.py:200:17: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` generics_defaults.py:203:52: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`? generics_defaults.py:204:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]` generics_defaults.py:205:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(int | float, bool, /) -> None` diff --git a/conformance/results/ty/generics_paramspec_basic.toml b/conformance/results/ty/generics_paramspec_basic.toml index e9b05cfe9..02fc1f77f 100644 --- a/conformance/results/ty/generics_paramspec_basic.toml +++ b/conformance/results/ty/generics_paramspec_basic.toml @@ -6,14 +6,12 @@ Does not support `Concatenate`. """ errors_diff = """ Line 15: Expected 1 errors +Line 23: Expected 1 errors Line 27: Expected 1 errors +Line 31: Expected 1 errors +Line 35: Expected 1 errors +Line 39: Expected 1 errors """ output = """ generics_paramspec_basic.py:10:1: error[invalid-paramspec] The name of a `ParamSpec` (`NotIt`) must match the name of the variable it is assigned to (`WrongName`) -generics_paramspec_basic.py:23:14: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression -generics_paramspec_basic.py:23:20: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression -generics_paramspec_basic.py:31:19: error[invalid-type-arguments] ParamSpec `P` cannot be used to specialize type variable `_T` -generics_paramspec_basic.py:35:35: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression -generics_paramspec_basic.py:39:18: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression -generics_paramspec_basic.py:39:31: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression """ diff --git a/conformance/results/ty/generics_scoping.toml b/conformance/results/ty/generics_scoping.toml index c8989dcbb..c1083e01c 100644 --- a/conformance/results/ty/generics_scoping.toml +++ b/conformance/results/ty/generics_scoping.toml @@ -5,7 +5,12 @@ Does not reject `list[T]()` in the global scope, where `T` is an unbound type va Does nto reject `alias: TypeAlias = list[T]` in the body scope of a class generic over a type variable `T`. """ errors_diff = """ +Line 61: Expected 1 errors +Line 65: Expected 1 errors +Line 89: Expected 1 errors Line 98: Expected 1 errors +Line 105: Expected 1 errors +Line 106: Expected 1 errors Line 107: Expected 1 errors """ output = """ @@ -14,12 +19,7 @@ generics_scoping.py:19:1: error[type-assertion-failure] Type `Literal["a"]` does generics_scoping.py:34:10: error[invalid-argument-type] Argument to bound method `meth_2` is incorrect: Expected `int`, found `Literal["a"]` generics_scoping.py:49:1: error[type-assertion-failure] Type `Literal["abc"]` does not match asserted type `str` generics_scoping.py:53:1: error[type-assertion-failure] Type `Literal[b"abc"]` does not match asserted type `bytes` -generics_scoping.py:61:13: error[unbound-type-variable] Type variable `S` is not bound to any outer generic context -generics_scoping.py:65:19: error[unbound-type-variable] Type variable `S` is not bound to any outer generic context generics_scoping.py:76:11: error[shadowed-type-variable] Generic class `MyGeneric` uses type variable `T` already bound by an enclosing scope generics_scoping.py:76:11: error[shadowed-type-variable] Generic class `MyGeneric` uses type variable `T` already bound by an enclosing scope generics_scoping.py:86:11: error[shadowed-type-variable] Generic class `Bad` uses type variable `T` already bound by an enclosing scope -generics_scoping.py:89:17: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context -generics_scoping.py:105:14: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context -generics_scoping.py:106:19: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context """ diff --git a/conformance/results/ty/qualifiers_annotated.toml b/conformance/results/ty/qualifiers_annotated.toml index da1de796e..7877ed0c7 100644 --- a/conformance/results/ty/qualifiers_annotated.toml +++ b/conformance/results/ty/qualifiers_annotated.toml @@ -8,7 +8,7 @@ qualifiers_annotated.py:39:18: error[invalid-type-form] Tuple literals are not a qualifiers_annotated.py:40:17: error[invalid-type-form] List comprehensions are not allowed in type expressions qualifiers_annotated.py:41:17: error[invalid-type-form] Dict literals are not allowed in type expressions qualifiers_annotated.py:42:17: error[invalid-type-form] Function calls are not allowed in type expressions -qualifiers_annotated.py:43:17: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression +qualifiers_annotated.py:43:17: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression qualifiers_annotated.py:43:23: error[invalid-type-form] Int literals are not allowed in this context in a type expression qualifiers_annotated.py:44:17: error[invalid-type-form] `if` expressions are not allowed in type expressions qualifiers_annotated.py:45:17: error[unresolved-reference] Name `var1` used when not defined diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 1186fdef6..207d5855e 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.21" +version = "ty 0.0.20" From 8ce5fa94375f2e8ee18ecb19e80539c63622991f Mon Sep 17 00:00:00 2001 From: Carl Meyer Date: Fri, 6 Mar 2026 17:10:17 -0800 Subject: [PATCH 11/11] update results with correct ty version --- conformance/results/results.html | 4 ++-- conformance/results/ty/aliases_implicit.toml | 6 +++--- conformance/results/ty/aliases_type_statement.toml | 6 +++--- conformance/results/ty/aliases_typealiastype.toml | 2 +- conformance/results/ty/annotations_forward_refs.toml | 2 +- conformance/results/ty/annotations_typeexpr.toml | 2 +- conformance/results/ty/constructors_callable.toml | 8 ++++---- conformance/results/ty/enums_member_names.toml | 1 - conformance/results/ty/enums_member_values.toml | 1 - conformance/results/ty/enums_members.toml | 4 ++-- conformance/results/ty/generics_defaults.toml | 2 ++ conformance/results/ty/generics_paramspec_basic.toml | 10 ++++++---- conformance/results/ty/generics_scoping.toml | 10 +++++----- conformance/results/ty/qualifiers_annotated.toml | 2 +- conformance/results/ty/version.toml | 2 +- 15 files changed, 32 insertions(+), 30 deletions(-) diff --git a/conformance/results/results.html b/conformance/results/results.html index cbc9f7f6d..f6f30a4f8 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -180,7 +180,7 @@

Python Type System Conformance Test Results

pyrefly 0.54.0
-
ty 0.0.20
+
ty 0.0.21
@@ -1114,7 +1114,7 @@

Python Type System Conformance Test Results

Pass*

Does not support `_ignore_` mechanism (optional).

Pass Pass -Unknown +Pass Type narrowing diff --git a/conformance/results/ty/aliases_implicit.toml b/conformance/results/ty/aliases_implicit.toml index 9419afb9e..bda018615 100644 --- a/conformance/results/ty/aliases_implicit.toml +++ b/conformance/results/ty/aliases_implicit.toml @@ -20,10 +20,10 @@ aliases_implicit.py:78:29: error[invalid-type-arguments] Too many type arguments aliases_implicit.py:79:29: error[invalid-type-arguments] Too many type arguments: expected 1, got 2 aliases_implicit.py:80:24: error[invalid-type-arguments] Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` aliases_implicit.py:81:25: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int | float` of type variable `TFloat@GoodTypeAlias12` -aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[Unknown | | ]` is not allowed in a type expression +aliases_implicit.py:107:9: error[invalid-type-form] Variable of type `list[ | ]` is not allowed in a type expression aliases_implicit.py:108:9: error[invalid-type-form] Variable of type `tuple[tuple[, ]]` is not allowed in a type expression -aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[Unknown | ]` is not allowed in a type expression -aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[Unknown | str, Unknown | str]` is not allowed in a type expression +aliases_implicit.py:109:9: error[invalid-type-form] Variable of type `list[]` is not allowed in a type expression +aliases_implicit.py:110:9: error[invalid-type-form] Variable of type `dict[str, str]` is not allowed in a type expression aliases_implicit.py:114:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression aliases_implicit.py:115:10: error[invalid-type-form] Variable of type `Literal[True]` is not allowed in a type expression aliases_implicit.py:116:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression diff --git a/conformance/results/ty/aliases_type_statement.toml b/conformance/results/ty/aliases_type_statement.toml index 2d35e581a..420c17ee9 100644 --- a/conformance/results/ty/aliases_type_statement.toml +++ b/conformance/results/ty/aliases_type_statement.toml @@ -8,8 +8,6 @@ Does not support `type` statements generic over `TypeVarTuple`s. """ errors_diff = """ Line 56: Expected 1 errors -Line 62: Expected 1 errors -Line 67: Expected 1 errors Line 84: Expected 1 errors Lines 51, 52: Expected error (tag 'TA14') Line 10: Unexpected errors ['aliases_type_statement.py:10:52: error[invalid-type-arguments] Too many type arguments: expected 2, got 3', 'aliases_type_statement.py:10:52: error[invalid-type-form] `...` is not allowed in this context in a type expression'] @@ -29,7 +27,7 @@ aliases_type_statement.py:39:23: error[invalid-type-form] Tuple literals are not aliases_type_statement.py:40:22: error[invalid-type-form] List comprehensions are not allowed in type expressions aliases_type_statement.py:41:22: error[invalid-type-form] Dict literals are not allowed in type expressions aliases_type_statement.py:42:22: error[invalid-type-form] Function calls are not allowed in type expressions -aliases_type_statement.py:43:22: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +aliases_type_statement.py:43:22: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression aliases_type_statement.py:43:28: error[invalid-type-form] Int literals are not allowed in this context in a type expression aliases_type_statement.py:44:22: error[invalid-type-form] `if` expressions are not allowed in type expressions aliases_type_statement.py:45:22: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression @@ -37,6 +35,8 @@ aliases_type_statement.py:46:23: error[invalid-type-form] Boolean literals are n aliases_type_statement.py:47:23: error[invalid-type-form] Int literals are not allowed in this context in a type expression aliases_type_statement.py:48:23: error[invalid-type-form] Boolean operations are not allowed in type expressions aliases_type_statement.py:49:23: error[fstring-type-annotation] Type expressions cannot use f-strings +aliases_type_statement.py:62:23: error[unbound-type-variable] Type variable `V` is not bound to any outer generic context +aliases_type_statement.py:67:17: error[unbound-type-variable] Type variable `T1` is not bound to any outer generic context aliases_type_statement.py:77:27: error[invalid-type-arguments] Type `str` is not assignable to upper bound `int` of type variable `S@RecursiveTypeAlias2` aliases_type_statement.py:79:32: error[invalid-type-arguments] Type `int` is not assignable to upper bound `str` of type variable `T@RecursiveTypeAlias2` aliases_type_statement.py:82:1: error[cyclic-type-alias-definition] Cyclic definition of `RecursiveTypeAlias3` diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml index 9e5470da3..0d4317cca 100644 --- a/conformance/results/ty/aliases_typealiastype.toml +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -24,7 +24,7 @@ aliases_typealiastype.py:54:43: error[invalid-type-form] Tuple literals are not aliases_typealiastype.py:55:42: error[invalid-type-form] List comprehensions are not allowed in type expressions aliases_typealiastype.py:56:42: error[invalid-type-form] Dict literals are not allowed in type expressions aliases_typealiastype.py:57:42: error[invalid-type-form] Function calls are not allowed in type expressions -aliases_typealiastype.py:58:42: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +aliases_typealiastype.py:58:42: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression aliases_typealiastype.py:58:48: error[invalid-type-form] Int literals are not allowed in this context in a type expression aliases_typealiastype.py:59:42: error[invalid-type-form] `if` expressions are not allowed in type expressions aliases_typealiastype.py:60:42: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression diff --git a/conformance/results/ty/annotations_forward_refs.toml b/conformance/results/ty/annotations_forward_refs.toml index 721ab9477..15ee0435c 100644 --- a/conformance/results/ty/annotations_forward_refs.toml +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -21,7 +21,7 @@ annotations_forward_refs.py:43:10: error[invalid-type-form] Tuple literals are n annotations_forward_refs.py:44:10: error[invalid-type-form] List comprehensions are not allowed in type expressions annotations_forward_refs.py:45:10: error[invalid-type-form] Dict literals are not allowed in type expressions annotations_forward_refs.py:46:10: error[invalid-type-form] Function calls are not allowed in type expressions -annotations_forward_refs.py:47:10: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +annotations_forward_refs.py:47:10: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression annotations_forward_refs.py:47:16: error[invalid-type-form] Int literals are not allowed in this context in a type expression annotations_forward_refs.py:48:10: error[invalid-type-form] `if` expressions are not allowed in type expressions annotations_forward_refs.py:49:10: error[invalid-type-form] Variable of type `Literal[1]` is not allowed in a type expression diff --git a/conformance/results/ty/annotations_typeexpr.toml b/conformance/results/ty/annotations_typeexpr.toml index d000bd099..4bc31c01b 100644 --- a/conformance/results/ty/annotations_typeexpr.toml +++ b/conformance/results/ty/annotations_typeexpr.toml @@ -8,7 +8,7 @@ annotations_typeexpr.py:90:9: error[invalid-type-form] Tuple literals are not al annotations_typeexpr.py:91:9: error[invalid-type-form] List comprehensions are not allowed in type expressions annotations_typeexpr.py:92:9: error[invalid-type-form] Dict literals are not allowed in type expressions annotations_typeexpr.py:93:9: error[invalid-type-form] Function calls are not allowed in type expressions -annotations_typeexpr.py:94:9: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +annotations_typeexpr.py:94:9: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression annotations_typeexpr.py:94:15: error[invalid-type-form] Int literals are not allowed in this context in a type expression annotations_typeexpr.py:95:9: error[invalid-type-form] `if` expressions are not allowed in type expressions annotations_typeexpr.py:96:9: error[invalid-type-form] Variable of type `Literal[3]` is not allowed in a type expression diff --git a/conformance/results/ty/constructors_callable.toml b/conformance/results/ty/constructors_callable.toml index a6f26a40c..a0e0c6c35 100644 --- a/conformance/results/ty/constructors_callable.toml +++ b/conformance/results/ty/constructors_callable.toml @@ -10,15 +10,12 @@ errors_diff = """ Line 66: Expected 1 errors Line 67: Expected 1 errors Line 68: Expected 1 errors -Line 186: Expected 1 errors -Line 197: Expected 1 errors Line 102: Unexpected errors ['constructors_callable.py:102:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`'] Line 107: Unexpected errors ['constructors_callable.py:107:5: error[type-assertion-failure] Type `Unknown` does not match asserted type `Never`'] Line 143: Unexpected errors ["constructors_callable.py:143:27: error[invalid-argument-type] Argument to function `accepts_callable` is incorrect: Expected `() -> Any | Class6Any`, found ``"] Line 145: Unexpected errors ['constructors_callable.py:145:1: error[type-assertion-failure] Type `Any | Class6Any` does not match asserted type `Any`'] Line 166: Unexpected errors ['constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]`'] Line 167: Unexpected errors ['constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]`'] -Line 185: Unexpected errors ['constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]`'] """ output = """ constructors_callable.py:36:13: info[revealed-type] Revealed type: `(x: int) -> Class1` @@ -45,6 +42,9 @@ constructors_callable.py:164:5: info[revealed-type] Revealed type: `Overload[[T] constructors_callable.py:166:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[int]` constructors_callable.py:167:1: error[type-assertion-failure] Type `Class7[int] | Class7[str]` does not match asserted type `Class7[str]` constructors_callable.py:184:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class8[T]` -constructors_callable.py:185:1: error[type-assertion-failure] Type `Class8[Unknown | str]` does not match asserted type `Class8[str]` +constructors_callable.py:186:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]` +constructors_callable.py:186:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]` constructors_callable.py:195:13: info[revealed-type] Revealed type: `[T](x: list[T], y: list[T]) -> Class9` +constructors_callable.py:197:4: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[int]` +constructors_callable.py:197:9: error[invalid-argument-type] Argument is incorrect: Expected `list[int | str]`, found `list[str]` """ diff --git a/conformance/results/ty/enums_member_names.toml b/conformance/results/ty/enums_member_names.toml index 8b41fdfc0..cdd4d0cd9 100644 --- a/conformance/results/ty/enums_member_names.toml +++ b/conformance/results/ty/enums_member_names.toml @@ -2,5 +2,4 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_member_names.py:30:5: error[type-assertion-failure] Type `Any` does not match asserted type `Literal["RED", "BLUE", "GREEN"]` """ diff --git a/conformance/results/ty/enums_member_values.toml b/conformance/results/ty/enums_member_values.toml index 1af6cc6e4..2686347f9 100644 --- a/conformance/results/ty/enums_member_values.toml +++ b/conformance/results/ty/enums_member_values.toml @@ -2,7 +2,6 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -enums_member_values.py:30:5: error[type-assertion-failure] Type `Any` does not match asserted type `Literal[1, 2, 3]` enums_member_values.py:50:5: error[invalid-assignment] Enum member `MARS` is incompatible with `__init__` enums_member_values.py:51:5: error[invalid-assignment] Enum member `JUPITER` is incompatible with `__init__` enums_member_values.py:54:1: error[type-assertion-failure] Type `Any` does not match asserted type `Literal[1]` diff --git a/conformance/results/ty/enums_members.toml b/conformance/results/ty/enums_members.toml index bcbc5875b..ea7380da9 100644 --- a/conformance/results/ty/enums_members.toml +++ b/conformance/results/ty/enums_members.toml @@ -1,8 +1,8 @@ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 50: Expected 1 errors """ output = """ +enums_members.py:50:10: error[invalid-enum-member-annotation] Type annotation on enum member `DOG` is not allowed enums_members.py:82:20: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member enums_members.py:83:20: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member enums_members.py:84:18: error[invalid-type-form] Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member diff --git a/conformance/results/ty/generics_defaults.toml b/conformance/results/ty/generics_defaults.toml index 6d5df1780..8fae90d23 100644 --- a/conformance/results/ty/generics_defaults.toml +++ b/conformance/results/ty/generics_defaults.toml @@ -10,6 +10,7 @@ Line 188: Expected 1 errors Line 122: Unexpected errors ['generics_defaults.py:122:5: error[type-assertion-failure] Type `(**DefaultP@Class_ParamSpec) -> None` does not match asserted type `(str, int, /) -> None`'] Line 139: Unexpected errors ['generics_defaults.py:139:5: error[type-assertion-failure] Type `tuple[@Todo(TypeVarTuple), ...]` does not match asserted type `tuple[str, int]`'] Line 140: Unexpected errors ['generics_defaults.py:140:5: error[type-assertion-failure] Type `Class_TypeVarTuple` does not match asserted type `@Todo`'] +Line 200: Unexpected errors ['generics_defaults.py:200:17: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...`'] Line 203: Unexpected errors ['generics_defaults.py:203:52: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`?'] Line 204: Unexpected errors ['generics_defaults.py:204:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]`'] Line 205: Unexpected errors ['generics_defaults.py:205:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(int | float, bool, /) -> None`'] @@ -25,6 +26,7 @@ generics_defaults.py:140:5: error[type-assertion-failure] Type `Class_TypeVarTup generics_defaults.py:152:51: error[invalid-type-variable-default] TypeVar default is not assignable to the TypeVar's upper bound generics_defaults.py:159:52: error[invalid-type-variable-default] TypeVar default is inconsistent with the TypeVar's constraints: `int` is not one of the constraints of `Invalid2` generics_defaults.py:177:1: error[type-assertion-failure] Type `int` does not match asserted type `Any` +generics_defaults.py:200:17: error[invalid-type-form] The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` generics_defaults.py:203:52: error[invalid-type-form] List literals are not allowed in this context in a type expression: Did you mean `list[bytes]`? generics_defaults.py:204:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `tuple[int, str]` generics_defaults.py:205:5: error[type-assertion-failure] Type `@Todo` does not match asserted type `(int | float, bool, /) -> None` diff --git a/conformance/results/ty/generics_paramspec_basic.toml b/conformance/results/ty/generics_paramspec_basic.toml index 02fc1f77f..e9b05cfe9 100644 --- a/conformance/results/ty/generics_paramspec_basic.toml +++ b/conformance/results/ty/generics_paramspec_basic.toml @@ -6,12 +6,14 @@ Does not support `Concatenate`. """ errors_diff = """ Line 15: Expected 1 errors -Line 23: Expected 1 errors Line 27: Expected 1 errors -Line 31: Expected 1 errors -Line 35: Expected 1 errors -Line 39: Expected 1 errors """ output = """ generics_paramspec_basic.py:10:1: error[invalid-paramspec] The name of a `ParamSpec` (`NotIt`) must match the name of the variable it is assigned to (`WrongName`) +generics_paramspec_basic.py:23:14: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression +generics_paramspec_basic.py:23:20: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression +generics_paramspec_basic.py:31:19: error[invalid-type-arguments] ParamSpec `P` cannot be used to specialize type variable `_T` +generics_paramspec_basic.py:35:35: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression +generics_paramspec_basic.py:39:18: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression +generics_paramspec_basic.py:39:31: error[invalid-type-form] Bare ParamSpec `P` is not valid in this context in a type expression """ diff --git a/conformance/results/ty/generics_scoping.toml b/conformance/results/ty/generics_scoping.toml index c1083e01c..c8989dcbb 100644 --- a/conformance/results/ty/generics_scoping.toml +++ b/conformance/results/ty/generics_scoping.toml @@ -5,12 +5,7 @@ Does not reject `list[T]()` in the global scope, where `T` is an unbound type va Does nto reject `alias: TypeAlias = list[T]` in the body scope of a class generic over a type variable `T`. """ errors_diff = """ -Line 61: Expected 1 errors -Line 65: Expected 1 errors -Line 89: Expected 1 errors Line 98: Expected 1 errors -Line 105: Expected 1 errors -Line 106: Expected 1 errors Line 107: Expected 1 errors """ output = """ @@ -19,7 +14,12 @@ generics_scoping.py:19:1: error[type-assertion-failure] Type `Literal["a"]` does generics_scoping.py:34:10: error[invalid-argument-type] Argument to bound method `meth_2` is incorrect: Expected `int`, found `Literal["a"]` generics_scoping.py:49:1: error[type-assertion-failure] Type `Literal["abc"]` does not match asserted type `str` generics_scoping.py:53:1: error[type-assertion-failure] Type `Literal[b"abc"]` does not match asserted type `bytes` +generics_scoping.py:61:13: error[unbound-type-variable] Type variable `S` is not bound to any outer generic context +generics_scoping.py:65:19: error[unbound-type-variable] Type variable `S` is not bound to any outer generic context generics_scoping.py:76:11: error[shadowed-type-variable] Generic class `MyGeneric` uses type variable `T` already bound by an enclosing scope generics_scoping.py:76:11: error[shadowed-type-variable] Generic class `MyGeneric` uses type variable `T` already bound by an enclosing scope generics_scoping.py:86:11: error[shadowed-type-variable] Generic class `Bad` uses type variable `T` already bound by an enclosing scope +generics_scoping.py:89:17: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context +generics_scoping.py:105:14: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context +generics_scoping.py:106:19: error[unbound-type-variable] Type variable `T` is not bound to any outer generic context """ diff --git a/conformance/results/ty/qualifiers_annotated.toml b/conformance/results/ty/qualifiers_annotated.toml index 7877ed0c7..da1de796e 100644 --- a/conformance/results/ty/qualifiers_annotated.toml +++ b/conformance/results/ty/qualifiers_annotated.toml @@ -8,7 +8,7 @@ qualifiers_annotated.py:39:18: error[invalid-type-form] Tuple literals are not a qualifiers_annotated.py:40:17: error[invalid-type-form] List comprehensions are not allowed in type expressions qualifiers_annotated.py:41:17: error[invalid-type-form] Dict literals are not allowed in type expressions qualifiers_annotated.py:42:17: error[invalid-type-form] Function calls are not allowed in type expressions -qualifiers_annotated.py:43:17: error[invalid-type-form] Invalid subscript of object of type `list[Unknown | ]` in type expression +qualifiers_annotated.py:43:17: error[invalid-type-form] Invalid subscript of object of type `list[]` in type expression qualifiers_annotated.py:43:23: error[invalid-type-form] Int literals are not allowed in this context in a type expression qualifiers_annotated.py:44:17: error[invalid-type-form] `if` expressions are not allowed in type expressions qualifiers_annotated.py:45:17: error[unresolved-reference] Name `var1` used when not defined diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml index 207d5855e..1186fdef6 100644 --- a/conformance/results/ty/version.toml +++ b/conformance/results/ty/version.toml @@ -1 +1 @@ -version = "ty 0.0.20" +version = "ty 0.0.21"