We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
@abstract
TypeScript Version: nightly (2.5.0-dev.20170712)
Code
/** @abstract */ class C {} new C();
Expected behavior:
Error.
Actual behavior:
No error.
Adding a bit more to this, it would be nice if @abstract on methods were supported.
For example, with this code:
/** * @abstract */ class Integer { /** * @abstract * @return {number} A number. */ get() {} } class FortyTwo extends Integer { get() { return 42 } } /** * @returns {number} The return. */ function getFortyTwo() { const number = new FortyTwo(); return number.get(); }
tsc --pretty (at 3.1.0-dev.20180901) results in this error:
tsc --pretty
main.js:8:15 - error TS2355: A function whose declared type is neither 'void' nor 'any' must return a value. 8 * @return {number} A number. ~~~~~~
Activity
tschaub commentedon Sep 1, 2018
Adding a bit more to this, it would be nice if
@abstract
on methods were supported.For example, with this code:
tsc --pretty
(at 3.1.0-dev.20180901) results in this error:29 remaining items