TypeScript/tests/cases/conformance/salsa/typeFromPrototypeAssignment3.ts

23 lines
386 B
TypeScript
Raw Normal View History

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: bug26885.js
// @strict: true
function Multimap3() {
this._map = {};
};
Multimap3.prototype = {
/**
* @param {string} key
* @returns {number} the value ok
*/
get(key) {
return this._map[key + ''];
}
}
/** @type {Multimap3} */
const map = new Multimap3();
const n = map.get('hi')