type Foo = Literal["foo"]
bar1: dict[Foo, int] = {'foo': 1}
bar2: dict[Foo, int] = {k: v for k, v in bar1.items()}
baz3: dict[Foo, int] = bar1 | bar2
baz4: dict[Foo, int] = bar1 | {k: v for k, v in bar1.items()} # error
Pyright: Type "dict[str, int]" is not assignable to declared type "dict[Foo, int]"
 "dict[str, int]" is not assignable to "dict[Foo, int]"
   Type parameter "_KT@dict" is invariant, but "str" is not the same as "Foo