<!-- 🚨 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. --> **TypeScript Version:** 4.0.0-dev.20200516 <!-- Search terms you tried before logging this (so others can find this issue more easily) --> **Search Terms:**: JSDoc invalid dts **Code** ```ts /** * @param {Array=} y desc */ function x(y) {} /** * @param {function (Olm.InboundGroupSession)} func Invoked */ function y(func) {} /** * @return {(Array.<> | null)} list of devices */ function z() {} /** * * @return {?Promise} A promise */ function w() {} ``` <details><summary><b>Compiler Options</b></summary> ```json { "compilerOptions": { "noImplicitAny": true, "strictFunctionTypes": true, "strictPropertyInitialization": true, "strictBindCallApply": true, "noImplicitThis": true, "noImplicitReturns": true, "alwaysStrict": true, "esModuleInterop": true, "checkJs": true, "allowJs": true, "declaration": true, "experimentalDecorators": true, "emitDecoratorMetadata": true, "moduleResolution": 2, "target": "ES2017", "jsx": "React", "module": "ESNext" } } ``` </details> Invalid outputs: ```js /** * @param {Array=} y desc */ declare function x(y?: Array | undefined): void; // ~~~~~~~~~~~~~~~~~~~~~~~~~^ Missing generics /** * @param {function (Olm.InboundGroupSession)} func Invoked */ declare function y(func: (arg0: any) => ): void; // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ invalid type signature /** * @return {(Array.<> | null)} list of devices */ declare function z(): (Array | null); // ~~~~~~~~~~~~~~~~~~~~~~~~~^ missing generics /** * * @return {?Promise} A promise */ declare function w(): Promise | null; // ~~~~~~~~~~~~~~~~~~~~~~~~~~^ missing generics ``` **Playground Link:** [Provided](https://www.typescriptlang.org/play?ts=4.0.0-dev.20200516&useJavaScript=true#code/PQKhFgCgAJpaACAHAhgJxQW2gbwIJoYCeAvAL7RHQAmApgM4DGUsIwUAZgK4B2jALgEsA9j2gAPABREAlLjJQooCDDiJUGbDm58ho6JIDyAG0wA6AJI8ARsN7UA4mjtIAyg3oieMijsbQrADdhAGtaahY2Tl4BL0pJPzkcBUglMEjENFp+LjQxHEkCYjMAHgA+aAAfaB4uY2MfaGNBen5oYQ4aWkDBRgZI9kg-PTEAL0kklLSVNQyELJy83AB+AAVnTBbaCjxoJA2tgejdOIB3CfkgA)
Activity
Jack-Works commentedon May 18, 2020
And seems like fix in #38368 doesn't work on the return value
Jack-Works commentedon May 25, 2020
related #38356 Wesley Wigham (@weswigham)