From webpack/lib/Compilation.js (but simplified):
/** @param {{ [s: string]: number }} map */
function mappy(map) {}
export class C {
constructor() {
/** @type {{ [assetName: string]: number}} */
this.assets = {};
}
m() {
mappy(this.assets)
}
}
Expected behavior:
in mappy(this.assets), assets should have a string indexer.
Actual behavior:
this.assets: {}, and error {} is not assignable to { [s: string]: number] }