You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior:second is of type Record<string, string> & { baz: string}; analogous to third which is inferred as type { baz: string, qux: string }.
Actual behavior:second is of type { baz: string } and reports an error accessing any other member.
TypeScript Version: 4.0.2 (& nightly 4.1.0-dev.20201005)
Search Terms: spread operator, record type, infer / inference / inferred
Code
Expected behavior:
second
is of typeRecord<string, string> & { baz: string}
; analogous tothird
which is inferred as type{ baz: string, qux: string }
.Actual behavior:
second
is of type{ baz: string }
and reports an error accessing any other member.Playground Link: https://www.typescriptlang.org/play?ts=4.1.0-dev.20201005&ssl=1&ssc=12&pln=1&pc=36#code/MYewdgzgLgBAZgSwE7QFwwEoFNRICYA80SCYA5gDQzGlkB8MAvDAN7wgjoDkARgIZIuMAL4BuAFDjQkWBBzg8TVjAB0axCihV+AL25Cxk6dBhQAFskXM2alXOl4qARwCuAD30iJU8BBAAbLBV-EDIACnNLFV0ASgljAKCQ8PsFFTgOOPEgA
The text was updated successfully, but these errors were encountered: