René's URL Explorer Experiment


Title: CFA Assertions Not Active on Implicitly-Typed Function Calls · Issue #33580 · microsoft/TypeScript · GitHub

Open Graph Title: CFA Assertions Not Active on Implicitly-Typed Function Calls · Issue #33580 · microsoft/TypeScript

X Title: CFA Assertions Not Active on Implicitly-Typed Function Calls · Issue #33580 · microsoft/TypeScript

Description: TypeScript Version: 3.7.0-insiders.20190923 (this tgz from this comment) Search Terms: asserts cfa control flow analysis Code class Foo { } interface BarChild { parent: Bar; } class Bar { static staticAdd(f: Foo): asserts f is Foo & BarC...

Open Graph Description: TypeScript Version: 3.7.0-insiders.20190923 (this tgz from this comment) Search Terms: asserts cfa control flow analysis Code class Foo { } interface BarChild { parent: Bar; } class Bar { static st...

X Description: TypeScript Version: 3.7.0-insiders.20190923 (this tgz from this comment) Search Terms: asserts cfa control flow analysis Code class Foo { } interface BarChild { parent: Bar; } class Bar { static st...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"CFA Assertions Not Active on Implicitly-Typed Function Calls","articleBody":"**TypeScript Version:**  3.7.0-insiders.20190923 (this [tgz](https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/45201/artifacts?artifactName=tgz&fileId=FCC96CD1470D020E21159D18DAC814941830D31C28D43629A094AF099B11388B02&fileName=/typescript-3.7.0-insiders.20190923.tgz) from [this comment](https://github.com/microsoft/TypeScript/pull/32695#issuecomment-534269544))\r\n\r\n**Search Terms:** `asserts` `cfa` `control flow analysis`\r\n\r\n**Code**\r\n\r\n```ts\r\nclass Foo {\r\n}\r\n\r\ninterface BarChild {\r\n    parent: Bar;\r\n}\r\n\r\nclass Bar {\r\n    static staticAdd(f: Foo): asserts f is Foo & BarChild {}\r\n    add(f: Foo): asserts f is Foo & BarChild {}\r\n    innerTest() {\r\n        const innerFoo = new Foo();\r\n        this.add(innerFoo);\r\n        innerFoo.parent;  // this compiles successfully\r\n    }\r\n}\r\n\r\nfunction main() {\r\n    const foo1 = new Foo();\r\n    const bar1 = new Bar();\r\n    bar1.add(foo1);\r\n    foo1.parent;  // this is an ERROR - Property 'parent' does not exist on type 'Foo'. ts(2339)\r\n\r\n    const foo2 = new Foo();\r\n    Bar.staticAdd(foo2);\r\n    foo2.parent;  // this compiles successfully\r\n}\r\n```\r\n\r\nThe `Bar.add` assertion works when called inside another method of `Bar` but fails when called externally from `main`. I added a static function assertion to show that assertion still works otherwise in `main`.\r\n\r\n**Expected behavior:** In `main` after `bar1.add(foo1)`, `foo1` should be of type `Foo & BarChild`.\r\n\r\n**Actual behavior:** In `main` after `bar1.add(foo1)`, `foo1` is still type `Foo`.\r\n\r\n**Playground Link:** I've duplicated the sample code above in [this](https://www.typescriptlang.org/play/?ts=Nightly#code/MYGwhgzhAEBiD29oG8BQBfVqCWA7ALgKYBOAZmMIdAEJjEDCAFtiACYqrRfQAOdhBAFw06AbgxZQkGLWIdu0CPjD5swRctXAAgq1YAKUsITwAlMOkl8MUtGwwT0AGQiGzNikwKwew8cTm0JbE1tC29nCIzq5MLOzIXtx4uCQAKoRK+qbyCtzA8LhKdrgpxI4AvNApAO6R8Fniudz4zBAAdD4GySQmpo1NxaUmbXzEAviiXAD0U9AtEfkAtjwsGYoArsCUUKTrICAAnpzcmJiou7jAqgXQi2B4WTlc+YX4YYgAjNCVNXUNx88CkUAEZ0L4-Qi1WT-BSg4gfDq+UifPoA97wBGjcaTaAzOatOwwMC4aAAUQASuSAPLk6AAWmgAAViPAeFYDtAAORYgic6CseBrXDwN6EAAe9jeN3wBzZXJMnLacwg+gATABmdUATlMWAULyKyPgqu+VUhf1RClkbSUKjUugMRtVlu4TpG-AIOLx8xgSxWIDWEE22wgu32R3QQA) playground link, but at the time of posting the nightly version does not have these changes.\r\n\r\n**Related Issues:** https://github.com/microsoft/TypeScript/pull/32695 This feature was merged to master yesterday, so instead of commenting on a closed PR I opened a new issue. ","author":{"url":"https://github.com/molisani","@type":"Person","name":"molisani"},"datePublished":"2019-09-24T15:04:33Z","url":"https://github.com/microsoft/TypeScript/issues/33580"}

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:04537708-a3d5-c7c0-1294-e39a34252891
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8E5A:A99C2:E022F2:120651A:6B00F534
html-safe-nonce421d7550c9ae04cf78fa856895c8374e43b90be446fa056f732a8e8b31b04d00
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTVBOkE5OUMyOkUwMjJGMjoxMjA2NTFBOjZCMDBGNTM0IiwidmlzaXRvcl9pZCI6IjgyOTgxNzk4NjE5Njk2OTYwNTIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb5f55d61b24916348ae6c131808cd67aa73538caa0d56413caf949c937e5d3da
hovercard-subject-tagissue:497748670
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/33580/issue_layout
twitter:imagehttps://opengraph.githubassets.com/bbaad315b75fcf6447ca72f96efd6cb6d27b6eb4041b9c394322979058ea704e/microsoft/TypeScript/issues/33580
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/bbaad315b75fcf6447ca72f96efd6cb6d27b6eb4041b9c394322979058ea704e/microsoft/TypeScript/issues/33580
og:image:altTypeScript Version: 3.7.0-insiders.20190923 (this tgz from this comment) Search Terms: asserts cfa control flow analysis Code class Foo { } interface BarChild { parent: Bar; } class Bar { static st...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemolisani
hostnamegithub.com
expected-hostnamegithub.com
None4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc
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
release9983dd5da06943f833c971dd5b6bc988e2858be5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/33580#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F33580
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%2F33580
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/33580
Reloadhttps://github.com/microsoft/TypeScript/issues/33580
Reloadhttps://github.com/microsoft/TypeScript/issues/33580
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests308 (308)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/33580
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/33580
#33622https://github.com/microsoft/TypeScript/pull/33622
CFA Assertions Not Active on Implicitly-Typed Function Callshttps://github.com/microsoft/TypeScript/issues/33580#top
#33622https://github.com/microsoft/TypeScript/pull/33622
https://github.com/ahejlsberg
Breaking ChangeWould introduce errors in existing codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Breaking%20Change%22
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
TypeScript 3.7.0https://github.com/microsoft/TypeScript/milestone/98
https://github.com/molisani
Michael Molisani (molisani)https://github.com/molisani
on Sep 24, 2019https://github.com/microsoft/TypeScript/issues/33580#issue-497748670
tgzhttps://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/45201/artifacts?artifactName=tgz&fileId=FCC96CD1470D020E21159D18DAC814941830D31C28D43629A094AF099B11388B02&fileName=/typescript-3.7.0-insiders.20190923.tgz
this commenthttps://github.com/microsoft/TypeScript/pull/32695#issuecomment-534269544
thishttps://www.typescriptlang.org/play/?ts=Nightly#code/MYGwhgzhAEBiD29oG8BQBfVqCWA7ALgKYBOAZmMIdAEJjEDCAFtiACYqrRfQAOdhBAFw06AbgxZQkGLWIdu0CPjD5swRctXAAgq1YAKUsITwAlMOkl8MUtGwwT0AGQiGzNikwKwew8cTm0JbE1tC29nCIzq5MLOzIXtx4uCQAKoRK+qbyCtzA8LhKdrgpxI4AvNApAO6R8Fniudz4zBAAdD4GySQmpo1NxaUmbXzEAviiXAD0U9AtEfkAtjwsGYoArsCUUKTrICAAnpzcmJiou7jAqgXQi2B4WTlc+YX4YYgAjNCVNXUNx88CkUAEZ0L4-Qi1WT-BSg4gfDq+UifPoA97wBGjcaTaAzOatOwwMC4aAAUQASuSAPLk6AAWmgAAViPAeFYDtAAORYgic6CseBrXDwN6EAAe9jeN3wBzZXJMnLacwg+gATABmdUATlMWAULyKyPgqu+VUhf1RClkbSUKjUugMRtVlu4TpG-AIOLx8xgSxWIDWEE22wgu32R3QQA
#32695https://github.com/microsoft/TypeScript/pull/32695
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Sep 24, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2658684115
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Sep 24, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2658684296
Nathan Shively-Sanders (sandersn)https://github.com/sandersn
TypeScript 3.7.0https://github.com/microsoft/TypeScript/milestone/98
on Sep 24, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2658684466
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
on Sep 24, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-534632977
thishttps://github.com/microsoft/TypeScript/pull/32695#issuecomment-522251155
https://github.com/molisani
Michael Molisani (molisani)https://github.com/molisani
on Sep 24, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-534636612
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Sep 24, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-534637598
https://github.com/molisani
Michael Molisani (molisani)https://github.com/molisani
on Sep 24, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-534641707
Jack Williams (@jack-williams)https://github.com/jack-williams
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
Michael Molisani (molisani)https://github.com/molisani
on Sep 24, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2658824326
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Sep 25, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-535202668
#32695 (comment)https://github.com/microsoft/TypeScript/pull/32695#issuecomment-522251155
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
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
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
on Sep 25, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2663059182
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
TypeScript 3.7.0https://github.com/microsoft/TypeScript/milestone/98
on Sep 25, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2663059522
https://github.com/jcalz
Joe Calzaretta (jcalz)https://github.com/jcalz
on Sep 26, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-535508914
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
on Sep 26, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-535568675
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Sep 26, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-535679895
Jack Williams (@jack-williams)https://github.com/jack-williams
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
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
on Sep 26, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2666655456
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
TypeScript 3.7.0https://github.com/microsoft/TypeScript/milestone/98
on Sep 26, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2666655694
https://github.com/ahejlsberg
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
on Sep 26, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-535693567
https://github.com/jack-williams
Jack Williams (jack-williams)https://github.com/jack-williams
on Sep 27, 2019https://github.com/microsoft/TypeScript/issues/33580#issuecomment-535849341
Daniel Rosenwasser (DanielRosenwasser)https://github.com/DanielRosenwasser
Breaking ChangeWould introduce errors in existing codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Breaking%20Change%22
on Sep 27, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2669547565
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#33622https://github.com/microsoft/TypeScript/pull/33622
on Sep 30, 2019https://github.com/microsoft/TypeScript/issues/33580#event-2674223332
microsofthttps://github.com/microsoft
on Oct 21, 2025https://github.com/microsoft/TypeScript/issues/33580#event-20416783649
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/33580
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/33580
Anders Hejlsberg (ahejlsberg)https://github.com/ahejlsberg
Breaking ChangeWould introduce errors in existing codehttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Breaking%20Change%22
BugA bug in TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Bug%22
TypeScript 3.7.0https://github.com/microsoft/TypeScript/milestone/98
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.