TypeScript/tests/cases/fourslash/annotateWithTypeFromJSDoc19.ts

25 lines
410 B
TypeScript
Raw Normal View History

2017-10-12 20:40:40 +02:00
/// <reference path='fourslash.ts' />
// @strict: true
/////**
//// * @template T
//// * @param {number} a
//// * @param {T} b
//// */
////function f(a, b) {
//// return a || b;
2017-10-12 20:40:40 +02:00
////}
verify.codeFix({
description: "Annotate with type from JSDoc",
index: 2,
newFileContent:
2017-10-12 20:40:40 +02:00
`/**
* @template T
* @param {number} a
* @param {T} b
*/
function f<T>(a: number, b: T) {
return a || b;
}`,
});