Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expand the typechecking of async function declared/inferred return ty…
…pes to allow union types; synthesize a more accurate upper bound for return expression types. This change is motivated by the case where an async function is inferred to have a union return type (as can happen when one is passed as a callback to some other function that made the type declarations). Since this happens relatively often, and is safe, it was decided to improve checking to support it. As as consequence, it was also necessary to improve the way we synthesize the return expression type bounds to be more accurately handle "synchronous" types; they can never actually returned. They are now illegal. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=220381088
- Loading branch information
Showing
3 changed files
with
100 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters