Repository: TypeScript
Issue: infer extends number in conditional type handles '\n' incorrectly
Labels: Bug,Rescheduled

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

- infer extends number

<!--
  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

4.8.0-beta (in playground)

### ⏯ 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.8.0-beta#code/PTAEDsFcFsCMFMBOAoALgTwA71AMQPb6gC8oA5ADrhmjwAeq84AJgM6gAGAJAN4CW4AGZJQAFVoMmbCDASIAvrwHDEoAEryOoAPxjQALgjwAbkgDcyIA)

[A simple type-level JSON parser encounters this issue](https://www.typescriptlang.org/play?ts=4.8.0-beta#code/KYDwDg9gTgLgBDAnmYcCiICGBbMAbVAXjgAVMoBnYAKQGUB5AOQB4ADAbwCIAzCCTgFwA2EQF9WAPgDcAKAD0cuEuUqAegH4Z8xTGAV4AY0xUKWgJa5o8JCjjt0ARwCumPABp04YAfii43KAhsOAByAAEbYABaAwALVwIAOwBzPTknGDM8ChDZGVBIWARkVABhYz04YgBtGRUMFB9mNGdXZjqVZTJKGgYWVg7Ou0Gh5R4+QTgRITcR0bhOACNySaXMAC9OWfmVNc2BOFqd0fH+bePO6rWoLbsF5f2EKCdUUQ9uVyoPRKc8PABdc4XZRRACMAAYAEwAFjmo3+cKUokRcEkQM67BRKl4EAO03R82WUAOIQeIQJoweByOwOUIRx5Kxo2qpPI5PsVKeLzgb38n2A31+AIpxzBUNhwMBKORKgkElm-zyCjgwESMCgiC0kVI5CodCYzAAKiqQLpEgATChwfRQMwpCRVa3qu3JE1my1wY3qOBORIAa0SEAA7ok4AdulRmLQjIkjXLquDFVplRQY4lgFAtSU4NHMLHjaB3VabS6PAB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pCKwEMIeCIaXAqn9eaXy7ocbeKC0EGTnpguA05D4nzPhfQh6CSFwDIdAxisDqFLxwWvBhkVmFwFYflcuXDr5Pgfk-b02CAEAX1joo2IR3z6PQXPZ+6ibE+QFtfO+ViBGKKoLQvBHhGGAXUbfNhJsf62FEafJo3DgF9wHkPSh2NWL0QgGInwjp2CiFJo4yRBkADS7FaKhAfC48cCIU7CI7hIiexDSHoPIX7aJDY3HACPiE8+0U4AADJJLeGgOaZgGSWFym5hwqAfMHFKG4VPPhe9rF1IaeIkxG80lb2-PkiSNjvTVBID3Haa99YeHsewr+SpFAZCyKYKG2ZxatUdOCV8oJXyQlfEDV80JXx-VfEIV8INXwAA5XwAE5Antw2UgOMSSRhrJkaGP0wBEB9U9P8A4ho1lJlEP8z02si6AJgijFsV9Q5WQMnTASw0WavkWHwAgeZXzxzwGlKBH99kyCAA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
// number
type Foo = '\n' extends `${infer T extends number}${infer R}` ? T : never;
```

### 🙁 Actual behavior

`Foo` is `number`
<!-- What happened, and why it was wrong -->

### 🙂 Expected behavior

`Foo` should be `never`
<!-- What you expected to happen instead, and why -->