DescriptionFilter out more spurious Promise-related type checking errors.
- Expand the PromiseErrorFilter to allow multiple types of errors to be filtered out.
- Add a new type of allowed error, namely errors from the compiler failing to
unwrap the result of a returned Promise chain. Example:
/** @return {!Promise<string>} */
var getStringAsync = function() {
/** @return {!Promise<string>} */
var generateString = function() {return Promise.resolve('foo');};
return Promise.resolve().then(generateString);
};
The compiler will emit an error that looks like
ERROR - inconsistent return type
found : Promise<Promise<string>>
required: Promise<string>
BUG=406995
Committed: https://crrev.com/e24723c00ae1257c67a47c5d48c3a4ad7a8e30f5
Cr-Commit-Position: refs/heads/master@{#307045}
Patch Set 1 #Patch Set 2 : Provide a more succinct example. #
Total comments: 5
Patch Set 3 : Address feedback. #Messages
Total messages: 8 (2 generated)
|