Closed
Description
I was thinking it could be useful to have a way to specify that a class should not be subclassed, so that the compiler would warn the user on compilation if it sees another class extending the original one.
On Java a class marked with final cannot be extended, so with the same keyword on TypeScript it would look like this:
final class foo {
constructor() {
}
}
class bar extends foo { // Error: foo is final and cannot be extended
constructor() {
super();
}
}