Skip to content

Commit 1ff577f

Browse files
committed
conformance: change generics_typevartuple_args.py case
I don't think this case should error; a type checker can solve Ts to something like (object,) or (int | str,). This is not all that different from the first call to func4(), where the two calls with (0,) and (1,) lead to Ts being solved to a common supertype.
1 parent 40b929c commit 1ff577f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

conformance/tests/generics_typevartuple_args.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Env:
2121
...
2222

2323

24-
def exec_le(path: str, *args: * tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]:
24+
def exec_le(path: str, *args: *tuple[*Ts, Env], env: Env | None = None) -> tuple[*Ts]:
2525
raise NotImplementedError
2626

2727

@@ -39,7 +39,7 @@ def has_int_and_str(x: int, y: str):
3939
# > *args: int, which accepts zero or more values of type int.
4040

4141

42-
def func1(*args: * tuple[int, ...]) -> None:
42+
def func1(*args: *tuple[int, ...]) -> None:
4343
...
4444

4545

@@ -48,7 +48,7 @@ def func1(*args: * tuple[int, ...]) -> None:
4848
func1(1, "2", 3) # E
4949

5050

51-
def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None:
51+
def func2(*args: *tuple[int, *tuple[str, ...], str]) -> None:
5252
...
5353

5454

@@ -59,7 +59,7 @@ def func2(*args: * tuple[int, *tuple[str, ...], str]) -> None:
5959
func2("") # E
6060

6161

62-
def func3(*args: * tuple[int, str]) -> None:
62+
def func3(*args: *tuple[int, str]) -> None:
6363
...
6464

6565

@@ -72,8 +72,7 @@ def func4(*args: tuple[*Ts]):
7272

7373

7474
func4((0,), (1,)) # OK
75-
func4((0,), (1, 2)) # E
76-
func4((0,), ("1",)) # E
75+
func4((0,), (1, 2)) # E (length mismatch)
7776

7877

7978
# This is a syntax error, so leave it commented out.

0 commit comments

Comments
 (0)