mihaip / react-closure-compiler

Tooling to teach Closure Compiler about React
Apache License 2.0
100 stars 14 forks source link

Allow parameterized typed in static mixin methods #48

Closed arv closed 5 years ago

arv commented 5 years ago

We used to generate:

/** @type {function(number): string} */
Comp.staticMethod;

but that does not allow type parameters. By Using the following syntax we can support type parameters.

/**
 * @param {!Array[T]} p0
 * @return {T}
 * @template T
 */
Comp.staticMethod;

We still need to use the @type syntax for abstract optional methods but we could potentially figure out a way to allow type parameters there too by using a temporary typedef and using typeof types.

arv commented 5 years ago

TBR

mihaip commented 5 years ago

LGTM