Skip to content

Commit

Permalink
Updated conformance test results for mypy 1.10 and pyright 1.1.360. M… (
Browse files Browse the repository at this point in the history
#1726)

Updated conformance test results for mypy 1.10 and pyright 1.1.360. Mypy added partial support for TypeAliasType and TypeIs. Pyright fixed a couple of bugs in constructor call evaluation.
  • Loading branch information
erictraut committed Apr 24, 2024
1 parent f7f5723 commit c62646f
Show file tree
Hide file tree
Showing 16 changed files with 79 additions and 152 deletions.
107 changes: 36 additions & 71 deletions conformance/results/mypy/aliases_typealiastype.toml
@@ -1,82 +1,47 @@
conformant = "Unsupported"
conformant = "Partial"
notes = """
Support for TypeAliasType is not implemented.
Incorrectly rejects some recursive type aliases using TypeAliasType.
Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.
Generates error when accessing `__value__` attribute of TypeAliasType.
"""
output = """
aliases_typealiastype.py:17: error: Type variable "aliases_typealiastype.T" is unbound [valid-type]
aliases_typealiastype.py:17: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
aliases_typealiastype.py:17: note: (Hint: Use "T" in function signature to bind "T" inside a function)
aliases_typealiastype.py:17: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:18: error: Type variable "aliases_typealiastype.T" is unbound [valid-type]
aliases_typealiastype.py:18: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class)
aliases_typealiastype.py:18: note: (Hint: Use "T" in function signature to bind "T" inside a function)
aliases_typealiastype.py:18: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]
aliases_typealiastype.py:18: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class)
aliases_typealiastype.py:18: note: (Hint: Use "S" in function signature to bind "S" inside a function)
aliases_typealiastype.py:18: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:19: error: Cannot resolve name "GoodAlias4" (possible cyclic definition) [misc]
aliases_typealiastype.py:19: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:22: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]
aliases_typealiastype.py:22: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class)
aliases_typealiastype.py:22: note: (Hint: Use "S" in function signature to bind "S" inside a function)
aliases_typealiastype.py:20: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]
aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]
aliases_typealiastype.py:22: error: TypeVarTuple "Ts" is unbound [valid-type]
aliases_typealiastype.py:23: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object, object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:32: error: "TypeAliasType" has no attribute "other_attrib" [attr-defined]
aliases_typealiastype.py:35: error: Variable "aliases_typealiastype.GoodAlias4" is not valid as a type [valid-type]
aliases_typealiastype.py:35: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:36: error: Variable "aliases_typealiastype.GoodAlias4" is not valid as a type [valid-type]
aliases_typealiastype.py:36: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:37: error: Unexpected "..." [misc]
aliases_typealiastype.py:37: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]
aliases_typealiastype.py:37: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:38: error: Unexpected "..." [misc]
aliases_typealiastype.py:38: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]
aliases_typealiastype.py:38: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:39: error: Bracketed expression "[...]" is not valid as a type [valid-type]
aliases_typealiastype.py:39: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]
aliases_typealiastype.py:39: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:39: error: Unpack is only valid in a variadic position [valid-type]
aliases_typealiastype.py:40: error: Unexpected "..." [misc]
aliases_typealiastype.py:40: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]
aliases_typealiastype.py:40: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:43: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]
aliases_typealiastype.py:43: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class)
aliases_typealiastype.py:43: note: (Hint: Use "S" in function signature to bind "S" inside a function)
aliases_typealiastype.py:43: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:44: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]
aliases_typealiastype.py:44: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class)
aliases_typealiastype.py:44: note: (Hint: Use "S" in function signature to bind "S" inside a function)
aliases_typealiastype.py:45: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:46: error: Cannot determine type of "BadAlias4" [has-type]
aliases_typealiastype.py:47: error: Cannot determine type of "BadAlias5" [has-type]
aliases_typealiastype.py:47: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]
aliases_typealiastype.py:48: error: Cannot determine type of "BadAlias7" [has-type]
aliases_typealiastype.py:27: error: Type variable "T" is not included in type_params [valid-type]
aliases_typealiastype.py:30: error: "type[int]" has no attribute "__value__" [attr-defined]
aliases_typealiastype.py:32: error: "type[int]" has no attribute "other_attrib" [attr-defined]
aliases_typealiastype.py:40: error: Type argument "int" of "GoodAlias5" must be a subtype of "str" [type-var]
aliases_typealiastype.py:43: error: Type variable "S" is not included in type_params [valid-type]
aliases_typealiastype.py:44: error: Type variable "S" is not included in type_params [valid-type]
aliases_typealiastype.py:45: error: Tuple literal expected as the type_params argument to TypeAliasType [misc]
aliases_typealiastype.py:46: error: Cannot resolve name "BadAlias4" (possible cyclic definition) [misc]
aliases_typealiastype.py:47: error: Invalid recursive alias: a union item of itself [misc]
aliases_typealiastype.py:48: error: Cannot resolve name "BadAlias6" (possible cyclic definition) [misc]
aliases_typealiastype.py:48: error: Cannot resolve name "BadAlias7" (possible cyclic definition) [misc]
aliases_typealiastype.py:48: error: Name "BadAlias7" is used before definition [used-before-def]
aliases_typealiastype.py:49: error: Cannot resolve name "BadAlias7" (possible cyclic definition) [misc]
aliases_typealiastype.py:52: error: Invalid type alias: expression is not a valid type [valid-type]
aliases_typealiastype.py:53: error: Bracketed expression "[...]" is not valid as a type [valid-type]
aliases_typealiastype.py:54: error: Invalid type alias: expression is not a valid type [valid-type]
aliases_typealiastype.py:55: error: Invalid type alias: expression is not a valid type [valid-type]
aliases_typealiastype.py:56: error: Invalid type alias: expression is not a valid type [valid-type]
aliases_typealiastype.py:57: error: Invalid type alias: expression is not a valid type [valid-type]
aliases_typealiastype.py:58: error: Invalid type alias: expression is not a valid type [valid-type]
aliases_typealiastype.py:59: error: Invalid type alias: expression is not a valid type [valid-type]
aliases_typealiastype.py:60: error: Variable "aliases_typealiastype.var1" is not valid as a type [valid-type]
aliases_typealiastype.py:60: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#variables-vs-type-aliases
aliases_typealiastype.py:61: error: Invalid type: try using Literal[True] instead? [valid-type]
aliases_typealiastype.py:62: error: Invalid type: try using Literal[1] instead? [valid-type]
aliases_typealiastype.py:63: error: Invalid type alias: expression is not a valid type [valid-type]
aliases_typealiastype.py:63: error: Function "list" could always be true in boolean context [truthy-function]
aliases_typealiastype.py:64: error: Invalid type alias: expression is not a valid type [valid-type]
"""
conformance_automated = "Fail"
errors_diff = """
Line 52: Expected 1 errors
Line 53: Expected 1 errors
Line 54: Expected 1 errors
Line 55: Expected 1 errors
Line 56: Expected 1 errors
Line 57: Expected 1 errors
Line 58: Expected 1 errors
Line 59: Expected 1 errors
Line 60: Expected 1 errors
Line 61: Expected 1 errors
Line 62: Expected 1 errors
Line 64: Expected 1 errors
Line 17: Unexpected errors ['aliases_typealiastype.py:17: error: Type variable "aliases_typealiastype.T" is unbound [valid-type]', 'aliases_typealiastype.py:17: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]']
Line 18: Unexpected errors ['aliases_typealiastype.py:18: error: Type variable "aliases_typealiastype.T" is unbound [valid-type]', 'aliases_typealiastype.py:18: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]', 'aliases_typealiastype.py:18: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]']
Line 19: Unexpected errors ['aliases_typealiastype.py:19: error: Cannot resolve name "GoodAlias4" (possible cyclic definition) [misc]', 'aliases_typealiastype.py:19: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]']
Line 22: Unexpected errors ['aliases_typealiastype.py:22: error: Type variable "aliases_typealiastype.S" is unbound [valid-type]', 'aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]', 'aliases_typealiastype.py:22: error: TypeVarTuple "Ts" is unbound [valid-type]']
Line 23: Unexpected errors ['aliases_typealiastype.py:23: error: Argument "type_params" to "TypeAliasType" has incompatible type "tuple[object, object, object, object]"; expected "tuple[TypeVar | ParamSpec | TypeVarTuple, ...]" [arg-type]']
Line 35: Unexpected errors ['aliases_typealiastype.py:35: error: Variable "aliases_typealiastype.GoodAlias4" is not valid as a type [valid-type]']
Line 36: Unexpected errors ['aliases_typealiastype.py:36: error: Variable "aliases_typealiastype.GoodAlias4" is not valid as a type [valid-type]']
Line 37: Unexpected errors ['aliases_typealiastype.py:37: error: Unexpected "..." [misc]', 'aliases_typealiastype.py:37: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]']
Line 38: Unexpected errors ['aliases_typealiastype.py:38: error: Unexpected "..." [misc]', 'aliases_typealiastype.py:38: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]']
Line 39: Unexpected errors ['aliases_typealiastype.py:39: error: Bracketed expression "[...]" is not valid as a type [valid-type]', 'aliases_typealiastype.py:39: error: Variable "aliases_typealiastype.GoodAlias5" is not valid as a type [valid-type]', 'aliases_typealiastype.py:39: error: Unpack is only valid in a variadic position [valid-type]']
Line 19: Unexpected errors ['aliases_typealiastype.py:19: error: Cannot resolve name "GoodAlias4" (possible cyclic definition) [misc]']
Line 20: Unexpected errors ['aliases_typealiastype.py:20: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]']
Line 22: Unexpected errors ['aliases_typealiastype.py:22: error: Cannot resolve name "GoodAlias5" (possible cyclic definition) [misc]']
Line 27: Unexpected errors ['aliases_typealiastype.py:27: error: Type variable "T" is not included in type_params [valid-type]']
Line 30: Unexpected errors ['aliases_typealiastype.py:30: error: "type[int]" has no attribute "__value__" [attr-defined]']
"""
1 change: 1 addition & 0 deletions conformance/results/mypy/annotations_generators.toml
Expand Up @@ -7,6 +7,7 @@ annotations_generators.py:51: error: Missing return statement [return]
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]
annotations_generators.py:71: error: No return value expected [return-value]
annotations_generators.py:75: error: Incompatible types in "yield" (actual type "B", expected type "A") [misc]
annotations_generators.py:86: error: The return type of a generator function should be "Generator" or one of its supertypes [misc]
annotations_generators.py:91: error: The return type of an async generator function should be "AsyncGenerator" or one of its supertypes [misc]
Expand Down
10 changes: 1 addition & 9 deletions conformance/results/mypy/generics_defaults_referential.toml
@@ -1,28 +1,20 @@
conformant = "Unsupported"
output = """
generics_defaults_referential.py:23: error: Expression is of type "type[slice[Any, Any, Any]]", not "type[slice[int, int, int | None]]" [assert-type]
generics_defaults_referential.py:24: error: Expression is of type "slice[int, StartT?, int | None]", not "slice[int, int, int | None]" [assert-type]
generics_defaults_referential.py:25: error: Expression is of type "slice[str, StartT?, int | None]", not "slice[str, str, int | None]" [assert-type]
generics_defaults_referential.py:37: error: Argument 1 to "Foo" has incompatible type "str"; expected "int" [arg-type]
generics_defaults_referential.py:87: error: Type variable "generics_defaults_referential.Z1" is unbound [valid-type]
generics_defaults_referential.py:87: note: (Hint: Use "Generic[Z1]" or "Protocol[Z1]" base class to bind "Z1" inside a class)
generics_defaults_referential.py:87: note: (Hint: Use "Z1" in function signature to bind "Z1" inside a function)
generics_defaults_referential.py:53: error: Type parameter "Start2T" has a default type that refers to one or more type variables that are out of scope [misc]
generics_defaults_referential.py:94: error: Expression is of type "type[Bar[Any, Any]]", not "type[Bar[Any, list[Any]]]" [assert-type]
generics_defaults_referential.py:95: error: Expression is of type "type[Bar[Any, Any]]", not "type[Bar[int, list[int]]]" [assert-type]
generics_defaults_referential.py:96: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]
"""
conformance_automated = "Fail"
errors_diff = """
Line 36: Expected 1 errors
Line 53: Expected 1 errors
Line 60: Expected 1 errors
Line 68: Expected 1 errors
Line 74: Expected 1 errors
Line 78: Expected 1 errors
Line 23: Unexpected errors ['generics_defaults_referential.py:23: error: Expression is of type "type[slice[Any, Any, Any]]", not "type[slice[int, int, int | None]]" [assert-type]']
Line 24: Unexpected errors ['generics_defaults_referential.py:24: error: Expression is of type "slice[int, StartT?, int | None]", not "slice[int, int, int | None]" [assert-type]']
Line 25: Unexpected errors ['generics_defaults_referential.py:25: error: Expression is of type "slice[str, StartT?, int | None]", not "slice[str, str, int | None]" [assert-type]']
Line 87: Unexpected errors ['generics_defaults_referential.py:87: error: Type variable "generics_defaults_referential.Z1" is unbound [valid-type]']
Line 94: Unexpected errors ['generics_defaults_referential.py:94: error: Expression is of type "type[Bar[Any, Any]]", not "type[Bar[Any, list[Any]]]" [assert-type]']
Line 95: Unexpected errors ['generics_defaults_referential.py:95: error: Expression is of type "type[Bar[Any, Any]]", not "type[Bar[int, list[int]]]" [assert-type]']
Line 96: Unexpected errors ['generics_defaults_referential.py:96: error: Expression is of type "Bar[int, list[Never]]", not "Bar[int, list[int]]" [assert-type]']
Expand Down

0 comments on commit c62646f

Please sign in to comment.