Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed May 18, 2024
1 parent 160a9c7 commit 9fcaedb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test-data/unit/check-namedtuple.test
Original file line number Diff line number Diff line change
Expand Up @@ -1376,3 +1376,17 @@ class Test3(NamedTuple, metaclass=type): # E: Unexpected keyword argument "meta
...
[builtins fixtures/tuple.pyi]
[typing fixtures/typing-namedtuple.pyi]


[case testNamedTupleDunderReplace]
# flags: --python-version 3.13
from typing import NamedTuple

class A(NamedTuple):
x: int

A(x=0).__replace__(x=1)
A(x=0).__replace__(x="asdf") # E: Argument "x" to "__replace__" of "A" has incompatible type "str"; expected "int"
A(x=0).__replace__(y=1) # E: Unexpected keyword argument "y" for "__replace__" of "A"
[builtins fixtures/tuple.pyi]
[typing fixtures/typing-namedtuple.pyi]

0 comments on commit 9fcaedb

Please sign in to comment.