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
I don't think this is a bug. We don't know for sure that Z's kind property isn't 'A' or 'B' (it could basically be any string value), so we can't safely narrow to A or B in the switch cases.
Activity
zpdDG4gta8XKpMCd commentedon Oct 7, 2016
despite #10417 (comment)
ahejlsberg commentedon Oct 13, 2016
I don't think this is a bug. We don't know for sure that Z's
kindproperty isn't'A'or'B'(it could basically be any string value), so we can't safely narrow toAorBin the switch cases.zpdDG4gta8XKpMCd commentedon Oct 13, 2016
i see your point, negating type constraints (#7993) could have guaranteed that
Z.kindis neitherAnorB: