You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
consta: {x?: number;}={};letx=0;({ x =1}=a);// error: Type 'number | undefined' is not assignable to 'number'.
However, the destructuring assignment has a default value assigned. This should be treated the same way that strict null checking treats VariableDeclarationList, which does not have this error:
consta: {x?: number;}={};let{ x =1}=a;lety: number=x;// ok, x has type 'number'
TypeScript Version:
nightly
The text was updated successfully, but these errors were encountered:
Given the following TypeScript:
However, the destructuring assignment has a default value assigned. This should be treated the same way that strict null checking treats
VariableDeclarationList
, which does not have this error:TypeScript Version:
nightly
The text was updated successfully, but these errors were encountered: