google / google/closure-compiler
goog.abstractMethod vs @abstract
Open
- Dominant language
- JavaScript
- Stars
- 7.7k
- Forks
- 1.2k
- Avg merge
- 2d 12h
- Merged PRs (30d)
- 6
Description
Since 08606a76, the compiler warn if abstract methods appear in concrete classes:
``` js
/**
* @abstract
* @constructor
*/
C = function() {
this.foo = -1;
};
/**
* @abstract
*/
C.prototype.add = function() {};
```
But it is not the case when `goog.abstractMethod` is used:
``` js
/**
* @constructor
*/
C = function() {
this.foo = -1;
};
/**
*
*/
C.prototype.add = goog.abstractMethod;
```
(and `goog.abstractMethod` doesn't require the constructor to be abstract.)
Contributor guide
Assessment
This issue has not been assessed yet.