diff --git a/conformance/results/mypy/generics_upper_bound.toml b/conformance/results/mypy/generics_upper_bound.toml index 4cf18a8f..9aad1c5c 100644 --- a/conformance/results/mypy/generics_upper_bound.toml +++ b/conformance/results/mypy/generics_upper_bound.toml @@ -4,8 +4,8 @@ Does not reject use of type variable within an upper bound. """ output = """ generics_upper_bound.py:43: error: Expression is of type "Collection[int]", not "list[int] | set[int]" [assert-type] -generics_upper_bound.py:51: error: Value of type variable "ST" of "longer" cannot be "int" [type-var] -generics_upper_bound.py:56: error: TypeVar cannot have both values and an upper bound [misc] +generics_upper_bound.py:52: error: Value of type variable "ST" of "longer" cannot be "int" [type-var] +generics_upper_bound.py:57: error: TypeVar cannot have both values and an upper bound [misc] """ conformance_automated = "Fail" errors_diff = """ diff --git a/conformance/results/pyrefly/generics_upper_bound.toml b/conformance/results/pyrefly/generics_upper_bound.toml index b438675c..87ebce48 100644 --- a/conformance/results/pyrefly/generics_upper_bound.toml +++ b/conformance/results/pyrefly/generics_upper_bound.toml @@ -1,10 +1,19 @@ -conformance_automated = "Pass" +conformance_automated = "Fail" +conformant = "Partial" +notes = """ +Cannot find a common supertype of `list[int]` and `set[int]` in order to solve a type variable bound to `Sized`. +""" errors_diff = """ +Lines 43, 44: Expected exactly one error (tag 'mixed-collections') +Line 43: Unexpected errors ['assert_type(list[int], list[int] | set[int]) failed [assert-type]', 'Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type]'] +Line 44: Unexpected errors ['assert_type(list[int], Collection[int]) failed [assert-type]', 'Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type]'] """ output = """ ERROR generics_upper_bound.py:24:38-45: Type variable bounds and constraints must be concrete [invalid-annotation] -ERROR generics_upper_bound.py:43:12-55: assert_type(list[int], list[int] | set[int]) failed [assert-type] -ERROR generics_upper_bound.py:43:25-31: Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type] -ERROR generics_upper_bound.py:51:7-13: `int` is not assignable to upper bound `Sized` of type variable `ST` [bad-specialization] -ERROR generics_upper_bound.py:56:38-49: TypeVar cannot have both constraints and bound [invalid-type-var] +ERROR generics_upper_bound.py:43:16-59: assert_type(list[int], list[int] | set[int]) failed [assert-type] +ERROR generics_upper_bound.py:43:31-35: Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type] +ERROR generics_upper_bound.py:44:16-54: assert_type(list[int], Collection[int]) failed [assert-type] +ERROR generics_upper_bound.py:44:31-35: Argument `set[int]` is not assignable to parameter `y` with type `list[int]` in function `longer` [bad-argument-type] +ERROR generics_upper_bound.py:52:7-13: `int` is not assignable to upper bound `Sized` of type variable `ST` [bad-specialization] +ERROR generics_upper_bound.py:57:38-49: TypeVar cannot have both constraints and bound [invalid-type-var] """ diff --git a/conformance/results/pyright/generics_upper_bound.toml b/conformance/results/pyright/generics_upper_bound.toml index ed479279..1fd34bce 100644 --- a/conformance/results/pyright/generics_upper_bound.toml +++ b/conformance/results/pyright/generics_upper_bound.toml @@ -1,15 +1,16 @@ conformant = "Pass" output = """ generics_upper_bound.py:24:38 - error: TypeVar bound type cannot be generic (reportGeneralTypeIssues) -generics_upper_bound.py:51:8 - error: Argument of type "Literal[3]" cannot be assigned to parameter "x" of type "ST@longer" in function "longer" +generics_upper_bound.py:44:17 - error: "assert_type" mismatch: expected "Collection[int]" but received "list[int] | set[int]" (reportAssertTypeFailure) +generics_upper_bound.py:52:8 - error: Argument of type "Literal[3]" cannot be assigned to parameter "x" of type "ST@longer" in function "longer" Type "Literal[3]" is not assignable to type "Sized" "Literal[3]" is incompatible with protocol "Sized" "__len__" is not present (reportArgumentType) -generics_upper_bound.py:51:11 - error: Argument of type "Literal[3]" cannot be assigned to parameter "y" of type "ST@longer" in function "longer" +generics_upper_bound.py:52:11 - error: Argument of type "Literal[3]" cannot be assigned to parameter "y" of type "ST@longer" in function "longer" Type "Literal[3]" is not assignable to type "Sized" "Literal[3]" is incompatible with protocol "Sized" "__len__" is not present (reportArgumentType) -generics_upper_bound.py:56:44 - error: TypeVar cannot be both bound and constrained (reportGeneralTypeIssues) +generics_upper_bound.py:57:44 - error: TypeVar cannot be both bound and constrained (reportGeneralTypeIssues) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/results.html b/conformance/results/results.html index 980ba8d8..6099d74f 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -416,7 +416,7 @@
Does not reject use of type variable within an upper bound.
Cannot find a common supertype of `list[int]` and `set[int]` in order to solve a type variable bound to `Sized`.
Does not reject use of class-scoped TypeVar used in a base class when variance is incompatible.