Closed
Description
Hi, Guys,
Something a bit strange here:
TypeScript Version: 2.0.6
Code
type foo1 = { id: number}[];
type foo2 = { id: number, value: string }[];
type foo3 = foo1 & foo2;
var x: foo3;
x[0].value; // okay
x.forEach(item => {
// Error: Property 'value' does not exist on type '{ id: number; }'.
item.value;
});
Expected behavior:
No error when property value
is referenced in the body of the forEach
.
Actual behavior:
The compiler reports an error.