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

Async / Await Refactoring - Arguments in promise handlers that are not function type #26375

Closed
elizabethdinella opened this issue Aug 10, 2018 · 0 comments · Fixed by #26930
Closed
Labels
Bug A bug in TypeScript

Comments

@elizabethdinella
Copy link
Contributor

Search Terms:
Async, Await, Refactoring, Code Fix, Expression, Arguments

Code

function f() {
	return Promise.resolve().then(f ? (x => 1) : (y => 2));
}

Expected behavior:
A refactoring is not offered.

Actual behavior:
A refactoring is offered and the following code is generated:

async function f() {
	await Promise.resolve();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants