René's URL Explorer Experiment


Title: Instantiation expressions inconsistently trigger incorrect error messages in editor contexts · Issue #50161 · microsoft/TypeScript · GitHub

Open Graph Title: Instantiation expressions inconsistently trigger incorrect error messages in editor contexts · Issue #50161 · microsoft/TypeScript

X Title: Instantiation expressions inconsistently trigger incorrect error messages in editor contexts · Issue #50161 · microsoft/TypeScript

Description: Type: Bug Attempt to use the Instantiation Expressions in VSCode typescript language function makeBox(value: T){ return {value}; } const makeStringBox = makeBox; const stringBox = makeStringBox('abc'); Observe Red squiggly lin...

Open Graph Description: Type: Bug Attempt to use the Instantiation Expressions in VSCode typescript language function makeBox(value: T){ return {value}; } const makeStringBox = makeBox; const stringBox = makeSt...

X Description: Type: Bug Attempt to use the Instantiation Expressions in VSCode typescript language function makeBox<T>(value: T){ return {value}; } const makeStringBox = makeBox<string>; const string...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Instantiation expressions inconsistently trigger incorrect error messages in editor contexts","articleBody":"\r\nType: \u003cb>Bug\u003c/b>\r\n\r\n1. Attempt to use the Instantiation Expressions in VSCode typescript language\r\n\r\n```ts\r\nfunction makeBox\u003cT>(value: T){\r\n  return {value};\r\n}\r\n\r\nconst makeStringBox = makeBox\u003cstring>;\r\nconst stringBox = makeStringBox('abc');\r\n```\r\n2. Observe Red squiggly lines that shouldn't be there.\r\n\r\n![image](https://user-images.githubusercontent.com/19843782/182518772-b60c9846-35d8-4337-b801-216b8a953d93.png)\r\n\r\n\r\nVS Code version: Code - Insiders 1.70.0-insider (e9bda7aa4ff76648cfccc1a7bde465443803da71, 2022-08-02T16:56:25.649Z)\r\nOS version: Windows_NT x64 10.0.19044\r\nModes:\r\n\r\n\u003cdetails>\r\n\u003csummary>System Info\u003c/summary>\r\n\r\n|Item|Value|\r\n|---|---|\r\n|CPUs|Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz (16 x 3600)|\r\n|GPU Status|2d_canvas: enabled\u003cbr>canvas_oop_rasterization: disabled_off\u003cbr>direct_rendering_display_compositor: disabled_off_ok\u003cbr>gpu_compositing: enabled\u003cbr>multiple_raster_threads: enabled_on\u003cbr>opengl: enabled_on\u003cbr>rasterization: enabled\u003cbr>raw_draw: disabled_off_ok\u003cbr>skia_renderer: enabled_on\u003cbr>video_decode: enabled\u003cbr>video_encode: enabled\u003cbr>vulkan: disabled_off\u003cbr>webgl: enabled\u003cbr>webgl2: enabled|\r\n|Load (avg)|undefined|\r\n|Memory (System)|31.92GB (17.88GB free)|\r\n|Process Argv||\r\n|Screen Reader|no|\r\n|VM|0%|\r\n\u003c/details>Extensions: none\u003cdetails>\r\n\u003csummary>A/B Experiments\u003c/summary>\r\n\r\n```\r\nvsliv695:30137379\r\nvsins829:30139715\r\nvsliv368:30146709\r\nvsreu685:30147344\r\npython383:30185418\r\nvspor879:30202332\r\nvspor708:30202333\r\nvspor363:30204092\r\nvslsvsres303:30308271\r\npythonvspyl392:30422396\r\npythontb:30258533\r\npythonptprofiler:30281269\r\nvsdfh931:30280409\r\nvshan820:30294714\r\npythondataviewer:30285072\r\nvscod805:30301674\r\nbridge0708:30335490\r\nbridge0723:30353136\r\nvsaa593cf:30376535\r\npythonvs932:30404738\r\nwslgetstarted:30449409\r\nvscscmwlcmt:30465136\r\ncppdebug:30492333\r\nvscaac:30438845\r\npylanb8912:30522163\r\nvsclangdf:30492506\r\nc4g48928:30535728\r\n\r\n```\r\n\r\n\u003c/details>\r\n\r\n\u003c!-- generated by issue reporter -->\r\n\r\n\r\nI've had this issue with both no npm packages installed. With typescript installed only. And with typescript and a tsconfig.json file.\r\n\r\nNote: It is _incredibly_ inconsistent. Sometimes it doesn't happen. Other times changing from the built-in version of typescript to the local version fixes it, sometimes just waiting fixes it. Until you change the code at all (adding/removing whitespace for example) and then it comes back. Installing a different version of typescript removes the error until you change the code as well.\r\n\r\nI believe that this is a VSCode centric issue and not a Typescript issue for 2 reasons.\r\n1. Running `npx tsc` builds the package just fine without any issues from type errors.\r\n2. As seen in this comment, the typescript playground doesn't show any errors with this. https://github.com/microsoft/TypeScript/pull/47607#issuecomment-1191409426 [TS Playground](https://www.typescriptlang.org/play?target=99&moduleResolution=99&ts=4.7.4&jsx=0&jsxImportSource=true#code/GYVwdgxgLglg9mABAWwIYGsCmAhOAPAHgBUA+ACgDdUAbETALkSIEoBvAKES8QCdMoQPJKyq1MAXwDc7ce3YB6eYgB6AfnYQEAZygoMmAMpQeMMAHNceRAF49WSwR0nzJaZrA7ET0xfw27hsY+lmQA5KgARhChzNKKKuoa2roAojw8cDwAsqgADv45uY5B5gA0aRk8rkkeupjpmYX+YJgA7ogVjXlksXLsQA)\r\n","author":{"url":"https://github.com/ZachHaber","@type":"Person","name":"ZachHaber"},"datePublished":"2022-08-03T03:40:46Z","url":"https://github.com/microsoft/TypeScript/issues/50161"}

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:10a121ab-062f-89c1-df5a-4eb50aa1f517
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDE96:291B58:185714E:1ECD77E:6B017D00
html-safe-nonce9da4214ecba5de3a167821038e6ed95768f7db11e442e76415612cf5179f3c48
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJERTk2OjI5MUI1ODoxODU3MTRFOjFFQ0Q3N0U6NkIwMTdEMDAiLCJ2aXNpdG9yX2lkIjoiNjMwNjg1NDE2MjkwMzUyMzg1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacfcd3fb42acdfee393a0a1c623ae28b67f3600b5bfc407ed296674d59c8c846e0
hovercard-subject-tagissue:1327349029
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/50161/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ec24b14f739dfe6622c12f7e193eca2c4f7f68da87ed9fd90c87b160fa4c14a3/microsoft/TypeScript/issues/50161
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ec24b14f739dfe6622c12f7e193eca2c4f7f68da87ed9fd90c87b160fa4c14a3/microsoft/TypeScript/issues/50161
og:image:altType: Bug Attempt to use the Instantiation Expressions in VSCode typescript language function makeBox(value: T){ return {value}; } const makeStringBox = makeBox; const stringBox = makeSt...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameZachHaber
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/50161#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F50161
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%2F50161
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/50161
Reloadhttps://github.com/microsoft/TypeScript/issues/50161
Reloadhttps://github.com/microsoft/TypeScript/issues/50161
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests312 (312)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/50161
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/50161
#52373https://github.com/microsoft/TypeScript/pull/52373
Instantiation expressions inconsistently trigger incorrect error messages in editor contextshttps://github.com/microsoft/TypeScript/issues/50161#top
#52373https://github.com/microsoft/TypeScript/pull/52373
https://github.com/navya9singh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
TypeScript 5.0.0https://github.com/microsoft/TypeScript/milestone/175
https://github.com/ZachHaber
Zachary Haber (ZachHaber)https://github.com/ZachHaber
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#issue-1327349029
https://user-images.githubusercontent.com/19843782/182518772-b60c9846-35d8-4337-b801-216b8a953d93.png
Instantiation expressions #47607 (comment)https://github.com/microsoft/TypeScript/pull/47607#issuecomment-1191409426
TS Playgroundhttps://www.typescriptlang.org/play?target=99&moduleResolution=99&ts=4.7.4&jsx=0&jsxImportSource=true#code/GYVwdgxgLglg9mABAWwIYGsCmAhOAPAHgBUA+ACgDdUAbETALkSIEoBvAKES8QCdMoQPJKyq1MAXwDc7ce3YB6eYgB6AfnYQEAZygoMmAMpQeMMAHNceRAF49WSwR0nzJaZrA7ET0xfw27hsY+lmQA5KgARhChzNKKKuoa2roAojw8cDwAsqgADv45uY5B5gA0aRk8rkkeupjpmYX+YJgA7ogVjXlksXLsQA
VS Code Bot (vscodenpa)https://github.com/vscodenpa
Matt Bierner (mjbvz)https://github.com/mjbvz
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#event-7119426300
https://github.com/IllusionMH
Andrii Dieiev (IllusionMH)https://github.com/IllusionMH
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1204058613
https://github.com/ZachHaber
Zachary Haber (ZachHaber)https://github.com/ZachHaber
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1204058619
https://github.com/ZachHaber
Zachary Haber (ZachHaber)https://github.com/ZachHaber
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1204058628
https://user-images.githubusercontent.com/19843782/182628692-1d72352c-ceba-4c94-ba62-30e196e2be8c.mp4https://user-images.githubusercontent.com/19843782/182628692-1d72352c-ceba-4c94-ba62-30e196e2be8c.mp4
https://user-images.githubusercontent.com/19843782/182627872-ed362af8-3897-4edc-8149-602e4f151d5a.png
Matt Bierner (mjbvz)https://github.com/mjbvz
microsoft/vscodehttps://github.com/microsoft/vscode
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#event-7119426454
https://github.com/mjbvz
Matt Bierner (mjbvz)https://github.com/mjbvz
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1204063274
Matt Bierner (mjbvz)https://github.com/mjbvz
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#event-7119480347
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#event-7121169029
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
navya9singhhttps://github.com/navya9singh
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#event-7121170977
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
TypeScript 4.9.0https://github.com/microsoft/TypeScript/milestone/169
on Aug 3, 2022https://github.com/microsoft/TypeScript/issues/50161#event-7121171193
https://github.com/xiaoxiangmoe
ZHAO Jin-Xiang (xiaoxiangmoe)https://github.com/xiaoxiangmoe
on Sep 16, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1249500875
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Sep 19, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1251598980
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Sep 19, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1251662492
https://github.com/BrendanKelowna
Brendan (BrendanKelowna)https://github.com/BrendanKelowna
on Nov 30, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1331661708
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 16, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1353994301
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 16, 2022https://github.com/microsoft/TypeScript/issues/50161#event-8052358188
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 16, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1354022017
Jake Bailey (@jakebailey)https://github.com/jakebailey
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 16, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1355754663
https://github.com/jakebailey
Jake Bailey (jakebailey)https://github.com/jakebailey
on Dec 16, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1355762393
https://github.com/DanielRosenwasser
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
on Dec 16, 2022https://github.com/microsoft/TypeScript/issues/50161#issuecomment-1355762447
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
TypeScript 4.9.0https://github.com/microsoft/TypeScript/milestone/169
TypeScript 5.0.1https://github.com/microsoft/TypeScript/milestone/176
TypeScript 5.0.0https://github.com/microsoft/TypeScript/milestone/175
on Dec 16, 2022https://github.com/microsoft/TypeScript/issues/50161#event-8060427608
TypeScript Bot (typescript-bot)https://github.com/typescript-bot
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
on Jan 23, 2023https://github.com/microsoft/TypeScript/issues/50161#event-8336667584
navya9singhhttps://github.com/navya9singh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#52373https://github.com/microsoft/TypeScript/pull/52373
on Jan 31, 2023https://github.com/microsoft/TypeScript/issues/50161#event-8402970825
microsofthttps://github.com/microsoft
on Oct 22, 2025https://github.com/microsoft/TypeScript/issues/50161#event-20417578011
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/50161
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/50161
navya9singhhttps://github.com/navya9singh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Fix AvailableA PR has been opened for this issuehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Fix%20Available%22
TypeScript 5.0.0https://github.com/microsoft/TypeScript/milestone/175
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.