a.js(9,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
a.js(14,16): error TS2304: Cannot find name 'K'.
a.js(15,18): error TS2304: Cannot find name 'V'.
a.js(18,21): error TS2339: Property '_map' does not exist on type '{ get(key: K): V; }'.
a.js(30,5): error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
a.js(35,16): error TS2304: Cannot find name 'K'.
a.js(36,18): error TS2304: Cannot find name 'V'.
a.js(39,21): error TS2339: Property '_map' does not exist on type '{ get: (key: K) => V; }'.
a.js(52,10): error TS2339: Property '_map' does not exist on type '{ Multimap3: { <K extends string, V>(): void; prototype: { get(key: K): V; }; }; }'.
a.js(57,16): error TS2304: Cannot find name 'K'.
a.js(58,18): error TS2304: Cannot find name 'V'.
a.js(61,21): error TS2339: Property '_map' does not exist on type '{ get(key: K): V; }'.


==== a.js (12 errors) ====
    /**
     * Should work for function declarations
     * @constructor
     * @template {string} K
     * @template V
     */
    function Multimap() {
        /** @type {Object<string, V>} TODO: Remove the prototype from the fresh object */
        this._map = {};
        ~~~~
!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
    };
    
    Multimap.prototype = {
        /**
         * @param {K} key the key ok
                   ~
!!! error TS2304: Cannot find name 'K'.
         * @returns {V} the value ok
                     ~
!!! error TS2304: Cannot find name 'V'.
         */
        get(key) {
            return this._map[key + ''];
                        ~~~~
!!! error TS2339: Property '_map' does not exist on type '{ get(key: K): V; }'.
        }
    }
    
    /**
     * Should work for initialisers too
     * @constructor
     * @template {string} K
     * @template V
     */
    var Multimap2 = function() {
        /** @type {Object<string, V>} TODO: Remove the prototype from the fresh object */
        this._map = {};
        ~~~~
!!! error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
    };
    
    Multimap2.prototype = {
        /**
         * @param {K} key the key ok
                   ~
!!! error TS2304: Cannot find name 'K'.
         * @returns {V} the value ok
                     ~
!!! error TS2304: Cannot find name 'V'.
         */
        get: function(key) {
            return this._map[key + ''];
                        ~~~~
!!! error TS2339: Property '_map' does not exist on type '{ get: (key: K) => V; }'.
        }
    }
    
    var Ns = {};
    /**
     * Should work for expando-namespaced initialisers too
     * @constructor
     * @template {string} K
     * @template V
     */
    Ns.Multimap3 = function() {
        /** @type {Object<string, V>} TODO: Remove the prototype from the fresh object */
        this._map = {};
             ~~~~
!!! error TS2339: Property '_map' does not exist on type '{ Multimap3: { <K extends string, V>(): void; prototype: { get(key: K): V; }; }; }'.
    };
    
    Ns.Multimap3.prototype = {
        /**
         * @param {K} key the key ok
                   ~
!!! error TS2304: Cannot find name 'K'.
         * @returns {V} the value ok
                     ~
!!! error TS2304: Cannot find name 'V'.
         */
        get(key) {
            return this._map[key + ''];
                        ~~~~
!!! error TS2339: Property '_map' does not exist on type '{ get(key: K): V; }'.
        }
    }
    
    