Open
Description
π Search Terms
"destructuring", "record"
π Version & Regression Information
- This is the behavior in every version I tried, and I reviewed the FAQ.
β― Playground Link
π» Code
This raises a type error:
const recordWithStrings: Record<string, string> = {};
export const recordWithNumbers: Record<string, number> = {
...recordWithStrings,
};
and this doesn't:
const recordWithStrings: Record<string, string> = {};
export const recordWithNumbers: Record<string, number> = {
extraProperty: 0,
...recordWithStrings,
};
Is there a sound reason for that?
π Actual behavior
The 2nd example doesn't raise a type error.
π Expected behavior
The 2nd example should raise a type error.
Additional information about the issue
No response