closure-library
closure-library copied to clipboard
Unknown "this" in goog.partial
https://github.com/google/closure-library/blob/master/closure/goog/base.js#L1895
goog.parial is causing warnings with the unknownThis conformance check.
Could we change its type to the following?
/** @param {function(this: T, ...*): R} func
@param {...*} var_args
@return {function(this: T, ...*): R}
@template T, R */
goog.partial = function(func, var_args) {};
This should fix the definition, but could introduce problems if callers have underlying type mismatches that were getting glossed over by the raw Functions before. In the interim, we could keep the @return type as {!Function} and then fix callers in a second pass.