google / google/closure-compiler

goog.abstractMethod vs @abstract

Open
#1,988 1 comment 0 reactions 0 assignees View on GitHub
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.