TypeScript Version: 2.6.1
Code
interfaceA{first: string;bList?: B[];}interfaceB{second: string;c?: C;}interfaceC{third: string;}constQ: A&{bList: (B&{c: C})[]}={first: 'first',bList: [{second: 'second',c: {third: 'third',},},],};Q.bList.map(item=>{P(item);});functionP(value: B&{c: C}){console.log(value);}Expected behavior:
Until 2.5.1 this code did not generate a compilation error.
The type of bList is calculated as follows:
(undefined&(B&{c: C;})[])|(B[]&(B&{c: C;})[])And type of item
Actual behavior:
With 2.6.x, this code causes an error.
The type of bList is calculated as follows:
And type of item
The type of item is treated as B and an error occurs. Is this change specified in the changelog?
TypeScript Version: 2.6.1
Code
Expected behavior:
Until 2.5.1 this code did not generate a compilation error.
The type of bList is calculated as follows:
And type of item
Actual behavior:
With 2.6.x, this code causes an error.
The type of bList is calculated as follows:
And type of item
BThe type of item is treated as B and an error occurs. Is this change specified in the changelog?