Closed
Description
TypeScript Version:
1.8.9 / nightly
Code
abstract class Abstract {
protected name: string;
constructor () {
this.abstractMethod();
}
protected abstract abstractMethod (): void;
}
class Concrete extends Abstract {
protected name: string = 'Concrete';
protected abstractMethod () {
console.log(this, this.name); // Concrete, undefined
}
}
new Concrete();
Playground: link
Expected behavior:
this.name inside abstractMethod() realization must be pointed at name
property of Concrete
class.
Actual behavior:
this.name inside abstractMethod() realization is pointed at name
property of Abstract
class.