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
The compiler already warns when you try to set such a property to undefined, but deleteing it circumvents this warning:
const/** {x: number, y: number} */point={x: 1,y:2};point.x=null;// Compiler does warnpoint.x=undefined;// Compiler does warndeletepoint.x;// Compiler does not warn
input0:3: WARNING - assignment to property x of point
found : null
required: number
point.x = null; // Compiler does warn
^^^^^^^^^^^^^^
input0:4: WARNING - assignment to property x of point
found : undefined
required: number
point.x = undefined; // Compiler does warn
^^^^^^^^^^^^^^^^^^^
The text was updated successfully, but these errors were encountered:
repro
The compiler already warns when you try to set such a property to
undefined
, butdelete
ing it circumvents this warning:The text was updated successfully, but these errors were encountered: