TypeScript/tests/cases/conformance/jsdoc/checkJsdocTypeTagOnObjectProperty1.ts
2017-06-13 15:24:05 -07:00

29 lines
589 B
TypeScript

// @allowJS: true
// @suppressOutputPathCheck: true
// @strictNullChecks: true
// @filename: 0.js
// @ts-check
var lol = "hello Lol"
const obj = {
/** @type {string|undefined} */
foo: undefined,
/** @type {string|undefined} */
bar: "42",
/** @type {function(number): number} */
method1(n1) {
return n1 + 42;
},
/** @type {string} */
lol,
/** @type {number} */
['b' + 'ar1']: 42,
/** @type {function(number): number} */
arrowFunc: (num) => num + 42
}
obj.foo = 'string'
obj.lol
obj.bar = undefined;
var k = obj.method1(0);
obj.bar1 = "42";
obj.arrowFunc(0);