diff --git a/conformance/README.md b/conformance/README.md index e0302c80..d43fcfef 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 eac56a05..705af6b0 100644 --- a/conformance/requirements.txt +++ b/conformance/requirements.txt @@ -5,3 +5,4 @@ mypy pip zuban pyrefly +ty diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index e0afe12c..6356188e 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1 +1 @@ -version = "mypy 1.19.0" +version = "mypy 1.19.1" diff --git a/conformance/results/pyrefly/protocols_explicit.toml b/conformance/results/pyrefly/protocols_explicit.toml index 3986491f..e415ed26 100644 --- a/conformance/results/pyrefly/protocols_explicit.toml +++ b/conformance/results/pyrefly/protocols_explicit.toml @@ -3,14 +3,14 @@ notes = """ Does not reject call to super method with no default implementation. Does not detect stub methods inherited from protocols as abstract. """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 89: Expected 1 errors """ output = """ ERROR protocols_explicit.py:27:16-28: Method `draw` inherited from class `PColor` has no implementation and cannot be accessed via `super()` [missing-attribute] ERROR protocols_explicit.py:56:20-36: `tuple[int, int, str]` is not assignable to attribute `rgb` with type `tuple[int, int, int]` [bad-assignment] ERROR protocols_explicit.py:60:10-20: Cannot instantiate `Point` because the following members are abstract: `intensity`, `transparency` [bad-instantiation] +ERROR protocols_explicit.py:89:15-17: Cannot instantiate `Concrete1` because the following members are abstract: `cm1` [bad-instantiation] ERROR protocols_explicit.py:134:15-17: Cannot instantiate `Concrete5` because the following members are abstract: `method1` [bad-instantiation] ERROR protocols_explicit.py:164:17-19: Cannot instantiate `Concrete7A` because the following members are abstract: `method1` [bad-instantiation] """ diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index 4dfd1faa..c10f8526 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.45.2" +version = "pyrefly 0.46.0" diff --git a/conformance/results/results.html b/conformance/results/results.html index ec5fb551..d909f913 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -158,16 +158,18 @@

Python Type System Conformance Test Results

- - + - @@ -175,32 +177,37 @@

Python Type System Conformance Test Results

+ + + + + - @@ -208,32 +215,37 @@

Python Type System Conformance Test Results

+ + + + + - @@ -241,182 +253,212 @@

Python Type System Conformance Test Results

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - @@ -424,20 +466,23 @@

Python Type System Conformance Test Results

+ + + - @@ -445,14 +490,16 @@

Python Type System Conformance Test Results

+ + - @@ -460,44 +507,51 @@

Python Type System Conformance Test Results

+ + + + + + + - @@ -505,26 +559,30 @@

Python Type System Conformance Test Results

+ + + + - @@ -532,68 +590,79 @@

Python Type System Conformance Test Results

+ + + + + + + + + + + - @@ -601,26 +670,30 @@

Python Type System Conformance Test Results

+ + + + - @@ -628,38 +701,44 @@

Python Type System Conformance Test Results

+ + + + + + - @@ -667,32 +746,37 @@

Python Type System Conformance Test Results

+ + + + + - @@ -700,8 +784,9 @@

Python Type System Conformance Test Results

+ - @@ -709,98 +794,114 @@

Python Type System Conformance Test Results

+ + + + + + + + + + + + + + + + - @@ -808,86 +909,100 @@

Python Type System Conformance Test Results

+ + + + + + + + + + + + + + - @@ -895,20 +1010,23 @@

Python Type System Conformance Test Results

+ + + - @@ -916,26 +1034,30 @@

Python Type System Conformance Test Results

+ + + + - @@ -943,38 +1065,44 @@

Python Type System Conformance Test Results

+ + + + + + - @@ -982,14 +1110,16 @@

Python Type System Conformance Test Results

+ + - @@ -997,62 +1127,72 @@

Python Type System Conformance Test Results

+ + + + + + + + + + - @@ -1060,6 +1200,7 @@

Python Type System Conformance Test Results

+
 
mypy 1.19.0
+
mypy 1.19.1
pyright 1.1.407
zuban 0.3.0
pyrefly 0.45.2
+
pyrefly 0.46.0
+
ty 0.0.2 (42835578d 2025-12-16)
+
Type annotations
     annotations_coroutines Pass Pass PassPass
     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

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

Incorrectly generates error for quoted type defined in class scope.

Does not ignore newlines in multi-line unions

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 PassPass
     annotations_typeexpr Pass Pass Pass PassPass
+
Special types in annotations
     specialtypes_any Pass Pass PassUnknown
     specialtypes_never Pass Pass Pass
Partial

Does not detect invalid return is unreachable

Unknown
     specialtypes_none Pass Pass Pass PassUnknown
     specialtypes_promotions Pass Pass Pass PassPass
     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
Partial

Does not implement all typing rules for type/type[]

Unknown
+
Generics
     generics_base_class Pass
Partial

Does not detect inconsistent type variable ordering in multi-inheritance.

Partial

Does not reject inconsistent ordering of type variables in different base classes.

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
Partial

Does not reject TypeVars with defaults after a TypeVarTuple

Type parameter defaults are not bound by attribute access

ParamSpec after TypeVarTuple is not always handled correctly

Partial

Defaults are not bound by attribute access

Unknown
     generics_defaults_referential Partial Pass Pass UnsupportedUnknown
     generics_defaults_specialization Partial Pass Pass PassUnknown
     generics_paramspec_basic Pass Pass Pass PassUnknown
     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 PassUnknown
     generics_paramspec_specialization Pass Pass Pass PassPass
     generics_scoping Pass Pass
Partial

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

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

Unknown
     generics_self_attributes Pass Pass Pass PassUnknown
     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 PassPass
     generics_self_usage Pass Pass
Partial

Does not detect invalid Self when Self is not properly bound

Partial

Does not implement some restrictions on where Self can be used

Unknown
     generics_syntax_compatibility Pass Pass Pass PassUnknown
     generics_syntax_declarations Pass Pass Pass PassUnknown
     generics_syntax_infer_variance
Unsupported

Type parameter syntax not yet support.

Pass
Partial

Final is handled a bit different (questionable if this is an issue)

PassUnknown
     generics_syntax_scoping
Partial

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

Pass
Partial

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

PassUnknown
     generics_type_erasure
Partial

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

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

Pass
Partial

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

PassUnknown
     generics_typevartuple_args
Partial

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

Pass
Partial

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

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

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

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

Partial

TypeVarTuple is pinned too early when calling generic function

Unknown
     generics_typevartuple_callable Pass Pass Pass PassUnknown
     generics_typevartuple_concat Pass Pass Pass PassUnknown
     generics_typevartuple_overloads Pass Pass Pass PassPass
     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 PassUnknown
     generics_upper_bound
Partial

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

Pass
Partial

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

PassUnknown
     generics_variance
Partial

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

Pass
Partial

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

UnsupportedUnknown
     generics_variance_inference Pass Pass Pass PassPass
+
Type qualifiers
     qualifiers_annotated 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
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.

Partial

Final attributes not initialized on the class can be assigned to

Unknown
     qualifiers_final_decorator Pass Pass Pass PassUnknown
+
Class type compatibility
     classes_classvar Pass Pass PassUnknown
     classes_override Pass Pass Pass PassPass
+
Type aliases
     aliases_explicit Pass Pass PassUnknown
     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 PassUnknown
     aliases_recursive Pass Pass Pass UnsupportedUnknown
     aliases_type_statement
Partial

Does not reject type alias defined in function scope.

Pass Pass
Partial

Does not reject redeclaration of type alias with the same name.

Does not detect circular definitions.

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
Partial

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

Incorrectly allows type_params= to be an arbitrary tuple.

Partial

Does not detect circular definitions.

Unknown
     aliases_variance Pass Pass Pass UnsupportedUnknown
+
Literals
     literals_interactions Pass
Partial

Does not narrow type of `x` with `x in Literal` type guard pattern.

Partial

Two instances parameterized with different literals are not compatible

Unknown
     literals_literalstring
Unsupported

Support for `LiteralString` is not implemented.

Pass Pass PassUnknown
     literals_parameterizations
Partial

Does not reject tuple within Literal.

Pass Pass PassPass
     literals_semantics Pass Pass Pass PassPass
+
Protocols
     protocols_class_objects Pass Pass
Partial

Does not require concrete classes to be passed to type[Proto]

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

Partial

Incorrectly handles some ClassVar examples in Protocol subtyping

Unknown
     protocols_explicit
Pass*

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

Pass Pass
Partial

Does not reject call to super method with no default implementation.

Does not detect stub methods inherited from protocols as abstract.

Unknown
     protocols_generic Pass Pass Pass PassUnknown
     protocols_merging Pass Pass Pass PassUnknown
     protocols_modules Pass Pass Pass
Partial

Fails one subtyping example of protocol modules

Unknown
     protocols_recursive Pass Pass Pass PassUnknown
     protocols_runtime_checkable
Partial

Does not report unsafe overlap for runtime_checkable protocol.

Pass
Partial

Does not report unsafe overlap for runtime_checkable protocol.

PassUnknown
     protocols_self Pass Pass Pass PassPass
     protocols_subtyping Pass Pass Pass PassPass
     protocols_variance Pass Pass Pass UnsupportedUnknown
+
Callables
     callables_annotation Pass
Partial

Incorrectly treats "*args: T, **kwargs: T" as "..." when T is specialized to Any.

Does not treat "*args: Any, **kargs: Any" as "..." when separated by keyword parameter.

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 PassUnknown
     callables_protocol Pass Pass Pass PassPass
     callables_subtyping Pass Pass Pass PassUnknown
+
Constructors
     constructors_call_init Pass
Partial

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

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

Partial

Does not reject class-scoped type var in self param annotation

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 PassUnknown
     constructors_call_new
Partial

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

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

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

Pass
Partial

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

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

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

PassUnknown
     constructors_call_type
Partial

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

Pass
Partial

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

Partial

Does not check TypeVar type constructor using upper bound's __new__

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

Struggles with some cases of self types

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 PassPass
+
Overloads
     overloads_basic Pass Pass PassPass
     overloads_consistency Pass Pass Pass PassUnknown
     overloads_definitions
Partial

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

Pass Pass PassUnknown
     overloads_definitions_stub
Partial

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

Pass Pass PassUnknown
     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.

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.

PassUnknown
+
Exceptions
     exceptions_context_managers Pass Pass
Partial

Some error suppressing context managers are not detected

Unknown
+
Dataclasses
     dataclasses_descriptors Pass Pass PassUnknown
     dataclasses_final
Partial

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

Doesn't support Final nested inside ClassVar.

Pass
Partial

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

Doesn't support Final nested inside ClassVar.

PassPass
     dataclasses_frozen Pass Pass Pass PassPass
     dataclasses_hash
Partial

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

Pass
Partial

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

PassUnknown
     dataclasses_inheritance Pass Pass Pass PassUnknown
     dataclasses_kwonly Pass Pass Pass PassPass
     dataclasses_match_args Pass Pass Pass PassUnknown
     dataclasses_order Pass Pass Pass PassPass
     dataclasses_postinit Pass Pass Pass PassUnknown
     dataclasses_slots
Partial

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

Pass
Partial

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

Partial

__slots__ is generated but not checked during attribute assignment

Unknown
     dataclasses_transform_class Pass Pass Pass PassUnknown
     dataclasses_transform_converter
Unsupported

Converter parameter not yet supported.

Pass
Partial

Converters are fully supported, failed to match generic overloads against other generics

PassUnknown
     dataclasses_transform_field
Partial

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

Pass Pass PassPass
     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 PassPass
     dataclasses_transform_meta Pass Pass Pass PassUnknown
     dataclasses_usage
Pass*

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

Pass Pass PassUnknown
+
Typed dictionaries
     typeddicts_alt_syntax Pass
Pass*

Does not support keyword-argument form of alternative syntax (deprecated in 3.11).

PassUnknown
     typeddicts_class_syntax Pass Pass Pass PassUnknown
     typeddicts_extra_items
Unsupported

Not supported.

Pass Pass PassUnknown
     typeddicts_final Pass Pass Pass PassPass
     typeddicts_inheritance Pass Pass Pass PassUnknown
     typeddicts_operations Pass Pass Pass PassUnknown
     typeddicts_readonly Pass Pass Pass PassUnknown
     typeddicts_readonly_consistency Pass Pass Pass PassPass
     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
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.

PassUnknown
     typeddicts_readonly_kwargs Pass Pass Pass PassUnknown
     typeddicts_readonly_update
Partial

Incorrectly allows update of ReadOnly item.

Incorrectly rejects update involving an item with Never type.

Pass
Partial

Incorrectly allows update of ReadOnly item.

PassUnknown
     typeddicts_required Pass Pass Pass PassUnknown
     typeddicts_type_consistency Pass Pass Pass PassPass
     typeddicts_usage Pass Pass Pass PassUnknown
+
Tuples
     tuples_type_compat Pass Pass PassPass
     tuples_type_form Pass Pass Pass PassUnknown
     tuples_unpacked
Partial

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

Pass Pass PassUnknown
+
Named tuples
     namedtuples_define_class Pass
Partial

Does not reject override of named tuple attribute in child class.

PassUnknown
     namedtuples_define_functional Pass Pass Pass PassUnknown
     namedtuples_type_compat Pass Pass Pass PassPass
     namedtuples_usage
Partial

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

Pass Pass PassUnknown
+
Enumerations
     enums_behaviors Pass Pass PassPass
     enums_definition Pass Pass Pass PassPass
     enums_expansion
Partial

Improperly applies narrowing to Flag subclass.

Pass
Partial

Improperly applies narrowing to Flag subclass.

PassUnknown
     enums_member_names
Pass*

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

Pass Pass PassPass
     enums_member_values
Partial

Does not enforce declared type of `_value_`.

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

Pass
Partial

Does not enforce declared type of `_value_`.

PassUnknown
     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).

Partial

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

Does not properly handle aliased enum members.

Does not treat somecallables as non-members.

Partial

Enum members that are aliases of other members do not resolved to the aliased member's type

Unknown
+
Type narrowing
     narrowing_typeguard Pass Pass PassUnknown
     narrowing_typeis Pass Pass Pass PassUnknown
+
Type checker directives
     directives_assert_type Pass Pass PassPass
     directives_cast Pass Pass Pass PassPass
     directives_deprecated Pass Pass Pass PassUnknown
     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 PassPass
     directives_reveal_type Pass Pass Pass PassPass
     directives_type_checking Pass Pass Pass PassUnknown
     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.

PassPass
     directives_type_ignore_file1 Pass Pass Pass PassPass
     directives_type_ignore_file2 Pass Pass Pass PassPass
     directives_version_platform
Pass*

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

Does not understand os.name checks.

Pass Pass PassUnknown
+
Historical and deprecated features
     historical_positional Pass
Partial

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

Treats keyword-only parameter as positional-only.

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

PassUnknown
diff --git a/conformance/results/ty/aliases_explicit.toml b/conformance/results/ty/aliases_explicit.toml new file mode 100644 index 00000000..6570bf94 --- /dev/null +++ b/conformance/results/ty/aliases_explicit.toml @@ -0,0 +1,28 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 79: Expected 1 errors +Line 80: Expected 1 errors +Line 81: Expected 1 errors +Line 82: Expected 1 errors +Line 83: Expected 1 errors +Line 84: Expected 1 errors +Line 85: Expected 1 errors +Line 86: Expected 1 errors +Line 87: Expected 1 errors +Line 88: Expected 1 errors +Line 89: Expected 1 errors +Line 90: Expected 1 errors +Line 91: Expected 1 errors +Line 100: Expected 1 errors +Line 57: Unexpected errors ['aliases_explicit.py:57:5 - major: type-assertion-failure: Argument does not have asserted type `(int, str, str, /) -> None` (type-assertion-failure)'] +""" +output = """ +aliases_explicit.py:57:5 - major: type-assertion-failure: Argument does not have asserted type `(int, str, str, /) -> None` (type-assertion-failure) +aliases_explicit.py:67:9 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +aliases_explicit.py:68:9 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +aliases_explicit.py:69:29 - major: invalid-type-arguments: Too many type arguments: expected 1, got 2 (invalid-type-arguments) +aliases_explicit.py:70:29 - major: invalid-type-arguments: Too many type arguments: expected 1, got 2 (invalid-type-arguments) +aliases_explicit.py:71:24 - major: invalid-type-arguments: Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` (invalid-type-arguments) +aliases_explicit.py:101:6 - major: call-non-callable: Object of type `UnionType` is not callable (call-non-callable) +aliases_explicit.py:102:5 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +""" diff --git a/conformance/results/ty/aliases_implicit.toml b/conformance/results/ty/aliases_implicit.toml new file mode 100644 index 00000000..5c48c6b4 --- /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 - major: type-assertion-failure: Argument does not have asserted type `(int, str, str, /) -> None` (type-assertion-failure)'] +""" +output = """ +aliases_implicit.py:68:5 - major: type-assertion-failure: Argument does not have asserted type `(int, str, str, /) -> None` (type-assertion-failure) +aliases_implicit.py:76:9 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +aliases_implicit.py:77:9 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +aliases_implicit.py:78:29 - major: invalid-type-arguments: Too many type arguments: expected 1, got 2 (invalid-type-arguments) +aliases_implicit.py:79:29 - major: invalid-type-arguments: Too many type arguments: expected 1, got 2 (invalid-type-arguments) +aliases_implicit.py:80:24 - major: invalid-type-arguments: Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` (invalid-type-arguments) +aliases_implicit.py:81:25 - major: invalid-type-arguments: Type `str` is not assignable to upper bound `int | float` of type variable `TFloat@GoodTypeAlias12` (invalid-type-arguments) +aliases_implicit.py:107:9 - major: invalid-type-form: Variable of type `list[Unknown | | ]` is not allowed in a type expression (invalid-type-form) +aliases_implicit.py:108:9 - major: invalid-type-form: Variable of type `tuple[tuple[, ]]` is not allowed in a type expression (invalid-type-form) +aliases_implicit.py:109:9 - major: invalid-type-form: Variable of type `list[ | Unknown]` is not allowed in a type expression (invalid-type-form) +aliases_implicit.py:110:9 - major: invalid-type-form: Variable of type `dict[Unknown | str, Unknown | str]` is not allowed in a type expression (invalid-type-form) +aliases_implicit.py:114:9 - major: invalid-type-form: Variable of type `Literal[3]` is not allowed in a type expression (invalid-type-form) +aliases_implicit.py:115:10 - major: invalid-type-form: Variable of type `Literal[True]` is not allowed in a type expression (invalid-type-form) +aliases_implicit.py:116:10 - major: invalid-type-form: Variable of type `Literal[1]` is not allowed in a type expression (invalid-type-form) +aliases_implicit.py:118:10 - major: invalid-type-form: Variable of type `Literal["int"]` is not allowed in a type expression (invalid-type-form) +aliases_implicit.py:119:10 - major: invalid-type-form: Variable of type `Literal["int | str"]` is not allowed in a type expression (invalid-type-form) +aliases_implicit.py:133:6 - major: call-non-callable: Object of type `UnionType` is not callable (call-non-callable) +aliases_implicit.py:135:5 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +""" diff --git a/conformance/results/ty/aliases_newtype.toml b/conformance/results/ty/aliases_newtype.toml new file mode 100644 index 00000000..9bf0ffb0 --- /dev/null +++ b/conformance/results/ty/aliases_newtype.toml @@ -0,0 +1,19 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 50: Expected 1 errors +""" +output = """ +aliases_newtype.py:11:8 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +aliases_newtype.py:12:14 - major: invalid-assignment: Object of type `Literal[42]` is not assignable to `UserId` (invalid-assignment) +aliases_newtype.py:18:11 - major: invalid-assignment: Object of type `` is not assignable to `type` (invalid-assignment) +aliases_newtype.py:23:16 - major: invalid-argument-type: Argument to function `isinstance` is incorrect (invalid-argument-type) +aliases_newtype.py:26:21 - major: invalid-base: Cannot subclass an instance of NewType (invalid-base) +aliases_newtype.py:35:1 - major: invalid-newtype: The name of a `NewType` (`BadName`) must match the name of the variable it is assigned to (`GoodName`) (invalid-newtype) +aliases_newtype.py:41:6 - major: invalid-type-form: `GoodNewType1` is a `NewType` and cannot be specialized (invalid-type-form) +aliases_newtype.py:47:38 - major: invalid-newtype: invalid base for `typing.NewType` (invalid-newtype) +aliases_newtype.py:52:38 - major: invalid-newtype: invalid base for `typing.NewType` (invalid-newtype) +aliases_newtype.py:54:38 - major: invalid-newtype: invalid base for `typing.NewType` (invalid-newtype) +aliases_newtype.py:61:38 - major: invalid-newtype: invalid base for `typing.NewType` (invalid-newtype) +aliases_newtype.py:63:15 - major: invalid-newtype: Wrong number of arguments in `NewType` creation, expected 2, found 3 (invalid-newtype) +aliases_newtype.py:65:38 - major: invalid-newtype: invalid base for `typing.NewType` (invalid-newtype) +""" diff --git a/conformance/results/ty/aliases_recursive.toml b/conformance/results/ty/aliases_recursive.toml new file mode 100644 index 00000000..536250ec --- /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 00000000..c7a2799b --- /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 - major: invalid-type-arguments: Too many type arguments: expected 2, got 3 (invalid-type-arguments)'] +""" +output = """ +aliases_type_statement.py:10:52 - major: invalid-type-arguments: Too many type arguments: expected 2, got 3 (invalid-type-arguments) +aliases_type_statement.py:17:1 - major: unresolved-attribute: Object of type `TypeAliasType` has no attribute `bit_count` (unresolved-attribute) +aliases_type_statement.py:19:1 - major: call-non-callable: Object of type `TypeAliasType` is not callable (call-non-callable) +aliases_type_statement.py:23:7 - major: unresolved-attribute: Object of type `TypeAliasType` has no attribute `other_attrib` (unresolved-attribute) +aliases_type_statement.py:26:18 - major: invalid-base: Invalid class base with type `TypeAliasType` (invalid-base) +aliases_type_statement.py:31:22 - major: invalid-argument-type: Argument to function `isinstance` is incorrect (invalid-argument-type) +aliases_type_statement.py:37:22 - major: invalid-type-form: Function calls are not allowed in type expressions (invalid-type-form) +aliases_type_statement.py:38:22 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form) +aliases_type_statement.py:39:22 - major: invalid-type-form: Tuple literals are not allowed in this context in a type expression (invalid-type-form) +aliases_type_statement.py:39:23 - major: invalid-type-form: Tuple literals are not allowed in this context in a type expression (invalid-type-form) +aliases_type_statement.py:40:22 - major: invalid-type-form: List comprehensions are not allowed in type expressions (invalid-type-form) +aliases_type_statement.py:41:22 - major: invalid-type-form: Dict literals are not allowed in type expressions (invalid-type-form) +aliases_type_statement.py:42:22 - major: invalid-type-form: Function calls are not allowed in type expressions (invalid-type-form) +aliases_type_statement.py:43:22 - major: invalid-type-form: Invalid subscript of object of type `list[Unknown | ]` in type expression (invalid-type-form) +aliases_type_statement.py:43:28 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +aliases_type_statement.py:44:22 - major: invalid-type-form: `if` expressions are not allowed in type expressions (invalid-type-form) +aliases_type_statement.py:45:22 - major: invalid-type-form: Variable of type `Literal[1]` is not allowed in a type expression (invalid-type-form) +aliases_type_statement.py:46:23 - major: invalid-type-form: Boolean literals are not allowed in this context in a type expression (invalid-type-form) +aliases_type_statement.py:47:23 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +aliases_type_statement.py:48:23 - major: invalid-type-form: Boolean operations are not allowed in type expressions (invalid-type-form) +aliases_type_statement.py:49:23 - major: fstring-type-annotation: Type expressions cannot use f-strings (fstring-type-annotation) +aliases_type_statement.py:77:27 - major: invalid-type-arguments: Type `str` is not assignable to upper bound `int` of type variable `S@RecursiveTypeAlias2` (invalid-type-arguments) +aliases_type_statement.py:79:32 - major: invalid-type-arguments: Type `int` is not assignable to upper bound `str` of type variable `T@RecursiveTypeAlias2` (invalid-type-arguments) +aliases_type_statement.py:82:1 - major: cyclic-type-alias-definition: Cyclic definition of `RecursiveTypeAlias3` (cyclic-type-alias-definition) +aliases_type_statement.py:88:1 - major: cyclic-type-alias-definition: Cyclic definition of `RecursiveTypeAlias6` (cyclic-type-alias-definition) +aliases_type_statement.py:89:1 - major: cyclic-type-alias-definition: Cyclic definition of `RecursiveTypeAlias7` (cyclic-type-alias-definition) +""" diff --git a/conformance/results/ty/aliases_typealiastype.toml b/conformance/results/ty/aliases_typealiastype.toml new file mode 100644 index 00000000..cf15f4fa --- /dev/null +++ b/conformance/results/ty/aliases_typealiastype.toml @@ -0,0 +1,31 @@ +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 +Line 23: Unexpected errors ['aliases_typealiastype.py:23:5 - major: invalid-argument-type: Argument to class `TypeAliasType` is incorrect (invalid-argument-type)'] +""" +output = """ +aliases_typealiastype.py:23:5 - major: invalid-argument-type: Argument to class `TypeAliasType` is incorrect (invalid-argument-type) +aliases_typealiastype.py:32:7 - major: unresolved-attribute: Object of type `TypeAliasType` has no attribute `other_attrib` (unresolved-attribute) +aliases_typealiastype.py:52:40 - major: invalid-type-form: Function calls are not allowed in type expressions (invalid-type-form) +aliases_typealiastype.py:53:40 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form) +aliases_typealiastype.py:54:42 - major: invalid-type-form: Tuple literals are not allowed in this context in a type expression (invalid-type-form) +aliases_typealiastype.py:54:43 - major: invalid-type-form: Tuple literals are not allowed in this context in a type expression (invalid-type-form) +aliases_typealiastype.py:55:42 - major: invalid-type-form: List comprehensions are not allowed in type expressions (invalid-type-form) +aliases_typealiastype.py:56:42 - major: invalid-type-form: Dict literals are not allowed in type expressions (invalid-type-form) +aliases_typealiastype.py:57:42 - major: invalid-type-form: Function calls are not allowed in type expressions (invalid-type-form) +aliases_typealiastype.py:58:42 - major: invalid-type-form: Invalid subscript of object of type `list[Unknown | ]` in type expression (invalid-type-form) +aliases_typealiastype.py:58:48 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +aliases_typealiastype.py:59:42 - major: invalid-type-form: `if` expressions are not allowed in type expressions (invalid-type-form) +aliases_typealiastype.py:60:42 - major: invalid-type-form: Variable of type `Literal[3]` is not allowed in a type expression (invalid-type-form) +aliases_typealiastype.py:61:42 - major: invalid-type-form: Boolean literals are not allowed in this context in a type expression (invalid-type-form) +aliases_typealiastype.py:62:42 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +aliases_typealiastype.py:63:42 - major: invalid-type-form: Boolean operations are not allowed in type expressions (invalid-type-form) +aliases_typealiastype.py:64:42 - major: invalid-type-form: F-strings are not allowed in type expressions (invalid-type-form) +aliases_typealiastype.py:66:47 - major: unresolved-reference: Name `BadAlias21` used when not defined (unresolved-reference) +""" diff --git a/conformance/results/ty/aliases_variance.toml b/conformance/results/ty/aliases_variance.toml new file mode 100644 index 00000000..5add77e8 --- /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 00000000..cdd4d0cd --- /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 00000000..984dbfe7 --- /dev/null +++ b/conformance/results/ty/annotations_forward_refs.toml @@ -0,0 +1,35 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 24: Expected 1 errors +Line 25: Expected 1 errors +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 44: Expected 1 errors +Line 45: Expected 1 errors +Line 46: Expected 1 errors +Line 48: Expected 1 errors +Line 50: Expected 1 errors +Line 51: Expected 1 errors +Line 52: Expected 1 errors +Line 53: Expected 1 errors +Line 82: Unexpected errors ['annotations_forward_refs.py:82:11 - major: invalid-type-form: Variable of type `Literal[""]` is not allowed in a type expression (invalid-type-form)'] +Line 87: Unexpected errors ['annotations_forward_refs.py:87:9 - major: invalid-type-form: Variable of type `def int(self) -> None` is not allowed in a type expression (invalid-type-form)'] +Line 95: Unexpected errors ['annotations_forward_refs.py:95:1 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure)'] +Line 96: Unexpected errors ['annotations_forward_refs.py:96:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +""" +output = """ +annotations_forward_refs.py:22:7 - major: unresolved-reference: Name `ClassA` used when not defined (unresolved-reference) +annotations_forward_refs.py:23:12 - major: unresolved-reference: Name `ClassA` used when not defined (unresolved-reference) +annotations_forward_refs.py:47:10 - major: invalid-type-form: Invalid subscript of object of type `list[Unknown | ]` in type expression (invalid-type-form) +annotations_forward_refs.py:49:10 - major: invalid-type-form: Variable of type `Literal[1]` is not allowed in a type expression (invalid-type-form) +annotations_forward_refs.py:54:11 - major: fstring-type-annotation: Type expressions cannot use f-strings (fstring-type-annotation) +annotations_forward_refs.py:55:11 - major: invalid-type-form: Module `types` is not valid in a type expression (invalid-type-form) +annotations_forward_refs.py:66:26 - major: unresolved-reference: Name `ClassB` used when not defined (unresolved-reference) +annotations_forward_refs.py:80:14 - major: unresolved-reference: Name `ClassF` used when not defined (unresolved-reference) +annotations_forward_refs.py:82:11 - major: invalid-type-form: Variable of type `Literal[""]` is not allowed in a type expression (invalid-type-form) +annotations_forward_refs.py:87:9 - major: invalid-type-form: Variable of type `def int(self) -> None` is not allowed in a type expression (invalid-type-form) +annotations_forward_refs.py:89:8 - major: invalid-type-form: Variable of type `def int(self) -> None` is not allowed in a type expression (invalid-type-form) +annotations_forward_refs.py:95:1 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure) +annotations_forward_refs.py:96:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +""" diff --git a/conformance/results/ty/annotations_generators.toml b/conformance/results/ty/annotations_generators.toml new file mode 100644 index 00000000..45ee086f --- /dev/null +++ b/conformance/results/ty/annotations_generators.toml @@ -0,0 +1,17 @@ +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 +Line 193: Unexpected errors ['annotations_generators.py:193:1 - major: type-assertion-failure: Argument does not have asserted type `() -> AsyncIterator[int]` (type-assertion-failure)'] +""" +output = """ +annotations_generators.py:86:21 - major: invalid-return-type: Return type does not match returned value (invalid-return-type) +annotations_generators.py:91:27 - major: invalid-return-type: Return type does not match returned value (invalid-return-type) +annotations_generators.py:193:1 - major: type-assertion-failure: Argument does not have asserted type `() -> AsyncIterator[int]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/annotations_methods.toml b/conformance/results/ty/annotations_methods.toml new file mode 100644 index 00000000..16a069c5 --- /dev/null +++ b/conformance/results/ty/annotations_methods.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_methods.py:42:1 - major: type-assertion-failure: Argument does not have asserted type `A` (type-assertion-failure) +""" diff --git a/conformance/results/ty/annotations_typeexpr.toml b/conformance/results/ty/annotations_typeexpr.toml new file mode 100644 index 00000000..e89f3db4 --- /dev/null +++ b/conformance/results/ty/annotations_typeexpr.toml @@ -0,0 +1,21 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +annotations_typeexpr.py:88:9 - major: invalid-type-form: Function calls are not allowed in type expressions (invalid-type-form) +annotations_typeexpr.py:89:9 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form) +annotations_typeexpr.py:90:9 - major: invalid-type-form: Tuple literals are not allowed in this context in a type expression (invalid-type-form) +annotations_typeexpr.py:91:9 - major: invalid-type-form: List comprehensions are not allowed in type expressions (invalid-type-form) +annotations_typeexpr.py:92:9 - major: invalid-type-form: Dict literals are not allowed in type expressions (invalid-type-form) +annotations_typeexpr.py:93:9 - major: invalid-type-form: Function calls are not allowed in type expressions (invalid-type-form) +annotations_typeexpr.py:94:9 - major: invalid-type-form: Invalid subscript of object of type `list[Unknown | ]` in type expression (invalid-type-form) +annotations_typeexpr.py:94:15 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +annotations_typeexpr.py:95:9 - major: invalid-type-form: `if` expressions are not allowed in type expressions (invalid-type-form) +annotations_typeexpr.py:96:9 - major: invalid-type-form: Variable of type `Literal[3]` is not allowed in a type expression (invalid-type-form) +annotations_typeexpr.py:97:10 - major: invalid-type-form: Boolean literals are not allowed in this context in a type expression (invalid-type-form) +annotations_typeexpr.py:98:10 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +annotations_typeexpr.py:99:10 - major: invalid-type-form: Unary operations are not allowed in type expressions (invalid-type-form) +annotations_typeexpr.py:100:10 - major: invalid-type-form: Boolean operations are not allowed in type expressions (invalid-type-form) +annotations_typeexpr.py:101:10 - major: fstring-type-annotation: Type expressions cannot use f-strings (fstring-type-annotation) +annotations_typeexpr.py:102:10 - major: invalid-type-form: Module `types` is not valid in a type expression (invalid-type-form) +""" diff --git a/conformance/results/ty/callables_annotation.toml b/conformance/results/ty/callables_annotation.toml new file mode 100644 index 00000000..5ba618af --- /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 - major: invalid-assignment: Object of type `Proto7` is not assignable to `Proto6` (invalid-assignment)'] +""" +output = """ +callables_annotation.py:25:5 - major: missing-argument: No argument provided for required parameter 2 (missing-argument) +callables_annotation.py:26:11 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +callables_annotation.py:27:15 - major: too-many-positional-arguments: Too many positional arguments: expected 2, got 3 (too-many-positional-arguments) +callables_annotation.py:29:5 - major: missing-argument: No arguments provided for required parameters 1, 2 (missing-argument) +callables_annotation.py:29:8 - major: unknown-argument: Argument `a` does not match any known parameter (unknown-argument) +callables_annotation.py:29:13 - major: unknown-argument: Argument `b` does not match any known parameter (unknown-argument) +callables_annotation.py:35:8 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 1 (too-many-positional-arguments) +callables_annotation.py:55:5 - major: invalid-type-form: Special form `typing.Callable` expected exactly two arguments (parameter types and return type) (invalid-type-form) +callables_annotation.py:55:14 - major: invalid-type-form: The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` (invalid-type-form) +callables_annotation.py:56:14 - major: invalid-type-form: The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` (invalid-type-form) +callables_annotation.py:57:18 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form) +callables_annotation.py:58:5 - major: invalid-type-form: Special form `typing.Callable` expected exactly two arguments (parameter types and return type) (invalid-type-form) +callables_annotation.py:58:14 - major: invalid-type-form: The first argument to `Callable` must be either a list of types, ParamSpec, Concatenate, or `...` (invalid-type-form) +callables_annotation.py:157:20 - major: invalid-assignment: Object of type `Proto7` is not assignable to `Proto6` (invalid-assignment) +""" diff --git a/conformance/results/ty/callables_kwargs.toml b/conformance/results/ty/callables_kwargs.toml new file mode 100644 index 00000000..e1366106 --- /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 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 32: Unexpected errors ['callables_kwargs.py:32:9 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure)'] +Line 35: Unexpected errors ['callables_kwargs.py:35:5 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure)'] +Line 41: Unexpected errors ['callables_kwargs.py:41:5 - major: type-assertion-failure: Argument does not have asserted type `TD1` (type-assertion-failure)'] +""" +output = """ +callables_kwargs.py:24:5 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +callables_kwargs.py:32:9 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure) +callables_kwargs.py:35:5 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure) +callables_kwargs.py:41:5 - major: type-assertion-failure: Argument does not have asserted type `TD1` (type-assertion-failure) +callables_kwargs.py:52:11 - major: too-many-positional-arguments: Too many positional arguments to function `func1`: expected 0, got 3 (too-many-positional-arguments) +callables_kwargs.py:64:11 - major: invalid-argument-type: Argument to function `func2` is incorrect (invalid-argument-type) +callables_kwargs.py:64:14 - major: parameter-already-assigned: Multiple values provided for parameter `v3` of function `func2` (parameter-already-assigned) +callables_kwargs.py:103:19 - major: invalid-assignment: Object of type `def func1(**kwargs: @Todo) -> None` is not assignable to `TDProtocol5` (invalid-assignment) +callables_kwargs.py:134:19 - major: invalid-assignment: Object of type `def func7(*, v1: int, v3: str, v2: str = "") -> None` is not assignable to `TDProtocol6` (invalid-assignment) +""" diff --git a/conformance/results/ty/callables_protocol.toml b/conformance/results/ty/callables_protocol.toml new file mode 100644 index 00000000..a91fea76 --- /dev/null +++ b/conformance/results/ty/callables_protocol.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +callables_protocol.py:35:7 - major: invalid-assignment: Object of type `def cb1_bad1(*vals: bytes, *, max_items: int | None) -> list[bytes]` is not assignable to `Proto1` (invalid-assignment) +callables_protocol.py:36:7 - major: invalid-assignment: Object of type `def cb1_bad2(*vals: bytes) -> list[bytes]` is not assignable to `Proto1` (invalid-assignment) +callables_protocol.py:37:7 - major: invalid-assignment: Object of type `def cb1_bad3(*vals: bytes, *, max_len: str | None) -> list[bytes]` is not assignable to `Proto1` (invalid-assignment) +callables_protocol.py:67:7 - major: invalid-assignment: Object of type `def cb2_bad1(*a: bytes) -> Unknown` is not assignable to `Proto2` (invalid-assignment) +callables_protocol.py:68:7 - major: invalid-assignment: Object of type `def cb2_bad2(*a: str, **b: str) -> Unknown` is not assignable to `Proto2` (invalid-assignment) +callables_protocol.py:69:7 - major: invalid-assignment: Object of type `def cb2_bad3(*a: bytes, **b: bytes) -> Unknown` is not assignable to `Proto2` (invalid-assignment) +callables_protocol.py:70:7 - major: invalid-assignment: Object of type `def cb2_bad4(**b: str) -> Unknown` is not assignable to `Proto2` (invalid-assignment) +callables_protocol.py:97:16 - major: invalid-assignment: Object of type `def cb4_bad1(x: int) -> None` is not assignable to `Proto4` (invalid-assignment) +callables_protocol.py:121:18 - major: invalid-assignment: Object of type `def cb6_bad1(*vals: bytes, *, max_len: int | None = None) -> list[bytes]` is not assignable to `NotProto6` (invalid-assignment) +callables_protocol.py:169:7 - major: invalid-assignment: Object of type `def cb8_bad1(x: int) -> Any` is not assignable to `Proto8` (invalid-assignment) +callables_protocol.py:186:5 - major: invalid-assignment: Object of type `Literal["str"]` is not assignable to attribute `other_attribute` of type `int` (invalid-assignment) +callables_protocol.py:187:5 - major: unresolved-attribute: Unresolved attribute `xxx` on type `Proto9[P@decorator1, R@decorator1]`. (unresolved-attribute) +callables_protocol.py:197:7 - major: unresolved-attribute: Object of type `Proto9[(x: int), str]` has no attribute `other_attribute2` (unresolved-attribute) +callables_protocol.py:238:8 - major: invalid-assignment: Object of type `def cb11_bad1(x: int, y: str, /) -> Any` is not assignable to `Proto11` (invalid-assignment) +callables_protocol.py:260:8 - major: invalid-assignment: Object of type `def cb12_bad1(*args: Any, *, kwarg0: Any) -> None` is not assignable to `Proto12` (invalid-assignment) +callables_protocol.py:284:27 - major: invalid-assignment: Object of type `def cb13_no_default(path: str) -> str` is not assignable to `Proto13_Default` (invalid-assignment) +callables_protocol.py:311:27 - major: invalid-assignment: Object of type `def cb14_no_default(*, path: str) -> str` is not assignable to `Proto14_Default` (invalid-assignment) +""" diff --git a/conformance/results/ty/callables_subtyping.toml b/conformance/results/ty/callables_subtyping.toml new file mode 100644 index 00000000..fc1d5afe --- /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 - major: invalid-assignment: Object of type `(int, /) -> int` is not assignable to `(int | float, /) -> int | float` (invalid-assignment) +callables_subtyping.py:29:32 - major: invalid-assignment: Object of type `(int | float, /) -> int | float` is not assignable to `(int, /) -> int` (invalid-assignment) +callables_subtyping.py:51:21 - major: invalid-assignment: Object of type `PosOnly2` is not assignable to `Standard2` (invalid-assignment) +callables_subtyping.py:52:21 - major: invalid-assignment: Object of type `KwOnly2` is not assignable to `Standard2` (invalid-assignment) +callables_subtyping.py:55:20 - major: invalid-assignment: Object of type `KwOnly2` is not assignable to `PosOnly2` (invalid-assignment) +callables_subtyping.py:58:19 - major: invalid-assignment: Object of type `PosOnly2` is not assignable to `KwOnly2` (invalid-assignment) +callables_subtyping.py:82:20 - major: invalid-assignment: Object of type `NoArgs3` is not assignable to `IntArgs3` (invalid-assignment) +callables_subtyping.py:85:22 - major: invalid-assignment: Object of type `NoArgs3` is not assignable to `FloatArgs3` (invalid-assignment) +callables_subtyping.py:86:22 - major: invalid-assignment: Object of type `IntArgs3` is not assignable to `FloatArgs3` (invalid-assignment) +callables_subtyping.py:116:20 - major: invalid-assignment: Object of type `IntArgs4` is not assignable to `PosOnly4` (invalid-assignment) +callables_subtyping.py:119:23 - major: invalid-assignment: Object of type `StrArgs4` is not assignable to `IntStrArgs4` (invalid-assignment) +callables_subtyping.py:120:23 - major: invalid-assignment: Object of type `IntArgs4` is not assignable to `IntStrArgs4` (invalid-assignment) +callables_subtyping.py:122:20 - major: invalid-assignment: Object of type `IntArgs4` is not assignable to `StrArgs4` (invalid-assignment) +callables_subtyping.py:124:20 - major: invalid-assignment: Object of type `StrArgs4` is not assignable to `IntArgs4` (invalid-assignment) +callables_subtyping.py:126:22 - major: invalid-assignment: Object of type `StrArgs4` is not assignable to `Standard4` (invalid-assignment) +callables_subtyping.py:151:22 - major: invalid-assignment: Object of type `NoKwargs5` is not assignable to `IntKwargs5` (invalid-assignment) +callables_subtyping.py:154:24 - major: invalid-assignment: Object of type `NoKwargs5` is not assignable to `FloatKwargs5` (invalid-assignment) +callables_subtyping.py:155:24 - major: invalid-assignment: Object of type `IntKwargs5` is not assignable to `FloatKwargs5` (invalid-assignment) +callables_subtyping.py:187:19 - major: invalid-assignment: Object of type `IntKwargs6` is not assignable to `KwOnly6` (invalid-assignment) +callables_subtyping.py:190:25 - major: invalid-assignment: Object of type `StrKwargs6` is not assignable to `IntStrKwargs6` (invalid-assignment) +callables_subtyping.py:191:25 - major: invalid-assignment: Object of type `IntKwargs6` is not assignable to `IntStrKwargs6` (invalid-assignment) +callables_subtyping.py:193:22 - major: invalid-assignment: Object of type `IntKwargs6` is not assignable to `StrKwargs6` (invalid-assignment) +callables_subtyping.py:195:22 - major: invalid-assignment: Object of type `StrKwargs6` is not assignable to `IntKwargs6` (invalid-assignment) +callables_subtyping.py:196:22 - major: invalid-assignment: Object of type `IntStrKwargs6` is not assignable to `Standard6` (invalid-assignment) +callables_subtyping.py:197:22 - major: invalid-assignment: Object of type `StrKwargs6` is not assignable to `Standard6` (invalid-assignment) +callables_subtyping.py:236:23 - major: invalid-assignment: Object of type `NoDefaultArg8` is not assignable to `DefaultArg8` (invalid-assignment) +callables_subtyping.py:237:23 - major: invalid-assignment: Object of type `NoX8` is not assignable to `DefaultArg8` (invalid-assignment) +callables_subtyping.py:240:25 - major: invalid-assignment: Object of type `NoX8` is not assignable to `NoDefaultArg8` (invalid-assignment) +callables_subtyping.py:243:16 - major: invalid-assignment: Object of type `NoDefaultArg8` is not assignable to `NoX8` (invalid-assignment) +callables_subtyping.py:273:21 - major: invalid-assignment: Object of type `Overloaded9` is not assignable to `FloatArg9` (invalid-assignment) +callables_subtyping.py:297:24 - major: invalid-assignment: Object of type `StrArg10` is not assignable to `Overloaded10` (invalid-assignment) +""" diff --git a/conformance/results/ty/classes_classvar.toml b/conformance/results/ty/classes_classvar.toml new file mode 100644 index 00000000..b2c45bde --- /dev/null +++ b/conformance/results/ty/classes_classvar.toml @@ -0,0 +1,22 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 45: Expected 1 errors +Line 46: Expected 1 errors +Line 47: Expected 1 errors +Line 54: Expected 1 errors +Line 78: Expected 1 errors +""" +output = """ +classes_classvar.py:38:11 - major: invalid-type-form: Type qualifier `typing.ClassVar` expected exactly 1 argument, got 2 (invalid-type-form) +classes_classvar.py:39:14 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +classes_classvar.py:40:14 - major: unresolved-reference: Name `var` used when not defined (unresolved-reference) +classes_classvar.py:52:33 - major: invalid-assignment: Object of type `dict[Unknown, Unknown]` is not assignable to `list[str]` (invalid-assignment) +classes_classvar.py:55:17 - major: invalid-type-form: Type qualifier `typing.ClassVar` is not allowed in type expressions (only in annotation expressions) (invalid-type-form) +classes_classvar.py:69:23 - major: invalid-type-form: `ClassVar` is not allowed in function parameter annotations (invalid-type-form) +classes_classvar.py:70:12 - major: invalid-type-form: `ClassVar` annotations are only allowed in class-body scopes (invalid-type-form) +classes_classvar.py:71:18 - major: invalid-type-form: `ClassVar` annotations are not allowed for non-name targets (invalid-type-form) +classes_classvar.py:73:26 - major: invalid-type-form: `ClassVar` is not allowed in function return type annotations (invalid-type-form) +classes_classvar.py:77:8 - major: invalid-type-form: `ClassVar` annotations are only allowed in class-body scopes (invalid-type-form) +classes_classvar.py:111:1 - major: invalid-attribute-access: Cannot assign to ClassVar `stats` from an instance of type `Starship` (invalid-attribute-access) +classes_classvar.py:140:13 - major: invalid-assignment: Object of type `ProtoAImpl` is not assignable to `ProtoA` (invalid-assignment) +""" diff --git a/conformance/results/ty/classes_override.toml b/conformance/results/ty/classes_override.toml new file mode 100644 index 00000000..bc1d1c20 --- /dev/null +++ b/conformance/results/ty/classes_override.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +classes_override.py:53:9 - major: invalid-explicit-override: Method `method3` is decorated with `@override` but does not override anything (invalid-explicit-override) +classes_override.py:65:9 - major: invalid-explicit-override: Method `method4` is decorated with `@override` but does not override anything (invalid-explicit-override) +classes_override.py:79:9 - major: invalid-explicit-override: Method `static_method1` is decorated with `@override` but does not override anything (invalid-explicit-override) +classes_override.py:84:9 - major: invalid-explicit-override: Method `class_method1` is decorated with `@override` but does not override anything (invalid-explicit-override) +classes_override.py:89:9 - major: invalid-explicit-override: Method `property1` is decorated with `@override` but does not override anything (invalid-explicit-override) +""" diff --git a/conformance/results/ty/constructors_call_init.toml b/conformance/results/ty/constructors_call_init.toml new file mode 100644 index 00000000..e003a474 --- /dev/null +++ b/conformance/results/ty/constructors_call_init.toml @@ -0,0 +1,18 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 42: Expected 1 errors +Line 107: Expected 1 errors +Line 25: Unexpected errors ['constructors_call_init.py:25:1 - major: type-assertion-failure: Argument does not have asserted type `Class1[int | float]` (type-assertion-failure)'] +Line 75: Unexpected errors ['constructors_call_init.py:75:1 - major: type-assertion-failure: Argument does not have asserted type `Class5[int | float]` (type-assertion-failure)'] +Line 91: Unexpected errors ['constructors_call_init.py:91:1 - major: type-assertion-failure: Argument does not have asserted type `Class6[int, str]` (type-assertion-failure)'] +Line 99: Unexpected errors ['constructors_call_init.py:99:1 - major: type-assertion-failure: Argument does not have asserted type `Class7[str, int]` (type-assertion-failure)'] +""" +output = """ +constructors_call_init.py:21:13 - major: invalid-argument-type: Argument to bound method `__init__` is incorrect (invalid-argument-type) +constructors_call_init.py:25:1 - major: type-assertion-failure: Argument does not have asserted type `Class1[int | float]` (type-assertion-failure) +constructors_call_init.py:56:1 - major: invalid-argument-type: Argument to bound method `__init__` is incorrect (invalid-argument-type) +constructors_call_init.py:75:1 - major: type-assertion-failure: Argument does not have asserted type `Class5[int | float]` (type-assertion-failure) +constructors_call_init.py:91:1 - major: type-assertion-failure: Argument does not have asserted type `Class6[int, str]` (type-assertion-failure) +constructors_call_init.py:99:1 - major: type-assertion-failure: Argument does not have asserted type `Class7[str, int]` (type-assertion-failure) +constructors_call_init.py:130:9 - major: too-many-positional-arguments: Too many positional arguments to bound method `__init__`: expected 1, got 2 (too-many-positional-arguments) +""" diff --git a/conformance/results/ty/constructors_call_metaclass.toml b/conformance/results/ty/constructors_call_metaclass.toml new file mode 100644 index 00000000..204ffa39 --- /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 - major: type-assertion-failure: Argument does not have asserted type `int | Meta2` (type-assertion-failure)', 'constructors_call_metaclass.py:39:13 - major: missing-argument: No argument provided for required parameter `x` of function `__new__` (missing-argument)'] +Line 46: Unexpected errors ["constructors_call_metaclass.py:46:16 - major: invalid-super-argument: `T@__call__` is not an instance or subclass of `` in `super(, T@__call__)` call (invalid-super-argument)"] +""" +output = """ +constructors_call_metaclass.py:39:1 - major: type-assertion-failure: Argument does not have asserted type `int | Meta2` (type-assertion-failure) +constructors_call_metaclass.py:39:13 - major: missing-argument: No argument provided for required parameter `x` of function `__new__` (missing-argument) +constructors_call_metaclass.py:46:16 - major: invalid-super-argument: `T@__call__` is not an instance or subclass of `` in `super(, T@__call__)` call (invalid-super-argument) +constructors_call_metaclass.py:54:1 - major: missing-argument: No argument provided for required parameter `x` of function `__new__` (missing-argument) +constructors_call_metaclass.py:68:1 - major: missing-argument: No argument provided for required parameter `x` of function `__new__` (missing-argument) +""" diff --git a/conformance/results/ty/constructors_call_new.toml b/conformance/results/ty/constructors_call_new.toml new file mode 100644 index 00000000..8995b020 --- /dev/null +++ b/conformance/results/ty/constructors_call_new.toml @@ -0,0 +1,25 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 24: Unexpected errors ['constructors_call_new.py:24:1 - major: type-assertion-failure: Argument does not have asserted type `Class1[int | float]` (type-assertion-failure)'] +Line 49: Unexpected errors ['constructors_call_new.py:49:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)', 'constructors_call_new.py:49:13 - major: missing-argument: No argument provided for required parameter `x` of bound method `__init__` (missing-argument)'] +Line 64: Unexpected errors ['constructors_call_new.py:64:1 - major: type-assertion-failure: Argument does not have asserted type `Class4 | Any` (type-assertion-failure)', 'constructors_call_new.py:64:13 - major: missing-argument: No argument provided for required parameter `x` of bound method `__init__` (missing-argument)'] +Line 76: Unexpected errors ['constructors_call_new.py:76:5 - major: type-assertion-failure: Argument does not have asserted type `Never` (type-assertion-failure)', 'constructors_call_new.py:76:17 - major: missing-argument: No argument provided for required parameter `x` of bound method `__init__` (missing-argument)'] +Line 89: Unexpected errors ['constructors_call_new.py:89:1 - major: type-assertion-failure: Argument does not have asserted type `int | Class6` (type-assertion-failure)', 'constructors_call_new.py:89:13 - major: missing-argument: No argument provided for required parameter `x` of bound method `__init__` (missing-argument)'] +Line 117: Unexpected errors ['constructors_call_new.py:117:1 - major: type-assertion-failure: Argument does not have asserted type `Class8[list[int]]` (type-assertion-failure)'] +Line 118: Unexpected errors ['constructors_call_new.py:118:1 - major: type-assertion-failure: Argument does not have asserted type `Class8[list[str]]` (type-assertion-failure)'] +""" +output = """ +constructors_call_new.py:21:13 - major: invalid-argument-type: Argument to function `__new__` is incorrect (invalid-argument-type) +constructors_call_new.py:24:1 - major: type-assertion-failure: Argument does not have asserted type `Class1[int | float]` (type-assertion-failure) +constructors_call_new.py:49:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +constructors_call_new.py:49:13 - major: missing-argument: No argument provided for required parameter `x` of bound method `__init__` (missing-argument) +constructors_call_new.py:64:1 - major: type-assertion-failure: Argument does not have asserted type `Class4 | Any` (type-assertion-failure) +constructors_call_new.py:64:13 - major: missing-argument: No argument provided for required parameter `x` of bound method `__init__` (missing-argument) +constructors_call_new.py:76:5 - major: type-assertion-failure: Argument does not have asserted type `Never` (type-assertion-failure) +constructors_call_new.py:76:17 - major: missing-argument: No argument provided for required parameter `x` of bound method `__init__` (missing-argument) +constructors_call_new.py:89:1 - major: type-assertion-failure: Argument does not have asserted type `int | Class6` (type-assertion-failure) +constructors_call_new.py:89:13 - major: missing-argument: No argument provided for required parameter `x` of bound method `__init__` (missing-argument) +constructors_call_new.py:117:1 - major: type-assertion-failure: Argument does not have asserted type `Class8[list[int]]` (type-assertion-failure) +constructors_call_new.py:118:1 - major: type-assertion-failure: Argument does not have asserted type `Class8[list[str]]` (type-assertion-failure) +constructors_call_new.py:148:1 - major: invalid-argument-type: Argument to function `__new__` is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/constructors_call_type.toml b/conformance/results/ty/constructors_call_type.toml new file mode 100644 index 00000000..cd523ff1 --- /dev/null +++ b/conformance/results/ty/constructors_call_type.toml @@ -0,0 +1,13 @@ +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:40:5 - major: missing-argument: No arguments provided for required parameters `x`, `y` of function `__new__` (missing-argument) +constructors_call_type.py:50:5 - major: missing-argument: No arguments provided for required parameters `x`, `y` of bound method `__init__` (missing-argument) +constructors_call_type.py:59:9 - major: too-many-positional-arguments: Too many positional arguments to bound method `__init__`: expected 1, got 2 (too-many-positional-arguments) +constructors_call_type.py:81:5 - major: missing-argument: No argument provided for required parameter `y` of function `__new__` (missing-argument) +constructors_call_type.py:82:12 - major: invalid-argument-type: Argument to function `__new__` is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/constructors_callable.toml b/conformance/results/ty/constructors_callable.toml new file mode 100644 index 00000000..8aabb52d --- /dev/null +++ b/conformance/results/ty/constructors_callable.toml @@ -0,0 +1,50 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 66: Expected 1 errors +Line 67: Expected 1 errors +Line 68: Expected 1 errors +Line 102: Unexpected errors ['constructors_callable.py:102:5 - major: type-assertion-failure: Argument does not have asserted type `Never` (type-assertion-failure)'] +Line 107: Unexpected errors ['constructors_callable.py:107:5 - major: type-assertion-failure: Argument does not have asserted type `Never` (type-assertion-failure)'] +Line 143: Unexpected errors ['constructors_callable.py:143:27 - major: invalid-argument-type: Argument to function `accepts_callable` is incorrect (invalid-argument-type)'] +Line 145: Unexpected errors ['constructors_callable.py:145:1 - major: type-assertion-failure: Argument does not have asserted type `Any` (type-assertion-failure)'] +Line 166: Unexpected errors ['constructors_callable.py:166:1 - major: type-assertion-failure: Argument does not have asserted type `Class7[int]` (type-assertion-failure)'] +Line 167: Unexpected errors ['constructors_callable.py:167:1 - major: type-assertion-failure: Argument does not have asserted type `Class7[str]` (type-assertion-failure)'] +Line 185: Unexpected errors ['constructors_callable.py:185:1 - major: type-assertion-failure: Argument does not have asserted type `Class8[str]` (type-assertion-failure)', 'constructors_callable.py:185:16 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'constructors_callable.py:185:22 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)'] +Line 196: Unexpected errors ['constructors_callable.py:196:16 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'constructors_callable.py:196:22 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)'] +""" +output = """ +constructors_callable.py:36:13 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:38:1 - major: missing-argument: No argument provided for required parameter `x` (missing-argument) +constructors_callable.py:39:1 - major: missing-argument: No argument provided for required parameter `x` (missing-argument) +constructors_callable.py:39:4 - major: unknown-argument: Argument `y` does not match any known parameter (unknown-argument) +constructors_callable.py:49:13 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:51:4 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 1 (too-many-positional-arguments) +constructors_callable.py:64:13 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:79:13 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:81:1 - major: missing-argument: No argument provided for required parameter `x` (missing-argument) +constructors_callable.py:82:1 - major: missing-argument: No argument provided for required parameter `x` (missing-argument) +constructors_callable.py:82:4 - major: unknown-argument: Argument `y` does not match any known parameter (unknown-argument) +constructors_callable.py:99:13 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:102:5 - major: type-assertion-failure: Argument does not have asserted type `Never` (type-assertion-failure) +constructors_callable.py:107:5 - major: type-assertion-failure: Argument does not have asserted type `Never` (type-assertion-failure) +constructors_callable.py:127:13 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:129:4 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 1 (too-many-positional-arguments) +constructors_callable.py:143:27 - major: invalid-argument-type: Argument to function `accepts_callable` is incorrect (invalid-argument-type) +constructors_callable.py:144:13 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:145:1 - major: type-assertion-failure: Argument does not have asserted type `Any` (type-assertion-failure) +constructors_callable.py:146:8 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 1 (too-many-positional-arguments) +constructors_callable.py:164:5 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:166:1 - major: type-assertion-failure: Argument does not have asserted type `Class7[int]` (type-assertion-failure) +constructors_callable.py:167:1 - major: type-assertion-failure: Argument does not have asserted type `Class7[str]` (type-assertion-failure) +constructors_callable.py:184:13 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:185:1 - major: type-assertion-failure: Argument does not have asserted type `Class8[str]` (type-assertion-failure) +constructors_callable.py:185:16 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +constructors_callable.py:185:22 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +constructors_callable.py:186:4 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +constructors_callable.py:186:9 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +constructors_callable.py:195:13 - info: revealed-type: Revealed type (revealed-type) +constructors_callable.py:196:16 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +constructors_callable.py:196:22 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +constructors_callable.py:197:4 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +constructors_callable.py:197:9 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/constructors_consistency.toml b/conformance/results/ty/constructors_consistency.toml new file mode 100644 index 00000000..cdd4d0cd --- /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 00000000..9eddd4de --- /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 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 67: Unexpected errors ['dataclasses_descriptors.py:67:1 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure)'] +""" +output = """ +dataclasses_descriptors.py:66:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +dataclasses_descriptors.py:67:1 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure) +""" diff --git a/conformance/results/ty/dataclasses_final.toml b/conformance/results/ty/dataclasses_final.toml new file mode 100644 index 00000000..3267f463 --- /dev/null +++ b/conformance/results/ty/dataclasses_final.toml @@ -0,0 +1,10 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_final.py:27:1 - major: invalid-assignment: Cannot assign to final attribute `final_classvar` on type `` (invalid-assignment) +dataclasses_final.py:35:1 - major: invalid-assignment: Cannot assign to final attribute `final_no_default` on type `D` (invalid-assignment) +dataclasses_final.py:36:1 - major: invalid-assignment: Cannot assign to final attribute `final_with_default` on type `D` (invalid-assignment) +dataclasses_final.py:37:1 - major: invalid-assignment: Cannot assign to final attribute `final_no_default` on type `` (invalid-assignment) +dataclasses_final.py:38:1 - major: invalid-assignment: Cannot assign to final attribute `final_with_default` on type `` (invalid-assignment) +""" diff --git a/conformance/results/ty/dataclasses_frozen.toml b/conformance/results/ty/dataclasses_frozen.toml new file mode 100644 index 00000000..0bf5b35f --- /dev/null +++ b/conformance/results/ty/dataclasses_frozen.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_frozen.py:16:1 - major: invalid-assignment: Property `a` defined in `DC1` is read-only (invalid-assignment) +dataclasses_frozen.py:17:1 - major: invalid-assignment: Property `b` defined in `DC1` is read-only (invalid-assignment) +dataclasses_frozen.py:23:7 - major: invalid-frozen-dataclass-subclass: Non-frozen dataclass cannot inherit from frozen dataclass (invalid-frozen-dataclass-subclass) +dataclasses_frozen.py:33:7 - major: invalid-frozen-dataclass-subclass: Frozen dataclass cannot inherit from non-frozen dataclass (invalid-frozen-dataclass-subclass) +""" diff --git a/conformance/results/ty/dataclasses_hash.toml b/conformance/results/ty/dataclasses_hash.toml new file mode 100644 index 00000000..a7f264ee --- /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 00000000..6973d93f --- /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 00000000..0572d168 --- /dev/null +++ b/conformance/results/ty/dataclasses_kwonly.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_kwonly.py:23:11 - major: too-many-positional-arguments: Too many positional arguments: expected 1, got 2 (too-many-positional-arguments) +dataclasses_kwonly.py:38:11 - major: too-many-positional-arguments: Too many positional arguments: expected 1, got 2 (too-many-positional-arguments) +dataclasses_kwonly.py:53:11 - major: too-many-positional-arguments: Too many positional arguments: expected 1, got 2 (too-many-positional-arguments) +""" diff --git a/conformance/results/ty/dataclasses_match_args.toml b/conformance/results/ty/dataclasses_match_args.toml new file mode 100644 index 00000000..35c5980b --- /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 - major: type-assertion-failure: Argument does not have asserted type `tuple[()]` (type-assertion-failure)'] +""" +output = """ +dataclasses_match_args.py:42:1 - major: unresolved-attribute: Class `DC4` has no attribute `__match_args__` (unresolved-attribute) +dataclasses_match_args.py:49:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[()]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/dataclasses_order.toml b/conformance/results/ty/dataclasses_order.toml new file mode 100644 index 00000000..4c082f9d --- /dev/null +++ b/conformance/results/ty/dataclasses_order.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +dataclasses_order.py:50:4 - major: unsupported-operator: Unsupported `<` operation (unsupported-operator) +""" diff --git a/conformance/results/ty/dataclasses_postinit.toml b/conformance/results/ty/dataclasses_postinit.toml new file mode 100644 index 00000000..b078a9fe --- /dev/null +++ b/conformance/results/ty/dataclasses_postinit.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 19: Expected 1 errors +Line 36: Expected 1 errors +""" +output = """ +dataclasses_postinit.py:28:7 - major: unresolved-attribute: Object of type `DC1` has no attribute `x` (unresolved-attribute) +dataclasses_postinit.py:29:7 - major: unresolved-attribute: Object of type `DC1` has no attribute `y` (unresolved-attribute) +""" diff --git a/conformance/results/ty/dataclasses_slots.toml b/conformance/results/ty/dataclasses_slots.toml new file mode 100644 index 00000000..d6b99f19 --- /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 - major: unresolved-attribute: Class `DC6` has no attribute `__slots__` (unresolved-attribute) +dataclasses_slots.py:69:1 - major: unresolved-attribute: Object of type `DC6` has no attribute `__slots__` (unresolved-attribute) +""" diff --git a/conformance/results/ty/dataclasses_transform_class.toml b/conformance/results/ty/dataclasses_transform_class.toml new file mode 100644 index 00000000..54fad438 --- /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 - major: invalid-assignment: Property `id` defined in `Customer1` is read-only (invalid-assignment) +dataclasses_transform_class.py:66:8 - major: missing-argument: No arguments provided for required parameters `id`, `name` (missing-argument) +dataclasses_transform_class.py:66:18 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 2 (too-many-positional-arguments) +dataclasses_transform_class.py:72:6 - major: unsupported-operator: Unsupported `<` operation (unsupported-operator) +dataclasses_transform_class.py:82:8 - major: missing-argument: No argument provided for required parameter `id` (missing-argument) +dataclasses_transform_class.py:82:18 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 2 (too-many-positional-arguments) +dataclasses_transform_class.py:122:1 - major: invalid-assignment: Property `id` defined in `Customer3` is read-only (invalid-assignment) +""" diff --git a/conformance/results/ty/dataclasses_transform_converter.toml b/conformance/results/ty/dataclasses_transform_converter.toml new file mode 100644 index 00000000..40a2f644 --- /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 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type)'] +Line 103: Unexpected errors ['dataclasses_transform_converter.py:103:31 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type)'] +Line 104: Unexpected errors ['dataclasses_transform_converter.py:104:30 - major: invalid-assignment: Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]` (invalid-assignment)', 'dataclasses_transform_converter.py:104:42 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type)'] +Line 112: Unexpected errors ['dataclasses_transform_converter.py:112:11 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'dataclasses_transform_converter.py:112:17 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'dataclasses_transform_converter.py:112:23 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'dataclasses_transform_converter.py:112:29 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'dataclasses_transform_converter.py:112:36 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)'] +Line 114: Unexpected errors ['dataclasses_transform_converter.py:114:1 - major: invalid-assignment: Object of type `Literal["f1"]` is not assignable to attribute `field0` of type `int` (invalid-assignment)'] +Line 115: Unexpected errors ['dataclasses_transform_converter.py:115:1 - major: invalid-assignment: Object of type `Literal["f6"]` is not assignable to attribute `field3` of type `ConverterClass` (invalid-assignment)'] +Line 116: Unexpected errors ['dataclasses_transform_converter.py:116:1 - major: invalid-assignment: Object of type `Literal[b"f6"]` is not assignable to attribute `field3` of type `ConverterClass` (invalid-assignment)'] +Line 121: Unexpected errors ['dataclasses_transform_converter.py:121:11 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'dataclasses_transform_converter.py:121:17 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'dataclasses_transform_converter.py:121:23 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'dataclasses_transform_converter.py:121:29 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'dataclasses_transform_converter.py:121:35 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)', 'dataclasses_transform_converter.py:121:40 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type)'] +""" +output = """ +dataclasses_transform_converter.py:48:31 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:49:31 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:102:42 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:103:31 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:104:30 - major: invalid-assignment: Object of type `dict[str, str] | dict[bytes, bytes]` is not assignable to `dict[str, str]` (invalid-assignment) +dataclasses_transform_converter.py:104:42 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:107:8 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:107:14 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:107:20 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:107:27 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:108:5 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:108:11 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:108:17 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:108:23 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:108:26 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:109:5 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:109:11 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:109:17 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:109:23 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:109:29 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:112:11 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:112:17 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:112:23 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:112:29 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:112:36 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:114:1 - major: invalid-assignment: Object of type `Literal["f1"]` is not assignable to attribute `field0` of type `int` (invalid-assignment) +dataclasses_transform_converter.py:115:1 - major: invalid-assignment: Object of type `Literal["f6"]` is not assignable to attribute `field3` of type `ConverterClass` (invalid-assignment) +dataclasses_transform_converter.py:116:1 - major: invalid-assignment: Object of type `Literal[b"f6"]` is not assignable to attribute `field3` of type `ConverterClass` (invalid-assignment) +dataclasses_transform_converter.py:119:1 - major: invalid-assignment: Object of type `Literal[1]` is not assignable to attribute `field3` of type `ConverterClass` (invalid-assignment) +dataclasses_transform_converter.py:121:11 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:121:17 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:121:23 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:121:29 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:121:35 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:121:40 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:130:31 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type) +dataclasses_transform_converter.py:133:31 - major: invalid-argument-type: Argument to function `model_field` is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/dataclasses_transform_field.toml b/conformance/results/ty/dataclasses_transform_field.toml new file mode 100644 index 00000000..2f7ce1e6 --- /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 - major: unknown-argument: Argument `id` does not match any known parameter (unknown-argument) +dataclasses_transform_field.py:75:1 - major: missing-argument: No argument provided for required parameter `name` (missing-argument) +dataclasses_transform_field.py:75:16 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 1 (too-many-positional-arguments) +""" diff --git a/conformance/results/ty/dataclasses_transform_func.toml b/conformance/results/ty/dataclasses_transform_func.toml new file mode 100644 index 00000000..3990d5fc --- /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 - major: invalid-assignment: Object of type `Literal[3]` is not assignable to attribute `name` of type `str` (invalid-assignment) +dataclasses_transform_func.py:60:6 - major: unsupported-operator: Unsupported `<` operation (unsupported-operator) +dataclasses_transform_func.py:64:36 - major: unknown-argument: Argument `salary` does not match any known parameter (unknown-argument) +dataclasses_transform_func.py:70:8 - major: missing-argument: No arguments provided for required parameters `id`, `name` (missing-argument) +dataclasses_transform_func.py:70:18 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 2 (too-many-positional-arguments) +dataclasses_transform_func.py:89:7 - major: invalid-frozen-dataclass-subclass: Non-frozen dataclass cannot inherit from frozen dataclass (invalid-frozen-dataclass-subclass) +dataclasses_transform_func.py:96:1 - major: invalid-assignment: Property `id` defined in `Customer3` is read-only (invalid-assignment) +""" diff --git a/conformance/results/ty/dataclasses_transform_meta.toml b/conformance/results/ty/dataclasses_transform_meta.toml new file mode 100644 index 00000000..300123a0 --- /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 - major: invalid-assignment: Property `id` defined in `Customer1` is read-only (invalid-assignment) +dataclasses_transform_meta.py:66:8 - major: missing-argument: No arguments provided for required parameters `id`, `name` (missing-argument) +dataclasses_transform_meta.py:66:18 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 2 (too-many-positional-arguments) +dataclasses_transform_meta.py:73:6 - major: unsupported-operator: Unsupported `<` operation (unsupported-operator) +dataclasses_transform_meta.py:83:8 - major: missing-argument: No argument provided for required parameter `id` (missing-argument) +dataclasses_transform_meta.py:83:18 - major: too-many-positional-arguments: Too many positional arguments: expected 0, got 2 (too-many-positional-arguments) +dataclasses_transform_meta.py:103:1 - major: invalid-assignment: Property `id` defined in `Customer3` is read-only (invalid-assignment) +""" diff --git a/conformance/results/ty/dataclasses_usage.toml b/conformance/results/ty/dataclasses_usage.toml new file mode 100644 index 00000000..d999dbaa --- /dev/null +++ b/conformance/results/ty/dataclasses_usage.toml @@ -0,0 +1,16 @@ +conformance_automated = "Fail" +errors_diff = """ +Lines 58, 61: Expected error (tag 'DC1') +Lines 64, 67: Expected error (tag 'DC2') +Lines 70, 73: Expected error (tag 'DC3') +""" +output = """ +dataclasses_usage.py:50:6 - major: missing-argument: No argument provided for required parameter `unit_price` (missing-argument) +dataclasses_usage.py:51:28 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +dataclasses_usage.py:52:36 - major: too-many-positional-arguments: Too many positional arguments: expected 3, got 4 (too-many-positional-arguments) +dataclasses_usage.py:83:13 - major: too-many-positional-arguments: Too many positional arguments: expected 1, got 2 (too-many-positional-arguments) +dataclasses_usage.py:88:14 - major: invalid-assignment: Object of type `dataclasses.Field[str | int]` is not assignable to `int` (invalid-assignment) +dataclasses_usage.py:127:8 - major: too-many-positional-arguments: Too many positional arguments: expected 1, got 2 (too-many-positional-arguments) +dataclasses_usage.py:130:1 - major: missing-argument: No argument provided for required parameter `y` of bound method `__init__` (missing-argument) +dataclasses_usage.py:179:6 - major: too-many-positional-arguments: Too many positional arguments to bound method `__init__`: expected 1, got 2 (too-many-positional-arguments) +""" diff --git a/conformance/results/ty/directives_assert_type.toml b/conformance/results/ty/directives_assert_type.toml new file mode 100644 index 00000000..81689e98 --- /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 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +directives_assert_type.py:28:5 - major: type-assertion-failure: Argument does not have asserted type `Any` (type-assertion-failure) +directives_assert_type.py:29:5 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +directives_assert_type.py:30:5 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +directives_assert_type.py:32:5 - major: missing-argument: No arguments provided for required parameters `value`, `type` of function `assert_type` (missing-argument) +directives_assert_type.py:33:5 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +directives_assert_type.py:34:31 - major: too-many-positional-arguments: Too many positional arguments to function `assert_type`: expected 2, got 3 (too-many-positional-arguments) +""" diff --git a/conformance/results/ty/directives_cast.toml b/conformance/results/ty/directives_cast.toml new file mode 100644 index 00000000..0fc01411 --- /dev/null +++ b/conformance/results/ty/directives_cast.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_cast.py:15:8 - major: missing-argument: No arguments provided for required parameters `typ`, `val` of function `cast` (missing-argument) +directives_cast.py:16:13 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +directives_cast.py:17:22 - major: too-many-positional-arguments: Too many positional arguments to function `cast`: expected 2, got 3 (too-many-positional-arguments) +""" diff --git a/conformance/results/ty/directives_deprecated.toml b/conformance/results/ty/directives_deprecated.toml new file mode 100644 index 00000000..92c20d71 --- /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 - minor: deprecated: The class `Ham` is deprecated (deprecated) +directives_deprecated.py:24:9 - minor: deprecated: The function `norwegian_blue` is deprecated (deprecated) +directives_deprecated.py:25:13 - minor: deprecated: The function `norwegian_blue` is deprecated (deprecated) +directives_deprecated.py:34:7 - minor: deprecated: The class `Ham` is deprecated (deprecated) +directives_deprecated.py:69:1 - minor: deprecated: The function `lorem` is deprecated (deprecated) +directives_deprecated.py:98:7 - minor: 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 00000000..eb8c0535 --- /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 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +directives_no_type_check.py:29:7 - major: invalid-argument-type: Argument to function `func1` is incorrect (invalid-argument-type) +directives_no_type_check.py:29:19 - major: invalid-argument-type: Argument to function `func1` is incorrect (invalid-argument-type) +directives_no_type_check.py:32:1 - major: missing-argument: No arguments provided for required parameters `a`, `b` of function `func1` (missing-argument) +""" diff --git a/conformance/results/ty/directives_reveal_type.toml b/conformance/results/ty/directives_reveal_type.toml new file mode 100644 index 00000000..a362110b --- /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 (revealed-type) +directives_reveal_type.py:15:17 - info: revealed-type: Revealed type (revealed-type) +directives_reveal_type.py:16:17 - info: revealed-type: Revealed type (revealed-type) +directives_reveal_type.py:17:17 - info: revealed-type: Revealed type (revealed-type) +directives_reveal_type.py:19:5 - major: missing-argument: No argument provided for required parameter `obj` of function `reveal_type` (missing-argument) +directives_reveal_type.py:20:20 - major: too-many-positional-arguments: Too many positional arguments to function `reveal_type`: expected 1, got 2 (too-many-positional-arguments) +""" diff --git a/conformance/results/ty/directives_type_checking.toml b/conformance/results/ty/directives_type_checking.toml new file mode 100644 index 00000000..1a700ba9 --- /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 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment)'] +""" +output = """ +directives_type_checking.py:11:14 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +""" diff --git a/conformance/results/ty/directives_type_ignore.toml b/conformance/results/ty/directives_type_ignore.toml new file mode 100644 index 00000000..cdd4d0cd --- /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 00000000..cdd4d0cd --- /dev/null +++ b/conformance/results/ty/directives_type_ignore_file1.toml @@ -0,0 +1,5 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +""" 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 00000000..e9aa6948 --- /dev/null +++ b/conformance/results/ty/directives_type_ignore_file2.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +directives_type_ignore_file2.py:14:10 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +""" diff --git a/conformance/results/ty/directives_version_platform.toml b/conformance/results/ty/directives_version_platform.toml new file mode 100644 index 00000000..addf1725 --- /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 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment)'] +Line 22: Unexpected errors ['directives_version_platform.py:22:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment)'] +Line 31: Unexpected errors ['directives_version_platform.py:31:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment)'] +Line 36: Unexpected errors ['directives_version_platform.py:36:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment)'] +""" +output = """ +directives_version_platform.py:14:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +directives_version_platform.py:19:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +directives_version_platform.py:22:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +directives_version_platform.py:27:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +directives_version_platform.py:31:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +directives_version_platform.py:36:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +directives_version_platform.py:40:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +directives_version_platform.py:45:17 - major: invalid-assignment: Object of type `Literal[""]` is not assignable to `int` (invalid-assignment) +""" diff --git a/conformance/results/ty/enums_behaviors.toml b/conformance/results/ty/enums_behaviors.toml new file mode 100644 index 00000000..0e809f4a --- /dev/null +++ b/conformance/results/ty/enums_behaviors.toml @@ -0,0 +1,8 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +enums_behaviors.py:28:1 - major: type-assertion-failure: Argument does not have asserted type `Literal[Color.RED]` (type-assertion-failure) +enums_behaviors.py:32:1 - major: type-assertion-failure: Argument does not have asserted type `Literal[Color.BLUE]` (type-assertion-failure) +enums_behaviors.py:44:21 - major: subclass-of-final-class: Class `ExtendedShape` cannot inherit from final class `Shape` (subclass-of-final-class) +""" diff --git a/conformance/results/ty/enums_definition.toml b/conformance/results/ty/enums_definition.toml new file mode 100644 index 00000000..cdd4d0cd --- /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 00000000..4c155130 --- /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 - major: type-assertion-failure: Argument does not have asserted type `CustomFlags` (type-assertion-failure)'] +""" +output = """ +enums_expansion.py:52:9 - major: type-assertion-failure: Argument does not have asserted type `CustomFlags` (type-assertion-failure) +""" diff --git a/conformance/results/ty/enums_member_names.toml b/conformance/results/ty/enums_member_names.toml new file mode 100644 index 00000000..c19d4f5e --- /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 - major: type-assertion-failure: Argument does not have asserted type `Literal["RED", "BLUE", "GREEN"]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/enums_member_values.toml b/conformance/results/ty/enums_member_values.toml new file mode 100644 index 00000000..19dd2b28 --- /dev/null +++ b/conformance/results/ty/enums_member_values.toml @@ -0,0 +1,10 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 78: Expected 1 errors +""" +output = """ +enums_member_values.py:30:5 - major: type-assertion-failure: Argument does not have asserted type `Literal[1, 2, 3]` (type-assertion-failure) +enums_member_values.py:54:1 - major: type-assertion-failure: Argument does not have asserted type `Literal[1]` (type-assertion-failure) +enums_member_values.py:85:9 - major: invalid-assignment: Object of type `int` is not assignable to attribute `_value_` of type `str` (invalid-assignment) +enums_member_values.py:96:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +""" diff --git a/conformance/results/ty/enums_members.toml b/conformance/results/ty/enums_members.toml new file mode 100644 index 00000000..7c187515 --- /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 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +enums_members.py:83:20 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +enums_members.py:84:18 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +enums_members.py:85:16 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +enums_members.py:116:1 - major: type-assertion-failure: Argument does not have asserted type `Unknown` (type-assertion-failure) +enums_members.py:116:32 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +enums_members.py:128:21 - info: revealed-type: Revealed type (revealed-type) +enums_members.py:129:9 - major: type-assertion-failure: Argument does not have asserted type `Unknown` (type-assertion-failure) +enums_members.py:129:43 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +enums_members.py:146:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +enums_members.py:147:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +""" diff --git a/conformance/results/ty/exceptions_context_managers.toml b/conformance/results/ty/exceptions_context_managers.toml new file mode 100644 index 00000000..c272dc68 --- /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 - major: type-assertion-failure: Argument does not have asserted type `int | str` (type-assertion-failure)'] +Line 57: Unexpected errors ['exceptions_context_managers.py:57:5 - major: type-assertion-failure: Argument does not have asserted type `int | str` (type-assertion-failure)'] +""" +output = """ +exceptions_context_managers.py:50:5 - major: type-assertion-failure: Argument does not have asserted type `int | str` (type-assertion-failure) +exceptions_context_managers.py:57:5 - major: type-assertion-failure: Argument does not have asserted type `int | str` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_base_class.toml b/conformance/results/ty/generics_base_class.toml new file mode 100644 index 00000000..cdf71499 --- /dev/null +++ b/conformance/results/ty/generics_base_class.toml @@ -0,0 +1,14 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 68: Expected 1 errors +Line 98: Expected 1 errors +Line 45: Unexpected errors ['generics_base_class.py:45:5 - major: type-assertion-failure: Argument does not have asserted type `Iterator[int]` (type-assertion-failure)'] +""" +output = """ +generics_base_class.py:26:26 - major: invalid-argument-type: Argument to function `takes_dict_incorrect` is incorrect (invalid-argument-type) +generics_base_class.py:29:14 - major: invalid-type-form: `typing.Generic` is not allowed in type expressions (invalid-type-form) +generics_base_class.py:30:8 - major: invalid-type-form: `typing.Generic` is not allowed in type expressions (invalid-type-form) +generics_base_class.py:45:5 - major: type-assertion-failure: Argument does not have asserted type `Iterator[int]` (type-assertion-failure) +generics_base_class.py:49:38 - major: invalid-type-arguments: Too many type arguments to class `LinkedList`: expected 1, got 2 (invalid-type-arguments) +generics_base_class.py:61:30 - major: invalid-type-arguments: Too many type arguments to class `MyDict`: expected 1, got 2 (invalid-type-arguments) +""" diff --git a/conformance/results/ty/generics_basic.toml b/conformance/results/ty/generics_basic.toml new file mode 100644 index 00000000..758d4a61 --- /dev/null +++ b/conformance/results/ty/generics_basic.toml @@ -0,0 +1,26 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 55: Expected 1 errors +Line 69: Expected 1 errors +Line 121: Expected 1 errors +Line 208: Expected 1 errors +Line 34: Unexpected errors ['generics_basic.py:34:12 - major: unsupported-operator: Unsupported `+` operation (unsupported-operator)'] +Line 139: Unexpected errors ['generics_basic.py:139:5 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 140: Unexpected errors ['generics_basic.py:140:5 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 199: Unexpected errors ['generics_basic.py:199:5 - major: type-assertion-failure: Argument does not have asserted type `Iterator[Any]` (type-assertion-failure)'] +""" +output = """ +generics_basic.py:34:12 - major: unsupported-operator: Unsupported `+` operation (unsupported-operator) +generics_basic.py:49:44 - major: invalid-legacy-type-variable: A `TypeVar` cannot have exactly one constraint (invalid-legacy-type-variable) +generics_basic.py:139:5 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +generics_basic.py:140:5 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +generics_basic.py:157:5 - major: 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]` (invalid-argument-type) +generics_basic.py:158:5 - major: 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]` (invalid-argument-type) +generics_basic.py:162:12 - major: invalid-argument-type: `` is not a valid argument to `Generic` (invalid-argument-type) +generics_basic.py:163:12 - major: invalid-argument-type: `` is not a valid argument to `Protocol` (invalid-argument-type) +generics_basic.py:171:1 - major: invalid-generic-class: `Generic` base class must include all type variables used in other base classes (invalid-generic-class) +generics_basic.py:172:1 - major: invalid-generic-class: `Generic` base class must include all type variables used in other base classes (invalid-generic-class) +generics_basic.py:199:5 - major: type-assertion-failure: Argument does not have asserted type `Iterator[Any]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_defaults.toml b/conformance/results/ty/generics_defaults.toml new file mode 100644 index 00000000..ba52e9a2 --- /dev/null +++ b/conformance/results/ty/generics_defaults.toml @@ -0,0 +1,43 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 107: Expected 1 errors +Line 114: Expected 1 errors +Line 143: Expected 1 errors +Line 30: Unexpected errors ['generics_defaults.py:30:1 - major: type-assertion-failure: Argument does not have asserted type `type[NoNonDefaults[str, int]]` (type-assertion-failure)'] +Line 31: Unexpected errors ['generics_defaults.py:31:1 - major: type-assertion-failure: Argument does not have asserted type `type[NoNonDefaults[str, int]]` (type-assertion-failure)'] +Line 32: Unexpected errors ['generics_defaults.py:32:1 - major: type-assertion-failure: Argument does not have asserted type `type[NoNonDefaults[str, int]]` (type-assertion-failure)'] +Line 38: Unexpected errors ['generics_defaults.py:38:1 - major: type-assertion-failure: Argument does not have asserted type `type[OneDefault[int | float, bool]]` (type-assertion-failure)'] +Line 45: Unexpected errors ['generics_defaults.py:45:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[Any, Any, str, int, bool]]` (type-assertion-failure)'] +Line 46: Unexpected errors ['generics_defaults.py:46:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure)'] +Line 52: Unexpected errors ['generics_defaults.py:52:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure)'] +Line 55: Unexpected errors ['generics_defaults.py:55:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure)'] +Line 59: Unexpected errors ['generics_defaults.py:59:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure)'] +Line 63: Unexpected errors ['generics_defaults.py:63:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure)'] +Line 79: Unexpected errors ['generics_defaults.py:79:1 - major: type-assertion-failure: Argument does not have asserted type `type[Class_ParamSpec[(str, int, /)]]` (type-assertion-failure)'] +Line 94: Unexpected errors ['generics_defaults.py:94:1 - major: type-assertion-failure: Argument does not have asserted type `@Todo` (type-assertion-failure)'] +Line 95: Unexpected errors ['generics_defaults.py:95:1 - major: type-assertion-failure: Argument does not have asserted type `@Todo` (type-assertion-failure)'] +Line 156: Unexpected errors ['generics_defaults.py:156:49 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form)'] +Line 157: Unexpected errors ['generics_defaults.py:157:58 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form)'] +Line 171: Unexpected errors ['generics_defaults.py:171:1 - major: type-assertion-failure: Argument does not have asserted type `(Foo7[int], /) -> Foo7[int]` (type-assertion-failure)'] +""" +output = """ +generics_defaults.py:24:40 - major: invalid-generic-class: Type parameters without defaults cannot follow type parameters with defaults (invalid-generic-class) +generics_defaults.py:30:1 - major: type-assertion-failure: Argument does not have asserted type `type[NoNonDefaults[str, int]]` (type-assertion-failure) +generics_defaults.py:31:1 - major: type-assertion-failure: Argument does not have asserted type `type[NoNonDefaults[str, int]]` (type-assertion-failure) +generics_defaults.py:32:1 - major: type-assertion-failure: Argument does not have asserted type `type[NoNonDefaults[str, int]]` (type-assertion-failure) +generics_defaults.py:38:1 - major: type-assertion-failure: Argument does not have asserted type `type[OneDefault[int | float, bool]]` (type-assertion-failure) +generics_defaults.py:45:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[Any, Any, str, int, bool]]` (type-assertion-failure) +generics_defaults.py:46:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure) +generics_defaults.py:50:1 - major: invalid-type-arguments: No type argument provided for required type variable `T2` of class `AllTheDefaults` (invalid-type-arguments) +generics_defaults.py:52:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure) +generics_defaults.py:55:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure) +generics_defaults.py:59:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure) +generics_defaults.py:63:1 - major: type-assertion-failure: Argument does not have asserted type `type[AllTheDefaults[int, int | float | complex, str, int, bool]]` (type-assertion-failure) +generics_defaults.py:79:1 - major: type-assertion-failure: Argument does not have asserted type `type[Class_ParamSpec[(str, int, /)]]` (type-assertion-failure) +generics_defaults.py:94:1 - major: type-assertion-failure: Argument does not have asserted type `@Todo` (type-assertion-failure) +generics_defaults.py:95:1 - major: type-assertion-failure: Argument does not have asserted type `@Todo` (type-assertion-failure) +generics_defaults.py:132:1 - major: type-assertion-failure: Argument does not have asserted type `Any` (type-assertion-failure) +generics_defaults.py:156:49 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form) +generics_defaults.py:157:58 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form) +generics_defaults.py:171:1 - major: type-assertion-failure: Argument does not have asserted type `(Foo7[int], /) -> Foo7[int]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_defaults_referential.toml b/conformance/results/ty/generics_defaults_referential.toml new file mode 100644 index 00000000..5ca2ddb4 --- /dev/null +++ b/conformance/results/ty/generics_defaults_referential.toml @@ -0,0 +1,18 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 53: Expected 1 errors +Line 60: Expected 1 errors +Line 68: Expected 1 errors +Line 74: Expected 1 errors +Line 78: Expected 1 errors +Line 23: Unexpected errors ['generics_defaults_referential.py:23:1 - major: type-assertion-failure: Argument does not have asserted type `type[slice[int, int, int | None]]` (type-assertion-failure)'] +Line 94: Unexpected errors ['generics_defaults_referential.py:94:1 - major: type-assertion-failure: Argument does not have asserted type `type[Bar[Any, list[Any]]]` (type-assertion-failure)'] +Line 95: Unexpected errors ['generics_defaults_referential.py:95:1 - major: type-assertion-failure: Argument does not have asserted type `type[Bar[int, list[int]]]` (type-assertion-failure)'] +""" +output = """ +generics_defaults_referential.py:23:1 - major: type-assertion-failure: Argument does not have asserted type `type[slice[int, int, int | None]]` (type-assertion-failure) +generics_defaults_referential.py:36:13 - major: invalid-argument-type: Argument to bound method `__init__` is incorrect (invalid-argument-type) +generics_defaults_referential.py:37:10 - major: invalid-argument-type: Argument to bound method `__init__` is incorrect (invalid-argument-type) +generics_defaults_referential.py:94:1 - major: type-assertion-failure: Argument does not have asserted type `type[Bar[Any, list[Any]]]` (type-assertion-failure) +generics_defaults_referential.py:95:1 - major: type-assertion-failure: Argument does not have asserted type `type[Bar[int, list[int]]]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_defaults_specialization.toml b/conformance/results/ty/generics_defaults_specialization.toml new file mode 100644 index 00000000..8a8613f2 --- /dev/null +++ b/conformance/results/ty/generics_defaults_specialization.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 55: Expected 1 errors +Line 45: Unexpected errors ['generics_defaults_specialization.py:45:1 - major: type-assertion-failure: Argument does not have asserted type `type[Bar[str]]` (type-assertion-failure)'] +""" +output = """ +generics_defaults_specialization.py:30:15 - major: invalid-type-arguments: Too many type arguments: expected between 0 and 1, got 2 (invalid-type-arguments) +generics_defaults_specialization.py:45:1 - major: type-assertion-failure: Argument does not have asserted type `type[Bar[str]]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_paramspec_basic.toml b/conformance/results/ty/generics_paramspec_basic.toml new file mode 100644 index 00000000..262b8bf2 --- /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 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 - major: invalid-paramspec: The name of a `ParamSpec` (`NotIt`) must match the name of the variable it is assigned to (`WrongName`) (invalid-paramspec) +generics_paramspec_basic.py:23:20 - major: invalid-return-type: Function always implicitly returns `None`, which is not assignable to return type `P@func1` (invalid-return-type) +""" diff --git a/conformance/results/ty/generics_paramspec_components.toml b/conformance/results/ty/generics_paramspec_components.toml new file mode 100644 index 00000000..6f3dc103 --- /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 - major: invalid-type-form: `P.kwargs` is valid only in `**kwargs` annotation (invalid-type-form) +generics_paramspec_components.py:17:45 - major: invalid-type-form: `P.args` is valid only in `*args` annotation (invalid-type-form) +generics_paramspec_components.py:23:46 - major: invalid-type-form: `P.args` is valid only in `*args` annotation (invalid-type-form) +generics_paramspec_components.py:49:11 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +generics_paramspec_components.py:49:20 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +generics_paramspec_components.py:51:11 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +generics_paramspec_components.py:83:18 - major: invalid-argument-type: Argument to function `foo` is incorrect (invalid-argument-type) +generics_paramspec_components.py:83:18 - major: parameter-already-assigned: Multiple values provided for parameter 1 (`x`) of function `foo` (parameter-already-assigned) +generics_paramspec_components.py:98:7 - major: invalid-argument-type: Argument to function `twice` is incorrect (invalid-argument-type) +generics_paramspec_components.py:98:20 - major: invalid-argument-type: Argument to function `twice` is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/generics_paramspec_semantics.toml b/conformance/results/ty/generics_paramspec_semantics.toml new file mode 100644 index 00000000..a21e156b --- /dev/null +++ b/conformance/results/ty/generics_paramspec_semantics.toml @@ -0,0 +1,16 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 98: Expected 1 errors +Line 108: Expected 1 errors +Line 120: Expected 1 errors +Line 127: Expected 1 errors +Line 132: Expected 1 errors +Line 137: Expected 1 errors +""" +output = """ +generics_paramspec_semantics.py:26:4 - major: positional-only-parameter-as-kwarg: Positional-only parameter 1 (`a`) passed as keyword argument (positional-only-parameter-as-kwarg) +generics_paramspec_semantics.py:26:11 - major: positional-only-parameter-as-kwarg: Positional-only parameter 2 (`b`) passed as keyword argument (positional-only-parameter-as-kwarg) +generics_paramspec_semantics.py:27:9 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +generics_paramspec_semantics.py:46:17 - major: invalid-argument-type: Argument to function `func1` is incorrect (invalid-argument-type) +generics_paramspec_semantics.py:61:23 - major: invalid-argument-type: Argument to function `func1` is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/generics_paramspec_specialization.toml b/conformance/results/ty/generics_paramspec_specialization.toml new file mode 100644 index 00000000..fa92810e --- /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 - major: invalid-type-arguments: Type argument for `ParamSpec` must be either a list of types, `ParamSpec`, `Concatenate`, or `...` (invalid-type-arguments) +generics_paramspec_specialization.py:54:9 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +generics_paramspec_specialization.py:55:16 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +generics_paramspec_specialization.py:60:9 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +generics_paramspec_specialization.py:61:16 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/generics_scoping.toml b/conformance/results/ty/generics_scoping.toml new file mode 100644 index 00000000..96df4a0e --- /dev/null +++ b/conformance/results/ty/generics_scoping.toml @@ -0,0 +1,23 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 29: Expected 1 errors +Line 50: Expected 1 errors +Line 54: Expected 1 errors +Line 78: Expected 1 errors +Line 87: Expected 1 errors +Line 94: Expected 1 errors +Line 95: Expected 1 errors +Line 96: Expected 1 errors +Line 14: Unexpected errors ['generics_scoping.py:14:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 15: Unexpected errors ['generics_scoping.py:15:1 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure)'] +Line 42: Unexpected errors ['generics_scoping.py:42:1 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure)'] +Line 43: Unexpected errors ['generics_scoping.py:43:1 - major: type-assertion-failure: Argument does not have asserted type `bytes` (type-assertion-failure)'] +""" +output = """ +generics_scoping.py:14:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +generics_scoping.py:15:1 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure) +generics_scoping.py:42:1 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure) +generics_scoping.py:43:1 - major: type-assertion-failure: Argument does not have asserted type `bytes` (type-assertion-failure) +generics_scoping.py:65:11 - major: invalid-generic-class: Generic class `MyGeneric` must not reference type variables bound in an enclosing scope (invalid-generic-class) +generics_scoping.py:75:11 - major: invalid-generic-class: Generic class `Bad` must not reference type variables bound in an enclosing scope (invalid-generic-class) +""" diff --git a/conformance/results/ty/generics_self_advanced.toml b/conformance/results/ty/generics_self_advanced.toml new file mode 100644 index 00000000..d3c6d9fb --- /dev/null +++ b/conformance/results/ty/generics_self_advanced.toml @@ -0,0 +1,13 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 36: Unexpected errors ['generics_self_advanced.py:36:9 - major: type-assertion-failure: Argument does not have asserted type `list[Self@method2]` (type-assertion-failure)'] +Line 37: Unexpected errors ['generics_self_advanced.py:37:9 - major: type-assertion-failure: Argument does not have asserted type `Self@method2` (type-assertion-failure)'] +Line 43: Unexpected errors ['generics_self_advanced.py:43:9 - major: type-assertion-failure: Argument does not have asserted type `list[Self@method3]` (type-assertion-failure)'] +Line 44: Unexpected errors ['generics_self_advanced.py:44:9 - major: type-assertion-failure: Argument does not have asserted type `Self@method3` (type-assertion-failure)'] +""" +output = """ +generics_self_advanced.py:36:9 - major: type-assertion-failure: Argument does not have asserted type `list[Self@method2]` (type-assertion-failure) +generics_self_advanced.py:37:9 - major: type-assertion-failure: Argument does not have asserted type `Self@method2` (type-assertion-failure) +generics_self_advanced.py:43:9 - major: type-assertion-failure: Argument does not have asserted type `list[Self@method3]` (type-assertion-failure) +generics_self_advanced.py:44:9 - major: type-assertion-failure: Argument does not have asserted type `Self@method3` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_self_attributes.toml b/conformance/results/ty/generics_self_attributes.toml new file mode 100644 index 00000000..86168442 --- /dev/null +++ b/conformance/results/ty/generics_self_attributes.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 29: Unexpected errors ["generics_self_attributes.py:29:5 - major: invalid-assignment: Object of type `OrdinalLinkedList` is not assignable to attribute `next` of type ` | None` (invalid-assignment)"] +""" +output = """ +generics_self_attributes.py:26:33 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +generics_self_attributes.py:29:5 - major: invalid-assignment: Object of type `OrdinalLinkedList` is not assignable to attribute `next` of type ` | None` (invalid-assignment) +generics_self_attributes.py:32:5 - major: invalid-assignment: Object of type `LinkedList[int]` is not assignable to attribute `next` of type ` | None` (invalid-assignment) +""" diff --git a/conformance/results/ty/generics_self_basic.toml b/conformance/results/ty/generics_self_basic.toml new file mode 100644 index 00000000..20568bde --- /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 - major: invalid-return-type: Return type does not match returned value (invalid-return-type) +generics_self_basic.py:33:16 - major: invalid-return-type: Return type does not match returned value (invalid-return-type) +generics_self_basic.py:68:26 - major: invalid-type-form: Special form `typing.Self` expected no type parameter (invalid-type-form) +""" diff --git a/conformance/results/ty/generics_self_protocols.toml b/conformance/results/ty/generics_self_protocols.toml new file mode 100644 index 00000000..55834dc4 --- /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 - major: invalid-argument-type: Argument to function `accepts_shape` is incorrect (invalid-argument-type) +generics_self_protocols.py:64:19 - major: invalid-argument-type: Argument to function `accepts_shape` is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/generics_self_usage.toml b/conformance/results/ty/generics_self_usage.toml new file mode 100644 index 00000000..25429da4 --- /dev/null +++ b/conformance/results/ty/generics_self_usage.toml @@ -0,0 +1,19 @@ +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 +Line 50: Unexpected errors ["generics_self_usage.py:50:34 - major: invalid-assignment: Object of type `def foo(self) -> int` is not assignable to `(, /) -> int` (invalid-assignment)"] +""" +output = """ +generics_self_usage.py:50:34 - major: invalid-assignment: Object of type `def foo(self) -> int` is not assignable to `(, /) -> int` (invalid-assignment) +generics_self_usage.py:73:14 - major: invalid-type-form: Variable of type `` is not allowed in a type expression (invalid-type-form) +generics_self_usage.py:73:23 - major: invalid-type-form: Variable of type `` is not allowed in a type expression (invalid-type-form) +generics_self_usage.py:76:6 - major: invalid-type-form: Variable of type `` is not allowed in a type expression (invalid-type-form) +generics_self_usage.py:87:16 - major: invalid-return-type: Return type does not match returned value (invalid-return-type) +generics_self_usage.py:103:15 - major: invalid-type-form: Variable of type `` is not allowed in a type expression (invalid-type-form) +generics_self_usage.py:105:12 - major: invalid-base: Invalid class base with type `` (invalid-base) +generics_self_usage.py:108:30 - major: invalid-type-form: Variable of type `` is not allowed in a type expression (invalid-type-form) +""" diff --git a/conformance/results/ty/generics_syntax_compatibility.toml b/conformance/results/ty/generics_syntax_compatibility.toml new file mode 100644 index 00000000..c2a2f515 --- /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 00000000..c47bfae8 --- /dev/null +++ b/conformance/results/ty/generics_syntax_declarations.toml @@ -0,0 +1,15 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 44: Expected 1 errors +""" +output = """ +generics_syntax_declarations.py:17:1 - major: invalid-generic-class: Cannot both inherit from `typing.Generic` and use PEP 695 type variables (invalid-generic-class) +generics_syntax_declarations.py:25:20 - major: invalid-generic-class: Cannot both inherit from subscripted `Protocol` and use PEP 695 type variables (invalid-generic-class) +generics_syntax_declarations.py:32:9 - major: unresolved-attribute: Object of type `T@ClassD` has no attribute `is_integer` (unresolved-attribute) +generics_syntax_declarations.py:48:17 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form) +generics_syntax_declarations.py:60:17 - major: invalid-type-variable-constraints: TypeVar must have at least two constrained types (invalid-type-variable-constraints) +generics_syntax_declarations.py:64:17 - major: invalid-type-variable-constraints: TypeVar must have at least two constrained types (invalid-type-variable-constraints) +generics_syntax_declarations.py:71:17 - major: invalid-type-form: Variable of type `tuple[, ]` is not allowed in a type expression (invalid-type-form) +generics_syntax_declarations.py:75:18 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +generics_syntax_declarations.py:79:23 - major: unresolved-reference: Name `S` used when not defined (unresolved-reference) +""" 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 00000000..a5c6ac7e --- /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 - major: invalid-assignment: Object of type `ShouldBeCovariant1[int]` is not assignable to `ShouldBeCovariant1[int | float]` (invalid-assignment)'] +Line 46: Unexpected errors ['generics_syntax_infer_variance.py:46:37 - major: invalid-assignment: Object of type `ShouldBeCovariant2[int]` is not assignable to `ShouldBeCovariant2[int | float]` (invalid-assignment)'] +Line 55: Unexpected errors ['generics_syntax_infer_variance.py:55:37 - major: invalid-assignment: Object of type `ShouldBeCovariant3[int]` is not assignable to `ShouldBeCovariant3[int | float]` (invalid-assignment)'] +Line 84: Unexpected errors ['generics_syntax_infer_variance.py:84:36 - major: invalid-assignment: Object of type `ShouldBeCovariant5[int]` is not assignable to `ShouldBeCovariant5[int | float]` (invalid-assignment)'] +Line 92: Unexpected errors ['generics_syntax_infer_variance.py:92:9 - major: invalid-assignment: Cannot assign to final attribute `x` on type `Self@__init__` (invalid-assignment)'] +Line 95: Unexpected errors ['generics_syntax_infer_variance.py:95:36 - major: invalid-assignment: Object of type `ShouldBeCovariant6[int]` is not assignable to `ShouldBeCovariant6[int | float]` (invalid-assignment)'] +Line 166: Unexpected errors ['generics_syntax_infer_variance.py:166:43 - major: invalid-assignment: Object of type `ShouldBeContravariant1[int | float]` is not assignable to `ShouldBeContravariant1[int]` (invalid-assignment)'] +""" +output = """ +generics_syntax_infer_variance.py:28:37 - major: invalid-assignment: Object of type `ShouldBeCovariant1[int]` is not assignable to `ShouldBeCovariant1[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:29:35 - major: invalid-assignment: Object of type `ShouldBeCovariant1[int | float]` is not assignable to `ShouldBeCovariant1[int]` (invalid-assignment) +generics_syntax_infer_variance.py:46:37 - major: invalid-assignment: Object of type `ShouldBeCovariant2[int]` is not assignable to `ShouldBeCovariant2[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:47:35 - major: invalid-assignment: Object of type `ShouldBeCovariant2[int | float]` is not assignable to `ShouldBeCovariant2[int]` (invalid-assignment) +generics_syntax_infer_variance.py:55:37 - major: invalid-assignment: Object of type `ShouldBeCovariant3[int]` is not assignable to `ShouldBeCovariant3[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:56:35 - major: invalid-assignment: Object of type `ShouldBeCovariant3[int | float]` is not assignable to `ShouldBeCovariant3[int]` (invalid-assignment) +generics_syntax_infer_variance.py:84:36 - major: invalid-assignment: Object of type `ShouldBeCovariant5[int]` is not assignable to `ShouldBeCovariant5[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:85:34 - major: invalid-assignment: Object of type `ShouldBeCovariant5[int | float]` is not assignable to `ShouldBeCovariant5[int]` (invalid-assignment) +generics_syntax_infer_variance.py:92:9 - major: invalid-assignment: Cannot assign to final attribute `x` on type `Self@__init__` (invalid-assignment) +generics_syntax_infer_variance.py:95:36 - major: invalid-assignment: Object of type `ShouldBeCovariant6[int]` is not assignable to `ShouldBeCovariant6[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:96:34 - major: invalid-assignment: Object of type `ShouldBeCovariant6[int | float]` is not assignable to `ShouldBeCovariant6[int]` (invalid-assignment) +generics_syntax_infer_variance.py:112:38 - major: invalid-assignment: Object of type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:113:36 - major: invalid-assignment: Object of type `ShouldBeInvariant1[int | float]` is not assignable to `ShouldBeInvariant1[int]` (invalid-assignment) +generics_syntax_infer_variance.py:127:38 - major: invalid-assignment: Object of type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:128:36 - major: invalid-assignment: Object of type `ShouldBeInvariant2[int | float]` is not assignable to `ShouldBeInvariant2[int]` (invalid-assignment) +generics_syntax_infer_variance.py:135:43 - major: invalid-assignment: Object of type `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[int | float, str]` (invalid-assignment) +generics_syntax_infer_variance.py:136:41 - major: invalid-assignment: Object of type `ShouldBeInvariant3[int | float, str]` is not assignable to `ShouldBeInvariant3[int, str]` (invalid-assignment) +generics_syntax_infer_variance.py:137:43 - major: invalid-assignment: Object of type `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:138:41 - major: invalid-assignment: Object of type `ShouldBeInvariant3[str, int | float]` is not assignable to `ShouldBeInvariant3[str, int]` (invalid-assignment) +generics_syntax_infer_variance.py:146:38 - major: invalid-assignment: Object of type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:154:38 - major: invalid-assignment: Object of type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:165:45 - major: invalid-assignment: Object of type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[int | float]` (invalid-assignment) +generics_syntax_infer_variance.py:166:43 - major: invalid-assignment: Object of type `ShouldBeContravariant1[int | float]` is not assignable to `ShouldBeContravariant1[int]` (invalid-assignment) +""" diff --git a/conformance/results/ty/generics_syntax_scoping.toml b/conformance/results/ty/generics_syntax_scoping.toml new file mode 100644 index 00000000..f5e5decf --- /dev/null +++ b/conformance/results/ty/generics_syntax_scoping.toml @@ -0,0 +1,20 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 14: Expected 1 errors +Line 18: Expected 1 errors +Line 92: Expected 1 errors +Line 95: Expected 1 errors +Line 98: Expected 1 errors +Line 113: Unexpected errors ['generics_syntax_scoping.py:113:9 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure)'] +Line 116: Unexpected errors ['generics_syntax_scoping.py:116:13 - major: type-assertion-failure: Argument does not have asserted type `TypeVar` (type-assertion-failure)'] +Line 121: Unexpected errors ['generics_syntax_scoping.py:121:9 - major: type-assertion-failure: Argument does not have asserted type `int | float | complex` (type-assertion-failure)'] +Line 124: Unexpected errors ['generics_syntax_scoping.py:124:13 - major: type-assertion-failure: Argument does not have asserted type `int | float | complex` (type-assertion-failure)'] +""" +output = """ +generics_syntax_scoping.py:35:7 - major: unresolved-reference: Name `T` used when not defined (unresolved-reference) +generics_syntax_scoping.py:44:17 - major: unresolved-reference: Name `T` used when not defined (unresolved-reference) +generics_syntax_scoping.py:113:9 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure) +generics_syntax_scoping.py:116:13 - major: type-assertion-failure: Argument does not have asserted type `TypeVar` (type-assertion-failure) +generics_syntax_scoping.py:121:9 - major: type-assertion-failure: Argument does not have asserted type `int | float | complex` (type-assertion-failure) +generics_syntax_scoping.py:124:13 - major: type-assertion-failure: Argument does not have asserted type `int | float | complex` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_type_erasure.toml b/conformance/results/ty/generics_type_erasure.toml new file mode 100644 index 00000000..359e6d8f --- /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 - major: invalid-argument-type: Argument to bound method `__init__` is incorrect (invalid-argument-type) +generics_type_erasure.py:40:16 - major: invalid-argument-type: Argument to bound method `__init__` is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/generics_typevartuple_args.toml b/conformance/results/ty/generics_typevartuple_args.toml new file mode 100644 index 00000000..781e7e92 --- /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 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, str]` (type-assertion-failure)'] +Line 31: Unexpected errors ['generics_typevartuple_args.py:31:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[()]` (type-assertion-failure)'] +Line 32: Unexpected errors ['generics_typevartuple_args.py:32:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, str]` (type-assertion-failure)'] +""" +output = """ +generics_typevartuple_args.py:20:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, str]` (type-assertion-failure) +generics_typevartuple_args.py:31:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[()]` (type-assertion-failure) +generics_typevartuple_args.py:32:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, str]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_typevartuple_basic.toml b/conformance/results/ty/generics_typevartuple_basic.toml new file mode 100644 index 00000000..e24a4339 --- /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 52: 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 - major: type-assertion-failure: Argument does not have asserted type `tuple[int]` (type-assertion-failure)'] +""" +output = """ +generics_typevartuple_basic.py:42:34 - major: invalid-argument-type: Argument to bound method `__init__` is incorrect (invalid-argument-type) +generics_typevartuple_basic.py:65:27 - major: unknown-argument: Argument `covariant` does not match any known parameter of function `__new__` (unknown-argument) +generics_typevartuple_basic.py:66:27 - major: too-many-positional-arguments: Too many positional arguments to function `__new__`: expected 2, got 4 (too-many-positional-arguments) +generics_typevartuple_basic.py:67:27 - major: unknown-argument: Argument `bound` does not match any known parameter of function `__new__` (unknown-argument) +generics_typevartuple_basic.py:84:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[int]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_typevartuple_callable.toml b/conformance/results/ty/generics_typevartuple_callable.toml new file mode 100644 index 00000000..b5966bcd --- /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 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, int, int | float | complex]` (type-assertion-failure)'] +Line 42: Unexpected errors ['generics_typevartuple_callable.py:42:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[str]` (type-assertion-failure)'] +Line 49: Unexpected errors ['generics_typevartuple_callable.py:49:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[int | float, str, int | float | complex]` (type-assertion-failure)'] +""" +output = """ +generics_typevartuple_callable.py:41:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, int, int | float | complex]` (type-assertion-failure) +generics_typevartuple_callable.py:42:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[str]` (type-assertion-failure) +generics_typevartuple_callable.py:49:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[int | float, str, int | float | complex]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_typevartuple_concat.toml b/conformance/results/ty/generics_typevartuple_concat.toml new file mode 100644 index 00000000..d1c474e3 --- /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 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, bool, str]` (type-assertion-failure)'] +""" +output = """ +generics_typevartuple_concat.py:52:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, bool, str]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/generics_typevartuple_overloads.toml b/conformance/results/ty/generics_typevartuple_overloads.toml new file mode 100644 index 00000000..cdd4d0cd --- /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 00000000..a8f1c65a --- /dev/null +++ b/conformance/results/ty/generics_typevartuple_specialization.toml @@ -0,0 +1,67 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 109: Expected 1 errors +Line 110: Expected 1 errors +Line 121: Expected 1 errors +Line 122: Expected 1 errors +Line 45: Unexpected errors ['generics_typevartuple_specialization.py:45:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)', 'generics_typevartuple_specialization.py:45:40 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 46: Unexpected errors ['generics_typevartuple_specialization.py:46:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, int | float, bool]` (type-assertion-failure)'] +Line 47: Unexpected errors ['generics_typevartuple_specialization.py:47:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, @Todo]` (type-assertion-failure)'] +Line 51: Unexpected errors ['generics_typevartuple_specialization.py:51:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[int]` (type-assertion-failure)'] +Line 52: Unexpected errors ['generics_typevartuple_specialization.py:52:37 - major: invalid-type-form: Tuple literals are not allowed in this context in a type expression (invalid-type-form)'] +Line 92: Unexpected errors ['generics_typevartuple_specialization.py:92:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)', 'generics_typevartuple_specialization.py:92:42 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 93: Unexpected errors ['generics_typevartuple_specialization.py:93:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, int]` (type-assertion-failure)'] +Line 94: Unexpected errors ['generics_typevartuple_specialization.py:94:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[int | float]` (type-assertion-failure)'] +Line 95: Unexpected errors ['generics_typevartuple_specialization.py:95:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[Any, *tuple[Any, ...]]` (type-assertion-failure)'] +Line 102: Unexpected errors ['generics_typevartuple_specialization.py:102:20 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 103: Unexpected errors ['generics_typevartuple_specialization.py:103:21 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 130: Unexpected errors ['generics_typevartuple_specialization.py:130:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 134: Unexpected errors ['generics_typevartuple_specialization.py:134:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)', 'generics_typevartuple_specialization.py:134:33 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)', 'generics_typevartuple_specialization.py:134:59 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 135: Unexpected errors ['generics_typevartuple_specialization.py:135:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[()], str, bool]` (type-assertion-failure)'] +Line 136: Unexpected errors ['generics_typevartuple_specialization.py:136:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[str], bool, int | float]` (type-assertion-failure)'] +Line 137: Unexpected errors ['generics_typevartuple_specialization.py:137:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[str, bool], int | float, int]` (type-assertion-failure)'] +Line 143: Unexpected errors ['generics_typevartuple_specialization.py:143:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 147: Unexpected errors ['generics_typevartuple_specialization.py:147:15 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)', 'generics_typevartuple_specialization.py:147:41 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 148: Unexpected errors ['generics_typevartuple_specialization.py:148:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[()], str, bool, int | float]` (type-assertion-failure)'] +Line 149: Unexpected errors ['generics_typevartuple_specialization.py:149:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[bool], str, int | float, int]` (type-assertion-failure)'] +Line 153: Unexpected errors ['generics_typevartuple_specialization.py:153:8 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 156: Unexpected errors ['generics_typevartuple_specialization.py:156:24 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)', 'generics_typevartuple_specialization.py:156:55 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable)'] +Line 157: Unexpected errors ['generics_typevartuple_specialization.py:157:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[*tuple[int, ...], int]` (type-assertion-failure)'] +Line 158: Unexpected errors ['generics_typevartuple_specialization.py:158:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[*tuple[int, ...], str]` (type-assertion-failure)'] +Line 159: Unexpected errors ['generics_typevartuple_specialization.py:159:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[*tuple[int, ...], str]` (type-assertion-failure)'] +""" +output = """ +generics_typevartuple_specialization.py:45:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:45:40 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:46:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, int | float, bool]` (type-assertion-failure) +generics_typevartuple_specialization.py:47:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, @Todo]` (type-assertion-failure) +generics_typevartuple_specialization.py:51:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[int]` (type-assertion-failure) +generics_typevartuple_specialization.py:52:37 - major: invalid-type-form: Tuple literals are not allowed in this context in a type expression (invalid-type-form) +generics_typevartuple_specialization.py:92:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:92:42 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:93:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, int]` (type-assertion-failure) +generics_typevartuple_specialization.py:94:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[int | float]` (type-assertion-failure) +generics_typevartuple_specialization.py:95:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[Any, *tuple[Any, ...]]` (type-assertion-failure) +generics_typevartuple_specialization.py:102:20 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:103:21 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:127:5 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:130:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:134:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:134:33 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:134:59 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:135:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[()], str, bool]` (type-assertion-failure) +generics_typevartuple_specialization.py:136:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[str], bool, int | float]` (type-assertion-failure) +generics_typevartuple_specialization.py:137:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[str, bool], int | float, int]` (type-assertion-failure) +generics_typevartuple_specialization.py:143:14 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:147:15 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:147:41 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:148:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[()], str, bool, int | float]` (type-assertion-failure) +generics_typevartuple_specialization.py:149:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[tuple[bool], str, int | float, int]` (type-assertion-failure) +generics_typevartuple_specialization.py:153:8 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:156:24 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:156:55 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +generics_typevartuple_specialization.py:157:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[*tuple[int, ...], int]` (type-assertion-failure) +generics_typevartuple_specialization.py:158:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[*tuple[int, ...], str]` (type-assertion-failure) +generics_typevartuple_specialization.py:159:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[*tuple[int, ...], str]` (type-assertion-failure) +generics_typevartuple_specialization.py:163:8 - major: non-subscriptable: Cannot subscript non-generic type (non-subscriptable) +""" diff --git a/conformance/results/ty/generics_typevartuple_unpack.toml b/conformance/results/ty/generics_typevartuple_unpack.toml new file mode 100644 index 00000000..0ad3bee3 --- /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 00000000..72d65a99 --- /dev/null +++ b/conformance/results/ty/generics_upper_bound.toml @@ -0,0 +1,14 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 24: Expected 1 errors +Line 37: Unexpected errors ['generics_upper_bound.py:37:1 - major: type-assertion-failure: Argument does not have asserted type `list[int]` (type-assertion-failure)'] +Line 38: Unexpected errors ['generics_upper_bound.py:38:1 - major: type-assertion-failure: Argument does not have asserted type `set[int]` (type-assertion-failure)'] +""" +output = """ +generics_upper_bound.py:37:1 - major: type-assertion-failure: Argument does not have asserted type `list[int]` (type-assertion-failure) +generics_upper_bound.py:38:1 - major: type-assertion-failure: Argument does not have asserted type `set[int]` (type-assertion-failure) +generics_upper_bound.py:43:1 - major: type-assertion-failure: Argument does not have asserted type `list[int] | set[int]` (type-assertion-failure) +generics_upper_bound.py:51:8 - major: invalid-argument-type: Argument to function `longer` is incorrect (invalid-argument-type) +generics_upper_bound.py:51:11 - major: invalid-argument-type: Argument to function `longer` is incorrect (invalid-argument-type) +generics_upper_bound.py:56:10 - major: invalid-legacy-type-variable: A `TypeVar` cannot have both a bound and constraints (invalid-legacy-type-variable) +""" diff --git a/conformance/results/ty/generics_variance.toml b/conformance/results/ty/generics_variance.toml new file mode 100644 index 00000000..6342cfc4 --- /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 - major: invalid-legacy-type-variable: A `TypeVar` cannot be both covariant and contravariant (invalid-legacy-type-variable) +""" diff --git a/conformance/results/ty/generics_variance_inference.toml b/conformance/results/ty/generics_variance_inference.toml new file mode 100644 index 00000000..461b7477 --- /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 - major: invalid-assignment: Object of type `ClassA[int | float, int, int]` is not assignable to `ClassA[int, int, int]` (invalid-assignment) +generics_variance_inference.py:25:37 - major: invalid-assignment: Object of type `ClassA[int | float, int, int]` is not assignable to `ClassA[int | float, int | float, int]` (invalid-assignment) +generics_variance_inference.py:28:33 - major: invalid-assignment: Object of type `ClassA[int, int | float, int | float]` is not assignable to `ClassA[int, int, int]` (invalid-assignment) +generics_variance_inference.py:41:35 - major: invalid-assignment: Object of type `ShouldBeCovariant1[int | float]` is not assignable to `ShouldBeCovariant1[int]` (invalid-assignment) +generics_variance_inference.py:49:35 - major: invalid-assignment: Object of type `ShouldBeCovariant2[int | float]` is not assignable to `ShouldBeCovariant2[int]` (invalid-assignment) +generics_variance_inference.py:58:35 - major: invalid-assignment: Object of type `ShouldBeCovariant3[int | float]` is not assignable to `ShouldBeCovariant3[int]` (invalid-assignment) +generics_variance_inference.py:67:34 - major: invalid-assignment: Object of type `ShouldBeCovariant4[int | float]` is not assignable to `ShouldBeCovariant4[int]` (invalid-assignment) +generics_variance_inference.py:80:34 - major: invalid-assignment: Object of type `ShouldBeCovariant5[int | float]` is not assignable to `ShouldBeCovariant5[int]` (invalid-assignment) +generics_variance_inference.py:96:38 - major: invalid-assignment: Object of type `ShouldBeInvariant1[int]` is not assignable to `ShouldBeInvariant1[int | float]` (invalid-assignment) +generics_variance_inference.py:97:36 - major: invalid-assignment: Object of type `ShouldBeInvariant1[int | float]` is not assignable to `ShouldBeInvariant1[int]` (invalid-assignment) +generics_variance_inference.py:111:38 - major: invalid-assignment: Object of type `ShouldBeInvariant2[int]` is not assignable to `ShouldBeInvariant2[int | float]` (invalid-assignment) +generics_variance_inference.py:112:36 - major: invalid-assignment: Object of type `ShouldBeInvariant2[int | float]` is not assignable to `ShouldBeInvariant2[int]` (invalid-assignment) +generics_variance_inference.py:119:43 - major: invalid-assignment: Object of type `ShouldBeInvariant3[int, str]` is not assignable to `ShouldBeInvariant3[int | float, str]` (invalid-assignment) +generics_variance_inference.py:120:41 - major: invalid-assignment: Object of type `ShouldBeInvariant3[int | float, str]` is not assignable to `ShouldBeInvariant3[int, str]` (invalid-assignment) +generics_variance_inference.py:121:43 - major: invalid-assignment: Object of type `ShouldBeInvariant3[str, int]` is not assignable to `ShouldBeInvariant3[str, int | float]` (invalid-assignment) +generics_variance_inference.py:122:41 - major: invalid-assignment: Object of type `ShouldBeInvariant3[str, int | float]` is not assignable to `ShouldBeInvariant3[str, int]` (invalid-assignment) +generics_variance_inference.py:130:38 - major: invalid-assignment: Object of type `ShouldBeInvariant4[int]` is not assignable to `ShouldBeInvariant4[int | float]` (invalid-assignment) +generics_variance_inference.py:138:38 - major: invalid-assignment: Object of type `ShouldBeInvariant5[int]` is not assignable to `ShouldBeInvariant5[int | float]` (invalid-assignment) +generics_variance_inference.py:149:45 - major: invalid-assignment: Object of type `ShouldBeContravariant1[int]` is not assignable to `ShouldBeContravariant1[int | float]` (invalid-assignment) +generics_variance_inference.py:169:31 - major: invalid-assignment: Object of type `ShouldBeInvariant6[int | float]` is not assignable to `ShouldBeInvariant6[int]` (invalid-assignment) +generics_variance_inference.py:170:33 - major: invalid-assignment: Object of type `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[int | float]` (invalid-assignment) +generics_variance_inference.py:181:31 - major: invalid-assignment: Object of type `ShouldBeCovariant6[int | float]` is not assignable to `ShouldBeCovariant6[int]` (invalid-assignment) +generics_variance_inference.py:194:37 - major: invalid-assignment: Object of type `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[int | float]` (invalid-assignment) +""" diff --git a/conformance/results/ty/historical_positional.toml b/conformance/results/ty/historical_positional.toml new file mode 100644 index 00000000..586e9a99 --- /dev/null +++ b/conformance/results/ty/historical_positional.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 26: Expected 1 errors +Line 38: Expected 1 errors +""" +output = """ +historical_positional.py:18:4 - major: positional-only-parameter-as-kwarg: Positional-only parameter 1 (`__x`) passed as keyword argument of function `f1` (positional-only-parameter-as-kwarg) +historical_positional.py:43:6 - major: positional-only-parameter-as-kwarg: Positional-only parameter 2 (`__x`) passed as keyword argument of bound method `m1` (positional-only-parameter-as-kwarg) +""" diff --git a/conformance/results/ty/literals_interactions.toml b/conformance/results/ty/literals_interactions.toml new file mode 100644 index 00000000..2f233dad --- /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 - major: invalid-argument-type: Argument to function `expects_bad_status` is incorrect (invalid-argument-type)'] +Line 109: Unexpected errors ['literals_interactions.py:109:32 - major: invalid-argument-type: Argument to function `expects_pending_status` is incorrect (invalid-argument-type)'] +""" +output = """ +literals_interactions.py:15:5 - major: index-out-of-bounds: Index 5 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 (index-out-of-bounds) +literals_interactions.py:16:5 - major: index-out-of-bounds: Index -5 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 (index-out-of-bounds) +literals_interactions.py:17:5 - major: index-out-of-bounds: Index 4 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 (index-out-of-bounds) +literals_interactions.py:18:5 - major: index-out-of-bounds: Index -4 is out of bounds for tuple `tuple[int, str, list[bool]]` with length 3 (index-out-of-bounds) +literals_interactions.py:106:35 - major: invalid-argument-type: Argument to function `expects_bad_status` is incorrect (invalid-argument-type) +literals_interactions.py:109:32 - major: invalid-argument-type: Argument to function `expects_pending_status` is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/literals_literalstring.toml b/conformance/results/ty/literals_literalstring.toml new file mode 100644 index 00000000..0302d5e9 --- /dev/null +++ b/conformance/results/ty/literals_literalstring.toml @@ -0,0 +1,23 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 53: Unexpected errors ['literals_literalstring.py:53:5 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure)'] +Line 63: Unexpected errors ['literals_literalstring.py:63:5 - major: type-assertion-failure: Argument does not have asserted type `LiteralString` (type-assertion-failure)'] +Line 68: Unexpected errors ['literals_literalstring.py:68:5 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure)'] +Line 167: Unexpected errors ['literals_literalstring.py:167:1 - major: type-assertion-failure: Argument does not have asserted type `A` (type-assertion-failure)'] +""" +output = """ +literals_literalstring.py:36:29 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_literalstring.py:37:22 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_literalstring.py:43:23 - major: invalid-assignment: Object of type `Literal["two"]` is not assignable to `Literal[""]` (invalid-assignment) +literals_literalstring.py:53:5 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure) +literals_literalstring.py:63:5 - major: type-assertion-failure: Argument does not have asserted type `LiteralString` (type-assertion-failure) +literals_literalstring.py:66:25 - major: invalid-assignment: Object of type `str` is not assignable to `LiteralString` (invalid-assignment) +literals_literalstring.py:68:5 - major: type-assertion-failure: Argument does not have asserted type `str` (type-assertion-failure) +literals_literalstring.py:74:25 - major: invalid-assignment: Object of type `Literal[3]` is not assignable to `LiteralString` (invalid-assignment) +literals_literalstring.py:75:25 - major: invalid-assignment: Object of type `Literal[b"test"]` is not assignable to `LiteralString` (invalid-assignment) +literals_literalstring.py:120:22 - major: invalid-argument-type: Argument to function `literal_identity` is incorrect (invalid-argument-type) +literals_literalstring.py:134:51 - major: invalid-argument-type: Argument to bound method `__init__` is incorrect (invalid-argument-type) +literals_literalstring.py:134:51 - major: invalid-argument-type: Argument to bound method `__init__` is incorrect (invalid-argument-type) +literals_literalstring.py:167:1 - major: type-assertion-failure: Argument does not have asserted type `A` (type-assertion-failure) +literals_literalstring.py:171:21 - major: invalid-assignment: Object of type `list[LiteralString]` is not assignable to `list[str]` (invalid-assignment) +""" diff --git a/conformance/results/ty/literals_parameterizations.toml b/conformance/results/ty/literals_parameterizations.toml new file mode 100644 index 00000000..93569473 --- /dev/null +++ b/conformance/results/ty/literals_parameterizations.toml @@ -0,0 +1,22 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_parameterizations.py:41:15 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:42:15 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:43:15 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:44:15 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:45:15 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:46:15 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:47:15 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:48:15 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:49:15 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:50:16 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:51:16 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:52:16 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:53:16 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:56:28 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:60:4 - major: invalid-type-form: `typing.Literal` requires at least one argument when used in a type expression (invalid-type-form) +literals_parameterizations.py:61:12 - major: invalid-type-form: Type arguments for `Literal` must be `None`, a literal value (int, bool, str, or bytes), or an enum member (invalid-type-form) +literals_parameterizations.py:65:32 - major: invalid-assignment: Object of type `Literal[Color.RED]` is not assignable to `Literal["Color.RED"]` (invalid-assignment) +""" diff --git a/conformance/results/ty/literals_semantics.toml b/conformance/results/ty/literals_semantics.toml new file mode 100644 index 00000000..4a7227ec --- /dev/null +++ b/conformance/results/ty/literals_semantics.toml @@ -0,0 +1,9 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +literals_semantics.py:10:18 - major: invalid-assignment: Object of type `Literal[4]` is not assignable to `Literal[3]` (invalid-assignment) +literals_semantics.py:24:26 - major: invalid-assignment: Object of type `Literal[0]` is not assignable to `Literal[False]` (invalid-assignment) +literals_semantics.py:25:22 - major: invalid-assignment: Object of type `Literal[False]` is not assignable to `Literal[0]` (invalid-assignment) +literals_semantics.py:33:5 - major: invalid-assignment: Object of type `Literal[6, 7, 8]` is not assignable to `Literal[3, 4, 5]` (invalid-assignment) +""" diff --git a/conformance/results/ty/namedtuples_define_class.toml b/conformance/results/ty/namedtuples_define_class.toml new file mode 100644 index 00000000..346fd24d --- /dev/null +++ b/conformance/results/ty/namedtuples_define_class.toml @@ -0,0 +1,25 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 106: Expected 1 errors +Line 121: Unexpected errors ['namedtuples_define_class.py:121:1 - major: type-assertion-failure: Argument does not have asserted type `Property[int | float]` (type-assertion-failure)'] +Line 122: Unexpected errors ['namedtuples_define_class.py:122:1 - major: type-assertion-failure: Argument does not have asserted type `int | float` (type-assertion-failure)'] +Line 123: Unexpected errors ['namedtuples_define_class.py:123:1 - major: type-assertion-failure: Argument does not have asserted type `int | float` (type-assertion-failure)'] +""" +output = """ +namedtuples_define_class.py:32:7 - major: index-out-of-bounds: Index 3 is out of bounds for tuple `Point` with length 3 (index-out-of-bounds) +namedtuples_define_class.py:33:7 - major: index-out-of-bounds: Index -4 is out of bounds for tuple `Point` with length 3 (index-out-of-bounds) +namedtuples_define_class.py:44:6 - major: missing-argument: No argument provided for required parameter `y` (missing-argument) +namedtuples_define_class.py:45:6 - major: missing-argument: No argument provided for required parameter `y` (missing-argument) +namedtuples_define_class.py:46:15 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +namedtuples_define_class.py:47:18 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +namedtuples_define_class.py:48:22 - major: too-many-positional-arguments: Too many positional arguments: expected 4, got 5 (too-many-positional-arguments) +namedtuples_define_class.py:49:23 - major: unknown-argument: Argument `other` does not match any known parameter (unknown-argument) +namedtuples_define_class.py:69:20 - major: too-many-positional-arguments: Too many positional arguments: expected 3, got 4 (too-many-positional-arguments) +namedtuples_define_class.py:76:5 - major: invalid-named-tuple: NamedTuple field name cannot start with an underscore (invalid-named-tuple) +namedtuples_define_class.py:86:5 - major: invalid-named-tuple: NamedTuple field without default value cannot follow field(s) with default value(s) (invalid-named-tuple) +namedtuples_define_class.py:121:1 - major: type-assertion-failure: Argument does not have asserted type `Property[int | float]` (type-assertion-failure) +namedtuples_define_class.py:122:1 - major: type-assertion-failure: Argument does not have asserted type `int | float` (type-assertion-failure) +namedtuples_define_class.py:123:1 - major: type-assertion-failure: Argument does not have asserted type `int | float` (type-assertion-failure) +namedtuples_define_class.py:125:19 - major: invalid-argument-type: Argument is incorrect (invalid-argument-type) +namedtuples_define_class.py:132:24 - major: invalid-named-tuple: NamedTuple class `Unit` cannot use multiple inheritance except with `Generic[]` (invalid-named-tuple) +""" diff --git a/conformance/results/ty/namedtuples_define_functional.toml b/conformance/results/ty/namedtuples_define_functional.toml new file mode 100644 index 00000000..a2514deb --- /dev/null +++ b/conformance/results/ty/namedtuples_define_functional.toml @@ -0,0 +1,14 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 16: Expected 1 errors +Line 21: Expected 1 errors +Line 26: Expected 1 errors +Line 31: Expected 1 errors +Line 36: Expected 1 errors +Line 37: Expected 1 errors +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 69: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/namedtuples_type_compat.toml b/conformance/results/ty/namedtuples_type_compat.toml new file mode 100644 index 00000000..52a4b6c7 --- /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 - major: invalid-assignment: Object of type `Point` is not assignable to `tuple[int, int]` (invalid-assignment) +namedtuples_type_compat.py:23:28 - major: invalid-assignment: Object of type `Point` is not assignable to `tuple[int, str, str]` (invalid-assignment) +""" diff --git a/conformance/results/ty/namedtuples_usage.toml b/conformance/results/ty/namedtuples_usage.toml new file mode 100644 index 00000000..176cc281 --- /dev/null +++ b/conformance/results/ty/namedtuples_usage.toml @@ -0,0 +1,13 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 42: Expected 1 errors +Line 43: Expected 1 errors +""" +output = """ +namedtuples_usage.py:34:7 - major: index-out-of-bounds: Index 3 is out of bounds for tuple `Point` with length 3 (index-out-of-bounds) +namedtuples_usage.py:35:7 - major: index-out-of-bounds: Index -4 is out of bounds for tuple `Point` with length 3 (index-out-of-bounds) +namedtuples_usage.py:40:1 - major: invalid-assignment: Cannot assign to read-only property `x` on object of type `Point` (invalid-assignment) +namedtuples_usage.py:41:1 - major: invalid-assignment: Cannot assign to a subscript on an object of type `Point` (invalid-assignment) +namedtuples_usage.py:52:1 - major: invalid-assignment: Too many values to unpack (invalid-assignment) +namedtuples_usage.py:53:1 - major: invalid-assignment: Not enough values to unpack (invalid-assignment) +""" diff --git a/conformance/results/ty/narrowing_typeguard.toml b/conformance/results/ty/narrowing_typeguard.toml new file mode 100644 index 00000000..b7f4ed82 --- /dev/null +++ b/conformance/results/ty/narrowing_typeguard.toml @@ -0,0 +1,27 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 102: Expected 1 errors +Line 107: Expected 1 errors +Line 128: Expected 1 errors +Line 148: Expected 1 errors +Line 17: Unexpected errors ['narrowing_typeguard.py:17:9 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, str]` (type-assertion-failure)'] +Line 32: Unexpected errors ['narrowing_typeguard.py:32:9 - major: type-assertion-failure: Argument does not have asserted type `set[int]` (type-assertion-failure)'] +Line 69: Unexpected errors ['narrowing_typeguard.py:69:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 73: Unexpected errors ['narrowing_typeguard.py:73:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 77: Unexpected errors ['narrowing_typeguard.py:77:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 81: Unexpected errors ['narrowing_typeguard.py:81:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 85: Unexpected errors ['narrowing_typeguard.py:85:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 89: Unexpected errors ['narrowing_typeguard.py:89:9 - major: type-assertion-failure: Argument does not have asserted type `B` (type-assertion-failure)'] +Line 93: Unexpected errors ['narrowing_typeguard.py:93:9 - major: type-assertion-failure: Argument does not have asserted type `B` (type-assertion-failure)'] +""" +output = """ +narrowing_typeguard.py:17:9 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, str]` (type-assertion-failure) +narrowing_typeguard.py:32:9 - major: type-assertion-failure: Argument does not have asserted type `set[int]` (type-assertion-failure) +narrowing_typeguard.py:69:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +narrowing_typeguard.py:73:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +narrowing_typeguard.py:77:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +narrowing_typeguard.py:81:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +narrowing_typeguard.py:85:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +narrowing_typeguard.py:89:9 - major: type-assertion-failure: Argument does not have asserted type `B` (type-assertion-failure) +narrowing_typeguard.py:93:9 - major: type-assertion-failure: Argument does not have asserted type `B` (type-assertion-failure) +""" diff --git a/conformance/results/ty/narrowing_typeis.toml b/conformance/results/ty/narrowing_typeis.toml new file mode 100644 index 00000000..ccdd3c8d --- /dev/null +++ b/conformance/results/ty/narrowing_typeis.toml @@ -0,0 +1,28 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 105: Expected 1 errors +Line 110: Expected 1 errors +Line 169: Expected 1 errors +Line 170: Expected 1 errors +Line 195: Expected 1 errors +Line 199: Expected 1 errors +Line 21: Unexpected errors ['narrowing_typeis.py:21:9 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, ...]` (type-assertion-failure)'] +Line 38: Unexpected errors ['narrowing_typeis.py:38:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 72: Unexpected errors ['narrowing_typeis.py:72:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 76: Unexpected errors ['narrowing_typeis.py:76:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 80: Unexpected errors ['narrowing_typeis.py:80:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +Line 92: Unexpected errors ['narrowing_typeis.py:92:9 - major: type-assertion-failure: Argument does not have asserted type `B` (type-assertion-failure)'] +Line 96: Unexpected errors ['narrowing_typeis.py:96:9 - major: type-assertion-failure: Argument does not have asserted type `B` (type-assertion-failure)'] +""" +output = """ +narrowing_typeis.py:21:9 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, ...]` (type-assertion-failure) +narrowing_typeis.py:38:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +narrowing_typeis.py:72:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +narrowing_typeis.py:76:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +narrowing_typeis.py:80:9 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +narrowing_typeis.py:92:9 - major: type-assertion-failure: Argument does not have asserted type `B` (type-assertion-failure) +narrowing_typeis.py:96:9 - major: type-assertion-failure: Argument does not have asserted type `B` (type-assertion-failure) +narrowing_typeis.py:132:20 - major: invalid-argument-type: Argument to function `takes_callable_str` is incorrect (invalid-argument-type) +narrowing_typeis.py:152:26 - major: invalid-argument-type: Argument to function `takes_callable_str_proto` is incorrect (invalid-argument-type) +narrowing_typeis.py:191:18 - major: invalid-argument-type: Argument to function `takes_int_typeis` is incorrect (invalid-argument-type) +""" diff --git a/conformance/results/ty/overloads_basic.toml b/conformance/results/ty/overloads_basic.toml new file mode 100644 index 00000000..101270a1 --- /dev/null +++ b/conformance/results/ty/overloads_basic.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +overloads_basic.py:39:1 - major: 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` (invalid-argument-type) +""" diff --git a/conformance/results/ty/overloads_consistency.toml b/conformance/results/ty/overloads_consistency.toml new file mode 100644 index 00000000..e389cd61 --- /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 00000000..c9d9f430 --- /dev/null +++ b/conformance/results/ty/overloads_definitions.toml @@ -0,0 +1,29 @@ +conformance_automated = "Fail" +errors_diff = """ +Lines 15, 16: Expected error (tag 'func1') +Lines 27, 28: Expected error (tag 'func2') +Lines 58, 59: Expected error (tag 'not_abstract') +Lines 122, 123, 124, 128: Expected error (tag 'invalid_final') +Lines 137, 138, 139, 143, 144: Expected error (tag 'invalid_final_2') +Lines 226, 227, 228, 231, 232: Expected error (tag 'override_impl') +Line 20: Unexpected errors ['overloads_definitions.py:20:5 - major: invalid-overload: Overloaded function `func1` requires at least two overloads (invalid-overload)'] +Line 33: Unexpected errors ['overloads_definitions.py:33:5 - major: invalid-overload: Overloads for function `func2` must be followed by a non-`@overload`-decorated implementation function (invalid-overload)'] +Line 63: Unexpected errors ['overloads_definitions.py:63:9 - major: invalid-overload: Overloads for function `not_abstract` must be followed by a non-`@overload`-decorated implementation function (invalid-overload)'] +Line 131: Unexpected errors ['overloads_definitions.py:131:9 - major: invalid-overload: `@final` decorator should be applied only to the overload implementation (invalid-overload)'] +Line 148: Unexpected errors ['overloads_definitions.py:148:9 - major: invalid-overload: `@final` decorator should be applied only to the overload implementation (invalid-overload)', 'overloads_definitions.py:148:9 - major: invalid-overload: `@final` decorator should be applied only to the overload implementation (invalid-overload)'] +Line 235: Unexpected errors ['overloads_definitions.py:235:9 - major: invalid-overload: `@override` decorator should be applied only to the overload implementation (invalid-overload)', 'overloads_definitions.py:235:9 - major: invalid-overload: `@override` decorator should be applied only to the overload implementation (invalid-overload)'] +""" +output = """ +overloads_definitions.py:20:5 - major: invalid-overload: Overloaded function `func1` requires at least two overloads (invalid-overload) +overloads_definitions.py:33:5 - major: invalid-overload: Overloads for function `func2` must be followed by a non-`@overload`-decorated implementation function (invalid-overload) +overloads_definitions.py:63:9 - major: invalid-overload: Overloads for function `not_abstract` must be followed by a non-`@overload`-decorated implementation function (invalid-overload) +overloads_definitions.py:81:9 - major: invalid-overload: Overloaded function `func5` does not use the `@staticmethod` decorator consistently (invalid-overload) +overloads_definitions.py:94:9 - major: invalid-overload: Overloaded function `func6` does not use the `@classmethod` decorator consistently (invalid-overload) +overloads_definitions.py:131:9 - major: invalid-overload: `@final` decorator should be applied only to the overload implementation (invalid-overload) +overloads_definitions.py:148:9 - major: invalid-overload: `@final` decorator should be applied only to the overload implementation (invalid-overload) +overloads_definitions.py:148:9 - major: invalid-overload: `@final` decorator should be applied only to the overload implementation (invalid-overload) +overloads_definitions.py:186:9 - major: override-of-final-method: Cannot override `Base.final_method` (override-of-final-method) +overloads_definitions.py:203:9 - major: invalid-explicit-override: Method `bad_override` is decorated with `@override` but does not override anything (invalid-explicit-override) +overloads_definitions.py:235:9 - major: invalid-overload: `@override` decorator should be applied only to the overload implementation (invalid-overload) +overloads_definitions.py:235:9 - major: invalid-overload: `@override` decorator should be applied only to the overload implementation (invalid-overload) +""" diff --git a/conformance/results/ty/overloads_definitions_stub.toml b/conformance/results/ty/overloads_definitions_stub.toml new file mode 100644 index 00000000..462e142a --- /dev/null +++ b/conformance/results/ty/overloads_definitions_stub.toml @@ -0,0 +1,15 @@ +conformance_automated = "Fail" +errors_diff = """ +Lines 67, 69, 71, 72, 73: Expected error (tag 'invalid_final') +Line 76: Unexpected errors ['overloads_definitions_stub.pyi:76:9 - major: invalid-overload: `@final` decorator should be applied only to the first overload (invalid-overload)'] +""" +output = """ +overloads_definitions_stub.pyi:14:5 - major: invalid-overload: Overloaded function `func1` requires at least two overloads (invalid-overload) +overloads_definitions_stub.pyi:37:9 - major: invalid-overload: Overloaded function `func5` does not use the `@staticmethod` decorator consistently (invalid-overload) +overloads_definitions_stub.pyi:44:9 - major: invalid-overload: Overloaded function `func6` does not use the `@classmethod` decorator consistently (invalid-overload) +overloads_definitions_stub.pyi:76:9 - major: invalid-overload: `@final` decorator should be applied only to the first overload (invalid-overload) +overloads_definitions_stub.pyi:86:9 - major: invalid-overload: `@final` decorator should be applied only to the first overload (invalid-overload) +overloads_definitions_stub.pyi:111:9 - major: override-of-final-method: Cannot override `Base.final_method` (override-of-final-method) +overloads_definitions_stub.pyi:122:9 - major: invalid-explicit-override: Method `bad_override` is decorated with `@override` but does not override anything (invalid-explicit-override) +overloads_definitions_stub.pyi:147:9 - major: invalid-overload: `@override` decorator should be applied only to the first overload (invalid-overload) +""" diff --git a/conformance/results/ty/overloads_evaluation.toml b/conformance/results/ty/overloads_evaluation.toml new file mode 100644 index 00000000..e0431125 --- /dev/null +++ b/conformance/results/ty/overloads_evaluation.toml @@ -0,0 +1,11 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 162: Unexpected errors ['overloads_evaluation.py:162:5 - major: type-assertion-failure: Argument does not have asserted type `Literal[0, 1]` (type-assertion-failure)'] +""" +output = """ +overloads_evaluation.py:38:1 - major: no-matching-overload: No overload of function `example1_1` matches arguments (no-matching-overload) +overloads_evaluation.py:46:15 - major: invalid-argument-type: Argument to function `example1_1` is incorrect (invalid-argument-type) +overloads_evaluation.py:51:12 - major: invalid-argument-type: Argument to function `example1_1` is incorrect (invalid-argument-type) +overloads_evaluation.py:116:5 - major: no-matching-overload: No overload of function `example2` matches arguments (no-matching-overload) +overloads_evaluation.py:162:5 - major: type-assertion-failure: Argument does not have asserted type `Literal[0, 1]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/protocols_class_objects.toml b/conformance/results/ty/protocols_class_objects.toml new file mode 100644 index 00000000..48260789 --- /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 - major: invalid-assignment: Object of type `` is not assignable to `ProtoA2` (invalid-assignment)"] +""" +output = """ +protocols_class_objects.py:58:16 - major: invalid-assignment: Object of type `` is not assignable to `ProtoA1` (invalid-assignment) +protocols_class_objects.py:59:16 - major: invalid-assignment: Object of type `` is not assignable to `ProtoA2` (invalid-assignment) +""" diff --git a/conformance/results/ty/protocols_definition.toml b/conformance/results/ty/protocols_definition.toml new file mode 100644 index 00000000..368dc15c --- /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 - major: invalid-argument-type: Argument to function `close_all` is incorrect (invalid-argument-type) +protocols_definition.py:114:22 - major: invalid-assignment: Object of type `Concrete2_Bad1` is not assignable to `Template2` (invalid-assignment) +protocols_definition.py:115:22 - major: invalid-assignment: Object of type `Concrete2_Bad2` is not assignable to `Template2` (invalid-assignment) +protocols_definition.py:116:22 - major: invalid-assignment: Object of type `Concrete2_Bad3` is not assignable to `Template2` (invalid-assignment) +protocols_definition.py:156:22 - major: invalid-assignment: Object of type `Concrete3_Bad1` is not assignable to `Template3` (invalid-assignment) +protocols_definition.py:159:22 - major: invalid-assignment: Object of type `Concrete3_Bad4` is not assignable to `Template3` (invalid-assignment) +protocols_definition.py:160:22 - major: invalid-assignment: Object of type `Concrete3_Bad5` is not assignable to `Template3` (invalid-assignment) +protocols_definition.py:219:22 - major: invalid-assignment: Object of type `Concrete4_Bad2` is not assignable to `Template4` (invalid-assignment) +protocols_definition.py:285:22 - major: invalid-assignment: Object of type `Concrete5_Bad1` is not assignable to `Template5` (invalid-assignment) +protocols_definition.py:286:22 - major: invalid-assignment: Object of type `Concrete5_Bad2` is not assignable to `Template5` (invalid-assignment) +protocols_definition.py:287:22 - major: invalid-assignment: Object of type `Concrete5_Bad3` is not assignable to `Template5` (invalid-assignment) +protocols_definition.py:288:22 - major: invalid-assignment: Object of type `Concrete5_Bad4` is not assignable to `Template5` (invalid-assignment) +protocols_definition.py:289:22 - major: invalid-assignment: Object of type `Concrete5_Bad5` is not assignable to `Template5` (invalid-assignment) +""" diff --git a/conformance/results/ty/protocols_explicit.toml b/conformance/results/ty/protocols_explicit.toml new file mode 100644 index 00000000..9c5ab11a --- /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 - major: invalid-assignment: Object of type `tuple[int, int, str]` is not assignable to attribute `rgb` of type `tuple[int, int, int]` (invalid-assignment) +""" diff --git a/conformance/results/ty/protocols_generic.toml b/conformance/results/ty/protocols_generic.toml new file mode 100644 index 00000000..533f721f --- /dev/null +++ b/conformance/results/ty/protocols_generic.toml @@ -0,0 +1,14 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 44: Expected 1 errors +Line 145: Expected 1 errors +Line 146: Expected 1 errors +Line 147: Expected 1 errors +""" +output = """ +protocols_generic.py:40:24 - major: invalid-assignment: Object of type `Concrete1` is not assignable to `Proto1[int, str]` (invalid-assignment) +protocols_generic.py:56:20 - major: invalid-assignment: Object of type `Box[int | float]` is not assignable to `Box[int]` (invalid-assignment) +protocols_generic.py:66:25 - major: invalid-assignment: Object of type `Sender[int]` is not assignable to `Sender[int | float]` (invalid-assignment) +protocols_generic.py:74:28 - major: invalid-assignment: Object of type `AttrProto[int]` is not assignable to `AttrProto[int | float]` (invalid-assignment) +protocols_generic.py:75:26 - major: invalid-assignment: Object of type `AttrProto[int | float]` is not assignable to `AttrProto[int]` (invalid-assignment) +""" diff --git a/conformance/results/ty/protocols_merging.toml b/conformance/results/ty/protocols_merging.toml new file mode 100644 index 00000000..614ea171 --- /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 - major: invalid-assignment: Object of type `SCConcrete2` is not assignable to `SizedAndClosable1` (invalid-assignment) +protocols_merging.py:53:25 - major: invalid-assignment: Object of type `SCConcrete2` is not assignable to `SizedAndClosable2` (invalid-assignment) +protocols_merging.py:54:25 - major: invalid-assignment: Object of type `SCConcrete2` is not assignable to `SizedAndClosable3` (invalid-assignment) +protocols_merging.py:67:16 - major: invalid-protocol: Protocol class `BadProto` cannot inherit from non-protocol class `SizedAndClosable3` (invalid-protocol) +protocols_merging.py:83:24 - major: invalid-assignment: Object of type `SCConcrete1` is not assignable to `SizedAndClosable4` (invalid-assignment) +""" diff --git a/conformance/results/ty/protocols_modules.toml b/conformance/results/ty/protocols_modules.toml new file mode 100644 index 00000000..833c7345 --- /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 - major: invalid-assignment: Object of type `` is not assignable to `Options1` (invalid-assignment)"] +Line 47: Unexpected errors ["protocols_modules.py:47:18 - major: invalid-assignment: Object of type `` is not assignable to `Reporter1` (invalid-assignment)"] +""" +output = """ +protocols_modules.py:25:17 - major: invalid-assignment: Object of type `` is not assignable to `Options1` (invalid-assignment) +protocols_modules.py:26:17 - major: invalid-assignment: Object of type `` is not assignable to `Options2` (invalid-assignment) +protocols_modules.py:47:18 - major: invalid-assignment: Object of type `` is not assignable to `Reporter1` (invalid-assignment) +protocols_modules.py:48:18 - major: invalid-assignment: Object of type `` is not assignable to `Reporter2` (invalid-assignment) +protocols_modules.py:49:18 - major: invalid-assignment: Object of type `` is not assignable to `Reporter3` (invalid-assignment) +""" diff --git a/conformance/results/ty/protocols_recursive.toml b/conformance/results/ty/protocols_recursive.toml new file mode 100644 index 00000000..ac8bb490 --- /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 - major: type-assertion-failure: Argument does not have asserted type `list[int]` (type-assertion-failure)'] +""" +output = """ +protocols_recursive.py:81:1 - major: type-assertion-failure: Argument does not have asserted type `list[int]` (type-assertion-failure) +""" diff --git a/conformance/results/ty/protocols_runtime_checkable.toml b/conformance/results/ty/protocols_runtime_checkable.toml new file mode 100644 index 00000000..f3e77054 --- /dev/null +++ b/conformance/results/ty/protocols_runtime_checkable.toml @@ -0,0 +1,11 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 55: Expected 1 errors +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 - major: invalid-argument-type: Class `Proto1` cannot be used as the second argument to `isinstance` (invalid-argument-type) +""" diff --git a/conformance/results/ty/protocols_self.toml b/conformance/results/ty/protocols_self.toml new file mode 100644 index 00000000..cdd4d0cd --- /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 00000000..eb6b1fea --- /dev/null +++ b/conformance/results/ty/protocols_subtyping.toml @@ -0,0 +1,12 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +protocols_subtyping.py:16:6 - major: call-non-callable: Cannot instantiate class `Proto1` (call-non-callable) +protocols_subtyping.py:38:21 - major: invalid-assignment: Object of type `Proto2` is not assignable to `Concrete2` (invalid-assignment) +protocols_subtyping.py:55:18 - major: invalid-assignment: Object of type `Proto2` is not assignable to `Proto3` (invalid-assignment) +protocols_subtyping.py:79:30 - major: invalid-assignment: Object of type `Proto5[int]` is not assignable to `Proto4[int, int | float]` (invalid-assignment) +protocols_subtyping.py:80:25 - major: invalid-assignment: Object of type `Proto4[int, int]` is not assignable to `Proto5[int | float]` (invalid-assignment) +protocols_subtyping.py:102:30 - major: invalid-assignment: Object of type `Proto6[int | float, int | float]` is not assignable to `Proto7[int, int | float]` (invalid-assignment) +protocols_subtyping.py:103:33 - major: invalid-assignment: Object of type `Proto6[int | float, int | float]` is not assignable to `Proto7[int | float, object]` (invalid-assignment) +""" diff --git a/conformance/results/ty/protocols_variance.toml b/conformance/results/ty/protocols_variance.toml new file mode 100644 index 00000000..a9c17003 --- /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 61: Expected 1 errors +Line 66: Expected 1 errors +Line 71: Expected 1 errors +Line 104: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/qualifiers_annotated.toml b/conformance/results/ty/qualifiers_annotated.toml new file mode 100644 index 00000000..85c620c1 --- /dev/null +++ b/conformance/results/ty/qualifiers_annotated.toml @@ -0,0 +1,27 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +qualifiers_annotated.py:38:17 - major: invalid-type-form: List literals are not allowed in this context in a type expression (invalid-type-form) +qualifiers_annotated.py:39:17 - major: invalid-type-form: Tuple literals are not allowed in this context in a type expression (invalid-type-form) +qualifiers_annotated.py:39:18 - major: invalid-type-form: Tuple literals are not allowed in this context in a type expression (invalid-type-form) +qualifiers_annotated.py:40:17 - major: invalid-type-form: List comprehensions are not allowed in type expressions (invalid-type-form) +qualifiers_annotated.py:41:17 - major: invalid-type-form: Dict literals are not allowed in type expressions (invalid-type-form) +qualifiers_annotated.py:42:17 - major: invalid-type-form: Function calls are not allowed in type expressions (invalid-type-form) +qualifiers_annotated.py:43:17 - major: invalid-type-form: Invalid subscript of object of type `list[Unknown | ]` in type expression (invalid-type-form) +qualifiers_annotated.py:43:23 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +qualifiers_annotated.py:44:17 - major: invalid-type-form: `if` expressions are not allowed in type expressions (invalid-type-form) +qualifiers_annotated.py:45:17 - major: unresolved-reference: Name `var1` used when not defined (unresolved-reference) +qualifiers_annotated.py:46:17 - major: invalid-type-form: Boolean literals are not allowed in this context in a type expression (invalid-type-form) +qualifiers_annotated.py:47:18 - major: invalid-type-form: Int literals are not allowed in this context in a type expression (invalid-type-form) +qualifiers_annotated.py:48:18 - major: invalid-type-form: Boolean operations are not allowed in type expressions (invalid-type-form) +qualifiers_annotated.py:49:18 - major: fstring-type-annotation: Type expressions cannot use f-strings (fstring-type-annotation) +qualifiers_annotated.py:59:8 - major: invalid-type-form: Special form `typing.Annotated` expected at least 2 arguments (one type and at least one metadata element) (invalid-type-form) +qualifiers_annotated.py:71:24 - major: invalid-assignment: Object of type `]'>` is not assignable to `type[Any]` (invalid-assignment) +qualifiers_annotated.py:72:24 - major: invalid-assignment: Object of type `]'>` is not assignable to `type[Any]` (invalid-assignment) +qualifiers_annotated.py:79:7 - major: invalid-argument-type: Argument to function `func4` is incorrect (invalid-argument-type) +qualifiers_annotated.py:80:7 - major: invalid-argument-type: Argument to function `func4` is incorrect (invalid-argument-type) +qualifiers_annotated.py:86:1 - major: call-non-callable: Object of type `` is not callable (call-non-callable) +qualifiers_annotated.py:87:1 - major: call-non-callable: Object of type `GenericAlias` is not callable (call-non-callable) +qualifiers_annotated.py:88:1 - major: call-non-callable: Object of type `GenericAlias` is not callable (call-non-callable) +""" diff --git a/conformance/results/ty/qualifiers_final_annotation.toml b/conformance/results/ty/qualifiers_final_annotation.toml new file mode 100644 index 00000000..dfb7abb8 --- /dev/null +++ b/conformance/results/ty/qualifiers_final_annotation.toml @@ -0,0 +1,31 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 16: Expected 1 errors +Line 34: Expected 1 errors +Line 38: Expected 1 errors +Line 62: Expected 1 errors +Line 63: Expected 1 errors +Line 67: Expected 1 errors +Line 94: Expected 1 errors +Line 107: Expected 1 errors +Line 108: Expected 1 errors +Line 134: Expected 1 errors +Line 135: Expected 1 errors +Line 170: Expected 1 errors +""" +output = """ +qualifiers_final_annotation.py:18:7 - major: invalid-type-form: Type qualifier `typing.Final` expected exactly 1 argument, got 2 (invalid-type-form) +qualifiers_final_annotation.py:54:9 - major: invalid-assignment: Cannot assign to final attribute `ID5` in `__init__` because it already has a value at class level (invalid-assignment) +qualifiers_final_annotation.py:65:9 - major: invalid-assignment: Cannot assign to final attribute `ID7` on type `Self@method1` (invalid-assignment) +qualifiers_final_annotation.py:71:1 - major: invalid-assignment: Reassignment of `Final` symbol `RATE` is not allowed (invalid-assignment) +qualifiers_final_annotation.py:81:1 - major: invalid-assignment: Cannot assign to final attribute `DEFAULT_ID` on type `` (invalid-assignment) +qualifiers_final_annotation.py:118:9 - major: invalid-type-form: Type qualifier `typing.Final` is not allowed in type expressions (only in annotation expressions) (invalid-type-form) +qualifiers_final_annotation.py:121:11 - major: invalid-type-form: `Final` is not allowed in function parameter annotations (invalid-type-form) +qualifiers_final_annotation.py:141:5 - major: invalid-assignment: Reassignment of `Final` symbol `ID1` is not allowed (invalid-assignment) +qualifiers_final_annotation.py:145:5 - major: invalid-assignment: Reassignment of `Final` symbol `x` is not allowed (invalid-assignment) +qualifiers_final_annotation.py:147:10 - major: invalid-assignment: Reassignment of `Final` symbol `x` is not allowed (invalid-assignment) +qualifiers_final_annotation.py:149:9 - major: invalid-assignment: Reassignment of `Final` symbol `x` is not allowed (invalid-assignment) +qualifiers_final_annotation.py:152:30 - major: invalid-assignment: Reassignment of `Final` symbol `x` is not allowed (invalid-assignment) +qualifiers_final_annotation.py:155:9 - major: invalid-assignment: Reassignment of `Final` symbol `x` is not allowed (invalid-assignment) +qualifiers_final_annotation.py:166:1 - major: invalid-assignment: Reassignment of `Final` symbol `TEN` is not allowed (invalid-assignment) +""" diff --git a/conformance/results/ty/qualifiers_final_decorator.toml b/conformance/results/ty/qualifiers_final_decorator.toml new file mode 100644 index 00000000..91fda0cf --- /dev/null +++ b/conformance/results/ty/qualifiers_final_decorator.toml @@ -0,0 +1,17 @@ +conformance_automated = "Fail" +errors_diff = """ +Lines 84, 85, 86: Expected error (tag 'Derived3-2') +Lines 125, 126: Expected error (tag 'func') +""" +output = """ +qualifiers_final_decorator.py:21:16 - major: subclass-of-final-class: Class `Derived1` cannot inherit from final class `Base1` (subclass-of-final-class) +qualifiers_final_decorator.py:56:9 - major: override-of-final-method: Cannot override `Base2.method1` (override-of-final-method) +qualifiers_final_decorator.py:60:9 - major: override-of-final-method: Cannot override `Base2.method2` (override-of-final-method) +qualifiers_final_decorator.py:64:9 - major: override-of-final-method: Cannot override `Base2.method3` (override-of-final-method) +qualifiers_final_decorator.py:75:9 - major: override-of-final-method: Cannot override `Base2.method4` (override-of-final-method) +qualifiers_final_decorator.py:89:9 - major: invalid-overload: `@final` decorator should be applied only to the overload implementation (invalid-overload) +qualifiers_final_decorator.py:89:9 - major: override-of-final-method: Cannot override `Base3.method` (override-of-final-method) +qualifiers_final_decorator.py:102:9 - major: override-of-final-method: Cannot override `Base4.method` (override-of-final-method) +qualifiers_final_decorator.py:118:9 - major: invalid-method-override: Invalid override of method `method` (invalid-method-override) +qualifiers_final_decorator.py:118:9 - major: override-of-final-method: Cannot override `Base5_2.method` (override-of-final-method) +""" diff --git a/conformance/results/ty/specialtypes_any.toml b/conformance/results/ty/specialtypes_any.toml new file mode 100644 index 00000000..4ea83ede --- /dev/null +++ b/conformance/results/ty/specialtypes_any.toml @@ -0,0 +1,7 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 86: Unexpected errors ['specialtypes_any.py:86:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure)'] +""" +output = """ +specialtypes_any.py:86:1 - major: type-assertion-failure: Argument does not have asserted type `int` (type-assertion-failure) +""" diff --git a/conformance/results/ty/specialtypes_never.toml b/conformance/results/ty/specialtypes_never.toml new file mode 100644 index 00000000..2c0f17a4 --- /dev/null +++ b/conformance/results/ty/specialtypes_never.toml @@ -0,0 +1,10 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 32: Unexpected errors ['specialtypes_never.py:32:12 - major: invalid-return-type: Return type does not match returned value (invalid-return-type)'] +""" +output = """ +specialtypes_never.py:19:22 - major: invalid-return-type: Function always implicitly returns `None`, which is not assignable to return type `Never` (invalid-return-type) +specialtypes_never.py:32:12 - major: invalid-return-type: Return type does not match returned value (invalid-return-type) +specialtypes_never.py:86:21 - major: invalid-assignment: Object of type `list[Never]` is not assignable to `list[int]` (invalid-assignment) +specialtypes_never.py:105:12 - major: invalid-return-type: Return type does not match returned value (invalid-return-type) +""" diff --git a/conformance/results/ty/specialtypes_none.toml b/conformance/results/ty/specialtypes_none.toml new file mode 100644 index 00000000..5b177af7 --- /dev/null +++ b/conformance/results/ty/specialtypes_none.toml @@ -0,0 +1,10 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 41: Expected 1 errors +Line 32: Unexpected errors ['specialtypes_none.py:32:1 - major: missing-argument: No argument provided for required parameter `value` of function `__eq__` (missing-argument)'] +""" +output = """ +specialtypes_none.py:21:7 - major: invalid-argument-type: Argument to function `func1` is incorrect (invalid-argument-type) +specialtypes_none.py:27:19 - major: invalid-assignment: Object of type `None` is not assignable to `Iterable[Unknown]` (invalid-assignment) +specialtypes_none.py:32:1 - major: missing-argument: No argument provided for required parameter `value` of function `__eq__` (missing-argument) +""" diff --git a/conformance/results/ty/specialtypes_promotions.toml b/conformance/results/ty/specialtypes_promotions.toml new file mode 100644 index 00000000..738484b6 --- /dev/null +++ b/conformance/results/ty/specialtypes_promotions.toml @@ -0,0 +1,6 @@ +conformance_automated = "Pass" +errors_diff = """ +""" +output = """ +specialtypes_promotions.py:13:5 - minor: possibly-missing-attribute: Attribute `numerator` may be missing on object of type `int | float` (possibly-missing-attribute) +""" diff --git a/conformance/results/ty/specialtypes_type.toml b/conformance/results/ty/specialtypes_type.toml new file mode 100644 index 00000000..16357012 --- /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 - major: type-assertion-failure: Argument does not have asserted type `type[Any]` (type-assertion-failure)'] +Line 99: Unexpected errors ['specialtypes_type.py:99:17 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute)'] +Line 100: Unexpected errors ['specialtypes_type.py:100:17 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute)'] +Line 102: Unexpected errors ['specialtypes_type.py:102:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[type, ...]` (type-assertion-failure)'] +Line 107: Unexpected errors ['specialtypes_type.py:107:17 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute)'] +Line 108: Unexpected errors ['specialtypes_type.py:108:17 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute)'] +Line 110: Unexpected errors ['specialtypes_type.py:110:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[type, ...]` (type-assertion-failure)'] +Line 137: Unexpected errors ['specialtypes_type.py:137:5 - major: type-assertion-failure: Argument does not have asserted type `type[Any]` (type-assertion-failure)'] +Line 139: Unexpected errors ['specialtypes_type.py:139:5 - major: type-assertion-failure: Argument does not have asserted type `type[Any]` (type-assertion-failure)'] +Line 169: Unexpected errors ['specialtypes_type.py:169:21 - major: invalid-assignment: Object of type `type` is not assignable to `type[int]` (invalid-assignment)'] +Line 175: Unexpected errors ['specialtypes_type.py:175:16 - major: invalid-return-type: Return type does not match returned value (invalid-return-type)'] +""" +output = """ +specialtypes_type.py:56:7 - major: invalid-argument-type: Argument to function `func4` is incorrect (invalid-argument-type) +specialtypes_type.py:70:7 - major: invalid-argument-type: Argument to function `func5` is incorrect (invalid-argument-type) +specialtypes_type.py:76:17 - major: invalid-type-form: type[...] must have exactly one type argument (invalid-type-form) +specialtypes_type.py:84:5 - major: type-assertion-failure: Argument does not have asserted type `type[Any]` (type-assertion-failure) +specialtypes_type.py:99:17 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute) +specialtypes_type.py:100:17 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute) +specialtypes_type.py:102:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[type, ...]` (type-assertion-failure) +specialtypes_type.py:107:17 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute) +specialtypes_type.py:108:17 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute) +specialtypes_type.py:110:5 - major: type-assertion-failure: Argument does not have asserted type `tuple[type, ...]` (type-assertion-failure) +specialtypes_type.py:117:5 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute) +specialtypes_type.py:120:5 - major: unresolved-attribute: Object of type `type` has no attribute `unknown` (unresolved-attribute) +specialtypes_type.py:137:5 - major: type-assertion-failure: Argument does not have asserted type `type[Any]` (type-assertion-failure) +specialtypes_type.py:139:5 - major: type-assertion-failure: Argument does not have asserted type `type[Any]` (type-assertion-failure) +specialtypes_type.py:143:1 - major: unresolved-attribute: Special form `typing.Type` has no attribute `unknown` (unresolved-attribute) +specialtypes_type.py:145:1 - major: unresolved-attribute: Class `type` has no attribute `unknown` (unresolved-attribute) +specialtypes_type.py:169:21 - major: invalid-assignment: Object of type `type` is not assignable to `type[int]` (invalid-assignment) +specialtypes_type.py:175:16 - major: invalid-return-type: Return type does not match returned value (invalid-return-type) +""" diff --git a/conformance/results/ty/tuples_type_compat.toml b/conformance/results/ty/tuples_type_compat.toml new file mode 100644 index 00000000..3df53657 --- /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 - major: invalid-assignment: Object of type `tuple[int | float, int | float | complex]` is not assignable to `tuple[int, int]` (invalid-assignment) +tuples_type_compat.py:29:10 - major: invalid-assignment: Object of type `tuple[int, ...]` is not assignable to `tuple[int, *tuple[int, ...]]` (invalid-assignment) +tuples_type_compat.py:32:10 - major: invalid-assignment: Object of type `tuple[int, *tuple[int, ...]]` is not assignable to `tuple[int]` (invalid-assignment) +tuples_type_compat.py:33:10 - major: invalid-assignment: Object of type `tuple[int, ...]` is not assignable to `tuple[int]` (invalid-assignment) +tuples_type_compat.py:43:22 - major: invalid-assignment: Object of type `tuple[int, ...]` is not assignable to `tuple[int]` (invalid-assignment) +tuples_type_compat.py:62:26 - major: invalid-assignment: Object of type `tuple[int, ...]` is not assignable to `tuple[int, int]` (invalid-assignment) +tuples_type_compat.py:75:9 - major: type-assertion-failure: Argument does not have asserted type `tuple[int]` (type-assertion-failure) +tuples_type_compat.py:80:9 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, str] | tuple[int, int]` (type-assertion-failure) +tuples_type_compat.py:85:9 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, str, int]` (type-assertion-failure) +tuples_type_compat.py:101:13 - major: type-assertion-failure: Argument does not have asserted type `tuple[int]` (type-assertion-failure) +tuples_type_compat.py:106:13 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, str] | tuple[int, int]` (type-assertion-failure) +tuples_type_compat.py:111:13 - major: type-assertion-failure: Argument does not have asserted type `tuple[int, str, int]` (type-assertion-failure) +tuples_type_compat.py:126:13 - major: type-assertion-failure: Argument does not have asserted type `tuple[int | str, str]` (type-assertion-failure) +tuples_type_compat.py:129:13 - major: type-assertion-failure: Argument does not have asserted type `tuple[int | str, int]` (type-assertion-failure) +tuples_type_compat.py:157:6 - major: invalid-assignment: Object of type `tuple[Literal[1], Literal[""], Literal[""]]` is not assignable to `tuple[int, str]` (invalid-assignment) +tuples_type_compat.py:162:6 - major: invalid-assignment: Object of type `tuple[Literal[1], Literal[1], Literal[""]]` is not assignable to `tuple[int, *tuple[str, ...]]` (invalid-assignment) +tuples_type_compat.py:163:6 - major: invalid-assignment: Object of type `tuple[Literal[1], Literal[""], Literal[1]]` is not assignable to `tuple[int, *tuple[str, ...]]` (invalid-assignment) +tuples_type_compat.py:169:6 - major: invalid-assignment: Object of type `tuple[Literal[1], Literal[""], Literal[""]]` is not assignable to `tuple[int, *tuple[str, ...], int]` (invalid-assignment) +tuples_type_compat.py:170:6 - major: invalid-assignment: Object of type `tuple[Literal[1], Literal[""], Literal[""], float]` is not assignable to `tuple[int, *tuple[str, ...], int]` (invalid-assignment) +tuples_type_compat.py:175:6 - major: invalid-assignment: Object of type `tuple[Literal[1], Literal[""], Literal[1]]` is not assignable to `tuple[*tuple[str, ...], int]` (invalid-assignment) +tuples_type_compat.py:176:6 - major: invalid-assignment: Object of type `tuple[Literal[""], Literal[""], float]` is not assignable to `tuple[*tuple[str, ...], int]` (invalid-assignment) +tuples_type_compat.py:181:40 - major: invalid-assignment: Object of type `tuple[str, str]` is not assignable to `tuple[str, str, int]` (invalid-assignment) +tuples_type_compat.py:184:50 - major: invalid-assignment: Object of type `tuple[str, str]` is not assignable to `tuple[str, str, str, *tuple[str, ...]]` (invalid-assignment) +tuples_type_compat.py:188:50 - major: invalid-assignment: Object of type `tuple[str, str]` is not assignable to `tuple[*tuple[str, ...], str, str, str]` (invalid-assignment) +""" diff --git a/conformance/results/ty/tuples_type_form.toml b/conformance/results/ty/tuples_type_form.toml new file mode 100644 index 00000000..07bd0deb --- /dev/null +++ b/conformance/results/ty/tuples_type_form.toml @@ -0,0 +1,16 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 42: Expected 1 errors +Line 43: Expected 1 errors +Line 44: Expected 1 errors +Line 45: Expected 1 errors +""" +output = """ +tuples_type_form.py:12:6 - major: invalid-assignment: Object of type `tuple[Literal[1], Literal[2]]` is not assignable to `tuple[int]` (invalid-assignment) +tuples_type_form.py:14:6 - major: invalid-assignment: Object of type `tuple[Literal[1]]` is not assignable to `tuple[int, int]` (invalid-assignment) +tuples_type_form.py:15:6 - major: invalid-assignment: Object of type `tuple[Literal[1], Literal[""]]` is not assignable to `tuple[int, int]` (invalid-assignment) +tuples_type_form.py:25:7 - major: invalid-assignment: Object of type `tuple[Literal[1]]` is not assignable to `tuple[()]` (invalid-assignment) +tuples_type_form.py:36:7 - major: invalid-assignment: Object of type `tuple[Literal[1], Literal[2], Literal[3], Literal[""]]` is not assignable to `tuple[int, ...]` (invalid-assignment) +""" diff --git a/conformance/results/ty/tuples_unpacked.toml b/conformance/results/ty/tuples_unpacked.toml new file mode 100644 index 00000000..a16914ec --- /dev/null +++ b/conformance/results/ty/tuples_unpacked.toml @@ -0,0 +1,10 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 40: Expected 1 errors +Line 41: Expected 1 errors +Line 51: Expected 1 errors +Line 59: Expected 1 errors +Lines 60, 61: Expected error (tag 't14') +""" +output = """ +""" diff --git a/conformance/results/ty/typeddicts_alt_syntax.toml b/conformance/results/ty/typeddicts_alt_syntax.toml new file mode 100644 index 00000000..d39d314c --- /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 00000000..23f929c2 --- /dev/null +++ b/conformance/results/ty/typeddicts_class_syntax.toml @@ -0,0 +1,10 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 29: Expected 1 errors +Line 44: Expected 1 errors +Line 49: Expected 1 errors +Lines 33, 34: Expected error (tag 'method2') +Lines 38, 39: Expected error (tag 'method3') +""" +output = """ +""" diff --git a/conformance/results/ty/typeddicts_extra_items.toml b/conformance/results/ty/typeddicts_extra_items.toml new file mode 100644 index 00000000..d7c7569b --- /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 128: 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 - major: invalid-key: Unknown key "novel_adaptation" for TypedDict `Movie` (invalid-key)'] +Line 29: Unexpected errors ['typeddicts_extra_items.py:29:5 - major: type-assertion-failure: Argument does not have asserted type `bool` (type-assertion-failure)', 'typeddicts_extra_items.py:29:23 - major: invalid-key: Unknown key "novel_adaptation" for TypedDict `Movie` (invalid-key)'] +Line 43: Unexpected errors ['typeddicts_extra_items.py:43:5 - major: invalid-key: Unknown key "other_extra_key" for TypedDict `InheritedMovie` (invalid-key)'] +Line 129: Unexpected errors ['typeddicts_extra_items.py:129:15 - major: invalid-key: Unknown key "year" for TypedDict `MovieEI` (invalid-key)'] +Line 254: Unexpected errors ['typeddicts_extra_items.py:254:63 - major: invalid-key: Unknown key "year" for TypedDict `MovieExtraInt` (invalid-key)'] +Line 255: Unexpected errors ['typeddicts_extra_items.py:255:63 - major: invalid-key: Unknown key "description" for TypedDict `MovieExtraStr` (invalid-key)'] +Line 266: Unexpected errors ['typeddicts_extra_items.py:266:64 - major: invalid-key: Unknown key "year" for TypedDict `MovieExtraInt` (invalid-key)'] +Line 284: Unexpected errors ['typeddicts_extra_items.py:284:43 - major: invalid-key: Unknown key "year" for TypedDict `ExtraMovie` (invalid-key)'] +Line 299: Unexpected errors ['typeddicts_extra_items.py:299:54 - major: invalid-key: Unknown key "summary" for TypedDict `MovieExtraStr` (invalid-key)'] +Line 300: Unexpected errors ['typeddicts_extra_items.py:300:34 - major: invalid-assignment: Object of type `MovieExtraStr` is not assignable to `Mapping[str, str]` (invalid-assignment)'] +Line 302: Unexpected errors ['typeddicts_extra_items.py:302:54 - major: invalid-key: Unknown key "year" for TypedDict `MovieExtraInt` (invalid-key)'] +Line 304: Unexpected errors ['typeddicts_extra_items.py:304:44 - major: invalid-assignment: Object of type `MovieExtraInt` is not assignable to `Mapping[str, int | str]` (invalid-assignment)'] +Line 310: Unexpected errors ['typeddicts_extra_items.py:310:5 - major: type-assertion-failure: Argument does not have asserted type `list[tuple[str, int | str]]` (type-assertion-failure)'] +Line 311: Unexpected errors ['typeddicts_extra_items.py:311:5 - major: type-assertion-failure: Argument does not have asserted type `list[int | str]` (type-assertion-failure)'] +Line 326: Unexpected errors ['typeddicts_extra_items.py:326:25 - major: invalid-assignment: Object of type `IntDict` is not assignable to `dict[str, int]` (invalid-assignment)'] +Line 329: Unexpected errors ['typeddicts_extra_items.py:329:52 - major: invalid-key: Unknown key "bar" for TypedDict `IntDictWithNum` (invalid-key)'] +Line 330: Unexpected errors ['typeddicts_extra_items.py:330:32 - major: invalid-assignment: Object of type `IntDictWithNum` is not assignable to `dict[str, int]` (invalid-assignment)'] +Line 337: Unexpected errors ['typeddicts_extra_items.py:337:1 - major: unresolved-attribute: Object of type `IntDictWithNum` has no attribute `clear` (unresolved-attribute)'] +Line 339: Unexpected errors ['typeddicts_extra_items.py:339:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, int]` (type-assertion-failure)', 'typeddicts_extra_items.py:339:13 - major: unresolved-attribute: Object of type `IntDictWithNum` has no attribute `popitem` (unresolved-attribute)'] +Line 342: Unexpected errors ['typeddicts_extra_items.py:342:27 - major: invalid-key: TypedDict `IntDictWithNum` can only be subscripted with a string literal key, got key of type `str`. (invalid-key)'] +Line 343: Unexpected errors ['typeddicts_extra_items.py:343:31 - major: invalid-key: TypedDict `IntDictWithNum` can only be subscripted with a string literal key, got key of type `str` (invalid-key)'] +""" +output = """ +typeddicts_extra_items.py:14:37 - major: invalid-key: Unknown key "novel_adaptation" for TypedDict `Movie` (invalid-key) +typeddicts_extra_items.py:15:37 - major: invalid-key: Unknown key "year" for TypedDict `Movie` (invalid-key) +typeddicts_extra_items.py:29:5 - major: type-assertion-failure: Argument does not have asserted type `bool` (type-assertion-failure) +typeddicts_extra_items.py:29:23 - major: invalid-key: Unknown key "novel_adaptation" for TypedDict `Movie` (invalid-key) +typeddicts_extra_items.py:39:54 - major: invalid-argument-type: Invalid argument to key "year" with declared type `int` on TypedDict `InheritedMovie` (invalid-argument-type) +typeddicts_extra_items.py:43:5 - major: invalid-key: Unknown key "other_extra_key" for TypedDict `InheritedMovie` (invalid-key) +typeddicts_extra_items.py:129:15 - major: invalid-key: Unknown key "year" for TypedDict `MovieEI` (invalid-key) +typeddicts_extra_items.py:254:63 - major: invalid-key: Unknown key "year" for TypedDict `MovieExtraInt` (invalid-key) +typeddicts_extra_items.py:255:63 - major: invalid-key: Unknown key "description" for TypedDict `MovieExtraStr` (invalid-key) +typeddicts_extra_items.py:266:64 - major: invalid-key: Unknown key "year" for TypedDict `MovieExtraInt` (invalid-key) +typeddicts_extra_items.py:278:47 - major: invalid-key: Unknown key "year" for TypedDict `NonClosedMovie` (invalid-key) +typeddicts_extra_items.py:284:43 - major: invalid-key: Unknown key "year" for TypedDict `ExtraMovie` (invalid-key) +typeddicts_extra_items.py:285:43 - major: invalid-key: Unknown key "language" for TypedDict `ExtraMovie` (invalid-key) +typeddicts_extra_items.py:293:44 - major: invalid-key: Unknown key "year" for TypedDict `ClosedMovie` (invalid-key) +typeddicts_extra_items.py:299:54 - major: invalid-key: Unknown key "summary" for TypedDict `MovieExtraStr` (invalid-key) +typeddicts_extra_items.py:300:34 - major: invalid-assignment: Object of type `MovieExtraStr` is not assignable to `Mapping[str, str]` (invalid-assignment) +typeddicts_extra_items.py:302:54 - major: invalid-key: Unknown key "year" for TypedDict `MovieExtraInt` (invalid-key) +typeddicts_extra_items.py:303:34 - major: invalid-assignment: Object of type `MovieExtraInt` is not assignable to `Mapping[str, int]` (invalid-assignment) +typeddicts_extra_items.py:304:44 - major: invalid-assignment: Object of type `MovieExtraInt` is not assignable to `Mapping[str, int | str]` (invalid-assignment) +typeddicts_extra_items.py:310:5 - major: type-assertion-failure: Argument does not have asserted type `list[tuple[str, int | str]]` (type-assertion-failure) +typeddicts_extra_items.py:311:5 - major: type-assertion-failure: Argument does not have asserted type `list[int | str]` (type-assertion-failure) +typeddicts_extra_items.py:326:25 - major: invalid-assignment: Object of type `IntDict` is not assignable to `dict[str, int]` (invalid-assignment) +typeddicts_extra_items.py:329:52 - major: invalid-key: Unknown key "bar" for TypedDict `IntDictWithNum` (invalid-key) +typeddicts_extra_items.py:330:32 - major: invalid-assignment: Object of type `IntDictWithNum` is not assignable to `dict[str, int]` (invalid-assignment) +typeddicts_extra_items.py:337:1 - major: unresolved-attribute: Object of type `IntDictWithNum` has no attribute `clear` (unresolved-attribute) +typeddicts_extra_items.py:339:1 - major: type-assertion-failure: Argument does not have asserted type `tuple[str, int]` (type-assertion-failure) +typeddicts_extra_items.py:339:13 - major: unresolved-attribute: Object of type `IntDictWithNum` has no attribute `popitem` (unresolved-attribute) +typeddicts_extra_items.py:342:27 - major: invalid-key: TypedDict `IntDictWithNum` can only be subscripted with a string literal key, got key of type `str`. (invalid-key) +typeddicts_extra_items.py:343:31 - major: invalid-key: TypedDict `IntDictWithNum` can only be subscripted with a string literal key, got key of type `str` (invalid-key) +typeddicts_extra_items.py:352:25 - major: invalid-assignment: Object of type `dict[str, int]` is not assignable to `IntDict` (invalid-assignment) +""" diff --git a/conformance/results/ty/typeddicts_final.toml b/conformance/results/ty/typeddicts_final.toml new file mode 100644 index 00000000..cdd4d0cd --- /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 00000000..599d3bd1 --- /dev/null +++ b/conformance/results/ty/typeddicts_inheritance.toml @@ -0,0 +1,8 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 44: Expected 1 errors +Line 65: Expected 1 errors +Lines 54, 55: Expected error (tag 'Y1') +""" +output = """ +""" diff --git a/conformance/results/ty/typeddicts_operations.toml b/conformance/results/ty/typeddicts_operations.toml new file mode 100644 index 00000000..b8c4f340 --- /dev/null +++ b/conformance/results/ty/typeddicts_operations.toml @@ -0,0 +1,16 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 49: Expected 1 errors +""" +output = """ +typeddicts_operations.py:22:17 - major: invalid-assignment: Invalid assignment to key "name" with declared type `str` on TypedDict `Movie` (invalid-assignment) +typeddicts_operations.py:23:17 - major: invalid-assignment: Invalid assignment to key "year" with declared type `int` on TypedDict `Movie` (invalid-assignment) +typeddicts_operations.py:24:7 - major: invalid-key: Unknown key "other" for TypedDict `Movie` (invalid-key) +typeddicts_operations.py:26:13 - major: invalid-key: Unknown key "other" for TypedDict `Movie` (invalid-key) +typeddicts_operations.py:28:9 - major: missing-typed-dict-key: Missing required key 'year' in TypedDict `Movie` constructor (missing-typed-dict-key) +typeddicts_operations.py:29:42 - major: invalid-argument-type: Invalid argument to key "year" with declared type `int` on TypedDict `Movie` (invalid-argument-type) +typeddicts_operations.py:32:36 - major: invalid-key: Unknown key "other" for TypedDict `Movie` (invalid-key) +typeddicts_operations.py:37:20 - major: missing-typed-dict-key: Missing required key 'name' in TypedDict `Movie` constructor (missing-typed-dict-key) +typeddicts_operations.py:47:1 - major: unresolved-attribute: Object of type `Movie` has no attribute `clear` (unresolved-attribute) +typeddicts_operations.py:62:1 - major: unresolved-attribute: Object of type `MovieOptional` has no attribute `clear` (unresolved-attribute) +""" diff --git a/conformance/results/ty/typeddicts_readonly.toml b/conformance/results/ty/typeddicts_readonly.toml new file mode 100644 index 00000000..dfbdd91e --- /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 - major: invalid-assignment: Cannot assign to key "members" on TypedDict `Band` (invalid-assignment) +typeddicts_readonly.py:50:4 - major: invalid-assignment: Cannot assign to key "title" on TypedDict `Movie1` (invalid-assignment) +typeddicts_readonly.py:51:4 - major: invalid-assignment: Cannot assign to key "year" on TypedDict `Movie1` (invalid-assignment) +typeddicts_readonly.py:60:4 - major: invalid-assignment: Cannot assign to key "title" on TypedDict `Movie2` (invalid-assignment) +typeddicts_readonly.py:61:4 - major: invalid-assignment: Cannot assign to key "year" on TypedDict `Movie2` (invalid-assignment) +""" diff --git a/conformance/results/ty/typeddicts_readonly_consistency.toml b/conformance/results/ty/typeddicts_readonly_consistency.toml new file mode 100644 index 00000000..460453f5 --- /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 - major: invalid-assignment: Object of type `A1` is not assignable to `B1` (invalid-assignment) +typeddicts_readonly_consistency.py:38:14 - major: invalid-assignment: Object of type `C1` is not assignable to `B1` (invalid-assignment) +typeddicts_readonly_consistency.py:40:14 - major: invalid-assignment: Object of type `A1` is not assignable to `C1` (invalid-assignment) +typeddicts_readonly_consistency.py:81:14 - major: invalid-assignment: Object of type `A2` is not assignable to `B2` (invalid-assignment) +typeddicts_readonly_consistency.py:82:14 - major: invalid-assignment: Object of type `C2` is not assignable to `B2` (invalid-assignment) +typeddicts_readonly_consistency.py:84:14 - major: invalid-assignment: Object of type `A2` is not assignable to `C2` (invalid-assignment) +typeddicts_readonly_consistency.py:85:14 - major: invalid-assignment: Object of type `B2` is not assignable to `C2` (invalid-assignment) +""" diff --git a/conformance/results/ty/typeddicts_readonly_inheritance.toml b/conformance/results/ty/typeddicts_readonly_inheritance.toml new file mode 100644 index 00000000..08c8b4eb --- /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 - major: invalid-assignment: Cannot assign to key "name" on TypedDict `Album2` (invalid-assignment) +typeddicts_readonly_inheritance.py:65:19 - major: missing-typed-dict-key: Missing required key 'name' in TypedDict `RequiredName` constructor (missing-typed-dict-key) +typeddicts_readonly_inheritance.py:82:14 - major: invalid-assignment: Invalid assignment to key "ident" with declared type `str` on TypedDict `User` (invalid-assignment) +typeddicts_readonly_inheritance.py:83:15 - major: invalid-argument-type: Invalid argument to key "ident" with declared type `str` on TypedDict `User` (invalid-argument-type) +typeddicts_readonly_inheritance.py:84:5 - major: missing-typed-dict-key: Missing required key 'ident' in TypedDict `User` constructor (missing-typed-dict-key) +""" diff --git a/conformance/results/ty/typeddicts_readonly_kwargs.toml b/conformance/results/ty/typeddicts_readonly_kwargs.toml new file mode 100644 index 00000000..ff510105 --- /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 00000000..c614899e --- /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 00000000..355a54a8 --- /dev/null +++ b/conformance/results/ty/typeddicts_required.toml @@ -0,0 +1,9 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 12: Expected 1 errors +Line 16: Expected 1 errors +Line 59: Expected 1 errors +Line 60: Expected 1 errors +""" +output = """ +""" diff --git a/conformance/results/ty/typeddicts_type_consistency.toml b/conformance/results/ty/typeddicts_type_consistency.toml new file mode 100644 index 00000000..a194de2a --- /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 - major: invalid-assignment: Object of type `B1` is not assignable to `A1` (invalid-assignment) +typeddicts_type_consistency.py:38:10 - major: invalid-assignment: Object of type `B2` is not assignable to `A2` (invalid-assignment) +typeddicts_type_consistency.py:65:6 - major: invalid-assignment: Object of type `A3` is not assignable to `B3` (invalid-assignment) +typeddicts_type_consistency.py:69:21 - major: invalid-key: Unknown key "y" for TypedDict `A3` (invalid-key) +typeddicts_type_consistency.py:76:22 - major: invalid-assignment: Object of type `B3` is not assignable to `dict[str, int]` (invalid-assignment) +typeddicts_type_consistency.py:77:25 - major: invalid-assignment: Object of type `B3` is not assignable to `dict[str, object]` (invalid-assignment) +typeddicts_type_consistency.py:78:22 - major: invalid-assignment: Object of type `B3` is not assignable to `dict[Any, Any]` (invalid-assignment) +typeddicts_type_consistency.py:82:25 - major: invalid-assignment: Object of type `B3` is not assignable to `Mapping[str, int]` (invalid-assignment) +typeddicts_type_consistency.py:101:14 - major: invalid-assignment: Object of type `Unknown | None` is not assignable to `str` (invalid-assignment) +typeddicts_type_consistency.py:126:56 - major: invalid-argument-type: Invalid argument to key "inner_key" with declared type `str` on TypedDict `Inner1` (invalid-argument-type) +""" diff --git a/conformance/results/ty/typeddicts_usage.toml b/conformance/results/ty/typeddicts_usage.toml new file mode 100644 index 00000000..554590c1 --- /dev/null +++ b/conformance/results/ty/typeddicts_usage.toml @@ -0,0 +1,11 @@ +conformance_automated = "Fail" +errors_diff = """ +Line 35: Expected 1 errors +""" +output = """ +typeddicts_usage.py:23:7 - major: invalid-key: Unknown key "director" for TypedDict `Movie` (invalid-key) +typeddicts_usage.py:24:17 - major: invalid-assignment: Invalid assignment to key "year" with declared type `int` on TypedDict `Movie` (invalid-assignment) +typeddicts_usage.py:28:17 - major: missing-typed-dict-key: Missing required key 'name' in TypedDict `Movie` constructor (missing-typed-dict-key) +typeddicts_usage.py:28:18 - major: invalid-key: Unknown key "title" for TypedDict `Movie` (invalid-key) +typeddicts_usage.py:40:24 - major: invalid-type-form: The special form `typing.TypedDict` is not allowed in type expressions (invalid-type-form) +""" diff --git a/conformance/results/ty/version.toml b/conformance/results/ty/version.toml new file mode 100644 index 00000000..cddfe40c --- /dev/null +++ b/conformance/results/ty/version.toml @@ -0,0 +1 @@ +version = "ty 0.0.2 (42835578d 2025-12-16)" diff --git a/conformance/src/type_checker.py b/conformance/src/type_checker.py index c373fc4f..8dae0d7d 100644 --- a/conformance/src/type_checker.py +++ b/conformance/src/type_checker.py @@ -200,6 +200,74 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: line_to_errors.setdefault(int(lineno), []).append(line) 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", "gitlab"] + proc = run(command, stdout=PIPE, text=True, encoding="utf-8") + diagnostics = json.loads(proc.stdout) + + # Add results to a dictionary keyed by the file name. + results_dict: dict[str, str] = {} + for diagnostic in diagnostics: + location = diagnostic["location"] + positions = location["positions"] + file_path = Path(location["path"]) + file_name = file_path.name + line_number = positions["begin"]["line"] + col_number = positions["begin"]["column"] + severity = diagnostic["severity"] + message = diagnostic["description"] + + line_text = f"{file_name}:{line_number}:{col_number} - {severity}: {message} ({diagnostic['check_name']})\n" + results_dict[file_name] = results_dict.get(file_name, "") + line_text + + return results_dict + + def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: + # narrowing_typeguard.py:102:9 - error: User-defined type guard functions and methods must have at least one input parameter (reportGeneralTypeIssues) + line_to_errors: dict[int, list[str]] = {} + for line in output: + if not line or line[0].isspace(): + continue + # Ignore indented notes + assert line.count(":") >= 3, f"Failed to parse line: {line!r}" + _, lineno, kind, _ = line.split(":", maxsplit=3) + kind = kind.split()[-1] + if kind not in ("major", "minor"): + continue + line_to_errors.setdefault(int(lineno), []).append(line) + + return line_to_errors + class ZubanLSTypeChecker(MypyTypeChecker): @property @@ -346,4 +414,5 @@ def parse_errors(self, output: Sequence[str]) -> dict[int, list[str]]: PyrightTypeChecker(), ZubanLSTypeChecker(), PyreflyTypeChecker(), + TyTypeChecker() )