diff --git a/conformance/results/mypy/constructors_call_init.toml b/conformance/results/mypy/constructors_call_init.toml index f2d7df715..9ea5819df 100644 --- a/conformance/results/mypy/constructors_call_init.toml +++ b/conformance/results/mypy/constructors_call_init.toml @@ -2,16 +2,23 @@ conformant = "Partial" notes = """ 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. +Does not solve a subclass's type parameters from the self annotation of an inherited `__init__` method. """ conformance_automated = "Fail" errors_diff = """ Line 56: Expected 1 errors Line 107: Expected 1 errors +Line 145: Expected 1 errors +Line 157: Expected 1 errors Line 73: Unexpected errors ['constructors_call_init.py:73: error: Expression is of type "Class5[list[int]]", not "Class5[int]" [assert-type]'] +Line 127: Unexpected errors ['constructors_call_init.py:127: error: Expression is of type "Class13[Never, Never]", not "Class13[int, str]" [assert-type]'] +Line 134: Unexpected errors ['constructors_call_init.py:134: error: Expression is of type "Class14[Never, Never, Never]", not "Class14[Any, str, int]" [assert-type]'] """ output = """ constructors_call_init.py:21: error: Argument 1 to "Class1" has incompatible type "float"; expected "int" [arg-type] constructors_call_init.py:42: error: Argument 1 to "Class3" has incompatible type "Class2[Never]"; expected "Class3 | None" [arg-type] constructors_call_init.py:73: error: Expression is of type "Class5[list[int]]", not "Class5[int]" [assert-type] -constructors_call_init.py:130: error: Too many arguments for "Class11" [call-arg] +constructors_call_init.py:127: error: Expression is of type "Class13[Never, Never]", not "Class13[int, str]" [assert-type] +constructors_call_init.py:134: error: Expression is of type "Class14[Never, Never, Never]", not "Class14[Any, str, int]" [assert-type] +constructors_call_init.py:179: error: Too many arguments for "Class11" [call-arg] """ diff --git a/conformance/results/pycroscope/constructors_call_init.toml b/conformance/results/pycroscope/constructors_call_init.toml index da605980b..176d24f13 100644 --- a/conformance/results/pycroscope/constructors_call_init.toml +++ b/conformance/results/pycroscope/constructors_call_init.toml @@ -1,10 +1,21 @@ -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not solve a subclass's type parameters from the self annotation of an inherited `__init__` method. +Does not report errors during binding to the self parameter of an inherited `__init__` method. +""" +conformance_automated = "Fail" errors_diff = """ +Line 145: Expected 1 errors +Line 157: Expected 1 errors +Line 127: Unexpected errors ['./constructors_call_init.py:127:12: ./constructors_call_init.py.Class13~[Any[generic_argument], Any[generic_argument]] is not equivalent to ./constructors_call_init.py.Class13[int, str]'] +Line 134: Unexpected errors ['./constructors_call_init.py:134:12: ./constructors_call_init.py.Class14~[Any[generic_argument], Any[generic_argument], Any[generic_argument]] is not equivalent to ./constructors_call_init.py.Class14[Any[explicit], str, int]'] """ output = """ ./constructors_call_init.py:21:12: Incompatible argument type for x: expected int but got Literal[1.0] [incompatible_argument] ./constructors_call_init.py:42:7: Incompatible argument type for x: expected ./constructors_call_init.py.Class3 | None but got ./constructors_call_init.py.Class2 [incompatible_argument] ./constructors_call_init.py:56:0: Missing required positional argument '%self' [incompatible_call] ./constructors_call_init.py:107:17: Class-scoped type variables are not allowed in __init__ self annotation [invalid_self_usage] -./constructors_call_init.py:130:0: Takes 0 positional arguments but 1 were given [incompatible_call] +./constructors_call_init.py:127:12: ./constructors_call_init.py.Class13~[Any[generic_argument], Any[generic_argument]] is not equivalent to ./constructors_call_init.py.Class13[int, str] +./constructors_call_init.py:134:12: ./constructors_call_init.py.Class14~[Any[generic_argument], Any[generic_argument], Any[generic_argument]] is not equivalent to ./constructors_call_init.py.Class14[Any[explicit], str, int] +./constructors_call_init.py:179:0: Takes 0 positional arguments but 1 were given [incompatible_call] """ diff --git a/conformance/results/pyrefly/constructors_call_init.toml b/conformance/results/pyrefly/constructors_call_init.toml index 05593e0a0..ede5543ca 100644 --- a/conformance/results/pyrefly/constructors_call_init.toml +++ b/conformance/results/pyrefly/constructors_call_init.toml @@ -7,5 +7,7 @@ ERROR constructors_call_init.py:21:13-16: Argument `float` is not assignable to ERROR constructors_call_init.py:42:8-20: Argument `Class2[@_]` is not assignable to parameter `x` with type `Class3 | None` in function `Class2.__init__` [bad-argument-type] ERROR constructors_call_init.py:56:12-14: Argument `Class4[str]` is not assignable to parameter `self` with type `Class4[int]` in function `Class4.__init__` [bad-argument-type] ERROR constructors_call_init.py:107:9-17: `__init__` method self type cannot reference class type parameters `T2`, `T1` [invalid-annotation] -ERROR constructors_call_init.py:130:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] +ERROR constructors_call_init.py:145:8-10: Argument `Class15[@_]` is not assignable to parameter `self` with type `Class12[int, str]` in function `Class12.__init__` [bad-argument-type] +ERROR constructors_call_init.py:157:9-10: Argument `Literal[1]` is not assignable to parameter `value` with type `str` in function `Class16.__init__` [bad-argument-type] +ERROR constructors_call_init.py:179:9-10: Expected 0 positional arguments, got 1 in function `object.__init__` [bad-argument-count] """ diff --git a/conformance/results/pyright/constructors_call_init.toml b/conformance/results/pyright/constructors_call_init.toml index 4d6672588..2a521455a 100644 --- a/conformance/results/pyright/constructors_call_init.toml +++ b/conformance/results/pyright/constructors_call_init.toml @@ -1,6 +1,13 @@ -conformant = "Pass" -conformance_automated = "Pass" +conformant = "Partial" +notes = """ +Does not solve a subclass's type parameters from the self annotation of an inherited `__init__` method. +Does not report an error when a subclass's specialization of a base class is not assignable to the self annotation of an inherited `__init__` method. +""" +conformance_automated = "Fail" errors_diff = """ +Line 145: Expected 1 errors +Line 127: Unexpected errors ['constructors_call_init.py:127:13 - error: "assert_type" mismatch: expected "Class13[int, str]" but received "Class13[Unknown, Unknown]" (reportAssertTypeFailure)'] +Line 134: Unexpected errors ['constructors_call_init.py:134:13 - error: "assert_type" mismatch: expected "Class14[Any, str, int]" but received "Class14[Unknown, Unknown, Unknown]" (reportAssertTypeFailure)'] """ output = """ constructors_call_init.py:21:13 - error: Argument of type "float" cannot be assigned to parameter "x" of type "int" in function "__init__" @@ -14,5 +21,9 @@ constructors_call_init.py:56:1 - error: "Class4[str]" is not assignable to "Class4[int]" Type parameter "T@Class4" is invariant, but "str" is not the same as "int" (reportGeneralTypeIssues) constructors_call_init.py:107:24 - warning: Type annotation for "self" parameter of "__init__" method cannot contain class-scoped type variables (reportInvalidTypeVarUse) -constructors_call_init.py:130:9 - error: Expected 0 positional arguments (reportCallIssue) +constructors_call_init.py:127:13 - error: "assert_type" mismatch: expected "Class13[int, str]" but received "Class13[Unknown, Unknown]" (reportAssertTypeFailure) +constructors_call_init.py:134:13 - error: "assert_type" mismatch: expected "Class14[Any, str, int]" but received "Class14[Unknown, Unknown, Unknown]" (reportAssertTypeFailure) +constructors_call_init.py:157:9 - error: Argument of type "Literal[1]" cannot be assigned to parameter "value" of type "str" in function "__init__" + "Literal[1]" is not assignable to "str" (reportArgumentType) +constructors_call_init.py:179:9 - error: Expected 0 positional arguments (reportCallIssue) """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 2525a3b81..87833cefe 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -1503,11 +1503,24 @@
__init__ method.__init__ method.__init__ method.__init__ method.__init__ method.__init__ method.__init__ method.