594430f113
* Infer from arrows from usage. Previously only function expressions were, and only those with an easily accessible name. Now any arrow function or function expression will infer from usage. * remove isApplicableFunctionForInference *all* functions are applicable for inference now.
21 lines
333 B
TypeScript
21 lines
333 B
TypeScript
/// <reference path='fourslash.ts' />
|
|
|
|
/////**
|
|
//// * @template T
|
|
//// * @param {T} x
|
|
//// * @returns {T}
|
|
//// */
|
|
////var f = /*a*/x/*b*/ => x
|
|
|
|
verify.codeFix({
|
|
index: 0,
|
|
description: "Annotate with type from JSDoc",
|
|
newFileContent:
|
|
`/**
|
|
* @template T
|
|
* @param {T} x
|
|
* @returns {T}
|
|
*/
|
|
var f = <T>(x: T): T => x`,
|
|
});
|