Search code examples
argumentsgoogle-closure-compiler

Closure Compiler Externs - arguments - WARNING - Bad type annotation. type not recognized due to syntax error


I am getting the following warning:

js/lib/pixi-externs.js:848: WARNING - Bad type annotation. type not recognized due to syntax error
* @param {Array.|Array.|...PIXI.Point|...number} points
                            ^    

Here is the complete line in externs file, related to the above warning:

* @param {Array.<PIXI.Point>|Array.<number>|...PIXI.Point|...number} points

What am I doing wrong here? Should ...PIXI.Point and ...number be wrapped in ( ) ?


Solution

  • The ellipsis operator applies to the entire parameter - not a particular type:

    @param {...(Array<PIXI.Point>|Array<number>|PIXI.Point|number)} points