2013/12

closure compiler bug?

When I compile the JavaScript in following with Closure Compiler, usually I get an warning message “WARNING – Bad type annotation. Unknown type ClassA”. But, sometimes the compiler put no warning message. (function() { /** * @private * @constructor */ function ClassA() { } /** @type {function()} */ ClassA.prototype.say = function() { console.log("hoge"); }; /** * @private * @constructor */ function ClassB() { /** @type {ClassA} */ this.a = new ClassA(); } /** * @expose */ ClassB.