Closed
Description
/**
* @template T
* @typedef {[T, T]} TPair
*/
/** @type {TPair<number>} */
var tp = [1,2]
TPair doesn't correctly create a generic type alias.
Expected behavior:
TPair's typedef is equivalent to type TPair<T> = [T, T]
Actual behavior:
TPair's typedef is equivalent to type T; type TPair = [T, T]
(where T is unique and inexpressible). So @type {TPair}
is legal, but nothing can be assigned to it, and @type {TPair<number>}
says that TPair is not generic.