TypeScript/tests/cases/conformance/jsdoc/checkJsdocTypeTag1.ts

45 lines
643 B
TypeScript
Raw Normal View History

2017-05-24 01:11:23 +02:00
// @allowJS: true
// @suppressOutputPathCheck: true
// @filename: 0.js
// @ts-check
/** @type {String} */
var S = "hello world";
/** @type {number} */
var n = 10;
2017-05-24 01:11:23 +02:00
/** @type {*} */
var anyT = 2;
anyT = "hello";
2017-05-24 01:11:23 +02:00
/** @type {?} */
var anyT1 = 2;
anyT1 = "hi";
/** @type {Function} */
const x = (a) => a + 1;
x(1);
2017-05-30 05:37:15 +02:00
/** @type {function} */
const y = (a) => a + 1;
2017-07-13 20:33:12 +02:00
y(1);
2017-05-30 05:37:15 +02:00
2017-05-24 01:11:23 +02:00
/** @type {function (number)} */
const x1 = (a) => a + 1;
x1(0);
/** @type {function (number): number} */
const x2 = (a) => a + 1;
2017-07-11 00:24:03 +02:00
x2(0);
/**
* @type {object}
*/
var props = {};
/**
* @type {Object}
*/
2017-07-13 20:33:12 +02:00
var props = {};