Repository: TypeScript
Issue: Resolve deferred conditional types to their `true` branch when instantiated with a type parameter constrained to the tested type
Labels: Suggestion,Experience Enhancement,Experimentation Needed

# Bug Report

### 🔎 Search Terms

conditional-type, distributive-type, generics 

### 🕗 Version & Regression Information

Version **4.9.4** and **nightly**

### ⏯ Playground Link

[TS resolves type to different type even if I add constraint that should resolve to given type](https://www.typescriptlang.org/play?#code/C4TwDgpgBACgTgSwLYOAgbhAIgQ2DgFXGgF4oBnYRAOwHMoAfKagVyQCMI5Gp2FaE1YD3YB7UQBsIOaj3IgOkni2oATCADNBEVT1YSJAbgBQx0JCgBhUWtQIbOCUUgAeAgD4oZANoEAulAQAB7AEGrkUN7wyHaYuPjOEH7GUFAA-FAAFOgAXFAEAJRenuiiCKopUHkEgSFhqhEAgnBwOCAuKgDW1KIA7tTulRnZ1QA0UMB5rBxcRSQlZRWpUxCYcCbGOOyUrQDGwrsSOORN21Q4+5ZHJ26eAN6VWzsXwuiOLBDVJqlgcKKh+x0UF2NlUdgcEgAYip9vZqOQ8gBZHBgFzWWxoCGJW7jaacbhMFTqLTUHSeMik3pQZFgTIFEwAX1Mh2OEQAyqIkBArqy3LVQuFYIgUGg4nhCMRPMEBQ0oI0zntgDybh4oA9Um8JB8vqZUiD4VQWPtRHBsu9PvkiurUhQWJBTfTKqlgAALBDkAB0mo+Xig3og3ygTMq5E5EEREFdolUdLVTqgGhNWX1lAoYchslEGgmbs9+rBmOojmh1FhNk9nQgIHIdKt8dSoa5GcyrvdXvNjptQcqTIZQA)

### 💻 Code

```typescript
type PrimitiveDataType = string | number | bigint | boolean | symbol | undefined | null;

type ConditionalType<T> = [T] extends [PrimitiveDataType]
  ? (v: T) => void
  : T extends Array<unknown>
  ? (v: T, t: number) => void
  : never;

abstract class AbstractClass<T> {
  abstract value: T;
  protected conditionalFunctions: Map<ConditionalType<T>, number | undefined> = new Map();
}

class SomeClass<T extends PrimitiveDataType> extends AbstractClass<T> {
  value: T;

  constructor(value: T) {
    super();
    this.value = value;
  }

  someMethod() {
    for (const someFn of this.conditionalFunctions.keys()) {
      someFn(this.value);
    }
  }
}
```

In the above code I have created a `PrimitiveDataType` which is a union of all primitive data types in JavaScript. Then I have created a `ConditionalType<T>` that will resolve to some callback only if `T` is one of `PrimitiveDataType`. Then I have created an abstract generic class that have a field which type(`ConditionalType<T>`) depends on generic value of this class. In the end, I have crated a `SomeClass` that extends `AbstractClass<T>` and add constraints that generic parameter `T` have to extend `PrimitiveDataType`.

### 🙁 Actual behavior

For `someMethod` of this `SomeClass` `conditionalFunctions.keys()` is resolved to `(v: T, t: number) => void` what would implicate that my generic  `T` extends an `Array` type.

### 🙂 Expected behavior

For `someMethod` of this `SomeClass` I have expected that TS should resolve `conditionalFunctions.keys()` to `(v: T) => void` to my surprise it is resolved to `(v: T, t: number) => void` what  would implicate that my generic  `T` extends an `Array` type. This doesn't make sens to me because  `T` has constraint that has to extends `PrimitiveDataType`.

Example of what I would expect: 

[Works for regular variables](https://www.typescriptlang.org/play?#code/C4TwDgpgBACgTgSwLYOAgbhAIgQ2DgFXGgF4oBnYRAOwHMoAfKagVyQCMI5Gp2FaE1YD3YB7UQBsIOaj3IgOkni2oATCADNBEVT1YSJAbgBQx0JCgBhUWtQIbOCUUgAeAgD4oZANoEAulAQAB7AEGrkUN7wyHaYuPjOEH7GUFAA-FAAFOgAXFAEAJRenuiiCKopUHkEgSFhqhEAgnBwOCAuKgDW1KIA7tTulRnZ1QA0UMB5rBxcRSQlZRWpUxCYcCbGAMY2lFBBedEoaHF4hMReUACMAEwm29S7IHnWtmgOTsQu5hCiGnueZEyYBwrSQc08KnUWmoOkMQA)


```typescript
type PrimitiveDataType = string | number | bigint | boolean | symbol | undefined | null;

type ConditionalType<T> = [T] extends [PrimitiveDataType]
  ? (v: T) => void
  : T extends Array<unknown>
  ? (v: T, t: number) => void
  : never;

const x: PrimitiveDataType = 12;
const y: ConditionalType<typeof x> = (param: number) => undefined;
```

> [StackOverflow question](https://stackoverflow.com/questions/74935286/why-ts-gets-type-never-if-i-add-constraint-that-should-resolve-to-given-type)