-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specifically
Milestone
Description
function Multimap() {
this._map = {};
};
Multimap.prototype = {
/**
* @param {string} key
* @returns {number} the value ok
*/
get(key) {
return this._map[key + ''];
}
}
/** @type {Multimap} */
const map = new Multimap();
const n = map.get('hi')Expected behavior:
No error on map.get
Actual behavior:
Error: 'get' not found on type 'Multimap'
I thought there were tests that covered exactly this case, but apparently not. This doesn't work in 3.0 or 3.1.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JavaScriptThe issue relates to JavaScript specificallyThe issue relates to JavaScript specifically