Repository: TypeScript
Issue: Type can't `keyof`
Labels: Needs Investigation

### 🔎 Search Terms

* keyof

### 🕗 Version & Regression Information

- This is a crash


### ⏯ Playground Link

_No response_

### 💻 Code

```ts
export type IsEqual<A, B> =
  (<T>() => T extends A ? 1 : 2) extends
  (<T>() => T extends B ? 1 : 2) ? true : false

export type IsNotEqual<A, B> =
  (<T>() => T extends A ? 1 : 2) extends
  (<T>() => T extends B ? 1 : 2) ? false : true

export interface Entries<X> {
  100000: [true extends (
    & IsNotEqual<X, ArrayConstructor>
    // Simplifying the problem here allows for the removal of the next line.
    & ([X] extends [ObjectConstructor] ? true : false)
  ) ? true : false, {
    check: (
      & IsNotEqual<X, ArrayConstructor>
      & ([X] extends [ObjectConstructor] ? true : false)
    ),
    x: X
  }]
  [key: number & {}]: [boolean, any]
}
type Mapping<
  X,
  E extends Entries<X> = Entries<X>
> = {
  [ K in keyof E
      as true extends (
        IsEqual<E[K & number][0], true>
      ) ? K : never
  ]: E[K & number][1]
}
type A0 = keyof Mapping<ObjectConstructor>
//   ^? type A0 = 100000
type A1 = ObjectConstructor extends infer T ? Mapping<T> : never
//   ^? type A1 = { 10000: { check: true; x: ObjectConstructor } }
type A2 = ObjectConstructor extends infer T ? keyof Mapping<T> : never
//   ^? type A2 = never
type A3 = [ObjectConstructor] extends [infer T] ? keyof Mapping<T> : never
//   ^? type A3 = never
type A4 = keyof (ObjectConstructor extends infer T ? Mapping<T> : never)
//   ^? type A4 = 11000
```



<details><summary><b>Output</b></summary>

```ts
export {};
//   ^?

```


</details>


<details><summary><b>Compiler Options</b></summary>

```json
{
  "compilerOptions": {
    "strict": true,
    "noImplicitAny": true,
    "strictNullChecks": true,
    "strictFunctionTypes": true,
    "strictPropertyInitialization": true,
    "strictBindCallApply": true,
    "noImplicitThis": true,
    "noImplicitReturns": true,
    "alwaysStrict": true,
    "esModuleInterop": true,
    "declaration": true,
    "target": "ES2017",
    "jsx": "react",
    "module": "ESNext",
    "moduleResolution": "node"
  }
}
```


</details>

**Playground Link:** [Provided](https://www.typescriptlang.org/play?#code/KYDwDg9gTgLgBDAnmYcCSBnAogRwK4CGANgDwCCANHAEIB8cAvAFBxwAUJAKrWwJSP1OcUDGAA7ACYY4ZOAH44ARjgAuOACZ+I8VJbsuPfg0HCQoydOrylqjfwUwoeVGoBmxDMCZNQkWAmRUTAA5CBhcQlJKGnpmVg5uPgE4IW0LGWtlNU1Tc114gyTjFNydS0zbHIV3Ik9bR2dvX2h4AEsxUSh3AGNULA6oVuAMEgANegBvPUUABjm5tQBtBtQ0qXY9VgAydAxQ8PxiMaoyKCgCRABhCDEMBu6YaFpNuAB6V7gAZVaAWzAiVquRDtADmCAAFqgwFAIAAjIjAH5wSFQVDEIgQADu0lc0AhqFRPwgADdiHAIK58XAxCI4ACaQA6F47NiLUYAXVK6UWAHlYQArYAPa63e6PKCchxOFxwGqeXh6ewIaW2OXAKhTVisbqQ7oAazUbBe212+wiR1GJzOFxFdycDyexrgLLZnLW0l5AqFMFtYugkuVzlVHmACq1cF4FBeIDUoz0AF92XpFnrgIg1GI8D9YcAoM64BNE0tYRAIAiCGIqBXEEn40wkCg4ABZAhgMCgkh6S16LBc9b9RxDEbjRhwAeDYZjZ6xAvJuAAaTg7TgqcQFLHToI0hWfekRvD4cw5tIWEWi52mezufZixm7KoK2eB4j1kXGeAxNzenZalP5+pWY5hKiyKLW9aBDIMyjqu64tm2HZ8oKwo3HaeAOlAzzvFqAB6cjgY2ZDKAwcCId6vr2uKu5LmIri5iUChwe2YgggYtg0p+UBMFhrC4fhqBkOoo6kchooUXi7rUbReZCAoMGUoxHbcGxH5ftxcC8Q2-EAMyjp6SE+ihfoSlRiztFJKQBnJzatkxLFKe+HFcR8PF4ZpMgACzQWm65sMJBmiWhlESWZdEydZ8HMaxDm5gqam8UAA)


### 🙁 Actual behavior

In the case of `A2`, the type obtained through the operation cannot be used with `keyof` to obtain the `Keys` of the corresponding type.

### 🙂 Expected behavior

```ts
type A2 = 11000
```

### Additional information about the issue

_No response_