Closed
Description
Bug Report
β― Playground Link
Playground link with relevant code
π» Code
type DataType = {
value: (Data & Extra) | Data;
};
type Data = {
type1: string;
};
type Extra = {
isEditable: boolean;
onChange: () => void;
};
const data: DataType = {
// value should throw an error (onChange is not specified)
value: {
type1: 'type',
isEditable: true,
},
};
π Actual behavior
TypeScript ignores this definition ((Data & Extra) | Data
)
π Expected behavior
I expect TypeScript to warn me that a property within value
is missing: e.g (onChange
is not specified)