If the base type has a property by that name, add it to the list constructor types to make it as authoritative as special assignments found in the constructor.
16 lines
249 B
TypeScript
16 lines
249 B
TypeScript
// @noEmit: true
|
|
// @allowJs: true
|
|
// @checkJs: true
|
|
// @noImplicitAny: true
|
|
// @strictNullChecks: true
|
|
// @Filename: a.js
|
|
class Base {
|
|
constructor() {
|
|
this.p = 1
|
|
}
|
|
}
|
|
class Derived extends Base {
|
|
m() {
|
|
this.p = 1
|
|
}
|
|
}
|