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