TypeScript/tests/cases/conformance/jsdoc/jsdocParseParenthesizedJSDocParameter.ts
Nathan Shively-Sanders 1cedab18be
Fix parsing of parenthesized JSDoc parameters (#25799)
* Fix parsing of parenthesized JSDoc parameters

Parenthesis can start a jsdoc function parameter since it is just a
type, and parenthesis can start a type:

```js
/** @type {function(((string))): void} */
```

However, this is not legal in other parameter lists:

```ts
function x((((a))): string) { }
```

This change makes jsdoc function parameter lists parse differently than
normal parameter lists by allowing parenthesis as a start character of
jsdoc parameters.

* Parse nested uses of jsdoc function types

* Fix test
2018-07-19 12:50:36 -07:00

8 lines
161 B
TypeScript

// @noemit: true
// @allowjs: true
// @checkjs: true
// @strict: true
// @Filename: paren.js
/** @type {function((string)): string} */
var x = s => s.toString()