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
constmap=newMap<string,{attr: number}>();letobj=map.get('key');if(!obj){obj={attr: 1};}[].map(elem=>{console.log(obj.attr);// error occurs on this line})
Expected behavior:
TypeScript should detect that there's no way obj can become undefined during the evaluation of the map call.