Title: Type inference broken for this in master · Issue #5056 · microsoft/TypeScript · GitHub
Open Graph Title: Type inference broken for this in master · Issue #5056 · microsoft/TypeScript
X Title: Type inference broken for this in master · Issue #5056 · microsoft/TypeScript
Description: module Bug { export class BugClass { public fail(): void { var x = this; x = x.getself(); // error TS2322: Type 'BugClass' is not assignable to type 'this'. } public getself(): BugClass { return this; } } }
Open Graph Description: module Bug { export class BugClass { public fail(): void { var x = this; x = x.getself(); // error TS2322: Type 'BugClass' is not assignable to type 'this'. } public getself(): BugClass { return th...
X Description: module Bug { export class BugClass { public fail(): void { var x = this; x = x.getself(); // error TS2322: Type 'BugClass' is not assignable to type 'this'. } public getself(): BugC...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/5056
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Type inference broken for this in master","articleBody":"``` typescript\nmodule Bug {\n export class BugClass {\n public fail(): void {\n var x = this;\n x = x.getself(); // error TS2322: Type 'BugClass' is not assignable to type 'this'.\n }\n\n public getself(): BugClass {\n return this;\n }\n }\n}\n```\n","author":{"url":"https://github.com/MaceWindu","@type":"Person","name":"MaceWindu"},"datePublished":"2015-10-01T14:30:35Z","url":"https://github.com/microsoft/TypeScript/issues/5056"}
| 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:4337cabd-364c-8fbc-a015-df414fa4b43f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D6A6:34EA7D:96E33B:C32DA0:6B00DE5A |
| html-safe-nonce | ac6c757d144eda296fe695b1ac767d506694ce7826a5ebeddb46ef132b372e54 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENkE2OjM0RUE3RDo5NkUzM0I6QzMyREEwOjZCMDBERTVBIiwidmlzaXRvcl9pZCI6IjkwNzAwNTU5MDEwNDk3MDgxMjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 4c76878e1686bde6c39adef6e266d524faaca6236530378f1aeec96a02b8a4d2 |
| hovercard-subject-tag | issue:109312044 |
| 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/5056/issue_layout |
| twitter:image | https://opengraph.githubassets.com/15a3a40dd781749b4aa98bf5c0071f8485f4d096918ccb5cc0d4a7b80b97e423/microsoft/TypeScript/issues/5056 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/15a3a40dd781749b4aa98bf5c0071f8485f4d096918ccb5cc0d4a7b80b97e423/microsoft/TypeScript/issues/5056 |
| og:image:alt | module Bug { export class BugClass { public fail(): void { var x = this; x = x.getself(); // error TS2322: Type 'BugClass' is not assignable to type 'this'. } public getself(): BugClass { return th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | MaceWindu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf |
| 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 | 5425dc24e8bd8d6fca9641a12afc984825a43875 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width