Skip to content

Commit da88083

Browse files
migeed-zmeta-codesync[bot]
authored andcommitted
Document TypeVarTuple failure
Summary: For this one, instead of solving equality constraints, do we want to solve consistency constraints? that sounds challanging. Reviewed By: grievejia Differential Revision: D91708623 fbshipit-source-id: 3e1504b68a5f52445a544eccfc3dd416c48008b4
1 parent eef3d1d commit da88083

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pyrefly/lib/test/type_var_tuple.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,3 +310,17 @@ def test[T, *Ts](t1: tuple[T, *Ts], t2: tuple[*Ts, T]):
310310
t2 = (*t1[1:], t1[0])
311311
"#,
312312
);
313+
314+
testcase!(
315+
bug = "conformance: TypeVarTuple should allow compatible tuple types when solving (maybe related to issue 105)",
316+
test_typevartuple_compatible_tuple_types,
317+
r#"
318+
from typing import TypeVarTuple
319+
320+
Ts = TypeVarTuple("Ts")
321+
322+
def func2(arg1: tuple[*Ts], arg2: tuple[*Ts]) -> tuple[*Ts]: ...
323+
324+
func2((0,), (0.0,)) # E: Argument `tuple[float]` is not assignable to parameter `arg2` with type `tuple[int]`
325+
"#,
326+
);

0 commit comments

Comments
 (0)