TypeScript/tests/cases/conformance/salsa/annotatedThisPropertyInitializerDoesntNarrow.ts
Nathan Shively-Sanders 08eb99d8ec
For a this-property assignment with an empty object initializer, use type annotation if present (#26428)
* This-property w/empty object init: use type annotation

* JS initializer type doesn't apply to this-property assignments

* Move getJSExpandoType into getWidenedType* functions

Plus some cleanup.

* Improved style from PR comments

* Parameters are not expando
2018-08-15 14:53:30 -07:00

18 lines
373 B
TypeScript

// @noEmit: true
// @allowJs: true
// @checkJs: true
// @Filename: Compilation.js
// from webpack/lib/Compilation.js and filed at #26427
/** @param {{ [s: string]: number }} map */
function mappy(map) {}
export class C {
constructor() {
/** @type {{ [assetName: string]: number}} */
this.assets = {};
}
m() {
mappy(this.assets)
}
}