You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/**
* @param {!number} w
*/
function zzz(w) { // this function should be irrelevant
}
/**
* @constructor
*/
function MyObject() {
/** @const */
this.zzz = zzz; // fails the type check
/**
* @param {boolean} v
*/
function zzz(v) {
}
}
The text was updated successfully, but these errors were encountered:
If the inner function zzz() declaration gets moved above the this.zzz = zzz; assignment, the error no longer appears. It seems like the type checking is failing to take function hoisting into account.
In this minimal test case the compiler seems to be (incorrectly) type checking against a variable declared outside the scope?
@const
is necessaryThe text was updated successfully, but these errors were encountered: