From 6f4ea9d95af5a3e5faca597a263a967a18d999c7 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sat, 11 Oct 2025 00:43:50 +0200 Subject: [PATCH] Latest results for all type checkers Also allowed multiple errors in one case for tests/overloads_definitions.py --- .../results/mypy/annotations_forward_refs.toml | 3 --- .../results/pyre/annotations_forward_refs.toml | 3 --- .../pyrefly/annotations_forward_refs.toml | 3 --- conformance/results/results.html | 2 +- conformance/results/zuban/aliases_newtype.toml | 2 +- .../results/zuban/aliases_type_statement.toml | 2 +- .../results/zuban/annotations_forward_refs.toml | 13 +++++-------- .../results/zuban/annotations_generators.toml | 2 +- .../results/zuban/dataclasses_match_args.toml | 2 +- conformance/results/zuban/dataclasses_slots.toml | 2 +- .../zuban/dataclasses_transform_converter.toml | 2 +- conformance/results/zuban/dataclasses_usage.toml | 2 +- conformance/results/zuban/enums_expansion.toml | 1 - .../results/zuban/generics_base_class.toml | 4 ++-- conformance/results/zuban/generics_basic.toml | 2 +- conformance/results/zuban/generics_defaults.toml | 4 ++-- .../results/zuban/generics_syntax_scoping.toml | 6 +++--- .../results/zuban/overloads_definitions.toml | 1 + .../results/zuban/protocols_class_objects.toml | 16 ++++++++-------- .../results/zuban/qualifiers_annotated.toml | 8 ++++---- conformance/results/zuban/specialtypes_none.toml | 4 ++-- conformance/results/zuban/specialtypes_type.toml | 8 ++++---- .../results/zuban/tuples_type_compat.toml | 10 +++++----- conformance/results/zuban/version.toml | 2 +- conformance/tests/overloads_definitions.py | 10 +++++----- 25 files changed, 51 insertions(+), 63 deletions(-) diff --git a/conformance/results/mypy/annotations_forward_refs.toml b/conformance/results/mypy/annotations_forward_refs.toml index bee7ebbd0..13f39be87 100644 --- a/conformance/results/mypy/annotations_forward_refs.toml +++ b/conformance/results/mypy/annotations_forward_refs.toml @@ -31,11 +31,8 @@ annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [a """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors -Line 66: Expected 1 errors Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type int?, not "int" [assert-type]'] """ diff --git a/conformance/results/pyre/annotations_forward_refs.toml b/conformance/results/pyre/annotations_forward_refs.toml index 6dd78f971..047537bca 100644 --- a/conformance/results/pyre/annotations_forward_refs.toml +++ b/conformance/results/pyre/annotations_forward_refs.toml @@ -29,12 +29,9 @@ annotations_forward_refs.py:103:7 Undefined or invalid type [11]: Annotation ` """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors Line 54: Expected 1 errors -Line 66: Expected 1 errors Line 89: Expected 1 errors Line 87: Unexpected errors ['annotations_forward_refs.py:87:7 Undefined or invalid type [11]: Annotation `ClassD.int` is not defined as a type.'] Line 96: Unexpected errors ['annotations_forward_refs.py:96:0 Assert type [70]: Expected `int` but got `unknown`.'] diff --git a/conformance/results/pyrefly/annotations_forward_refs.toml b/conformance/results/pyrefly/annotations_forward_refs.toml index f15a1fe41..fc48f82b7 100644 --- a/conformance/results/pyrefly/annotations_forward_refs.toml +++ b/conformance/results/pyrefly/annotations_forward_refs.toml @@ -5,11 +5,8 @@ Does not reject some type forms that require quotes. """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors -Line 66: Expected 1 errors Line 87: Unexpected errors ['Expected a type form, got instance of `(self: Self@ClassD) -> None` [not-a-type]'] Line 96: Unexpected errors ['assert_type(Any, int) failed [assert-type]'] """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 68b02c4ad..7a6576212 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -164,7 +164,7 @@

Python Type System Conformance Test Results

pyre 0.9.25
-
zuban 0.0.24
+
zuban 0.1.0
pyrefly 0.36.2
diff --git a/conformance/results/zuban/aliases_newtype.toml b/conformance/results/zuban/aliases_newtype.toml index ed7a88d52..4bd918e54 100644 --- a/conformance/results/zuban/aliases_newtype.toml +++ b/conformance/results/zuban/aliases_newtype.toml @@ -4,7 +4,7 @@ errors_diff = """ output = """ aliases_newtype.py:11: error: Argument 1 to "UserId" has incompatible type "str"; expected "int" [arg-type] aliases_newtype.py:12: error: Incompatible types in assignment (expression has type "int", variable has type "UserId") [assignment] -aliases_newtype.py:18: error: Incompatible types in assignment (expression has type "Type[UserId]", variable has type "Type[Any]") [assignment] +aliases_newtype.py:18: error: Incompatible types in assignment (expression has type "type[UserId]", variable has type "type[Any]") [assignment] aliases_newtype.py:23: error: Cannot use isinstance() with NewType type [misc] aliases_newtype.py:26: error: Cannot subclass "NewType" [misc] aliases_newtype.py:35: error: String argument 1 "BadName" to NewType(...) does not match variable name "GoodName" [misc] diff --git a/conformance/results/zuban/aliases_type_statement.toml b/conformance/results/zuban/aliases_type_statement.toml index 85111674f..b82e24b75 100644 --- a/conformance/results/zuban/aliases_type_statement.toml +++ b/conformance/results/zuban/aliases_type_statement.toml @@ -6,7 +6,7 @@ aliases_type_statement.py:17: error: "TypeAliasType" has no attribute "bit_count aliases_type_statement.py:19: error: "TypeAliasType" not callable [operator] aliases_type_statement.py:23: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined] aliases_type_statement.py:26: error: Type alias defined using "type" statement not valid as base class [misc] -aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "Type[Any] | UnionType | tuple[_ClassInfo, ...]" [arg-type] +aliases_type_statement.py:31: error: Argument 2 to "isinstance" has incompatible type "TypeAliasType"; expected "type[Any] | UnionType | tuple[_ClassInfo, ...]" [arg-type] aliases_type_statement.py:37: error: Invalid type alias: expression is not a valid type [valid-type] aliases_type_statement.py:38: error: Bracketed expression "[...]" is not valid as a type [valid-type] aliases_type_statement.py:38: note: Did you mean "List[...]"? diff --git a/conformance/results/zuban/annotations_forward_refs.toml b/conformance/results/zuban/annotations_forward_refs.toml index eda32687b..5ca6e3aee 100644 --- a/conformance/results/zuban/annotations_forward_refs.toml +++ b/conformance/results/zuban/annotations_forward_refs.toml @@ -6,17 +6,14 @@ Does not ignore newlines in multi-line unions """ conformance_automated = "Fail" errors_diff = """ -Line 22: Expected 1 errors -Line 23: Expected 1 errors Line 24: Expected 1 errors Line 25: Expected 1 errors -Line 66: Expected 1 errors Line 82: Unexpected errors ['annotations_forward_refs.py:82: error: Name "str" is not defined [name-defined]'] Line 87: Unexpected errors ['annotations_forward_refs.py:87: error: Function "annotations_forward_refs.ClassD.int" is not valid as a type [valid-type]'] Line 95: Unexpected errors ['annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc]'] Line 96: Unexpected errors ['annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc]'] -Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: invalid syntax [syntax]'] -Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: invalid syntax [syntax]', 'annotations_forward_refs.py:105: error: invalid syntax [syntax]'] +Line 104: Unexpected errors ['annotations_forward_refs.py:104: error: Invalid syntax [syntax]'] +Line 105: Unexpected errors ['annotations_forward_refs.py:105: error: Invalid syntax [syntax]', 'annotations_forward_refs.py:105: error: Invalid syntax [syntax]'] """ output = """ annotations_forward_refs.py:41: error: Invalid type comment or annotation [valid-type] @@ -46,7 +43,7 @@ annotations_forward_refs.py:89: error: Function "annotations_forward_refs.ClassD annotations_forward_refs.py:89: note: Perhaps you need "Callable[...]" or a callback protocol? annotations_forward_refs.py:95: error: Expression is of type "Any", not "str" [misc] annotations_forward_refs.py:96: error: Expression is of type "Any", not "int" [misc] -annotations_forward_refs.py:104: error: invalid syntax [syntax] -annotations_forward_refs.py:105: error: invalid syntax [syntax] -annotations_forward_refs.py:105: error: invalid syntax [syntax] +annotations_forward_refs.py:104: error: Invalid syntax [syntax] +annotations_forward_refs.py:105: error: Invalid syntax [syntax] +annotations_forward_refs.py:105: error: Invalid syntax [syntax] """ diff --git a/conformance/results/zuban/annotations_generators.toml b/conformance/results/zuban/annotations_generators.toml index 21bd62604..8243e130d 100644 --- a/conformance/results/zuban/annotations_generators.toml +++ b/conformance/results/zuban/annotations_generators.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -annotations_generators.py:51: error: Missing return statement [return] +annotations_generators.py:51: error: Incompatible return value type (implicitly returns "None", expected "C") [return-value] annotations_generators.py:54: error: Incompatible return value type (got "bool", expected "C") [return-value] annotations_generators.py:57: error: Incompatible types in "yield" (actual type "int", expected type "A") [misc] annotations_generators.py:66: error: Incompatible types in "yield" (actual type "int", expected type "A") [misc] diff --git a/conformance/results/zuban/dataclasses_match_args.toml b/conformance/results/zuban/dataclasses_match_args.toml index 9a707d050..1309854f5 100644 --- a/conformance/results/zuban/dataclasses_match_args.toml +++ b/conformance/results/zuban/dataclasses_match_args.toml @@ -3,5 +3,5 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -dataclasses_match_args.py:42: error: "Type[DC4]" has no attribute "__match_args__" [attr-defined] +dataclasses_match_args.py:42: error: "type[DC4]" has no attribute "__match_args__" [attr-defined] """ diff --git a/conformance/results/zuban/dataclasses_slots.toml b/conformance/results/zuban/dataclasses_slots.toml index 9d9413f96..ecf43ca21 100644 --- a/conformance/results/zuban/dataclasses_slots.toml +++ b/conformance/results/zuban/dataclasses_slots.toml @@ -9,6 +9,6 @@ Line 25: Expected 1 errors output = """ dataclasses_slots.py:11: error: "DC1" both defines "__slots__" and is used with "slots=True" [misc] dataclasses_slots.py:38: error: Trying to assign name "y" that is not in "__slots__" of type "dataclasses_slots.DC3" [misc] -dataclasses_slots.py:66: error: "Type[DC6]" has no attribute "__slots__" [attr-defined] +dataclasses_slots.py:66: error: "type[DC6]" has no attribute "__slots__" [attr-defined] dataclasses_slots.py:69: error: "DC6" has no attribute "__slots__" [attr-defined] """ diff --git a/conformance/results/zuban/dataclasses_transform_converter.toml b/conformance/results/zuban/dataclasses_transform_converter.toml index 182ab6211..fc295f946 100644 --- a/conformance/results/zuban/dataclasses_transform_converter.toml +++ b/conformance/results/zuban/dataclasses_transform_converter.toml @@ -16,5 +16,5 @@ dataclasses_transform_converter.py:109: error: Argument 5 to "DC2" has incompati dataclasses_transform_converter.py:118: error: Incompatible types in assignment of a dataclass converter (expression has type "int", expected type "str") [assignment] dataclasses_transform_converter.py:119: error: Incompatible types in assignment of a dataclass converter (expression has type "int", expected type "str | bytes") [assignment] dataclasses_transform_converter.py:130: error: Argument "default" to "model_field" has incompatible type "int"; expected "str | None" [arg-type] -dataclasses_transform_converter.py:133: error: Argument "default_factory" to "model_field" has incompatible type "Type[int]"; expected "Callable[[], str] | None" [arg-type] +dataclasses_transform_converter.py:133: error: Argument "default_factory" to "model_field" has incompatible type "type[int]"; expected "Callable[[], str] | None" [arg-type] """ diff --git a/conformance/results/zuban/dataclasses_usage.toml b/conformance/results/zuban/dataclasses_usage.toml index 42fae5899..197dc1715 100644 --- a/conformance/results/zuban/dataclasses_usage.toml +++ b/conformance/results/zuban/dataclasses_usage.toml @@ -9,7 +9,7 @@ dataclasses_usage.py:61: error: Attributes without a default cannot follow attri dataclasses_usage.py:67: error: Attributes without a default cannot follow attributes with one [misc] dataclasses_usage.py:73: error: Attributes without a default cannot follow attributes with one [misc] dataclasses_usage.py:83: error: Too many arguments for "DC4" [call-arg] -dataclasses_usage.py:88: error: Argument "default_factory" to "field" has incompatible type "Type[str]"; expected "Callable[[], int]" [arg-type] +dataclasses_usage.py:88: error: Argument "default_factory" to "field" has incompatible type "type[str]"; expected "Callable[[], int]" [arg-type] dataclasses_usage.py:127: error: Too many arguments for "DC7" [call-arg] dataclasses_usage.py:130: error: Missing positional argument "y" in call to "DC8" [call-arg] dataclasses_usage.py:179: error: Too many arguments for "DC13" [call-arg] diff --git a/conformance/results/zuban/enums_expansion.toml b/conformance/results/zuban/enums_expansion.toml index 44138b03f..699dbd1c4 100644 --- a/conformance/results/zuban/enums_expansion.toml +++ b/conformance/results/zuban/enums_expansion.toml @@ -8,6 +8,5 @@ Line 53: Expected 1 errors Line 52: Unexpected errors ['enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [misc]'] """ output = """ -enums_expansion.py:35: error: Expression is of type "Color", not "Never" [misc] enums_expansion.py:52: error: Expression is of type "Literal[CustomFlags.FLAG3]", not "CustomFlags" [misc] """ diff --git a/conformance/results/zuban/generics_base_class.toml b/conformance/results/zuban/generics_base_class.toml index 81a4e00e3..c8166fd86 100644 --- a/conformance/results/zuban/generics_base_class.toml +++ b/conformance/results/zuban/generics_base_class.toml @@ -5,13 +5,13 @@ Does not detect inconsistent type variable ordering in multi-inheritance. conformance_automated = "Fail" errors_diff = """ Line 98: Expected 1 errors -Line 38: Unexpected errors ['generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]" [misc]'] +Line 38: Unexpected errors ['generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "type[Iterable]" [misc]'] """ output = """ generics_base_class.py:26: error: Argument 1 to "takes_dict_incorrect" has incompatible type "SymbolTable"; expected "dict[str, list[object]]" [arg-type] generics_base_class.py:29: error: Invalid type [valid-type] generics_base_class.py:30: error: Invalid type [valid-type] -generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "Type[Iterable]" [misc] +generics_base_class.py:38: error: Can only assign concrete classes to a variable of type "type[Iterable]" [misc] generics_base_class.py:49: error: "LinkedList" expects 1 type argument, but 2 given [type-arg] generics_base_class.py:61: error: "MyDict" expects 1 type argument, but 2 given [type-arg] generics_base_class.py:68: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] diff --git a/conformance/results/zuban/generics_basic.toml b/conformance/results/zuban/generics_basic.toml index 707f3c78f..1b2260e44 100644 --- a/conformance/results/zuban/generics_basic.toml +++ b/conformance/results/zuban/generics_basic.toml @@ -14,5 +14,5 @@ generics_basic.py:162: error: Free type variable expected in Generic[...] [misc generics_basic.py:163: error: Free type variable expected in Protocol[...] [misc] generics_basic.py:171: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] -generics_basic.py:208: error: Invalid metaclass "GenericMeta[T]" [misc] +generics_basic.py:208: error: Invalid metaclass "GenericMeta[T]" [metaclass] """ diff --git a/conformance/results/zuban/generics_defaults.toml b/conformance/results/zuban/generics_defaults.toml index 978478b80..c40a48dcd 100644 --- a/conformance/results/zuban/generics_defaults.toml +++ b/conformance/results/zuban/generics_defaults.toml @@ -7,7 +7,7 @@ ParamSpec after TypeVarTuple is not always handled correctly conformance_automated = "Fail" errors_diff = """ Line 142: Expected 1 errors -Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] +Line 155: Unexpected errors ['generics_defaults.py:155: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc]', 'generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc]'] Line 170: Unexpected errors ['generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc]'] """ output = """ @@ -16,7 +16,7 @@ generics_defaults.py:50: error: "AllTheDefaults" expects between 2 and 5 type ar generics_defaults.py:107: error: TypeVar default must be a subtype of the bound type [misc] generics_defaults.py:114: error: TypeVar default must be one of the constraint types [misc] generics_defaults.py:131: error: Expression is of type "int", not "Any" [misc] -generics_defaults.py:155: error: Expression is of type "Type[Foo6[int, [*Any, **Any]]]", not "Type[Foo6[int, str, [float, bool]]]" [misc] +generics_defaults.py:155: error: Expression is of type "type[Foo6[int, [*Any, **Any]]]", not "type[Foo6[int, str, [float, bool]]]" [misc] generics_defaults.py:155: error: Can only replace ParamSpec with a parameter types list or another ParamSpec, got "str" [misc] generics_defaults.py:170: error: Expression is of type "Callable[[Self], Self]", not "Callable[[Foo7[int]], Foo7[int]]" [misc] """ diff --git a/conformance/results/zuban/generics_syntax_scoping.toml b/conformance/results/zuban/generics_syntax_scoping.toml index 7f32a0ca8..6f4596518 100644 --- a/conformance/results/zuban/generics_syntax_scoping.toml +++ b/conformance/results/zuban/generics_syntax_scoping.toml @@ -7,7 +7,7 @@ errors_diff = """ Line 31: Unexpected errors ['generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" is unbound [misc]'] Line 56: Unexpected errors ['generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-redef]'] Line 62: Unexpected errors ['generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc]'] -Line 88: Unexpected errors ['generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" [arg-type]'] +Line 88: Unexpected errors ['generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "type[ClassE]"; expected "Callable[Never, Never]" [arg-type]'] Line 90: Unexpected errors ['generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 [no-redef]'] Line 106: Unexpected errors ['generics_syntax_scoping.py:106: error: Name "T" already defined on line 105 [no-redef]'] Line 108: Unexpected errors ['generics_syntax_scoping.py:108: error: Expression is of type "TypeVar", not "int" [misc]'] @@ -24,13 +24,13 @@ generics_syntax_scoping.py:31: error: Type variable "generics_syntax_scoping.T" generics_syntax_scoping.py:31: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) generics_syntax_scoping.py:31: note: (Hint: Use "T" in function signature to bind "T" inside a function) generics_syntax_scoping.py:35: error: Name "T" is used before definition [used-before-def] -generics_syntax_scoping.py:44: error: Argument 1 has incompatible type "Type[ClassD]"; expected "Callable[Never, Never]" [arg-type] +generics_syntax_scoping.py:44: error: Argument 1 has incompatible type "type[ClassD]"; expected "Callable[Never, Never]" [arg-type] generics_syntax_scoping.py:44: error: Name "T" is used before definition [used-before-def] generics_syntax_scoping.py:44: error: Variable "generics_syntax_scoping.T" is not valid as a type [valid-type] generics_syntax_scoping.py:44: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases generics_syntax_scoping.py:56: error: Name "S" already defined on line 55 [no-redef] generics_syntax_scoping.py:62: error: Expression is of type "TypeVar", not "str" [misc] -generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "Type[ClassE]"; expected "Callable[Never, Never]" [arg-type] +generics_syntax_scoping.py:88: error: Argument 1 has incompatible type "type[ClassE]"; expected "Callable[Never, Never]" [arg-type] generics_syntax_scoping.py:90: error: Name "T" already defined on line 89 [no-redef] generics_syntax_scoping.py:92: error: "T" already defined as a type parameter [misc] generics_syntax_scoping.py:95: error: "T" already defined as a type parameter [misc] diff --git a/conformance/results/zuban/overloads_definitions.toml b/conformance/results/zuban/overloads_definitions.toml index af18910fa..c24ff027b 100644 --- a/conformance/results/zuban/overloads_definitions.toml +++ b/conformance/results/zuban/overloads_definitions.toml @@ -7,6 +7,7 @@ overloads_definitions.py:28: error: An overloaded function outside a stub file m overloads_definitions.py:59: error: An overloaded function outside a stub file must have an implementation [no-overload-impl] overloads_definitions.py:71: error: Overload does not consistently use the "@staticmethod" decorator on all function signatures. [misc] overloads_definitions.py:84: error: Overload does not consistently use the "@classmethod" decorator on all function signatures. [misc] +overloads_definitions.py:93: error: Overloaded function implementation does not accept all possible arguments of signature 2 [misc] overloads_definitions.py:122: error: @final should be applied only to overload implementation [misc] overloads_definitions.py:136: error: @final should be applied only to overload implementation [misc] overloads_definitions.py:141: error: @final should be applied only to overload implementation [misc] diff --git a/conformance/results/zuban/protocols_class_objects.toml b/conformance/results/zuban/protocols_class_objects.toml index f02bb9de5..04681647c 100644 --- a/conformance/results/zuban/protocols_class_objects.toml +++ b/conformance/results/zuban/protocols_class_objects.toml @@ -2,24 +2,24 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -protocols_class_objects.py:29: error: Only concrete class can be given where "Type[Proto]" is expected [misc] -protocols_class_objects.py:34: error: Can only assign concrete classes to a variable of type "Type[Proto]" [misc] -protocols_class_objects.py:58: error: Incompatible types in assignment (expression has type "Type[ConcreteA]", variable has type "ProtoA1") [assignment] +protocols_class_objects.py:29: error: Only concrete class can be given where "type[Proto]" is expected [misc] +protocols_class_objects.py:34: error: Can only assign concrete classes to a variable of type "type[Proto]" [misc] +protocols_class_objects.py:58: error: Incompatible types in assignment (expression has type "type[ConcreteA]", variable has type "ProtoA1") [assignment] protocols_class_objects.py:58: note: Following member(s) of "ConcreteA" have conflicts: protocols_class_objects.py:58: note: Expected: protocols_class_objects.py:58: note: def method1(x: int) -> int protocols_class_objects.py:58: note: Got: protocols_class_objects.py:58: note: def method1(self: ConcreteA, x: int) -> int -protocols_class_objects.py:74: error: Incompatible types in assignment (expression has type "Type[ConcreteB]", variable has type "ProtoB1") [assignment] +protocols_class_objects.py:74: error: Incompatible types in assignment (expression has type "type[ConcreteB]", variable has type "ProtoB1") [assignment] protocols_class_objects.py:74: note: Following member(s) of "ConcreteB" have conflicts: protocols_class_objects.py:74: note: prop1: expected "int", got "property" -protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "Type[ConcreteC1]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:104: error: Incompatible types in assignment (expression has type "type[ConcreteC1]", variable has type "ProtoC1") [assignment] protocols_class_objects.py:104: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object -protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:106: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC1") [assignment] protocols_class_objects.py:106: note: Protocol member ProtoC1.attr1 expected class variable, got instance variable protocols_class_objects.py:106: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "Type[ConcreteC2]", variable has type "ProtoC2") [assignment] +protocols_class_objects.py:107: error: Incompatible types in assignment (expression has type "type[ConcreteC2]", variable has type "ProtoC2") [assignment] protocols_class_objects.py:107: note: Only class variables allowed for class object access on protocols, attr1 is an instance variable of "ConcreteC2" -protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "Type[ConcreteC3]", variable has type "ProtoC1") [assignment] +protocols_class_objects.py:108: error: Incompatible types in assignment (expression has type "type[ConcreteC3]", variable has type "ProtoC1") [assignment] protocols_class_objects.py:108: note: ClassVar protocol member ProtoC1.attr1 can never be matched by a class object """ diff --git a/conformance/results/zuban/qualifiers_annotated.toml b/conformance/results/zuban/qualifiers_annotated.toml index 1074d8db7..03e563a7a 100644 --- a/conformance/results/zuban/qualifiers_annotated.toml +++ b/conformance/results/zuban/qualifiers_annotated.toml @@ -17,10 +17,10 @@ qualifiers_annotated.py:47: error: Invalid type: try using Literal[1] instead? qualifiers_annotated.py:48: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:49: error: Invalid type comment or annotation [valid-type] qualifiers_annotated.py:59: error: Annotated[...] must have exactly one type argument and at least one annotation [valid-type] -qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] -qualifiers_annotated.py:72: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "Type[Any]") [assignment] -qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] -qualifiers_annotated.py:80: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] +qualifiers_annotated.py:71: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] +qualifiers_annotated.py:72: error: Incompatible types in assignment (expression has type "_SpecialForm", variable has type "type[Any]") [assignment] +qualifiers_annotated.py:79: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] +qualifiers_annotated.py:80: error: Argument 1 to "func4" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] qualifiers_annotated.py:86: error: "_SpecialForm" not callable [operator] qualifiers_annotated.py:87: error: "_SpecialForm" not callable [operator] qualifiers_annotated.py:88: error: "" not callable [operator] diff --git a/conformance/results/zuban/specialtypes_none.toml b/conformance/results/zuban/specialtypes_none.toml index 4cc99a4a7..c7f0e4b42 100644 --- a/conformance/results/zuban/specialtypes_none.toml +++ b/conformance/results/zuban/specialtypes_none.toml @@ -2,7 +2,7 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -specialtypes_none.py:21: error: Argument 1 to "func1" has incompatible type "Type[None]"; expected "None" [arg-type] +specialtypes_none.py:21: error: Argument 1 to "func1" has incompatible type "type[None]"; expected "None" [arg-type] specialtypes_none.py:27: error: Incompatible types in assignment (expression has type "None", variable has type "Iterable[Any]") [assignment] -specialtypes_none.py:41: error: Argument 1 to "func2" has incompatible type "None"; expected "Type[None]" [arg-type] +specialtypes_none.py:41: error: Argument 1 to "func2" has incompatible type "None"; expected "type[None]" [arg-type] """ diff --git a/conformance/results/zuban/specialtypes_type.toml b/conformance/results/zuban/specialtypes_type.toml index 31f3a8488..838e866ac 100644 --- a/conformance/results/zuban/specialtypes_type.toml +++ b/conformance/results/zuban/specialtypes_type.toml @@ -2,11 +2,11 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -specialtypes_type.py:56: error: Argument 1 to "func4" has incompatible type "Type[TeamUser]"; expected "Type[BasicUser | ProUser]" [arg-type] -specialtypes_type.py:70: error: Argument 1 to "func5" has incompatible type "_SpecialForm"; expected "Type[Never]" [arg-type] +specialtypes_type.py:56: error: Argument 1 to "func4" has incompatible type "type[TeamUser]"; expected "type[BasicUser | ProUser]" [arg-type] +specialtypes_type.py:70: error: Argument 1 to "func5" has incompatible type "_SpecialForm"; expected "type[Never]" [arg-type] specialtypes_type.py:76: error: Invalid type comment or annotation [valid-type] -specialtypes_type.py:117: error: "Type[object]" has no attribute "unknown" [attr-defined] -specialtypes_type.py:120: error: "Type[object]" has no attribute "unknown" [attr-defined] +specialtypes_type.py:117: error: "type[object]" has no attribute "unknown" [attr-defined] +specialtypes_type.py:120: error: "type[object]" has no attribute "unknown" [attr-defined] specialtypes_type.py:143: error: "_SpecialForm" has no attribute "unknown" [attr-defined] specialtypes_type.py:144: error: "_SpecialForm" has no attribute "unknown" [attr-defined] specialtypes_type.py:145: error: "_SpecialForm" has no attribute "unknown" [attr-defined] diff --git a/conformance/results/zuban/tuples_type_compat.toml b/conformance/results/zuban/tuples_type_compat.toml index b6ac1afb8..73d4e185c 100644 --- a/conformance/results/zuban/tuples_type_compat.toml +++ b/conformance/results/zuban/tuples_type_compat.toml @@ -2,8 +2,9 @@ conformant = "Pass" notes = """ Does not support tuple narrowing based on `len()` type guard (optional). """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Lines 111, 112: Expected error (tag 'func6_3') """ output = """ tuples_type_compat.py:15: error: Incompatible types in assignment (expression has type "tuple[float, complex]", variable has type "tuple[int, int]") [assignment] @@ -15,10 +16,9 @@ tuples_type_compat.py:62: error: Incompatible types in assignment (expression ha tuples_type_compat.py:76: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:81: error: Expression is of type "tuple[str, str] | tuple[int, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] tuples_type_compat.py:86: error: Expression is of type "tuple[int, str, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] -tuples_type_compat.py:101: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int]" [misc] -tuples_type_compat.py:106: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[str, str] | tuple[int, int]" [misc] -tuples_type_compat.py:111: error: Expression is of type "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]", not "tuple[int, str, int]" [misc] -tuples_type_compat.py:126: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, str]" [misc] +tuples_type_compat.py:102: error: Expression is of type "tuple[int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:107: error: Expression is of type "tuple[str, str] | tuple[int, int]", not "tuple[int] | tuple[str, str] | tuple[int, Unpack[Tuple[str, ...]], int]" [misc] +tuples_type_compat.py:127: error: Expression is of type "tuple[int | str, str]", not "tuple[int | str, int | str]" [misc] tuples_type_compat.py:129: error: Expression is of type "tuple[int | str, int | str]", not "tuple[int | str, int]" [misc] tuples_type_compat.py:157: error: Incompatible types in assignment (expression has type "tuple[int, str, str]", variable has type "tuple[int, str]") [assignment] tuples_type_compat.py:162: error: Incompatible types in assignment (expression has type "tuple[int, int, str]", variable has type "tuple[int, Unpack[Tuple[str, ...]]]") [assignment] diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index 88a02908d..2ffe43faa 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.0.24" +version = "zuban 0.1.0" diff --git a/conformance/tests/overloads_definitions.py b/conformance/tests/overloads_definitions.py index f223203c9..24ee5daa9 100644 --- a/conformance/tests/overloads_definitions.py +++ b/conformance/tests/overloads_definitions.py @@ -81,17 +81,17 @@ def func5(x: str, /) -> str: # E[func5] def func5(*args: object) -> int | str: # E[func5] return 1 - @overload # E[func6] + @overload # E[func6+] @classmethod - def func6(cls, x: int, /) -> int: # E[func6] + def func6(cls, x: int, /) -> int: # E[func6+] ... @overload - def func6(self, x: str, /) -> str: # E[func6] + def func6(self, x: str, /) -> str: # E[func6+] ... - @classmethod - def func6(cls, *args: int | str) -> int | str: # E[func6] + @classmethod # E[func6+] + def func6(cls, *args: int | str) -> int | str: # E[func6+] return 1