René's URL Explorer Experiment


Title: Suggestion: Implied Promise return type in async functions · Issue #7284 · microsoft/TypeScript · GitHub

Open Graph Title: Suggestion: Implied Promise return type in async functions · Issue #7284 · microsoft/TypeScript

X Title: Suggestion: Implied Promise return type in async functions · Issue #7284 · microsoft/TypeScript

Description: Apologies if this has already been brought up, but I wasn't able to find any issues that cover this topic (#5911 seems closest). The Current State Currently, if you want to enforce typing of an async function's resolved value, you must d...

Open Graph Description: Apologies if this has already been brought up, but I wasn't able to find any issues that cover this topic (#5911 seems closest). The Current State Currently, if you want to enforce typing of an asy...

X Description: Apologies if this has already been brought up, but I wasn't able to find any issues that cover this topic (#5911 seems closest). The Current State Currently, if you want to enforce typing of an...

Opengraph URL: https://github.com/microsoft/TypeScript/issues/7284

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Suggestion: Implied Promise return type in async functions","articleBody":"_Apologies if this has already been brought up, but I wasn't able to find any issues that cover this topic (#5911 seems closest)._\n## The Current State\n\nCurrently, if you want to enforce typing of an `async` function's resolved value, you must declare a return type of `:Promise\u003cResolveType>`:\n\n``` es\nasync function makeStuff():Promise\u003cStuff> {}\n```\n\nThis is a bit counterintuitive when it comes to `async` functions, as they generally mask the fact that there's a `Promise` there to begin with.  If you are utilizing promises purely via `async`/`await`, you're _never_ going to see the token `Promise` in your code.\n## Proposal\n\nWhen providing the return type of an `async` function, implicitly wrap it in a `Promise\u003cT>` (unless it is an explicit `Promise\u003cT>` type expression?).  This seems reasonable now that #6631 is in.\n\n``` es\nasync function makeStuff():Stuff {}\n```\n\nSeems like the least surprising way of declaring an async function\n","author":{"url":"https://github.com/nevir","@type":"Person","name":"nevir"},"datePublished":"2016-02-28T18:53:19Z","url":"https://github.com/microsoft/TypeScript/issues/7284"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e7eef3b5-755d-d92e-d488-8d23feca9310
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8408:3F8A67:349257:4791B3:6B00C738
html-safe-noncedf6725bd2905042e51edb719f2defcbba969b1cca42f3d679695d51ffec703cd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NDA4OjNGOEE2NzozNDkyNTc6NDc5MUIzOjZCMDBDNzM4IiwidmlzaXRvcl9pZCI6IjU2NjM2Nzg5ODg4MjkxMTYyMTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf87ef218633cb8903ff1e22e08a73782fa085f0554a0278e333c862b152458ac
hovercard-subject-tagissue:137082437
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/7284/issue_layout
twitter:imagehttps://opengraph.githubassets.com/8329dd03e49c389d89ba7eb40c69ef23f9cf1c5366ed7fff9babaa0427670bdc/microsoft/TypeScript/issues/7284
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/8329dd03e49c389d89ba7eb40c69ef23f9cf1c5366ed7fff9babaa0427670bdc/microsoft/TypeScript/issues/7284
og:image:altApologies if this has already been brought up, but I wasn't able to find any issues that cover this topic (#5911 seems closest). The Current State Currently, if you want to enforce typing of an asy...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenevir
hostnamegithub.com
expected-hostnamegithub.com
None98dc00e171c204462a6f367482a0f8c3c6b5dbca99cd7390e82d2df49ce096e4
turbo-cache-controlno-preview
go-importgithub.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git
octolytics-dimension-user_id6154722
octolytics-dimension-user_loginmicrosoft
octolytics-dimension-repository_id20929025
octolytics-dimension-repository_nwomicrosoft/TypeScript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id20929025
octolytics-dimension-repository_network_root_nwomicrosoft/TypeScript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releaseef013399cf0a3c324bea644a685d7c1e0f06b5b7
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/7284#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F7284
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F7284
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/7284
Reloadhttps://github.com/microsoft/TypeScript/issues/7284
Reloadhttps://github.com/microsoft/TypeScript/issues/7284
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests307 (307)https://github.com/microsoft/TypeScript/pulls
Actionshttps://github.com/microsoft/TypeScript/actions
Projectshttps://github.com/microsoft/TypeScript/projects
Wikihttps://github.com/microsoft/TypeScript/wiki
Security and qualityhttps://github.com/microsoft/TypeScript/security
Insightshttps://github.com/microsoft/TypeScript/insights
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/7284
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/7284
Suggestion: Implied Promise return type in async functionshttps://github.com/microsoft/TypeScript/issues/7284#top
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
https://github.com/nevir
Ian MacLeod (nevir)https://github.com/nevir
on Feb 28, 2016https://github.com/microsoft/TypeScript/issues/7284#issue-137082437
#5911https://github.com/microsoft/TypeScript/issues/5911
#6631https://github.com/microsoft/TypeScript/pull/6631
Nexthttps://github.com/microsoft/TypeScript/issues/7284?timeline_page=1
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190007542
https://github.com/nevir
Ian MacLeod (nevir)https://github.com/nevir
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190016334
https://github.com/tinganho
Tingan Ho (tinganho)https://github.com/tinganho
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190021235
https://github.com/ljqx
Remi Liu (ljqx)https://github.com/ljqx
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190027885
https://github.com/nevir
Ian MacLeod (nevir)https://github.com/nevir
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190030099
#6631https://github.com/microsoft/TypeScript/pull/6631
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190040037
Tingan Ho (@tinganho)https://github.com/tinganho
https://github.com/tinganho
Tingan Ho (tinganho)https://github.com/tinganho
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190050939
Troy Gerwien (@yortus)https://github.com/yortus
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190055058
Ian MacLeod (@nevir)https://github.com/nevir
https://github.com/tinganho
Tingan Ho (tinganho)https://github.com/tinganho
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190057301
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190076889
https://github.com/tinganho
Tingan Ho (tinganho)https://github.com/tinganho
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190081764
Ian MacLeod (@nevir)https://github.com/nevir
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190084078
https://github.com/tinganho
Tingan Ho (tinganho)https://github.com/tinganho
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190087943
Troy Gerwien (@yortus)https://github.com/yortus
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190102599
https://github.com/tinganho
Tingan Ho (tinganho)https://github.com/tinganho
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190108243
https://github.com/Arnavion
Arnav Singh (Arnavion)https://github.com/Arnavion
on Feb 29, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190418344
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Mar 1, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190467441
Ian MacLeod (@nevir)https://github.com/nevir
https://github.com/nevir
Ian MacLeod (nevir)https://github.com/nevir
on Mar 1, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-190510413
https://github.com/shockone/black-screen/blob/2d3466111d70ee5390c0ec091ab8a433e16f291a/src/Aliases.ts#L32https://github.com/shockone/black-screen/blob/2d3466111d70ee5390c0ec091ab8a433e16f291a/src/Aliases.ts#L32
https://github.com/shockone/black-screen/blob/90b1bda0046c0011569bfde858cca65d04369297/src/plugins/autocompletion_providers/Suggestions.ts#L273https://github.com/shockone/black-screen/blob/90b1bda0046c0011569bfde858cca65d04369297/src/plugins/autocompletion_providers/Suggestions.ts#L273
https://github.com/jods4
jods (jods4)https://github.com/jods4
on Mar 5, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-192549152
#6686 (comment)https://github.com/microsoft/TypeScript/issues/6686#issuecomment-176758649
https://github.com/nevir
Ian MacLeod (nevir)https://github.com/nevir
on Mar 5, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-192701258
section 1.1.8 of the async/await spechttps://tc39.github.io/ecmascript-asyncawait/#async-decls-exprs-EvaluateBody
TypeScripthttp://www.typescriptlang.org/Playground#src=async%20function%20foo%28%29%20%7B%0A%09return%20123%3B%0A%7D%0Aalert%28foo%28%29%20instanceof%20Promise%29%3B%0A
Babelhttps://babeljs.io/repl/#?experimental=true&evaluate=true&loose=false&spec=false&code=async%20function%20foo%28%29%20%7B%0A%20%20return%20123%3B%0A%7D%0Aconsole.log%28'Does%20it%20yield%20a%20promise%3F'%2C%20foo%28%29%20instanceof%20Promise%29%3B
https://github.com/jods4
jods (jods4)https://github.com/jods4
on Mar 5, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-192758009
Ian MacLeod (@nevir)https://github.com/nevir
#6686https://github.com/microsoft/TypeScript/issues/6686
https://github.com/nevir
Ian MacLeod (nevir)https://github.com/nevir
on Mar 6, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-192770090
Ian MacLeod (@nevir)https://github.com/nevir
#6686https://github.com/microsoft/TypeScript/issues/6686
async/await spec's repohttps://github.com/tc39/ecmascript-asyncawait/issues
https://github.com/jods4
jods (jods4)https://github.com/jods4
on Mar 6, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-192774409
Ian MacLeod (@nevir)https://github.com/nevir
https://github.com/yortus
Troy Gerwien (yortus)https://github.com/yortus
on Mar 6, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-192775442
Ian MacLeod (@nevir)https://github.com/nevir
jods (@jods4)https://github.com/jods4
jods (@jods4)https://github.com/jods4
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
on May 9, 2016https://github.com/microsoft/TypeScript/issues/7284#event-655080114
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on May 9, 2016https://github.com/microsoft/TypeScript/issues/7284#issuecomment-218016926
jods (@jods4)https://github.com/jods4
Troy Gerwien (@yortus)https://github.com/yortus
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on May 9, 2016https://github.com/microsoft/TypeScript/issues/7284#event-655082289
microsofthttps://github.com/microsoft
on Jun 19, 2018https://github.com/microsoft/TypeScript/issues/7284#event-1689640928
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/7284
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/7284
Working as IntendedThe behavior described is the intended behavior; this is not a bughttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Working%20as%20Intended%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.