diff --git a/conformance/results/basilisk/generics_variance_inference.toml b/conformance/results/basilisk/generics_variance_inference.toml index f9387d551..b9d0eabbc 100644 --- a/conformance/results/basilisk/generics_variance_inference.toml +++ b/conformance/results/basilisk/generics_variance_inference.toml @@ -1,6 +1,7 @@ conformant = "Pass" -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 204: Unexpected errors ['generics_variance_inference.py:204:1: error: Type `ShouldBeCovariant7[int]` is not assignable to `ShouldBeCovariant7[object]` (type parameter is covariant) [generics_variance_inference]'] """ output = """ generics_variance_inference.py:24:5: error: Type `ClassA[float]` is not assignable to `ClassA[int]` (type parameter is invariant) [generics_variance_inference] @@ -26,4 +27,6 @@ generics_variance_inference.py:169:1: error: Type `ShouldBeInvariant6[float]` is generics_variance_inference.py:170:1: error: Type `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[float]` (type parameter is invariant) [generics_variance_inference] generics_variance_inference.py:181:1: error: Type `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` (type parameter is covariant) [generics_variance_inference] generics_variance_inference.py:194:1: error: Type `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[float]` (type parameter is contravariant) [generics_variance_inference] +generics_variance_inference.py:204:1: error: Type `ShouldBeCovariant7[int]` is not assignable to `ShouldBeCovariant7[object]` (type parameter is covariant) [generics_variance_inference] +generics_variance_inference.py:205:1: error: Type `ShouldBeCovariant7[object]` is not assignable to `ShouldBeCovariant7[int]` (type parameter is covariant) [generics_variance_inference] """ diff --git a/conformance/results/mypy/generics_variance_inference.toml b/conformance/results/mypy/generics_variance_inference.toml index b1158c7e9..761c10490 100644 --- a/conformance/results/mypy/generics_variance_inference.toml +++ b/conformance/results/mypy/generics_variance_inference.toml @@ -1,4 +1,9 @@ -conformant = "Pass" +conformant = "Partial" +notes = """ +polymorphic functions with bound self type influence variance inference, +which is not part of the variance inference algorithm as described in the spec. +See gh-2281 for details. +""" output = """ generics_variance_inference.py:24: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[int, int, int]") [assignment] generics_variance_inference.py:25: error: Incompatible types in assignment (expression has type "ClassA[float, int, int]", variable has type "ClassA[float, float, int]") [assignment] @@ -23,7 +28,10 @@ generics_variance_inference.py:169: error: Incompatible types in assignment (exp generics_variance_inference.py:170: error: Incompatible types in assignment (expression has type "ShouldBeInvariant6[int]", variable has type "ShouldBeInvariant6[float]") [assignment] generics_variance_inference.py:181: error: Incompatible types in assignment (expression has type "ShouldBeCovariant6[float]", variable has type "ShouldBeCovariant6[int]") [assignment] generics_variance_inference.py:194: error: Incompatible types in assignment (expression has type "ShouldBeContravariant2[int]", variable has type "ShouldBeContravariant2[float]") [assignment] +generics_variance_inference.py:204: error: Incompatible types in assignment (expression has type "ShouldBeCovariant7[int]", variable has type "ShouldBeCovariant7[object]") [assignment] +generics_variance_inference.py:205: error: Incompatible types in assignment (expression has type "ShouldBeCovariant7[object]", variable has type "ShouldBeCovariant7[int]") [assignment] """ -conformance_automated = "Pass" +conformance_automated = "Fail" errors_diff = """ +Line 204: Unexpected errors ['generics_variance_inference.py:204: error: Incompatible types in assignment (expression has type "ShouldBeCovariant7[int]", variable has type "ShouldBeCovariant7[object]") [assignment]'] """ diff --git a/conformance/results/pycroscope/generics_variance_inference.toml b/conformance/results/pycroscope/generics_variance_inference.toml index 56b1fa57b..e968d354f 100644 --- a/conformance/results/pycroscope/generics_variance_inference.toml +++ b/conformance/results/pycroscope/generics_variance_inference.toml @@ -25,4 +25,5 @@ output = """ ./generics_variance_inference.py:170:0: Incompatible assignment: expected generics_variance_inference.ShouldBeInvariant6[float | int], got generics_variance_inference.ShouldBeInvariant6[int] [incompatible_assignment] ./generics_variance_inference.py:181:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant6[int], got generics_variance_inference.ShouldBeCovariant6[float | int] [incompatible_assignment] ./generics_variance_inference.py:194:0: Incompatible assignment: expected generics_variance_inference.ShouldBeContravariant2[float | int], got generics_variance_inference.ShouldBeContravariant2[int] [incompatible_assignment] +./generics_variance_inference.py:205:0: Incompatible assignment: expected generics_variance_inference.ShouldBeCovariant7[int], got generics_variance_inference.ShouldBeCovariant7[object] [incompatible_assignment] """ diff --git a/conformance/results/pyrefly/generics_variance_inference.toml b/conformance/results/pyrefly/generics_variance_inference.toml index 8035068c3..612ceca73 100644 --- a/conformance/results/pyrefly/generics_variance_inference.toml +++ b/conformance/results/pyrefly/generics_variance_inference.toml @@ -26,4 +26,5 @@ ERROR generics_variance_inference.py:169:31-58: `ShouldBeInvariant6[float]` is n ERROR generics_variance_inference.py:170:33-58: `ShouldBeInvariant6[int]` is not assignable to `ShouldBeInvariant6[float]` [bad-assignment] ERROR generics_variance_inference.py:181:31-58: `ShouldBeCovariant6[float]` is not assignable to `ShouldBeCovariant6[int]` [bad-assignment] ERROR generics_variance_inference.py:194:37-66: `ShouldBeContravariant2[int]` is not assignable to `ShouldBeContravariant2[float]` [bad-assignment] +ERROR generics_variance_inference.py:205:31-59: `ShouldBeCovariant7[object]` is not assignable to `ShouldBeCovariant7[int]` [bad-assignment] """ diff --git a/conformance/results/pyright/generics_variance_inference.toml b/conformance/results/pyright/generics_variance_inference.toml index 9a378ad6f..1bbd86ed4 100644 --- a/conformance/results/pyright/generics_variance_inference.toml +++ b/conformance/results/pyright/generics_variance_inference.toml @@ -79,6 +79,10 @@ generics_variance_inference.py:194:37 - error: Type "ShouldBeContravariant2[int] "ShouldBeContravariant2[int]" is not assignable to "ShouldBeContravariant2[float]" Type parameter "T@ShouldBeContravariant2" is contravariant, but "int" is not a supertype of "float" "float" is not assignable to "int" (reportAssignmentType) +generics_variance_inference.py:205:31 - error: Type "ShouldBeCovariant7[object]" is not assignable to declared type "ShouldBeCovariant7[int]" + "ShouldBeCovariant7[object]" is not assignable to "ShouldBeCovariant7[int]" + Type parameter "T@ShouldBeCovariant7" is covariant, but "object" is not a subtype of "int" + "object" is not assignable to "int" (reportAssignmentType) """ conformance_automated = "Pass" errors_diff = """ diff --git a/conformance/results/results.html b/conformance/results/results.html index aa2fa2891..f29a661f0 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -967,22 +967,36 @@