TypeScript/tests/cases/conformance/salsa/typeFromPrototypeAssignment3.ts
Pranav Senthilnathan d38c616e29
Fix resolution of properties from prototype assignment in JS (#29302)
* fix type derived from prototype assignment

* accept new baselines

* remove direct intersection with object literal assigned to prototype

* add tests

* change webpack submodule commit

* fix submodule commits

* comment and simplify getJSDocTypeReference

* remove circularity guards that aren't hit anymore
2019-01-18 16:00:18 -08:00

23 lines
386 B
TypeScript

// @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')