@@ -435,9 +435,9 @@ def set_coordinate(p: TaggedPoint, key: str, value: int) -> None:
435435from mypy_extensions import TypedDict
436436TaggedPoint = TypedDict('TaggedPoint', {'type': str, 'x': int, 'y': int})
437437p = TaggedPoint(type='2d', x=42, y=1337)
438- reveal_type(p.get('type')) # E: Revealed type is 'builtins.str'
439- reveal_type(p.get('x')) # E: Revealed type is 'builtins.int'
440- reveal_type(p.get('y')) # E: Revealed type is 'builtins.int'
438+ reveal_type(p.get('type')) # E: Revealed type is 'Union[ builtins.str, builtins.None] '
439+ reveal_type(p.get('x')) # E: Revealed type is 'Union[ builtins.int, builtins.None] '
440+ reveal_type(p.get('y', 0 )) # E: Revealed type is 'builtins.int'
441441[builtins fixtures/dict.pyi]
442442
443443[case testCannotGetMethodWithInvalidStringLiteralKey]
@@ -460,7 +460,7 @@ from mypy_extensions import TypedDict
460460TaggedPoint = TypedDict('TaggedPoint', {'type': str, 'x': int, 'y': int})
461461PointSet = TypedDict('PointSet', {'first_point': TaggedPoint})
462462p = PointSet(first_point=TaggedPoint(type='2d', x=42, y=1337))
463- reveal_type(p.get('first_point', {}).get('x')) # E: Revealed type is 'builtins.int'
463+ reveal_type(p.get('first_point', {}).get('x', 0 )) # E: Revealed type is 'builtins.int'
464464[builtins fixtures/dict.pyi]
465465
466466[case testDictGetMethodStillCallable]
0 commit comments