Title: Type not suggested when implementing an interface's overloaded method · Issue #18384 · microsoft/TypeScript · GitHub
Open Graph Title: Type not suggested when implementing an interface's overloaded method · Issue #18384 · microsoft/TypeScript
X Title: Type not suggested when implementing an interface's overloaded method · Issue #18384 · microsoft/TypeScript
Description: TypeScript Version: 2.5.2 / nightly (2.6.0-dev.20170910) Code interface MyInterface { exec(action: 'action_1'): void; exec(action: 'action_2'): void; exec(action: string): void; } const test: MyInterface = { exec(arg) { // `arg` type is ...
Open Graph Description: TypeScript Version: 2.5.2 / nightly (2.6.0-dev.20170910) Code interface MyInterface { exec(action: 'action_1'): void; exec(action: 'action_2'): void; exec(action: string): void; } const test: MyInt...
X Description: TypeScript Version: 2.5.2 / nightly (2.6.0-dev.20170910) Code interface MyInterface { exec(action: 'action_1'): void; exec(action: 'action_2'): void; exec(action: string): void; } c...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/18384
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type not suggested when implementing an interface's overloaded method","articleBody":"**TypeScript Version:** 2.5.2 / nightly (2.6.0-dev.20170910)\r\n\r\n**Code**\r\n\r\n```ts\r\ninterface MyInterface {\r\n\texec(action: 'action_1'): void;\r\n\texec(action: 'action_2'): void;\r\n\texec(action: string): void;\r\n}\r\n\r\nconst test: MyInterface = {\r\n\texec(arg) {\r\n\t\t// `arg` type is `any`\r\n\t}\r\n};\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nI would expect `arg` type to be `\"action1\"|\"action2\"|string`.\r\n\r\n**Actual behavior:**\r\n\r\n`arg` type is `any`.","author":{"url":"https://github.com/bruce965","@type":"Person","name":"bruce965"},"datePublished":"2017-09-11T12:10:29Z","url":"https://github.com/microsoft/TypeScript/issues/18384"}
| 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:6d3ce8ca-ff98-93f6-7e4f-10d7fe752e33 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | C7AC:4D9F2:35DB7A:472424:6B0193E5 |
| html-safe-nonce | 7298ea6e8744616a64d0011e9b6f660d5432f4fd89d80d164514bfeacae2ed75 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDN0FDOjREOUYyOjM1REI3QTo0NzI0MjQ6NkIwMTkzRTUiLCJ2aXNpdG9yX2lkIjoiMTEyMTk4MTkyNjc3ODg0OTAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 6d9fd99a173e51222ab783a36248028383eee9500a61a5aa42d4ee077e493cbc |
| hovercard-subject-tag | issue:256679916 |
| 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/18384/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8ce67c4252902a7c62fce14c4d16b7f6509d3931611b287e385fe381052d1def/microsoft/TypeScript/issues/18384 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8ce67c4252902a7c62fce14c4d16b7f6509d3931611b287e385fe381052d1def/microsoft/TypeScript/issues/18384 |
| og:image:alt | TypeScript Version: 2.5.2 / nightly (2.6.0-dev.20170910) Code interface MyInterface { exec(action: 'action_1'): void; exec(action: 'action_2'): void; exec(action: string): void; } const test: MyInt... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bruce965 |
| 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