Skip to content

Commit

Permalink
add fine-grained test
Browse files Browse the repository at this point in the history
  • Loading branch information
ikonst committed Mar 30, 2023
1 parent c005895 commit d71bc21
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions test-data/unit/fine-grained-dataclass.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
[case replace]
[file model.py]
from dataclasses import dataclass

@dataclass
class Model:
x: int = 0
[file replace.py]
from dataclasses import replace
from model import Model

m = Model()
replace(m, x=42)

[file model.py.2]
from dataclasses import dataclass

@dataclass
class Model:
x: str = 'hello'

[builtins fixtures/dataclasses.pyi]
[out]
==
replace.py:5: error: Argument "x" to "replace" of "Model" has incompatible type "int"; expected "str"

0 comments on commit d71bc21

Please sign in to comment.