Repository: TypeScript
Issue: Generic of abstract class should be inferrable from abstract property implemented in subclass
Labels: Suggestion,Awaiting More Feedback

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ

-->

## Search Terms
- generic
- abstract class
- abstract property
- type inference
<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->

## Suggestion, Use Case and Examples
As of typescript 3.9.3, if I write a code like the following:
```ts
abstract class SomeMapper<T extends string> {
    private someMap = new Map<number, T>();
    protected abstract readonly rndText: T;

    getSome(num: number) {
        return this.someMap.get(num)!;
    }
}

function rndGender(): 'male' | 'female' {
    return Math.random() > 0.5 ? 'male' : 'female';
}

class Gender extends SomeMapper<'male' | 'female' /* need to provide this explicitly */> {
    readonly rndText = rndGender();

    constructor() {
        super();
    }
}

const gen = new Gender();
const some = gen.getSome(1);
```
I have to make sure I always provide the generic to the SomeMapper class, and if I ever update the type of `rndText` in `Gender` class, I'll have to go and update the generic as well every time. The only way as of now to make this kinda auto-infer the generic, is to write it like this:
```ts
class Gender extends SomeMapper<Gender['rndText']> {
    readonly rndText = rndGender();

    constructor() {
        super();
    }
}
```
However this is not the most elegant way and can get very dirty with complicated type (for example [check this](https://www.typescriptlang.org/play/#code/IYIwzgLgTsDGEAJYBthjAgygewLYFMBZYABxPygB4AVBfADwnwDsATDSKAS2YHMA+BAG8AUAnEIS3AG7AmCMHiKkEAXgTN8AdwTESlZgFdcICgBoE1fgAoAlAG4xEqdibx8rBKE5xEUfMCs2MzIAJ4IyNi81AxMUABcCNYQjInUtmqC0thcrI5O4rz4EDgE1ka4iRWmUBmiEg0I-hCGUMwIEAAWXGAAdIoEer1FEOXGtgCEjg0AviJzAPQLlp34CEWa3LDrxRjY0hRIeCTIXLByHl5sCKxcUBDhzNhaIihoGADiLKyHsd8YpWUZAolAACsAYAQ4mBKF82BQANoAcki0T+UCRAF1+AiAAzY4QFJoBIIhcKomKMQ7qawbRJI3DAZD4JEIAA+CCRADN8IzmUiMqpBLBgopmb1UbSWA4RESRcxOIZ4NgoHZCY0JGBDORVTLZvNZfLIDt2upNDo4T9dY4jYgBmt1BthsVAdYAIwyoA)), and typescript should be able to do this on its own, similar to what it does with generics in functions.

So the ideal behaviour should be simply like this:
```ts
// Below line should not error: Generic type 'SomeMapper<T>' requires 1 type argument(s).
// Should auto infer the generic from property rndText
class Gender extends SomeMapper {
    readonly rndText = rndGender();

    constructor() {
        super();
    }
}
```
## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).