-
Notifications
You must be signed in to change notification settings - Fork 488
Closed
Description
Given this code:
/**
* Foo.
*/
function foo(): (any => Promise<string>) {
throw new Error('unimplemented');
}
and running this command (from master):
$ documentation.js build --format html --output docs ./src/
I get:
TypeError: Cannot read property 'name' of null
at params.type.params.map.param (/home/andrew/clones/documentation/lib/flow_doctrine.js:103:27)
at Array.map (native)
at flowDoctrine (/home/andrew/clones/documentation/lib/flow_doctrine.js:100:27)
at Arguments.inferReturn (/home/andrew/clones/documentation/lib/infer/return.js:34:22)
at comment (/home/andrew/clones/documentation/index.js:41:30)
at Array.map (native)
at /home/andrew/clones/documentation/index.js:115:40
at arrayMap (/home/andrew/clones/documentation/node_modules/lodash/lodash.js:660:23)
at map (/home/andrew/clones/documentation/node_modules/lodash/lodash.js:9571:14)
at Function.flatMap (/home/andrew/clones/documentation/node_modules/lodash/lodash.js:9274:26)
It looks like your handling of FunctionTypeAnnotation
assumes that a name for each formal parameter is provided, but in this case, the type (any => Promise<string>)
has no names for its any
parameter.
Metadata
Metadata
Assignees
Labels
No labels