Title: enum with bigger integer than available is allowed · Issue #8020 · microsoft/TypeScript · GitHub
Open Graph Title: enum with bigger integer than available is allowed · Issue #8020 · microsoft/TypeScript
X Title: enum with bigger integer than available is allowed · Issue #8020 · microsoft/TypeScript
Description: Code export enum ModelType { Repositories, Gists }; function test(modelType: ModelType) { } test(2); Example Expected behavior: Throw error, because 2 shouldn't be available in ModelType. Actual behavior: No error is thrown.
Open Graph Description: Code export enum ModelType { Repositories, Gists }; function test(modelType: ModelType) { } test(2); Example Expected behavior: Throw error, because 2 shouldn't be available in ModelType. Actual be...
X Description: Code export enum ModelType { Repositories, Gists }; function test(modelType: ModelType) { } test(2); Example Expected behavior: Throw error, because 2 shouldn't be available in ModelType. Actua...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/8020
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"enum with bigger integer than available is allowed","articleBody":"**Code**\n\n``` ts\nexport enum ModelType {\n Repositories,\n Gists\n};\n\nfunction test(modelType: ModelType) {\n\n}\n\ntest(2);\n```\n\n[Example](https://www.typescriptlang.org/play/#src=export%20enum%20ModelType%20%7B%0D%0A%20%20Repositories%2C%0D%0A%20%20Gists%0D%0A%7D%3B%0D%0A%0D%0Afunction%20test%28modelType%3A%20ModelType%29%20%7B%0D%0A%09%0D%0A%7D%0D%0A%0D%0Atest%282%29%3B)\n**Expected behavior:**\n\nThrow error, because `2` shouldn't be available in `ModelType`.\n\n**Actual behavior:** \n\nNo error is thrown.\n","author":{"url":"https://github.com/donaldpipowitch","@type":"Person","name":"donaldpipowitch"},"datePublished":"2016-04-12T05:13:50Z","url":"https://github.com/microsoft/TypeScript/issues/8020"}
| 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:00581342-8150-41ea-3562-2ac54a8f2025 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E7F0:2454CC:257DAD4:2F8A920:6B018F43 |
| html-safe-nonce | fc3e1596ddd146da137598fd27e93289e71d869c2e0e25f0b98b74a8d04ec96f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFN0YwOjI0NTRDQzoyNTdEQUQ0OjJGOEE5MjA6NkIwMThGNDMiLCJ2aXNpdG9yX2lkIjoiNjg4MDMxMjAxMTUxMjU4NDM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | fb74b0a2827ed766a7034808f24c6e51082bdc4c7e598304adb7f8886d70bcc1 |
| hovercard-subject-tag | issue:147634781 |
| 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/8020/issue_layout |
| twitter:image | https://opengraph.githubassets.com/820a22b4df44320d1e5da15f90a6d390929f14fcfaba78734e0b1fa26f6f585f/microsoft/TypeScript/issues/8020 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/820a22b4df44320d1e5da15f90a6d390929f14fcfaba78734e0b1fa26f6f585f/microsoft/TypeScript/issues/8020 |
| og:image:alt | Code export enum ModelType { Repositories, Gists }; function test(modelType: ModelType) { } test(2); Example Expected behavior: Throw error, because 2 shouldn't be available in ModelType. Actual be... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | donaldpipowitch |
| 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 | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width