Closed
Description
🐛 Bug Report
This is similar to #6462 and #9335 but with the star-star syntax.
There are cases where mypy could prove the following program type-safe, but currently this is never allowed:
To Reproduce
from typing import TypedDict
class Value(TypedDict):
key1: str
key2: str
const1: Value = {"key1": "foo", "key2": "bar"}
const2: Value = {**const1, "key2": "eggs"}
# ^^^^^^^^
# mypy: Expected TypedDict key to be string literal (10:20)
- Mypy version used: mypy 0.780
- Python version used: 3.8.6