Skip to content

Commit

Permalink
Fix template tag syntax
Browse files Browse the repository at this point in the history
In 2.9 and earlier, Typescript allowed braces around the name introduced
by the `@template` tag, even though this syntax is non-standard. In 3.0,
Typescript introduces a more complex `@template` syntax that uses braces
for specifying the constraint of a type parameter:

```js
/** @template {Constraint} T -- By analogy with param syntax:
 *  @param {T} name
 */
function f(name) { ... }
```

That means that the syntax `/** @template {T} */` is illegal. This PR
fixes the uses of the `@template` tag ahead of Typescript 3.0 as well as
typescript@next.
  • Loading branch information
sandersn committed Jun 4, 2018
1 parent 19389b7 commit c971073
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/Chunk.js
Expand Up @@ -69,7 +69,7 @@ const getModulesIdent = set => {
};

/**
* @template {T}
* @template T
* @param {Set<T>} set the set to convert to array
* @returns {Array<T>} the array returned from Array.from(set)
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/ChunkGroup.js
Expand Up @@ -18,7 +18,7 @@ const compareLocations = require("./compareLocations");
let debugId = 5000;

/**
* @template {T}
* @template T
* @param {Set<T>} set set to convert to array.
* @returns {T[]} the array format of existing set
*/
Expand Down

0 comments on commit c971073

Please sign in to comment.