Title: Arrow function is not compatible with ordinary one · Issue #17113 · microsoft/TypeScript · GitHub
Open Graph Title: Arrow function is not compatible with ordinary one · Issue #17113 · microsoft/TypeScript
X Title: Arrow function is not compatible with ordinary one · Issue #17113 · microsoft/TypeScript
Description: TypeScript Version: 2.4.1 Code class Component { render(): boolean { return false; } } class App extends Component { render = () => false; } Expected behavior: Compiles correctly. Actual behavior: The compiler reports an error: test.ts(7...
Open Graph Description: TypeScript Version: 2.4.1 Code class Component { render(): boolean { return false; } } class App extends Component { render = () => false; } Expected behavior: Compiles correctly. Actual behavior: ...
X Description: TypeScript Version: 2.4.1 Code class Component { render(): boolean { return false; } } class App extends Component { render = () => false; } Expected behavior: Compiles correctly. Actual behavio...
Opengraph URL: https://github.com/microsoft/TypeScript/issues/17113
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Arrow function is not compatible with ordinary one","articleBody":"**TypeScript Version:** 2.4.1\r\n\r\n**Code**\r\n\r\n```ts\r\nclass Component {\r\n render(): boolean {\r\n return false;\r\n }\r\n}\r\nclass App extends Component {\r\n render = () => false;\r\n}\r\n```\r\n\r\n**Expected behavior:**\r\n\r\nCompiles correctly.\r\n\r\n**Actual behavior:**\r\n\r\nThe compiler reports an error:\r\n\r\n```\r\ntest.ts(7,3): error TS2424: Class 'Component' defines instance member function 'render', but extended class 'App' defines it as instance member property.\r\n```\r\n\r\nI know this may be designed, a feature rather than a bug, but such behavior is quite weird.","author":{"url":"https://github.com/xfoxfu","@type":"Person","name":"xfoxfu"},"datePublished":"2017-07-12T03:16:45Z","url":"https://github.com/microsoft/TypeScript/issues/17113"}
| 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:becff97c-eccf-24f6-44e3-63dbda51c184 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 931A:25598F:BBF4F8:F9DF62:6B00F238 |
| html-safe-nonce | 27c5cfadd09a1660cfc6df4319cfa543333baca8a7dd8ef6906bc4797facd0a7 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MzFBOjI1NTk4RjpCQkY0Rjg6RjlERjYyOjZCMDBGMjM4IiwidmlzaXRvcl9pZCI6IjE5NTk4NzI1NDE5MzM3NjEwODAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 582eec19e1616b5a4688c414be48fe481613675b61d53b07822b3a2e2b2835d8 |
| hovercard-subject-tag | issue:242245244 |
| 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/17113/issue_layout |
| twitter:image | https://opengraph.githubassets.com/a2082a4e1b2a9071fdcdb79b5414af27af7a808c994de59ca3f201c65e969e04/microsoft/TypeScript/issues/17113 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/a2082a4e1b2a9071fdcdb79b5414af27af7a808c994de59ca3f201c65e969e04/microsoft/TypeScript/issues/17113 |
| og:image:alt | TypeScript Version: 2.4.1 Code class Component { render(): boolean { return false; } } class App extends Component { render = () => false; } Expected behavior: Compiles correctly. Actual behavior: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xfoxfu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4ef498cbabcbe3c50befc7a5b743e7072ee770b4daf0e15e54801180d1fa91fc |
| 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 | 9983dd5da06943f833c971dd5b6bc988e2858be5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width