Title: 2.4: Readonly
Open Graph Title: 2.4: Readonly
X Title: 2.4: Readonly
Description: TypeScript Version: 2.4.1 Code function GenMap() : ReadonlyMap
Open Graph Description: TypeScript Version: 2.4.1 Code function GenMap() : ReadonlyMap
X Description: TypeScript Version: 2.4.1 Code function GenMap() : ReadonlyMap<string, number> { const theMap = new Map<string, number>(); theMap.set("one", 1); theMap.set("two", 2)...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/16840
X: @github
Domain: github.com
IPv4 address: 140.82.113.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"2.4: Readonly\u003cMap\u003ck,v>> vs. ReadonlyMap\u003ck,v>","articleBody":"**TypeScript Version:** 2.4.1 \r\n\r\n**Code**\r\n\r\n```ts\r\nfunction GenMap() : ReadonlyMap\u003cstring, number> {\r\n const theMap = new Map\u003cstring, number>();\r\n theMap.set(\"one\", 1);\r\n theMap.set(\"two\", 2);\r\n return Object.freeze(theMap);\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nCompiles without error in tsc@\u003c2.4.0\r\n\r\n**Actual behavior:**\r\n```\r\nTryX.ts(5,5): error TS2322: Type 'Readonly\u003cMap\u003cstring, number>>' is not assignable to type 'ReadonlyMap\u003cs\r\ntring, number>'.\r\n Property '[Symbol.iterator]' is missing in type 'Readonly\u003cMap\u003cstring, number>>'.\r\n```\r\n","author":{"url":"https://github.com/BurtHarris","@type":"Person","name":"BurtHarris"},"datePublished":"2017-06-29T22:20:41Z","url":"https://github.com/microsoft/TypeScript/issues/16840"}
| react-profiling | 0 |
| react-import-map | react,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-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:56e80c54-ac0a-ffff-5f6f-0451c2a79b2f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C212:321110:25988B:351CD5:6B046951 |
| html-safe-nonce | 9dfc7f90578f1da8a7fdc91497a39b4e032008b8faddeeb01c6154d2e6615293 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjEyOjMyMTExMDoyNTk4OEI6MzUxQ0Q1OjZCMDQ2OTUxIiwidmlzaXRvcl9pZCI6Ijc4OTI3MTM0MDMwMzI2MDk3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 92dd69af282920f96a342a456c2a0019ed3cc03e562fdbdf8bf94c8142b99d7d |
| hovercard-subject-tag | issue:239627525 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/microsoft/TypeScript/16840/issue_layout |
| twitter:image | https://opengraph.githubassets.com/97a35017ff9b80f9dfabea80c91389cdb0135948c92230e30e449ad7e23d9d9e/microsoft/TypeScript/issues/16840 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/97a35017ff9b80f9dfabea80c91389cdb0135948c92230e30e449ad7e23d9d9e/microsoft/TypeScript/issues/16840 |
| og:image:alt | TypeScript Version: 2.4.1 Code function GenMap() : ReadonlyMap |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | BurtHarris |
| hostname | github.com |
| expected-hostname | github.com |
| None | 83e4c0e58c5162177f3c161c5fbad38527ae04c11ac14980f9f9d85ae2027b1f |
| turbo-cache-control | no-preview |
| go-import | github.com/microsoft/TypeScript git https://github.com/microsoft/TypeScript.git |
| octolytics-dimension-user_id | 6154722 |
| octolytics-dimension-user_login | microsoft |
| octolytics-dimension-repository_id | 20929025 |
| octolytics-dimension-repository_nwo | microsoft/TypeScript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 20929025 |
| octolytics-dimension-repository_network_root_nwo | microsoft/TypeScript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | ca4d07a7cef4e4b75f821dc25e7300d80c1450a9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width