Repository: TypeScript
Issue: JSDoc disappeared in overloading with mapped type
Labels: Bug,Domain: JSDoc

# Bug Report

<!--
  Please fill in each section completely. Thank you!
-->

### 🔎 Search Terms

<!--
  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.
-->

vscode, jsdoc

### 🕗 Version & Regression Information

4.1.3

### ⏯ 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.
-->
example 1, bug, no jsdoc:
[No JSDoc if overloading in mapped type](https://www.typescriptlang.org/play?ts=4.2.0-beta#code/C4TwDgpgBAgmCWAReBjYUC8UDeAoKUA9AFTH4HFQBWAzgCYD2KUAZgwE5QDmEwAysHbwAdl3JRihcj36CRXAFxQac0QG5yJMgQnV6TVh268AQgwYAbCAENh4ydNPmrtpQCNnN4RoC+G3KCQsAiYOOQA2gDWECBQIlDRIAwswUiowAC6Sng6UAAUAK7sFkoqQqIAlEpwaWhRMRkauYXFpapcADRQKAzCLPCKOD5VOFB01sDW1QjIdYmNUBAAHoJTULaxfuRbW7h0ECgW1uzQPcIq6wjT8P7WCAB0MmaWXnkA5G9d2MNqQA)
![image](https://user-images.githubusercontent.com/8111351/106252316-176fad80-6251-11eb-95e4-b1351117ce58.png)

example 2, works well:
[Has JSDoc if no overloading in mapped type](https://www.typescriptlang.org/play?ts=4.2.0-beta#code/C4TwDgpgBAgmCWAReBjYUC8UDeAoKUA9AFTH4HFQBWAzgCYD2KUAZgwE5QDmEwAysHbwAdl3JRihcj36CRXAFxQac0QG5yJMgQnV6TVh268AQgwYAbCAENh4ydNPmrtpQCNnN4RoC+G3KCQsAiYOOQA2gDWECBQIlDRIAwswUiowAC6Sng6UAAUAK7sFkoqQqIANFAoDMIs8Io4PgCU2VB01sDWSnBpaFExGWpQEAAegt1QtrF+5LOzuHQQKBbW7NA1wipTCD0I-tYIAHQyZpZeeQDkl1XYLWpAA)
![image](https://user-images.githubusercontent.com/8111351/106252498-500f8700-6251-11eb-9aeb-05310fd147a2.png)

example 3, bug, no jsdoc:
[JSDoc disappeared without overloading](https://www.typescriptlang.org/play?ts=4.2.0-beta#code/PQKhCgAIUgrBnAJgewMaQGbIE6QFJJoAiAlvAIYAOlApudjYgOokAuAFsgK6sDyAbjWwAbZOUQkAdgHMoIYOCmshGcqhr5CqUhWp0GzNpx4Cho8VOmQA3lEgAKLiIBckeK2yWAlK-KSAngDc4AC+4OCINKjC9BqoyJLucFo6VLSxhhzcfIIiYhIyrgQo2mRp+owsWSa55gXSweAIJal6GVXGOWb5lvYA5H1ewUA)

![JSDoc disappeared without overloading](https://user-images.githubusercontent.com/8111351/106252862-b399b480-6251-11eb-907d-c46e13472628.png)


### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
type ApiDict = {
  /**
   * jsdoc for getString
   */
  getString: string;
  /**
   * jsdoc for getBoolean
   */
  getBoolean: boolean;
};

type Api = {
  [key in keyof ApiDict]: {
    (url: string): ApiDict[key];
    (url: string, config: {}): { data: ApiDict[key]; extra: any };
  };
};

declare const api: Api;

api.getBoolean('', {});
```

```ts
type ApiDict = {
  /**
   * jsdoc for getString
   */
  getString: string;
  /**
   * jsdoc for getBoolean
   */
  getBoolean: boolean;
};

type Api = {
  [key in keyof ApiDict]: {
    (url: string, config: {}): { data: ApiDict[key]; extra: any };
  };
};

declare const api: Api;

api.getBoolean('', {});
```

```ts
/**
 * jsdoc for JsdocDisappearedWithoutOverloading
 */
interface JsdocDisappearedWithoutOverloading {
  (url: string): any;
}

declare const jsdocDisappearedWithoutOverloading: JsdocDisappearedWithoutOverloading;

jsdocDisappearedWithoutOverloading('');
```

### 🙂 Expected behavior

All of examples has jsdoc

<!-- What you expected to happen instead, and why -->