René's URL Explorer Experiment


Title: Support `readonly` type operator to allow correct definition of `Object.freeze` · Issue #10725 · microsoft/TypeScript · GitHub

Open Graph Title: Support `readonly` type operator to allow correct definition of `Object.freeze` · Issue #10725 · microsoft/TypeScript

X Title: Support `readonly` type operator to allow correct definition of `Object.freeze` · Issue #10725 · microsoft/TypeScript

Description: TypeScript Version: 2.0@RC Code // Current definition of `Object.freeze`: // freeze(o: T): T; const o = Object.freeze({a: 1}); o.a = 2; // Should throw type error console.log(o); // {a: 1} Expected behavior: Frozen object has readonly...

Open Graph Description: TypeScript Version: 2.0@RC Code // Current definition of `Object.freeze`: // freeze(o: T): T; const o = Object.freeze({a: 1}); o.a = 2; // Should throw type error console.log(o); // {a: 1} Expec...

X Description: TypeScript Version: 2.0@RC Code // Current definition of `Object.freeze`: // freeze<T>(o: T): T; const o = Object.freeze({a: 1}); o.a = 2; // Should throw type error console.log(o); // {a: 1}...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support `readonly` type operator to allow correct definition of `Object.freeze`","articleBody":"\u003c!-- BUGS: Please use this template. -->\n\n\u003c!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->\n\n\u003c!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->\n\n**TypeScript Version:**  2.0@RC\n\n**Code**\n\n``` ts\n// Current definition of `Object.freeze`:\n// freeze\u003cT>(o: T): T;\n\nconst o = Object.freeze({a: 1});\no.a = 2;  // Should throw type error\nconsole.log(o);  // {a: 1}\n\n```\n\n**Expected behavior:**\nFrozen object has `readonly` properties\n**Actual behavior:** \nType system allows me to write to `o`'s properties\n","author":{"url":"https://github.com/spiffytech","@type":"Person","name":"spiffytech"},"datePublished":"2016-09-06T16:20:35Z","url":"https://github.com/microsoft/TypeScript/issues/10725"}

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:ff2adad0-d23e-cd2e-c6d4-2d7655f0c3db
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB048:175A3:1CF1C5:26D1BD:6AFBE15D
html-safe-nonce95c0bb5b976305a724028be1093dd81cef82723496b201a919141e2d3c0f41b2
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMDQ4OjE3NUEzOjFDRjFDNToyNkQxQkQ6NkFGQkUxNUQiLCJ2aXNpdG9yX2lkIjoiMTYwMzUyNjI3Nzk3OTY5MzQwNSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmaca45eea95ee257baf5bde343d8693e1ea242e084e5d91ea1950c05238aa930cdb
hovercard-subject-tagissue:175290286
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/10725/issue_layout
twitter:imagehttps://opengraph.githubassets.com/f5594a25f741cb4b8920414a86b8f9fedc6f6741209f2b099b5202d80c3daf39/microsoft/TypeScript/issues/10725
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/f5594a25f741cb4b8920414a86b8f9fedc6f6741209f2b099b5202d80c3daf39/microsoft/TypeScript/issues/10725
og:image:altTypeScript Version: 2.0@RC Code // Current definition of `Object.freeze`: // freeze(o: T): T; const o = Object.freeze({a: 1}); o.a = 2; // Should throw type error console.log(o); // {a: 1} Expec...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamespiffytech
hostnamegithub.com
expected-hostnamegithub.com
None744d4381b1c4dbd6d8736c7d7e5bbe7dc11217584e457a3555020c631764e8ec
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
releasedf859c48a4c8b4c0009c19bb4e82101aacb4b998
ui-targetcanary-1
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/microsoft/TypeScript/issues/10725#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fmicrosoft%2FTypeScript%2Fissues%2F10725
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%2F10725
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/10725
Reloadhttps://github.com/microsoft/TypeScript/issues/10725
Reloadhttps://github.com/microsoft/TypeScript/issues/10725
microsofthttps://github.com/microsoft
TypeScripthttps://github.com/microsoft/TypeScript
Codehttps://github.com/microsoft/TypeScript
Issues5k (5k)https://github.com/microsoft/TypeScript/issues
Pull requests334 (334)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/pulse
https://github.com/microsoft/TypeScript
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/10725
New issuehttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/10725
Support readonly type operator to allow correct definition of Object.freezehttps://github.com/microsoft/TypeScript/issues/10725#top
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
https://github.com/spiffytech
spiffytech (spiffytech)https://github.com/spiffytech
on Sep 6, 2016https://github.com/microsoft/TypeScript/issues/10725#issue-175290286
Nexthttps://github.com/microsoft/TypeScript/issues/10725?timeline_page=1
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 6, 2016https://github.com/microsoft/TypeScript/issues/10725#issuecomment-245033427
https://github.com/mhegazy
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 6, 2016https://github.com/microsoft/TypeScript/issues/10725#issuecomment-245033480
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
on Sep 6, 2016https://github.com/microsoft/TypeScript/issues/10725#event-779733289
Mohamed Hegazy (mhegazy)https://github.com/mhegazy
SuggestionAn idea for TypeScripthttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22Suggestion%22
In DiscussionNot yet reached consensushttps://github.com/microsoft/TypeScript/issues?q=state%3Aopen%20label%3A%22In%20Discussion%22
on Sep 6, 2016https://github.com/microsoft/TypeScript/issues/10725#event-779733516
https://github.com/deregtd
David de Regt (deregtd)https://github.com/deregtd
on Sep 14, 2016https://github.com/microsoft/TypeScript/issues/10725#issuecomment-246872305
https://github.com/asfernandes
Adriano dos Santos Fernandes (asfernandes)https://github.com/asfernandes
on Feb 5, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-277490786
#12114https://github.com/microsoft/TypeScript/pull/12114
https://github.com/deregtd
David de Regt (deregtd)https://github.com/deregtd
on Feb 5, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-277494570
https://github.com/asfernandes
Adriano dos Santos Fernandes (asfernandes)https://github.com/asfernandes
on Feb 5, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-277517667
David de Regt (@deregtd)https://github.com/deregtd
https://github.com/deregtd
David de Regt (deregtd)https://github.com/deregtd
on Feb 5, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-277528801
https://github.com/asfernandes
Adriano dos Santos Fernandes (asfernandes)https://github.com/asfernandes
on Feb 5, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-277529256
#11535https://github.com/microsoft/TypeScript/issues/11535
https://github.com/deregtd
David de Regt (deregtd)https://github.com/deregtd
on Feb 5, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-277529452
https://github.com/asfernandes
Adriano dos Santos Fernandes (asfernandes)https://github.com/asfernandes
on Feb 5, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-277531109
#13214https://github.com/microsoft/TypeScript/issues/13214
#12424https://github.com/microsoft/TypeScript/issues/12424
#12424https://github.com/microsoft/TypeScript/issues/12424
https://github.com/deregtd
David de Regt (deregtd)https://github.com/deregtd
on Feb 5, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-277531936
https://github.com/gcanti
Giulio Canti (gcanti)https://github.com/gcanti
on Mar 29, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-290159469
David de Regt (@deregtd)https://github.com/deregtd
https://github.com/KiaraGrouwstra
kiara (KiaraGrouwstra)https://github.com/KiaraGrouwstra
on Dec 24, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-353782678
Alexandre Galays (@AlexGalays)https://github.com/AlexGalays
https://github.com/pelotom
Tom Crockett (pelotom)https://github.com/pelotom
on Dec 24, 2017https://github.com/microsoft/TypeScript/issues/10725#issuecomment-353802406
unnecessary type wideninghttps://github.com/Microsoft/TypeScript/issues/20195
https://github.com/KiaraGrouwstra
kiara (KiaraGrouwstra)https://github.com/KiaraGrouwstra
on Feb 11, 2018https://github.com/microsoft/TypeScript/issues/10725#issuecomment-364751461
#21316https://github.com/microsoft/TypeScript/pull/21316
https://github.com/ikokostya
ikokostyahttps://github.com/ikokostya
on Feb 11, 2018https://github.com/microsoft/TypeScript/issues/10725#issuecomment-364752002
#21316https://github.com/microsoft/TypeScript/pull/21316
https://github.com/alecmev
Alec Mev (alecmev)https://github.com/alecmev
on Apr 15, 2018https://github.com/microsoft/TypeScript/issues/10725#issuecomment-381409874
#21316https://github.com/microsoft/TypeScript/pull/21316
Playground.http://www.typescriptlang.org/play/#src=type%20DeepReadonly%3CT%3E%20%3D%0D%0A%20%20%20%20T%20extends%20any%5B%5D%20%3F%20DeepReadonlyArray%3CT%5Bnumber%5D%3E%20%3A%0D%0A%20%20%20%20T%20extends%20object%20%3F%20DeepReadonlyObject%3CT%3E%20%3A%0D%0A%20%20%20%20T%3B%0D%0A%0D%0Ainterface%20DeepReadonlyArray%3CT%3E%20extends%20ReadonlyArray%3CDeepReadonly%3CT%3E%3E%20%7B%20%7D%0D%0A%0D%0Atype%20DeepReadonlyObject%3CT%3E%20%3D%20T%20%26%0D%0A%20%20%7B%20readonly%20%5BP%20in%20keyof%20T%5D%3A%20DeepReadonly%3CT%5BP%5D%3E%20%7D%3B%0D%0A%0D%0Atype%20Hybrid%20%3D%20%7B%0D%0A%20%20()%3A%20string%3B%0D%0A%20%20prop%3F%3A%20string%3B%0D%0A%7D%3B%0D%0A%0D%0Aconst%20x%3A%20Hybrid%20%3D%20()%20%3D%3E%20'foo'%3B%0D%0Ax.prop%20%3D%20'x'%3B%0D%0A%0D%0Aconst%20y%3A%20Hybrid%20%3D%20()%20%3D%3E%20'bar'%3B%0D%0Ay.prop%20%3D%20'y'%3B%0D%0A%0D%0Ainterface%20A%20%7B%0D%0A%20%20num%3A%20number%3B%0D%0A%20%20func%3A%20()%20%3D%3E%20string%2C%0D%0A%20%20hybrid%3A%20Hybrid%3B%0D%0A%7D%0D%0A%0D%0Atype%20B%20%3D%20DeepReadonly%3CA%3E%3B%0D%0A%0D%0Aconst%20a%3A%20A%20%3D%20%7B%20num%3A%20123%2C%20func%3A%20()%20%3D%3E%20'foo'%2C%20hybrid%3A%20x%20%7D%3B%0D%0Aa.num%20%3D%20456%3B%0D%0Aa.func%20%3D%20()%20%3D%3E%20'bar'%3B%0D%0Aa.func%20%3D%20x%3B%0D%0Aa.func.prop%20%3D%20'a'%3B%20%2F%2F%20Error%0D%0Aa.hybrid%20%3D%20y%3B%0D%0Aa.hybrid.prop%20%3D%20'a'%3B%0D%0A%0D%0Aconst%20b%3A%20B%20%3D%20a%3B%0D%0Ab.num%20%3D%20789%3B%20%2F%2F%20Error%0D%0Ab.func%20%3D%20()%20%3D%3E%20'baz'%3B%20%2F%2F%20Error%0D%0Ab.hybrid%20%3D%20x%3B%20%2F%2F%20Error%0D%0Ab.hybrid.prop%20%3D%20'b'%3B%20%2F%2F%20Error%0D%0A%0D%0Aconst%20c%3A%20A%20%3D%20b%3B%0D%0Ac.num%20%3D%20789%3B%0D%0A
swpeasehttps://github.com/swpease
on Jul 1, 2018https://github.com/microsoft/TypeScript/issues/10725#event-1710356077
[Game] removed DEFAULT_STATEhttps://github.com/swpease/codenames/commit/a2e3ddad7a92a605131347d78cf93fe82d69cfb2
a2e3ddahttps://github.com/swpease/codenames/commit/a2e3ddad7a92a605131347d78cf93fe82d69cfb2
https://github.com/karlhorky
Karl Horky (karlhorky)https://github.com/karlhorky
on Jul 4, 2019https://github.com/microsoft/TypeScript/issues/10725#issuecomment-508503688
TypeScript/src/lib/es5.d.tshttps://github.com/microsoft/TypeScript/blob/b36c8a06902ca47da1568167991bd0bc28ced80e/src/lib/es5.d.ts#L195-L211
b36c8a0https://github.com/microsoft/TypeScript/commit/b36c8a06902ca47da1568167991bd0bc28ced80e
https://github.com/deregtd
David de Regt (deregtd)https://github.com/deregtd
on Jul 4, 2019https://github.com/microsoft/TypeScript/issues/10725#issuecomment-508532212
https://github.com/karlhorky
Karl Horky (karlhorky)https://github.com/karlhorky
on Jul 4, 2019https://github.com/microsoft/TypeScript/issues/10725#issuecomment-508564307
Utility Typehttps://www.typescriptlang.org/docs/handbook/utility-types.html
#21316 (comment)https://github.com/microsoft/TypeScript/pull/21316#issue-164138025
spiffytech (@spiffytech)https://github.com/spiffytech
https://github.com/KiaraGrouwstra
kiara (KiaraGrouwstra)https://github.com/KiaraGrouwstra
on Jul 5, 2019https://github.com/microsoft/TypeScript/issues/10725#issuecomment-508726816
Karl Horky (@karlhorky)https://github.com/karlhorky
https://github.com/lazytype
lazytypehttps://github.com/lazytype
on Sep 25, 2020https://github.com/microsoft/TypeScript/issues/10725#issuecomment-699193070
Daniel Rosenwasser (@DanielRosenwasser)https://github.com/DanielRosenwasser
Ryan Cavanaugh (@RyanCavanaugh)https://github.com/RyanCavanaugh
https://github.com/MartinJohns
Martin Johns (MartinJohns)https://github.com/MartinJohns
on Sep 26, 2020https://github.com/microsoft/TypeScript/issues/10725#issuecomment-699437064
https://github.com/RyanCavanaugh
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
on Jul 5, 2022https://github.com/microsoft/TypeScript/issues/10725#issuecomment-1175538371
Ryan Cavanaugh (RyanCavanaugh)https://github.com/RyanCavanaugh
completedhttps://github.com/microsoft/TypeScript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Jul 5, 2022https://github.com/microsoft/TypeScript/issues/10725#event-6937759165
https://github.com/ExE-Boss
ExE Boss (ExE-Boss)https://github.com/ExE-Boss
on Jul 5, 2022https://github.com/microsoft/TypeScript/issues/10725#issuecomment-1175542806
Suggestion: Const contexts for generic type inference #30680https://github.com/microsoft/TypeScript/issues/30680
Correctly handle generic functions (e.g.: Object.freeze) passed as callbacks to generic functions (e.g.: Array.prototype.map) #42862https://github.com/microsoft/TypeScript/issues/42862
Sign up for freehttps://github.com/signup?return_to=https://github.com/microsoft/TypeScript/issues/10725
Sign in to commenthttps://github.com/login?return_to=https://github.com/microsoft/TypeScript/issues/10725
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
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.