TypeScript Version: 2.4.0
Code
interface Foo {
a: string;
}
interface Bar extends Foo {
b: string;
c: string;
}
// d is neither foo nor bar!
const d: Foo | Bar = {
a: 'lol',
b: 'kek',
};
Expected behavior:
You would expect the code above to throw an error as d can not be resolved to type foo or type bar.
Actual behavior:
Code compiles without error.
TypeScript Version: 2.4.0
Code
Expected behavior:
You would expect the code above to throw an error as d can not be resolved to type foo or type bar.
Actual behavior:
Code compiles without error.