TypeScript/tests/cases/conformance/salsa/typeFromPropertyAssignment25.ts
Nathan Shively-Sanders d6250c8342
Fix circularity error when extending class in same JSContainer (#24710)
Do this by not widening properties of an object literal that are

1. JS initialisers
2. and not an object literal

These properties have types that will never widen, so the compiler
shouldn't ask for the types earlier than it strictly needs to.
2018-06-06 09:13:38 -07:00

23 lines
320 B
TypeScript

// @noEmit: true
// @checkJs: true
// @allowJs: true
// @Filename: bug24703.js
var Common = {};
Common.I = class {
constructor() {
this.i = 1
}
}
Common.O = class extends Common.I {
constructor() {
super()
this.o = 2
}
}
var o = new Common.O()
var i = new Common.I()
o.i
o.o
i.i