Title: No auto implementation refactorings for abstract class with method with explicit this parameter. · Issue #39440 · microsoft/TypeScript · GitHub
Open Graph Title: No auto implementation refactorings for abstract class with method with explicit this parameter. · Issue #39440 · microsoft/TypeScript
X Title: No auto implementation refactorings for abstract class with method with explicit this parameter. · Issue #39440 · microsoft/TypeScript
Description: TypeScript Version: 4.0.0-dev.20200706 Search Terms: refactoring, abstract class, this, suggestions, intellisense, Code abstract class Thing { abstract run(): void; } class ThingImpl extends Thing { } abstract class ThingWithThis { abstr...
Open Graph Description: TypeScript Version: 4.0.0-dev.20200706 Search Terms: refactoring, abstract class, this, suggestions, intellisense, Code abstract class Thing { abstract run(): void; } class ThingImpl extends Thing ...
X Description: TypeScript Version: 4.0.0-dev.20200706 Search Terms: refactoring, abstract class, this, suggestions, intellisense, Code abstract class Thing { abstract run(): void; } class ThingImpl extends Thing ...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/39440
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"No auto implementation refactorings for abstract class with method with explicit this parameter.","articleBody":"**TypeScript Version:** 4.0.0-dev.20200706\r\n\r\n**Search Terms:** refactoring, abstract class, this, suggestions, intellisense, \r\n\r\n**Code**\r\n```ts\r\nabstract class Thing {\r\n abstract run(): void;\r\n}\r\n\r\nclass ThingImpl extends Thing {\r\n}\r\n\r\nabstract class ThingWithThis {\r\n abstract run(this: ThingWithThis): void;\r\n}\r\n\r\nclass ThingWithThisImpl extends ThingWithThis {\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\nRefactorings to auto implement ThingWithThisImpl as such:\r\n```ts\r\nabstract class Thing {\r\n abstract run(): void;\r\n}\r\n\r\nclass ThingImpl extends Thing {\r\n run(): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n}\r\n\r\nabstract class ThingWithThis {\r\n abstract run(this: ThingWithThis): void;\r\n}\r\n\r\nclass ThingWithThisImpl extends ThingWithThis {\r\n run(this: ThingWithThis): void {\r\n throw new Error(\"Method not implemented.\");\r\n }\r\n}\r\n```\r\n\r\n**Actual behavior:**\r\nImplementing the abstract class is not suggested for ThingWithThis.\r\n\r\n\r\n\r\n\r\nGithub doesn't support mp4s, so attached is a zip containing an mp4 of the problem if necessary.\r\n[problem.zip](https://github.com/microsoft/TypeScript/files/4879016/problem.zip)\r\n\r\n**Playground Link:** [Playground Link]([Playground Link](https://www.typescriptlang.org/play?ts=4.0.0-dev.20200703#code/IYIwzgLgTsDGEAJYBthjAgKgCwJYDsBzBAbwCgEFRIZ4EoBXfACgEoAuBANwHtcATANxkAvmTIo0GHAUIBJALYAHZAgCmADwhr8-aXiKlR46tDiJJ6LAcIB1XBGwyM5SqdqJGLR7jCcZRPaOzhzcfELGEqhWAXYOTnhgiirqWjp61rJBCb5GIkA))\r\n\r\n**Related Issues:** N/A?\r\n","author":{"url":"https://github.com/monoclex","@type":"Person","name":"monoclex"},"datePublished":"2020-07-06T13:10:21Z","url":"https://github.com/microsoft/TypeScript/issues/39440"}
| 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:13d19648-6267-b407-0a30-814723c96f1e |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8E6A:358871:E634F5:130915C:6B00FF0C |
| html-safe-nonce | a424b2cbba8b9bda4bb07fb41f8c1dff8a697a1157a91c8956cd520af8bce642 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RTZBOjM1ODg3MTpFNjM0RjU6MTMwOTE1Qzo2QjAwRkYwQyIsInZpc2l0b3JfaWQiOiIxNDIxMTg2NTkzOTM0MzQzOTQ5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | b3930df5b0c511e84f9e358a262870b28e76e96ea06474ff9ec9498a2e8cef64 |
| hovercard-subject-tag | issue:651525650 |
| 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/39440/issue_layout |
| twitter:image | https://opengraph.githubassets.com/eac34a6f3c9f931ec9f6528f6a02c0ac7b1c6331c04a0d17c3a3e7aa6b3149cf/microsoft/TypeScript/issues/39440 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/eac34a6f3c9f931ec9f6528f6a02c0ac7b1c6331c04a0d17c3a3e7aa6b3149cf/microsoft/TypeScript/issues/39440 |
| og:image:alt | TypeScript Version: 4.0.0-dev.20200706 Search Terms: refactoring, abstract class, this, suggestions, intellisense, Code abstract class Thing { abstract run(): void; } class ThingImpl extends Thing ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | monoclex |
| hostname | github.com |
| expected-hostname | github.com |
| None | cb7fa109eca7d4156c889f474306b0e91336055e9adf8fd4684b61e49094d124 |
| 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 | 2b59d31a4e44f08b7af67a4b67f8fd0af3befe2a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width