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.
22 lines
320 B
TypeScript
22 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
|
|
|