Skip to content

CFA failure with fallthrough clauses in switch statements #23818

Description

@falsandtru

TypeScript Version: master

Search Terms:

Code

declareconsto: {c?: 1;};switch(0){case0:
break;caseo.c&&o.c.valueOf():
caseo.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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions