closure-library
closure-library copied to clipboard
Report a small bug, and a small fix: False alarm "could not determine the type of this expression"
Hello, I encountered this annoying bug many times - the bug can be demonstrated by compiling this code:
(function(){
/** @constructor */
function MyClass() {}
/** @type {!string} */ MyClass.prototype.myProp;
/** @type {!MyClass} */({}).myProp; <== Error: "could not determine the type of this expression"
})();
After long deep effort, it seems that this can be fixed by adding one line to com.google.javascript.jscomp.TypeInference: Add this line: objType.resolve(registry.getErrorReporter(), scope); right after this line: if (propertyType == null && objType != null) { in the method private JSType getPropertyType(JSType objType, String propName, Node n, FlowScope scope) {...}
This is something related to the Closure Compiler, not Closure Library. Can you report to https://github.com/google/closure-compiler instead? Thanks!
body p { margin-bottom: 0cm; margin-top: 0pt; }
Done - thanks :-)
On 22-Mar-16 23:04, Michael Zhou wrote:
This is something related to the Closure Compiler, not Closure
Library. Can you report to https://github.com/google/closure-compiler
instead? Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly or view
it on GitHub