diff --git a/conformance/results/mypy/generics_basic.toml b/conformance/results/mypy/generics_basic.toml index 322d9ff7..49c3f816 100644 --- a/conformance/results/mypy/generics_basic.toml +++ b/conformance/results/mypy/generics_basic.toml @@ -1,22 +1,26 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly allows variance on contrained type variables. +""" output = """ generics_basic.py:40: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:41: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] generics_basic.py:49: error: Type variable must have at least two constrained types [misc] generics_basic.py:55: error: TypeVar constraint type cannot be parametrized by type variables [misc] generics_basic.py:69: error: Value of type variable "AnyStr" of "concat" cannot be "Sequence[object]" [type-var] -generics_basic.py:121: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] -generics_basic.py:157: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index] -generics_basic.py:158: error: Invalid index type "int" for "MyMap2[int, str]"; expected type "str" [index] -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:122: error: Duplicate type variables in Generic[...] or Protocol[...] [misc] +generics_basic.py:158: error: Invalid index type "int" for "MyMap1[str, int]"; expected type "str" [index] +generics_basic.py:159: error: Invalid index type "int" for "MyMap2[int, str]"; expected type "str" [index] +generics_basic.py:163: error: Free type variable expected in Generic[...] [misc] +generics_basic.py:164: error: Free type variable expected in Protocol[...] [misc] generics_basic.py:172: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] -generics_basic.py:208: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc] -generics_basic.py:208: error: Type variable "generics_basic.T" is unbound [valid-type] -generics_basic.py:208: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) -generics_basic.py:208: note: (Hint: Use "T" in function signature to bind "T" inside a function) +generics_basic.py:173: error: If Generic[...] or Protocol[...] is present it should list all type variables [misc] +generics_basic.py:209: error: Dynamic metaclass not supported for "GenericMetaInstance" [misc] +generics_basic.py:209: error: Type variable "generics_basic.T" is unbound [valid-type] +generics_basic.py:209: note: (Hint: Use "Generic[T]" or "Protocol[T]" base class to bind "T" inside a class) +generics_basic.py:209: note: (Hint: Use "T" in function signature to bind "T" inside a function) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 75: Expected 1 errors """ diff --git a/conformance/results/mypy/version.toml b/conformance/results/mypy/version.toml index 41659210..6bd36c63 100644 --- a/conformance/results/mypy/version.toml +++ b/conformance/results/mypy/version.toml @@ -1,2 +1,2 @@ version = "mypy 1.15.0" -test_duration = 1.5 +test_duration = 2.1 diff --git a/conformance/results/pyright/aliases_typealiastype.toml b/conformance/results/pyright/aliases_typealiastype.toml index 732bebde..e0f4a8c9 100644 --- a/conformance/results/pyright/aliases_typealiastype.toml +++ b/conformance/results/pyright/aliases_typealiastype.toml @@ -31,8 +31,8 @@ aliases_typealiastype.py:61:42 - error: Expected class but received "Literal[Tru aliases_typealiastype.py:62:42 - error: Expected class but received "Literal[1]" (reportGeneralTypeIssues) aliases_typealiastype.py:63:42 - error: Binary operator not allowed in type expression (reportInvalidTypeForm) aliases_typealiastype.py:64:42 - error: Type expressions cannot use format string literals (f-strings) (reportGeneralTypeIssues) +aliases_typealiastype.py:66:47 - error: "BadAlias21" is not defined (reportUndefinedVariable) """ -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 66: Expected 1 errors """ diff --git a/conformance/results/pyright/callables_protocol.toml b/conformance/results/pyright/callables_protocol.toml index 47af0047..82afbb4c 100644 --- a/conformance/results/pyright/callables_protocol.toml +++ b/conformance/results/pyright/callables_protocol.toml @@ -32,11 +32,10 @@ callables_protocol.py:70:7 - error: Type "(**b: str) -> None" is not assignable Type "(**b: str) -> None" is not assignable to type "(*vals: bytes, **kwargs: str) -> None" Parameter "*vals" has no corresponding parameter (reportAssignmentType) callables_protocol.py:97:16 - error: Type "(x: int) -> None" is not assignable to declared type "Proto4" - "function" is incompatible with protocol "Proto4" - "other_attribute" is not present - "__call__" is not present (reportAssignmentType) + "FunctionType" is incompatible with protocol "Proto4" + "other_attribute" is not present (reportAssignmentType) callables_protocol.py:121:18 - error: Type "(*vals: bytes, max_len: int | None = None) -> list[bytes]" is not assignable to declared type "NotProto6" - "function" is not assignable to "NotProto6" (reportAssignmentType) + "FunctionType" is not assignable to "NotProto6" (reportAssignmentType) callables_protocol.py:169:7 - error: Type "(x: int) -> Any" is not assignable to declared type "Proto8" One or more overloads of "__call__" is not assignable Type "(x: int) -> Any" is not assignable to type "(x: str) -> str" diff --git a/conformance/results/pyright/generics_basic.toml b/conformance/results/pyright/generics_basic.toml index 8b77d57f..727e4d51 100644 --- a/conformance/results/pyright/generics_basic.toml +++ b/conformance/results/pyright/generics_basic.toml @@ -1,4 +1,7 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +Incorrectly allows variance on contrained type variables. +""" output = """ generics_basic.py:40:15 - error: Argument of type "bytes" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" "bytes" is not assignable to "str" (reportArgumentType) @@ -8,19 +11,20 @@ generics_basic.py:49:44 - error: TypeVar must have at least two constrained type generics_basic.py:55:53 - error: TypeVar constraint type cannot be generic (reportGeneralTypeIssues) generics_basic.py:69:15 - error: Argument of type "bytes" cannot be assigned to parameter "y" of type "AnyStr@concat" in function "concat" "bytes" is not assignable to "str" (reportArgumentType) -generics_basic.py:121:24 - error: Type arguments for "Generic" must be unique (reportInvalidTypeForm) -generics_basic.py:157:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" - "Literal[0]" is not assignable to "str" (reportArgumentType) +generics_basic.py:122:24 - error: Type arguments for "Generic" must be unique (reportInvalidTypeForm) generics_basic.py:158:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" "Literal[0]" is not assignable to "str" (reportArgumentType) -generics_basic.py:162:20 - error: Type argument for "Generic" must be a type variable (reportInvalidTypeForm) -generics_basic.py:163:21 - error: Type argument for "Protocol" must be a type parameter (reportInvalidTypeForm) -generics_basic.py:171:7 - error: Generic[] or Protocol[] must include all type variables - Missing type variables: "T_co" (reportGeneralTypeIssues) +generics_basic.py:159:5 - error: Argument of type "Literal[0]" cannot be assigned to parameter "key" of type "str" in function "__getitem__" + "Literal[0]" is not assignable to "str" (reportArgumentType) +generics_basic.py:163:20 - error: Type argument for "Generic" must be a type variable (reportInvalidTypeForm) +generics_basic.py:164:21 - error: Type argument for "Protocol" must be a type parameter (reportInvalidTypeForm) generics_basic.py:172:7 - error: Generic[] or Protocol[] must include all type variables Missing type variables: "T_co" (reportGeneralTypeIssues) -generics_basic.py:208:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues) +generics_basic.py:173:7 - error: Generic[] or Protocol[] must include all type variables + Missing type variables: "T_co" (reportGeneralTypeIssues) +generics_basic.py:209:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 75: Expected 1 errors """ diff --git a/conformance/results/pyright/generics_syntax_infer_variance.toml b/conformance/results/pyright/generics_syntax_infer_variance.toml index b23985d5..05f4c0d5 100644 --- a/conformance/results/pyright/generics_syntax_infer_variance.toml +++ b/conformance/results/pyright/generics_syntax_infer_variance.toml @@ -6,6 +6,12 @@ generics_syntax_infer_variance.py:29:35 - error: Type "ShouldBeCovariant1[float] "ShouldBeCovariant1[float]" is not assignable to "ShouldBeCovariant1[int]" Type parameter "T@ShouldBeCovariant1" is covariant, but "float" is not a subtype of "int" "float" is not assignable to "int" (reportAssignmentType) +generics_syntax_infer_variance.py:36:37 - error: Cannot instantiate abstract class "ShouldBeCovariant2" + "Collection.__len__" is not implemented + "Sequence.__getitem__" is not implemented (reportAbstractUsage) +generics_syntax_infer_variance.py:37:35 - error: Cannot instantiate abstract class "ShouldBeCovariant2" + "Collection.__len__" is not implemented + "Sequence.__getitem__" is not implemented (reportAbstractUsage) generics_syntax_infer_variance.py:37:35 - error: Type "ShouldBeCovariant2[float]" is not assignable to declared type "ShouldBeCovariant2[int]" "ShouldBeCovariant2[float]" is not assignable to "ShouldBeCovariant2[int]" Type parameter "T@ShouldBeCovariant2" is covariant, but "float" is not a subtype of "int" @@ -57,6 +63,7 @@ generics_syntax_infer_variance.py:155:45 - error: Type "ShouldBeContravariant1[i Type parameter "T@ShouldBeContravariant1" is contravariant, but "int" is not a supertype of "float" "float" is not assignable to "int" (reportAssignmentType) """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 36: Unexpected errors ['generics_syntax_infer_variance.py:36:37 - error: Cannot instantiate abstract class "ShouldBeCovariant2"'] """ diff --git a/conformance/results/pyright/protocols_definition.toml b/conformance/results/pyright/protocols_definition.toml index c27a3753..0ed86d0f 100644 --- a/conformance/results/pyright/protocols_definition.toml +++ b/conformance/results/pyright/protocols_definition.toml @@ -46,7 +46,7 @@ protocols_definition.py:160:22 - error: Type "Concrete3_Bad5" is not assignable protocols_definition.py:218:22 - error: Type "Concrete4_Bad1" is not assignable to declared type "Template4" "Concrete4_Bad1" is incompatible with protocol "Template4" "val1" is an incompatible type - "function" is not assignable to "Sequence[float]" (reportAssignmentType) + "FunctionType" is not assignable to "Sequence[float]" (reportAssignmentType) protocols_definition.py:219:22 - error: Type "Concrete4_Bad2" is not assignable to declared type "Template4" "Concrete4_Bad2" is incompatible with protocol "Template4" "val1" is not present (reportAssignmentType) diff --git a/conformance/results/pyright/version.toml b/conformance/results/pyright/version.toml index f105339d..e3b37052 100644 --- a/conformance/results/pyright/version.toml +++ b/conformance/results/pyright/version.toml @@ -1,2 +1,2 @@ -version = "pyright 1.1.400" -test_duration = 1.1 +version = "pyright 1.1.401" +test_duration = 1.0 diff --git a/conformance/results/results.html b/conformance/results/results.html index b881e237..8bb35913 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -159,13 +159,13 @@
mypy 1.15.0
-1.5sec
+2.1sec
|
-pyright 1.1.400
-1.1sec
+ | pyright 1.1.401
+1.0sec
|
pyre 0.9.23
-10.7sec
+0.6sec
|
|
|---|---|---|---|---|
| diff --git a/conformance/tests/generics_basic.py b/conformance/tests/generics_basic.py index 179d8475..654c2d06 100644 --- a/conformance/tests/generics_basic.py +++ b/conformance/tests/generics_basic.py @@ -72,6 +72,7 @@ def test_concat_subtype(s: str, b: bytes, a: Any, m: MyStr) -> None: # reveal_type(concat(m, a)) # reveal_type(concat(a, m)) +BadConstraint3 = TypeVar("BadConstraint3", str, int, covariant=True) # E: constraints can't have variance # Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#user-defined-generic-classes | ||||