Title: static toString with incorrect type breaks instanceof · Issue #12709 · microsoft/TypeScript · GitHub
Open Graph Title: static toString with incorrect type breaks instanceof · Issue #12709 · microsoft/TypeScript
X Title: static toString with incorrect type breaks instanceof · Issue #12709 · microsoft/TypeScript
Description: See microsoft/vscode#16819 TypeScript Version: typescript@2.1.4-insiders.20161206 VSCode Version: Code - Insiders 1.8.0-insider (0d65ced, 2016-12-07T07:05:09.124Z) OS Version: Darwin x64 15.6.0 Code export abstract class Marker { static ...
Open Graph Description: See microsoft/vscode#16819 TypeScript Version: typescript@2.1.4-insiders.20161206 VSCode Version: Code - Insiders 1.8.0-insider (0d65ced, 2016-12-07T07:05:09.124Z) OS Version: Darwin x64 15.6.0 Cod...
X Description: See microsoft/vscode#16819 TypeScript Version: typescript@2.1.4-insiders.20161206 VSCode Version: Code - Insiders 1.8.0-insider (0d65ced, 2016-12-07T07:05:09.124Z) OS Version: Darwin x64 15.6.0 Cod...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/12709
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"static toString with incorrect type breaks instanceof","articleBody":"See https://github.com/Microsoft/vscode/issues/16819\r\n\r\n**TypeScript Version:** typescript@2.1.4-insiders.20161206\r\n- VSCode Version: Code - Insiders 1.8.0-insider (0d65ced0fa7398dc9d50c39a23a2a8cc8406ff18, 2016-12-07T07:05:09.124Z)\r\n- OS Version: Darwin x64 15.6.0\r\n\r\n\r\n**Code**\r\n\r\n```ts\r\nexport abstract class Marker {\r\n\tstatic toString(markers: Marker[]): string {\r\n\t\treturn '';\r\n\t}\r\n}\r\n\r\nexport class Placeholder extends Marker {\r\n\tconstructor(public name: string = '', public defaultValue: Marker[]) {\r\n\t\tsuper();\r\n\t}\r\n}\r\n\r\nfunction foo(marker: Marker) {\r\n\tif (marker instanceof Placeholder) {\r\n\t\tconsole.log(marker.name);\r\n\t\tconsole.log(marker.defaultValue);\r\n\t}\r\n}\r\n\r\nfoo(null);\r\n```\r\n\r\n**Expected behavior:**\r\nNo erros are shown in the vscode editor\r\n\r\n**Actual behavior:**\r\n\r\n\r\nWhen the static toString is removed or renamed the problem goes away.\r\n\r\n","author":{"url":"https://github.com/kieferrm","@type":"Person","name":"kieferrm"},"datePublished":"2016-12-07T17:05:34Z","url":"https://github.com/microsoft/TypeScript/issues/12709"}
| 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:0ac6cc64-551d-178b-a9c9-113de00e0f4b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8D46:842EC:292977D:36E3DC2:6B01BCE4 |
| html-safe-nonce | 3f0cd0c35b799f7910a527e84444dac9330b18fbf7d33bf0e7d43941f6ebde69 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDQ2Ojg0MkVDOjI5Mjk3N0Q6MzZFM0RDMjo2QjAxQkNFNCIsInZpc2l0b3JfaWQiOiI0NjA5NTAyMTE1MjUxOTkzODI4IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c28aba2d71501f5aa63e3166522e6c4f6df28065a09e412703ff24ae4fb6b34b |
| hovercard-subject-tag | issue:194107648 |
| 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/12709/issue_layout |
| twitter:image | https://opengraph.githubassets.com/65a92b3c37f7b00d5b4b6a3e37d7d31189a44877a6126e57a0a75e373dadb209/microsoft/TypeScript/issues/12709 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/65a92b3c37f7b00d5b4b6a3e37d7d31189a44877a6126e57a0a75e373dadb209/microsoft/TypeScript/issues/12709 |
| og:image:alt | See microsoft/vscode#16819 TypeScript Version: typescript@2.1.4-insiders.20161206 VSCode Version: Code - Insiders 1.8.0-insider (0d65ced, 2016-12-07T07:05:09.124Z) OS Version: Darwin x64 15.6.0 Cod... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | kieferrm |
| 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