Open
Description
TypeScript Version: master
Search Terms:
Code
declare const o: { c?: 1; };
switch (0) {
case 0:
break;
case o.c && o.c.valueOf():
case o.c && o.c.valueOf():
break;
}
Expected behavior:
pass
Actual behavior:
$ node built/local/tsc.js index.ts --strictNullChecks
index.ts:5:15 - error TS2532: Object is possibly 'undefined'.
5 case o.c && o.c.valueOf():
~~~
Playground Link:
Related Issues: