Closed
Description
TypeScript Version:
1.8.10
Code
export abstract class AbstractClass {
constructor() {
this.abstractMethod();
}
abstract abstractMethod(): void;
}
Output
"use strict";
var AbstractClass = (function () {
function AbstractClass() {
this.abstractMethod();
}
return AbstractClass;
}());
exports.AbstractClass = AbstractClass;
Question
Is there a situation where calling this.abstractMethod
inside the constructor
makes sense? I have accidentally hit this pattern and the class compiles successfully, but the resulting JavaScript obviously fails because this.abstractMethod is not a function
.