diff --git a/conformance/results/pyrefly/aliases_explicit.toml b/conformance/results/pyrefly/aliases_explicit.toml index b56c8707..9edd1350 100644 --- a/conformance/results/pyrefly/aliases_explicit.toml +++ b/conformance/results/pyrefly/aliases_explicit.toml @@ -4,7 +4,7 @@ errors_diff = """ """ output = """ ERROR aliases_explicit.py:67:9-28: `TypeAlias[GoodTypeAlias2, type[int | None]]` is not subscriptable [unsupported-operation] -ERROR aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[GoodTypeAlias2]]]` is not subscriptable [unsupported-operation] +ERROR aliases_explicit.py:68:9-28: `TypeAlias[GoodTypeAlias3, type[list[int | None]]]` is not subscriptable [unsupported-operation] ERROR aliases_explicit.py:69:9-33: Expected 1 type argument for `GoodTypeAlias4`, got 2 [bad-specialization] ERROR aliases_explicit.py:70:9-33: Expected 1 type argument for `GoodTypeAlias8`, got 2 [bad-specialization] ERROR aliases_explicit.py:71:9-33: Expected a valid ParamSpec expression, got `int` [invalid-param-spec] diff --git a/conformance/results/pyrefly/aliases_recursive.toml b/conformance/results/pyrefly/aliases_recursive.toml index 0f805c8d..327b37f7 100644 --- a/conformance/results/pyrefly/aliases_recursive.toml +++ b/conformance/results/pyrefly/aliases_recursive.toml @@ -14,4 +14,5 @@ ERROR aliases_recursive.py:63:30-43: `list[list[float] | str | GenericTypeAlias1 ERROR aliases_recursive.py:69:35-64: `list[int | list[int | list[int | list[float] | str | GenericTypeAlias2[str, int]] | str | GenericTypeAlias2[str, int]] | str | GenericTypeAlias2[str, int]]` is not assignable to `list[int | str | GenericTypeAlias2[str, int]]` [bad-assignment] ERROR aliases_recursive.py:72:29-57: Found cyclic self-reference in `RecursiveUnion` [invalid-type-alias] ERROR aliases_recursive.py:75:31-61: Found cyclic self-reference in `MutualReference1` [invalid-type-alias] +ERROR aliases_recursive.py:75:93-123: Found cyclic self-reference in `MutualReference2` [invalid-type-alias] """ diff --git a/conformance/results/pyrefly/aliases_type_statement.toml b/conformance/results/pyrefly/aliases_type_statement.toml index b5846841..01603ba9 100644 --- a/conformance/results/pyrefly/aliases_type_statement.toml +++ b/conformance/results/pyrefly/aliases_type_statement.toml @@ -31,5 +31,6 @@ ERROR aliases_type_statement.py:77:7-41: `str` is not assignable to upper bound ERROR aliases_type_statement.py:79:7-41: `int` is not assignable to upper bound `str` of type variable `T` [bad-specialization] ERROR aliases_type_statement.py:82:28-47: Found cyclic self-reference in `RecursiveTypeAlias3` [invalid-type-alias] ERROR aliases_type_statement.py:84:31-59: Found cyclic self-reference in `RecursiveTypeAlias4` [invalid-type-alias] +ERROR aliases_type_statement.py:88:28-47: Found cyclic self-reference in `RecursiveTypeAlias6` [invalid-type-alias] ERROR aliases_type_statement.py:89:28-47: Found cyclic self-reference in `RecursiveTypeAlias7` [invalid-type-alias] """ diff --git a/conformance/results/pyrefly/aliases_typealiastype.toml b/conformance/results/pyrefly/aliases_typealiastype.toml index ff8d0590..c4e98a92 100644 --- a/conformance/results/pyrefly/aliases_typealiastype.toml +++ b/conformance/results/pyrefly/aliases_typealiastype.toml @@ -1,11 +1,5 @@ -conformant = "Partial" -notes = """ -Does not detect circular definitions. -""" -conformance_automated = "Fail" +conformance_automated = "Pass" errors_diff = """ -Line 48: Expected 1 errors -Line 66: Expected 1 errors """ output = """ ERROR aliases_typealiastype.py:32:7-30: Object of class `TypeAliasType` has no attribute `other_attrib` [missing-attribute] @@ -13,9 +7,10 @@ ERROR aliases_typealiastype.py:40:5-30: `int` is not assignable to upper bound ` ERROR aliases_typealiastype.py:43:13-66: Type variable `S` is out of scope for this `TypeAliasType` [invalid-type-alias] ERROR aliases_typealiastype.py:44:13-48: Type variable `S` is out of scope for this `TypeAliasType` [invalid-type-alias] ERROR aliases_typealiastype.py:45:45-65: Value for argument `type_params` must be a tuple literal [invalid-type-alias] -ERROR aliases_typealiastype.py:46:41-50: Found cyclic self-reference in `BadAlias4` [invalid-type-alias] -ERROR aliases_typealiastype.py:47:40-60: Found cyclic self-reference in `BadAlias5` [invalid-type-alias] -ERROR aliases_typealiastype.py:49:40-49: Found cyclic self-reference in `BadAlias7` [invalid-type-alias] +ERROR aliases_typealiastype.py:46:13-52: Found cyclic self-reference in `BadAlias4` [invalid-type-alias] +ERROR aliases_typealiastype.py:47:13-79: Found cyclic self-reference in `BadAlias5` [invalid-type-alias] +ERROR aliases_typealiastype.py:48:13-52: Found cyclic self-reference in `BadAlias6` [invalid-type-alias] +ERROR aliases_typealiastype.py:49:13-50: Found cyclic self-reference in `BadAlias7` [invalid-type-alias] ERROR aliases_typealiastype.py:52:40-80: Function call cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:53:40-50: List literal cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:54:42-55: Tuple literal cannot be used in annotations [invalid-annotation] @@ -31,4 +26,5 @@ ERROR aliases_typealiastype.py:61:42-46: Bool literal cannot be used in annotati ERROR aliases_typealiastype.py:62:42-43: Number literal cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:63:42-53: Boolean operation cannot be used in annotations [invalid-annotation] ERROR aliases_typealiastype.py:64:42-52: F-string cannot be used in annotations [invalid-annotation] +ERROR aliases_typealiastype.py:66:14-59: Found cyclic self-reference in `BadAlias21` [invalid-type-alias] """ diff --git a/conformance/results/pyrefly/generics_scoping.toml b/conformance/results/pyrefly/generics_scoping.toml index a4d46cbf..236c49f0 100644 --- a/conformance/results/pyrefly/generics_scoping.toml +++ b/conformance/results/pyrefly/generics_scoping.toml @@ -4,13 +4,9 @@ Does not implement several scoping checks/restrictions for generics """ conformance_automated = "Fail" errors_diff = """ -Line 61: Expected 1 errors -Line 65: Expected 1 errors Line 86: Expected 1 errors Line 89: Expected 1 errors Line 98: Expected 1 errors -Line 105: Expected 1 errors -Line 106: Expected 1 errors Line 107: Expected 1 errors """ output = """ @@ -19,5 +15,9 @@ ERROR generics_scoping.py:20:12-38: assert_type(str, Literal['a']) failed [asser ERROR generics_scoping.py:34:10-13: Argument `Literal['a']` is not assignable to parameter `x` with type `int` in function `MyClass.meth_2` [bad-argument-type] ERROR generics_scoping.py:50:12-48: assert_type(str, Literal['abc']) failed [assert-type] ERROR generics_scoping.py:54:12-50: assert_type(bytes, Literal[b'abc']) failed [assert-type] +ERROR generics_scoping.py:61:8-15: Type variable `S` is not in scope [invalid-type-var] +ERROR generics_scoping.py:65:14-21: Type variable `S` is not in scope [invalid-type-var] ERROR generics_scoping.py:76:11-20: Redundant type parameter declaration [invalid-type-var] +ERROR generics_scoping.py:105:14-15: Type variable `T` is not in scope [invalid-type-var] +ERROR generics_scoping.py:106:14-21: Type variable `T` is not in scope [invalid-type-var] """ diff --git a/conformance/results/pyrefly/generics_typevartuple_args.toml b/conformance/results/pyrefly/generics_typevartuple_args.toml index 6656023b..ae29ac7e 100644 --- a/conformance/results/pyrefly/generics_typevartuple_args.toml +++ b/conformance/results/pyrefly/generics_typevartuple_args.toml @@ -3,8 +3,8 @@ conformance_automated = "Pass" errors_diff = """ """ output = """ -ERROR generics_typevartuple_args.py:33:8-19: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] -ERROR generics_typevartuple_args.py:34:8-30: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] +ERROR generics_typevartuple_args.py:33:12-23: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] +ERROR generics_typevartuple_args.py:34:12-34: Unpacked argument `tuple[Literal[0], Literal['']]` is not assignable to parameter `*args` with type `tuple[*@_, Env]` in function `exec_le` [bad-argument-type] ERROR generics_typevartuple_args.py:48:6-17: Unpacked argument `tuple[Literal[1], Literal['2'], Literal[3]]` is not assignable to parameter `*args` with type `tuple[int, ...]` in function `func1` [bad-argument-type] ERROR generics_typevartuple_args.py:57:6-16: Unpacked argument `tuple[Literal[1], Literal[1], Literal['']]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] ERROR generics_typevartuple_args.py:58:6-9: Unpacked argument `tuple[Literal[1]]` is not assignable to parameter `*args` with type `tuple[int, *tuple[str, ...], str]` in function `func2` [bad-argument-type] diff --git a/conformance/results/pyrefly/version.toml b/conformance/results/pyrefly/version.toml index d8470f38..64c5c3a3 100644 --- a/conformance/results/pyrefly/version.toml +++ b/conformance/results/pyrefly/version.toml @@ -1 +1 @@ -version = "pyrefly 0.53.0" +version = "pyrefly 0.54.0" diff --git a/conformance/results/pyright/generics_typevartuple_args.toml b/conformance/results/pyright/generics_typevartuple_args.toml index 2ef2c70e..de352581 100644 --- a/conformance/results/pyright/generics_typevartuple_args.toml +++ b/conformance/results/pyright/generics_typevartuple_args.toml @@ -1,8 +1,8 @@ conformant = "Pass" output = """ -generics_typevartuple_args.py:33:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le" +generics_typevartuple_args.py:33:20 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le"   "Literal['']" is not assignable to "Env" (reportArgumentType) -generics_typevartuple_args.py:34:16 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le" +generics_typevartuple_args.py:34:20 - error: Argument of type "Literal['']" cannot be assigned to parameter of type "Env" in function "exec_le"   "Literal['']" is not assignable to "Env" (reportArgumentType) generics_typevartuple_args.py:48:10 - error: Argument of type "Literal['2']" cannot be assigned to parameter of type "int" in function "func1"   "Literal['2']" is not assignable to "int" (reportArgumentType) diff --git a/conformance/results/results.html b/conformance/results/results.html index 980ba8d8..95c73cb7 100644 --- a/conformance/results/results.html +++ b/conformance/results/results.html @@ -176,9 +176,9 @@

Python Type System Conformance Test Results

pyright 1.1.408
-
zuban 0.6.0
+
zuban 0.6.1
-
pyrefly 0.53.0
+
pyrefly 0.54.0
@@ -307,7 +307,7 @@

Python Type System Conformance Test Results

     generics_scoping Pass Pass -Partial +Pass
Partial

Does not implement several scoping checks/restrictions for generics

     generics_self_advanced @@ -503,7 +503,7 @@

Python Type System Conformance Test Results

Partial

Incorrectly rejects some recursive type aliases using TypeAliasType.

Incorrectly rejects the use of a class-scoped TypeVar in a TypeAliasType definition.

Pass Pass -
Partial

Does not detect circular definitions.

+Pass      aliases_variance Pass diff --git a/conformance/results/zuban/generics_scoping.toml b/conformance/results/zuban/generics_scoping.toml index 7c937b14..54b38f2f 100644 --- a/conformance/results/zuban/generics_scoping.toml +++ b/conformance/results/zuban/generics_scoping.toml @@ -1,13 +1,12 @@ -conformance_automated = "Fail" -conformant = "Partial" +conformance_automated = "Pass" errors_diff = """ -Lines 15, 16: Expected error (tag 'fun1') -Lines 19, 20: Expected error (tag 'fun2') -Lines 49, 50: Expected error (tag 'method-str') -Lines 53, 54: Expected error (tag 'method-bytes') """ output = """ +generics_scoping.py:15: error: Expression is of type "Literal[1]", not "int" [misc] +generics_scoping.py:19: error: Expression is of type "Literal['a']", not "str" [misc] generics_scoping.py:34: error: Argument 1 to "meth_2" of "MyClass" has incompatible type "str"; expected "int" [arg-type] +generics_scoping.py:49: error: Expression is of type "Literal['abc']", not "str" [misc] +generics_scoping.py:53: error: Expression is of type "Literal[b'abc']", not "bytes" [misc] generics_scoping.py:61: error: Type variable "generics_scoping.S" is unbound [misc] generics_scoping.py:61: note: (Hint: Use "Generic[S]" or "Protocol[S]" base class to bind "S" inside a class) generics_scoping.py:61: note: (Hint: Use "S" in function signature to bind "S" inside a function) diff --git a/conformance/results/zuban/version.toml b/conformance/results/zuban/version.toml index c5293aab..edcd1bf5 100644 --- a/conformance/results/zuban/version.toml +++ b/conformance/results/zuban/version.toml @@ -1 +1 @@ -version = "zuban 0.6.0" +version = "zuban 0.6.1" diff --git a/conformance/tests/generics_typevartuple_args.py b/conformance/tests/generics_typevartuple_args.py index 114d2ec4..1afd69f2 100644 --- a/conformance/tests/generics_typevartuple_args.py +++ b/conformance/tests/generics_typevartuple_args.py @@ -17,9 +17,6 @@ def args_to_tuple(*args: *Ts) -> tuple[*Ts]: raise NotImplementedError -assert_type(args_to_tuple(1, "a"), tuple[int, str]) - - class Env: ... @@ -28,10 +25,13 @@ def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tupl raise NotImplementedError -assert_type(exec_le("", Env()), tuple[()]) # OK -assert_type(exec_le("", 0, "", Env()), tuple[int, str]) # OK -exec_le("", 0, "") # E -exec_le("", 0, "", env=Env()) # E +def has_int_and_str(x: int, y: str): + assert_type(args_to_tuple(x, y), tuple[int, str]) + + assert_type(exec_le("", Env()), tuple[()]) # OK + assert_type(exec_le(y, x, y, Env()), tuple[int, str]) # OK + exec_le("", 0, "") # E + exec_le("", 0, "", env=Env()) # E # > Using an unpacked unbounded tuple is equivalent to the diff --git a/conformance/tests/generics_typevartuple_callable.py b/conformance/tests/generics_typevartuple_callable.py index f0292505..11e59657 100644 --- a/conformance/tests/generics_typevartuple_callable.py +++ b/conformance/tests/generics_typevartuple_callable.py @@ -46,4 +46,5 @@ def func3(*args: * tuple[int, *Ts, T]) -> tuple[T, *Ts]: raise NotImplementedError -assert_type(func3(1, "", 3j, 3.4), tuple[float, str, complex]) +def has_int_and_str(a: int, b: str, c: float, d: complex): + assert_type(func3(a, b, c, d), tuple[float, str, complex])