Repository: TypeScript
Issue: Multiple cases inside of a switch statement not narrowing the type
Labels: Bug

# Bug Report

If you have a `switch` statement that has multiple `case`s that fall through, and those `case` statements are not first, TypeScript will not narrow your types in those statements. 

It's a bit confusing to explain, but if you look at the playground link below, hopefully it makes sense. You can see if that you get rid of the first `case` statement, everything works just fine.

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

switch, case
<!--
  What search terms did you use when trying to find an existing bug report?
  List them here so people in the future can find this one more easily.
-->

### 🕗 Version & Regression Information

<!-- When did you start seeing this bug occur?

"Bugs" that have existed in TS for a long time are very likely to be FAQs; refer to
  https://github.com/Microsoft/TypeScript/wiki/FAQ#common-bugs-that-arent-bugs

If possible, please try testing the nightly version of TS to see if it's already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly

Note: The TypeScript Playground can be used to try older versions of TypeScript.

Please keep and fill in the line that best applies:
-->


- This is the behavior in every version I tried, and I reviewed the FAQ for entries about `switch` statements

### ⏯ Playground Link

<!--
  A link to a TypeScript Playground "Share" link which shows this behavior

  The TypeScript Workbench can be used for more complex setups, try
  https://www.typescriptlang.org/dev/bug-workbench/

  As a last resort, you can link to a repo, but these will be slower for us to investigate.
-->
[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.3.0-dev.20210331#code/C4TwDgpgBAKgFgSwHYHMoF4BQUoB8oDe2OJokAXFAOQCGVA3MSVAPZIA2IAgpQM7AAnZCkbMAvsXxFmOMhEpUARlTzUAQgyYk2nNX0HDRJMY0wBjNvyjBEqSvGEZCYqDV6xbIzJl4B3BMBmcFAAFIIArhAAlITEZm7QNsIAdHIY6OjqVORaigIQNADWpjjxvImeqeDQGZlKKgBkDdaVOiBq6XV0OaUJLSlptdR0UE39qMltXJ3Uyj1QZRUD1TO0jc1JE1OrZtm5+UUlUAAmEABmNOHswPM4eQXFmGJAA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
type Thing =
  | {
      type: 'a';
      onlyA: string;
    }
  | {
      type: 'b' | 'B';
      onlyB: string;
    };

const thing: Thing = {} as Thing;

switch (true) {
  case thing.type === 'B':
    break;

  case thing.type === 'b' && thing.onlyB === 'a': // TS error on this line
  case thing.type === 'a' && thing.onlyA === 'b': // and on this line
  case thing.type === 'a' && thing.onlyA === 'c':
    break;

  default:
    break;
}
```

### 🙁 Actual behavior

<!-- What happened, and why it was wrong -->

In the first 2 of the 3 case statements that are grouped together, TS will complain that `onlyB` and `onlyA` does not exist on type `Thing`. If you get rid of the very first `case` statement in the `switch`, the errors go away.

### 🙂 Expected behavior

<!-- What you expected to happen instead, and why -->
I would expect this code to work as-is, without the need for the 3 `case` statements to be listed first in the `switch` statement.