René's URL Explorer Experiment


Title: Type-asserting function call on variable initialized using `this` causes false implicit-any in VSCode · Issue #51661 · microsoft/TypeScript · GitHub

Open Graph Title: Type-asserting function call on variable initialized using `this` causes false implicit-any in VSCode · Issue #51661 · microsoft/TypeScript

X Title: Type-asserting function call on variable initialized using `this` causes false implicit-any in VSCode · Issue #51661 · microsoft/TypeScript

Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Type-asserting function call on variable initialized using `this` causes false implicit-any in VSCode · Issue #51661 · microsoft/TypeScript

Open Graph Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Type-asserting function call on variable initialized using `this` causes false implicit-any in VSCode · Issue #516...

X Description: TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Type-asserting function call on variable initialized using `this` causes false implicit-any in VSCode · Issue #516...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type-asserting function call on variable initialized using `this` causes false implicit-any in VSCode","articleBody":"# Bug Report\r\n\r\n### 🔎 Search Terms\r\n\r\nasserts, this, vscode, language server, implicit any\r\n\r\n### 🕗 Version & Regression Information\r\n\r\n- This changed between versions 4.6 and 4.7\r\n- This is also a problem on Nightly (`5.0.0-dev.20221128`)\r\n\r\nThis issue seems to be specific to VSCode's TS support - I have not been able to reproduce it in either the Playground nor the Bug Workbench. `tsc` itself accepts this code with no issues.\r\n\r\n### 💻 Code\r\n\r\n\u003c!-- Please post the relevant code sample here as well-->\r\n```ts\r\nconst assertExists: \u003cT extends number>(actual: T | null | undefined) => asserts actual is T = () => {};\r\n\r\ntype Value = { n: number | undefined };\r\nconst callThisFunc = (f: (this: Value) => void): void => {\r\n  f.call({ n: 42 });\r\n};\r\n\r\ncallThisFunc(function() {\r\n  const maybeN = this.n;\r\n  assertExists(maybeN);\r\n});\r\n```\r\n\r\n### 🙁 Actual behavior\r\n\r\nSometimes, usually when freshly loading this code, this works normally. If you edit the function body passed to `callThisFunc` in any way, even stuff like adding superfluous semicolons, `maybeN` will become red-underlined and complain about implicit-`any` on hover. Further appearances of `maybeN` in the function are also treated as `any`.\r\n\r\nThis error does not happen if you do not call `assertExists`, nor does it happen if you give `this` an explicit type, like so:\r\n```ts\r\ncallThisFunc(function(this: Value) {\r\n  const maybeN = this.n;\r\n  assertExists(maybeN);\r\n});\r\n```\r\n\r\n### 🙂 Expected behavior\r\n\r\nThis should not display any errors in VSCode, and the `assertExists` call should correctly narrow the type to `number`.\r\n","author":{"url":"https://github.com/OxleyS","@type":"Person","name":"OxleyS"},"datePublished":"2022-11-28T10:29:56Z","url":"https://github.com/microsoft/TypeScript/issues/51661"}

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/:user_id/:repository/issues/:id(.:format)
route-controllerissues
route-actionshow
fetch-noncev2:ae234c80-4de0-ea39-59a7-0e4c1b640e2d
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE9B0:2C4BED:22AC62C:2C0861F:6B017D4B
html-safe-nonceaeb5564a154ab7f4c0649c7ced3aaf558ac35bdecfa3509b8666ab8a43036c21
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOUIwOjJDNEJFRDoyMkFDNjJDOjJDMDg2MUY6NkIwMTdENEIiLCJ2aXNpdG9yX2lkIjoiMTY3Njg0NTcxMTkzNDcxNzI1OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac3f2d087c64f60e5f691b6e94b8667331ebf63b1b4a50070820f8f159d4c97576
hovercard-subject-tagrepository:20929025
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///issues/show
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/microsoft/TypeScript/issues/51661
twitter:imagehttps://opengraph.githubassets.com/47cde802d3847ff7ce61448bd4f8c3272d012c9a3f2b9085b71a67530bf7bbd6/microsoft/TypeScript
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/47cde802d3847ff7ce61448bd4f8c3272d012c9a3f2b9085b71a67530bf7bbd6/microsoft/TypeScript
og:image:altTypeScript is a superset of JavaScript that compiles to clean JavaScript output. - Type-asserting function call on variable initialized using `this` causes false implicit-any in VSCode · Issue #516...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-cache
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/51661#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F51661
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%2F51661
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fissues%2Fshow&source=header-repo&source_repo=microsoft%2FTypeScript
Reloadhttps://github.com/microsoft/TypeScript/issues/51661
Reloadhttps://github.com/microsoft/TypeScript/issues/51661
Reloadhttps://github.com/microsoft/TypeScript/issues/51661
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/51661
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/51661
Type-asserting function call on variable initialized using this causes false implicit-any in VSCodehttps://github.com/microsoft/TypeScript/issues/51661#top
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: This-TypingThe issue relates to providing types to thishttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20This-Typing%22
Needs More InfoThe issue still hasn't been fully clarifiedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20More%20Info%22
Backloghttps://github.com/microsoft/TypeScript/milestone/29
https://github.com/OxleyS
Sean Oxley (OxleyS)https://github.com/OxleyS
on Nov 28, 2022https://github.com/microsoft/TypeScript/issues/51661#issue-1466177927
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Help Wantedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Help%20Wanted%22
on Dec 2, 2022https://github.com/microsoft/TypeScript/issues/51661#event-7944515147
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Backloghttps://github.com/microsoft/TypeScript/milestone/29
on Dec 2, 2022https://github.com/microsoft/TypeScript/issues/51661#event-7944515225
https://github.com/OxleyS
Sean Oxley (OxleyS)https://github.com/OxleyS
on Dec 21, 2022https://github.com/microsoft/TypeScript/issues/51661#issuecomment-1361342016
https://github.com/OxleyS
Sean Oxley (OxleyS)https://github.com/OxleyS
on Dec 21, 2022https://github.com/microsoft/TypeScript/issues/51661#issuecomment-1361478725
https://github.com/wlinna
William Linna (wlinna)https://github.com/wlinna
on Oct 16, 2023https://github.com/microsoft/TypeScript/issues/51661#issuecomment-1764393743
https://www.typescriptlang.org/play?#code/GYVwdgxgLglg9mABAQwM6oKYCcoElUAiGwMYGAJgDwAqAfABQBuyANgFyLUCUHamOqRMxaIYggHIJxIFi2QAjFhhq1EAbwBQibaOCImrRAF4jiMDJZd1WnbagALLHADuZjK4CiWJ1noByYVFBc1kxez8uAG4bbQBfDXiNUihsYGQIDEQCZChka1sAegLESVgMxAdMgEcQDFRYBEQAW2QsAGsAOkQY0TBgOAB+DnMm+WwAbQBdBI0NCAR6xHIcvNM1Un6OKdiUQWzc6LmFqF7+gEFvYyWVjo24aL5sPEJiUgp6O4usKNn+rH0lCcYFcAAyRUSISinOBfDpKMAAcwc4JgAGpUVZNLZ5mBFncrp9vOMYJNorZHjh8EQSGRyB8+nAfvEgAhttps://www.typescriptlang.org/play#code/GYVwdgxgLglg9mABAQwM6oKYCcoElUAiGwMYGAJgDwAqAfABQBuyANgFyLUCUHamOqRMxaIYggHIJxIFi2QAjFhhq1EAbwBQibaOCImrRAF4jiMDJZd1WnbagALLHADuZjK4CiWJ1noByYVFBc1kxez8uAG4bbQBfDXiNUihsYGQIDEQCZChka1sAegLESVgMxAdMgEcQDFRYBEQAW2QsAGsAOkQY0TBgOAB+DnMm+WwAbQBdBI0NCAR6xHIcvNM1Un6OKdiUQWzc6LmFqF7+gEFvYyWVjo24aL5sPEJiUgp6O4usKNn+rH0lCcYFcAAyRUSISinOBfDpKMAAcwc4JgAGpUVZNLZ5mBFncrp9vOMYJNorZHjh8EQSGRyB8+nAfvEgA
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Domain: This-TypingThe issue relates to providing types to thishttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20This-Typing%22
on Oct 16, 2025https://github.com/microsoft/TypeScript/issues/51661#event-20330954400
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 18, 2026https://github.com/microsoft/TypeScript/issues/51661#issuecomment-5737570095
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
Needs Human ReviewThis issue has a backlog check awaiting maintainer review.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Human%20Review%22
Needs More InfoThe issue still hasn't been fully clarifiedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20More%20Info%22
Needs Human ReviewThis issue has a backlog check awaiting maintainer review.https://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20Human%20Review%22
on Sep 18, 2026https://github.com/microsoft/TypeScript/issues/51661#event-31425712074
https://github.com/OxleyS
Sean Oxley (OxleyS)https://github.com/OxleyS
on Sep 30, 2026https://github.com/microsoft/TypeScript/issues/51661#issuecomment-5904970780
Sean Oxley (OxleyS)https://github.com/OxleyS
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Sep 30, 2026https://github.com/microsoft/TypeScript/issues/51661#event-32138355823
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/51661
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/51661
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
Domain: This-TypingThe issue relates to providing types to thishttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Domain%3A%20This-Typing%22
Needs More InfoThe issue still hasn't been fully clarifiedhttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Needs%20More%20Info%22
BacklogNo due datehttps://github.com/microsoft/TypeScript/milestone/29
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.