Title: Incomplete enum type check · Issue #15591 · microsoft/TypeScript · GitHub
Open Graph Title: Incomplete enum type check · Issue #15591 · microsoft/TypeScript
X Title: Incomplete enum type check · Issue #15591 · microsoft/TypeScript
Description: enum with custom values not fully checked TypeScript Version: 2.3.2 Code enum A { B = 2, C = 7 } function getSomething(str: string, a: A): void { } getSomething('str', A.B) // 1 getSomething('str', 9) // 2 getSomething('str', 'x') // 3 E...
Open Graph Description: enum with custom values not fully checked TypeScript Version: 2.3.2 Code enum A { B = 2, C = 7 } function getSomething(str: string, a: A): void { } getSomething('str', A.B) // 1 getSomething('str',...
X Description: enum with custom values not fully checked TypeScript Version: 2.3.2 Code enum A { B = 2, C = 7 } function getSomething(str: string, a: A): void { } getSomething('str', A.B) // 1 getSomethin...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/15591
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Incomplete enum type check","articleBody":"enum with custom values not fully checked\r\n**TypeScript Version:** 2.3.2\r\n\r\n**Code**\r\n\r\n```ts\r\nenum A {\r\n B = 2,\r\n C = 7\r\n}\r\n\r\nfunction getSomething(str: string, a: A): void {\r\n\r\n}\r\n\r\ngetSomething('str', A.B) // 1\r\ngetSomething('str', 9) // 2\r\ngetSomething('str', 'x') // 3\r\n```\r\n\r\n**Expected behavior:**\r\n1. OK.\r\n2. Should throw.\r\n3. Should throw.\r\n**Actual behavior:**\r\n1) OK.\r\n2) OK.\r\n3) error TS2345: Argument of type '\"x\"' is not assignable to parameter of type 'A'.\r\n","author":{"url":"https://github.com/svr93","@type":"Person","name":"svr93"},"datePublished":"2017-05-04T20:29:31Z","url":"https://github.com/microsoft/TypeScript/issues/15591"}
| 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:3ea1a923-a993-9d06-bfcc-a55bd704dd90 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AD40:EDA7A:27344C9:31CFB45:6B0197E4 |
| html-safe-nonce | 226efb9fab5234bc2b58ebe1e9b57b61a64f0f8acb39b0b99dbabff8f6a29c13 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBRDQwOkVEQTdBOjI3MzQ0Qzk6MzFDRkI0NTo2QjAxOTdFNCIsInZpc2l0b3JfaWQiOiIzODU2Mjk2MTc0NDUzNjI2ODUyIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b1bd20d03828db3ca6f1166d5b9e9f023485bf1a0a89268ef7b4e25cbea1b244 |
| hovercard-subject-tag | issue:226399305 |
| 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/15591/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b26e3e56719be05e32ab3645fb84946e3759e7126ef4b948ddca1f43dc742eda/microsoft/TypeScript/issues/15591 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b26e3e56719be05e32ab3645fb84946e3759e7126ef4b948ddca1f43dc742eda/microsoft/TypeScript/issues/15591 |
| og:image:alt | enum with custom values not fully checked TypeScript Version: 2.3.2 Code enum A { B = 2, C = 7 } function getSomething(str: string, a: A): void { } getSomething('str', A.B) // 1 getSomething('str',... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | svr93 |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| 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 | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width