Skip to content

Conversation

@rbuckton
Copy link
Contributor

@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
Contributor 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.

5 participants