@@ -757,24 +757,24 @@ class C(Generic[P]):
757
757
# think PhantomData<T> from rust
758
758
phantom: Optional[Callable[P, None]]
759
759
760
- def add_str(self) -> C[Concatenate[int, P]]:
761
- return C[Concatenate[int, P]]()
762
-
763
- def add_int(self) -> C[Concatenate[str, P]]:
760
+ def add_str(self) -> C[Concatenate[str, P]]:
764
761
return C[Concatenate[str, P]]()
765
762
763
+ def add_int(self) -> C[Concatenate[int, P]]:
764
+ return C[Concatenate[int, P]]()
765
+
766
766
def f(c: C[P]) -> None:
767
767
reveal_type(c) # N: Revealed type is "__main__.C[P`-1]"
768
768
769
769
n1 = c.add_str()
770
- reveal_type(n1) # N: Revealed type is "__main__.C[[builtins.int , **P`-1]]"
770
+ reveal_type(n1) # N: Revealed type is "__main__.C[[builtins.str , **P`-1]]"
771
771
n2 = n1.add_int()
772
- reveal_type(n2) # N: Revealed type is "__main__.C[[builtins.str , builtins.int , **P`-1]]"
772
+ reveal_type(n2) # N: Revealed type is "__main__.C[[builtins.int , builtins.str , **P`-1]]"
773
773
774
774
p1 = c.add_int()
775
- reveal_type(p1) # N: Revealed type is "__main__.C[[builtins.str , **P`-1]]"
775
+ reveal_type(p1) # N: Revealed type is "__main__.C[[builtins.int , **P`-1]]"
776
776
p2 = p1.add_str()
777
- reveal_type(p2) # N: Revealed type is "__main__.C[[builtins.int , builtins.str , **P`-1]]"
777
+ reveal_type(p2) # N: Revealed type is "__main__.C[[builtins.str , builtins.int , **P`-1]]"
778
778
[builtins fixtures/paramspec.pyi]
779
779
780
780
[case testParamSpecLiteralJoin]
0 commit comments