Skip to content

Commit 48bc430

Browse files
committed
Sync test
1 parent 0cc75eb commit 48bc430

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

test-data/unit/check-typeddict.test

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,22 +1164,21 @@ fc(b) # E: Argument 1 to "fc" has incompatible type "B"; expected "C"
11641164
from typing import TypedDict, TypeVar
11651165
A = TypedDict('A', {'x': int})
11661166
B = TypedDict('B', {'x': int}, total=False)
1167+
B2 = TypedDict('B2', {'x': int}, total=False)
11671168
C = TypedDict('C', {'x': int, 'y': str}, total=False)
1169+
C2 = TypedDict('C2', {'x': int, 'y': str}, total=False)
11681170
T = TypeVar('T')
11691171
def j(x: T, y: T) -> T: return x
11701172
a: A
11711173
b: B
1174+
b2: B2
11721175
c: C
1173-
reveal_type(j(a, b)) \
1174-
# N: Revealed type is "TypedDict({})"
1175-
reveal_type(j(b, b)) \
1176-
# N: Revealed type is "TypedDict({'x'?: builtins.int})"
1177-
reveal_type(j(c, c)) \
1178-
# N: Revealed type is "TypedDict({'x'?: builtins.int, 'y'?: builtins.str})"
1179-
reveal_type(j(b, c)) \
1180-
# N: Revealed type is "TypedDict({'x'?: builtins.int})"
1181-
reveal_type(j(c, b)) \
1182-
# N: Revealed type is "TypedDict({'x'?: builtins.int})"
1176+
c2: C2
1177+
reveal_type(j(a, b)) # N: Revealed type is "TypedDict({})"
1178+
reveal_type(j(b, b2)) # N: Revealed type is "TypedDict({'x'?: builtins.int})"
1179+
reveal_type(j(c, c2)) # N: Revealed type is "TypedDict({'x'?: builtins.int, 'y'?: builtins.str})"
1180+
reveal_type(j(b, c)) # N: Revealed type is "TypedDict({'x'?: builtins.int})"
1181+
reveal_type(j(c, b)) # N: Revealed type is "TypedDict({'x'?: builtins.int})"
11831182
[builtins fixtures/dict.pyi]
11841183
[typing fixtures/typing-typeddict.pyi]
11851184

0 commit comments

Comments
 (0)