google / google/closure-compiler

Add warnings for incorrect use of goog.abstractMethod

Open
#776 2 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

Just spent some time on an issue that boiled down to:

```
/** @constructor */
example.Foo = goog.abstractMethod;

example.Foo.prototype.bar = goog.abstractMethod;
```

which should have been

```
/** @constructor */
example.Foo = function() {};

example.Foo.prototype.bar = goog.abstractMethod;
```

The compiler removed example.Foo entirely, so then a `goog.inherits(example.SubFoo, example.Foo)` call later on failed. We should warn for incorrect uses of goog.abstractMethod so this doesn't happen.

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.