Bad JSDoc comments leads to generate invalid declaration file #37703
Labels
Bug
A bug in TypeScript
Domain: Declaration Emit
The issue relates to the emission of d.ts files
Help Wanted
You can do this
Milestone
TypeScript Version: 3.9.0-dev.20200328
Search Terms:
JSDoc
A required parameter cannot follow an optional parameter.
Code
Expected behavior:
Generate declaration file:
Actual behavior:
Generate declaration file:
Playground Link: https://www.typescriptlang.org/v2/en/play?ts=3.9.0-dev.20200328&useJavaScript=true#code/PQKhFgCgAIWgBADgQwE7ILbQN4GcAuqAlgHYDmAvtCrrgO4D2qAJtAArK2IAW6uAplFgIU6LHkKlK0ANr40ZfvgBKDBhgCSzALrRV66BoAi0fA1MKl0ZNFyJ+AYyIAzIg+io1GAHRC4y-gImQOsAG1CPL1xoF2h1Inx8fmZfGDgkNEwcBgAjACtHfCoGRHxogHlSogYSZAjRTGjcAFcHbmtohzrQnOQHAGtcP2AoZ2aSB3xqkmgADwAKGnomZgAaC1RFFS8tdZKygEocCigoBYOoIA
Hover the mouse on the function
x
, you can see it's signature is inferred asfunction x(password: string, targetRoomId?: string, opts: object): void
which is wrong.The text was updated successfully, but these errors were encountered: