Skip to content

fix(46570) Unhelpful "Did you forget to include 'void' in your type argument to 'Promise'" in JS file #46637

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

Closed
wants to merge 1 commit into from

Conversation

osaimola
Copy link
Contributor

@osaimola osaimola commented Nov 2, 2021

Fixes #46570

@typescript-bot typescript-bot added the For Backlog Bug PRs that fix a backlog bug label Nov 2, 2021
@ghost
Copy link

ghost commented Nov 2, 2021

CLA assistant check
All CLA requirements met.

@@ -29712,7 +29712,7 @@ namespace ts {
: min < max ? min + "-" + max
: min;
const error = hasRestParameter ? Diagnostics.Expected_at_least_0_arguments_but_got_1
: parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node) ? Diagnostics.Expected_0_arguments_but_got_1_Did_you_forget_to_include_void_in_your_type_argument_to_Promise
: parameterRange === 1 && args.length === 0 && isPromiseResolveArityError(node) ? Diagnostics.Expected_0_arguments_but_got_1_TypeScript_may_need_a_JSDoc_hint_that_the_call_to_new_Promise_produces_a_Promise_void
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only want to change this if the source file is JavaScript—this changes it for TypeScript users too, and the message is correct for TS.

@andrewbranch
Copy link
Member

I’m going to close this for housekeeping since it’s been a while without any updates. Feel free to open a new one with the suggested changes if you decide to come back to it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Unhelpful "Did you forget to include 'void' in your type argument to 'Promise'" in JS file
3 participants