Open
Description
The docs imply that @final
on a class method makes it an error to override that method in a subclass:
/** @constructor */
function MyClass() {}
/** @final */
MyClass.prototype.method = function() {};
/**
* @constructor
* @extends {MyClass}
*/
function MyChildClass() {}
MyChildClass.prototype = {
__proto__: MyClass,
/** @override */
method: function() {}, // should fail
};
But this doesn't error. The method has to be set separately:
MyChildClass.prototype.method = function() {}; // does fail
for closure-compiler to notice this mistake.