Repository: TypeScript
Issue: Difference in overload pick between JS and TS with default generic type parameter
Labels: Needs Investigation

<!-- 🚨 STOP 🚨 STOP 🚨 STOP 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!--
Please try to reproduce the issue with the latest published version. It may have already been fixed.
For npm: `typescript@next`
This is also the 'Nightly' version in the playground: http://www.typescriptlang.org/play/?ts=Nightly
-->
**TypeScript Version:**  4.0.0-dev.20200703, 3.9.2 (playground)

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** js ts overload difference, javascript different overload, javascript wrong overload, javascript overload generic empty object

**Code**
`definition.d.ts`
```ts
export class EmptyObjectOverloads<T = {}> {
    constructor(a: Readonly<T>);
    /** @deprecated */
    constructor(a: T, b?: any);
}

export class RecordOverloads<T = Record<string, any>> {
    constructor(a: Readonly<T>);
    /** @deprecated */
    constructor(a: T, b?: any);
}
```
`ts-example.ts`
```ts
import { EmptyObjectOverloads, RecordOverloads } from './declaration';

class TSExampleEmpty extends EmptyObjectOverloads {
    constructor(a: any) {
        // hover over super: constructor EmptyObjectOverloads<{}>(a: Readonly<{}>): EmptyObjectOverloads<{}> (+1 overload)
        super(a); 
    }
}

class TSExampleRecord extends RecordOverloads {
    constructor(a: any) {
        // hover over super: constructor RecordOverloads<Record<string, any>>(a: Readonly<Record<string, any>>): RecordOverloads<Record<string, any>> (+1 overload)
        super(a);
    }
}
```
`js-example.js`
```js
class JSExampleEmpty extends EmptyObjectOverloads {
    /** @param {*} a */
    constructor(a) {
        // hover over super: constructor EmptyObjectOverloads<any>(a: any, b?: any): EmptyObjectOverloads<any> (+1 overload)
        super(a); // deprecation warning '(a: any, b?: any): EmptyObjectOverloads<any>' is deprecated ts(6385)
    }
}

class JSExampleRecord extends RecordOverloads {
    /** @param {*} a */
    constructor(a) {
        // hover over super: constructor RecordOverloads<Record<string, any>>(a: Readonly<Record<string, any>>): RecordOverloads<Record<string, any>> (+1 overload)
        super(a);
    }
}
```

**Expected behavior:**
Both `TSExampleEmpty`  and `JSExampleEmpty` pick same overload similar to `TSExampleRecord` and `JSExampleRecord`. 

**Actual behavior:**
`TSExampleEmpty` uses default generic value `{}` and picks first overload.
For `JSExampleEmpty` generic value to is `any` and second (deprecated) overload picked, while `JSExampleRecord` works as expected.

In real world examples this behavior marks all `super(props);` in React class components in JS files as deprecated.
Of course it's impossible to report TS issue without mentioning React 😆  related [constructor declaration](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/b5b627cf71bebf6dc7fcfdc7284a44065d378e20/types/react/index.d.ts#L478-L483)


**Playground Link:**
[Example TS](https://www.staging-typescript.org/play?ts=4.0.0-dev.20200703#code/JYWwDg9gTgLgBAJQKYEMDGMA0cDecDCE4EAdkifAL5wBmURcA5FKhowNwBQnaANigGcBcALIBPAEIBXGDFJwkADxjkAJsMLEyFXJwCQaUgJhQpGaAAow9MAIBccFCTEBKXXr0B6T3EMljpuZQiKwwAHSakNowADw4lNjx2E5iAHxWNvYhKKqkvGJxlKkuDsjo4ZGk5LFJuAmOzqlwFgDUAIxwEABuSFC8EDku+noCUmC9GRC2Luxw+pScC0A) [Example JS](https://www.staging-typescript.org/play?ts=4.0.0-dev.20200703&useJavaScript=true#code/JYWwDg9gTgLgBAJQKYEMDGMA0cDecDCE4EAdkifAL5wBmURcA5FKhowNwBQnaANigGcBcALIBPAEIBXGDFJwkADxjkAJsMLEyFXJwCQAegBURuAAEwKKChC4j1MPTDCjB-WlICYUKRmgAKRwhnAEpdPUMDOA8SLx8-KERWGAA6TUhtGAAeFBIxbFz8uEKAPkCnAQAuYrzsGJVlAH5qwpDq5HRU9NJybMKC2pqxErh-AGoARjgIADckKF4IFFUQ-T0BKTB58uCBEPY4AyjGHecWwfqlGGahtoIiDN6cwf6hksY4YGFVJEckNBQKlU-gAbABmAAcAFZVnpKJx4UA)


**Related Issues:** Haven't found any