Skip to content

*[] for array of mixed type values breaks #1628

@calvinjuarez

Description

@calvinjuarez

Note: This is how JetBrains' PHPStorm IDE documents arrays of values of unknown type by default.

Input code

/**
 * @param  {*[]}  foo
 */

JSDoc configuration

{
    "opts": {
        "destination": "/path/docs",
        "private": true,
        "recurse": true
    },
    "plugins": [
        "plugins/markdown",
        "plugins/underscore"
    ],
    "source": {
        ... // (none of this is relevant)
    },
    "templates": {
        "cleverLinks": true,
        "default": {
            "useLongnameInNav": true
        }
    }
}

JSDoc debug output

Unable to parse a tag's type expression for source file [FILE] in line 1 with tag title "param" and text "{*[]}  foo": Invalid type expression "*[]": Expected "!", "=", "?", "|" or end of input but "[" found.

Expected behavior

Should document like Array<*> or even Array

Current behavior

Errors

Your environment

Software Version
JSDoc 3.5.5
Node.js 11.12.0
npm 6.9.0
Operating system MacOS X (10.14.3), also seen on Windows 10 (not sure the specific version) and Linux (centos 6.6)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions