Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix async return type check #11430

Merged
merged 4 commits into from
Oct 31, 2016
Merged

Fix async return type check #11430

merged 4 commits into from
Oct 31, 2016

Conversation

rbuckton
Copy link
Member

@rbuckton rbuckton commented Oct 6, 2016

There were two issues here:

  1. Some global symbol lookups (PromiseConstructorLike, ClassDecorator, etc.) are deferred until needed during check, but are missed by getGlobalDiagnostics and getSemanticDiagnostics when getting diagnostics for a single file.
  2. The checks in checkAsyncFunctionReturnType was trying to report an error finding the global Promise type (lost due to [1] above) rather than reporting an error about the current return type.

Fixes #11376

@rbuckton
Copy link
Member Author

rbuckton commented Oct 6, 2016

// CC: @mhegazy, @vladima

I wonder if we could leverage @weswigham's Type Builder API internally to synthesize types like PromiseConstructorLike internally if they are not found, rather than reporting an error. Without such an API it is just too messy to synthesize a type.

@weswigham
Copy link
Member

I think it'd be a good idea. TBH just having a canonical way to
programmatically build types which is a bit closer to the syntax than the
internal type representation can be super nice.

On Thu, Oct 6, 2016, 3:34 PM Ron Buckton [email protected] wrote:

// CC: @mhegazy https://github.com/mhegazy, @vladima
https://github.com/vladima

I wonder if we could leverage @weswigham https://github.com/weswigham's
Type Builder API internally to synthesize types like
PromiseConstructorLike internally if they are not found, rather than
reporting an error. Without such an API it is just too messy to synthesize
a type.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#11430 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ACzAMsZvQxL4VOpNECIeNgQU6tFp20TXks5qxU1JgaJpZM4KQU-w
.

@rbuckton rbuckton merged commit 4371889 into master Oct 31, 2016
@mhegazy mhegazy deleted the fixAsyncReturnTypeCheck branch November 2, 2017 21:03
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants