Title: bug: constructor parameter members initialized in wrong order · Issue #1918 · AssemblyScript/assemblyscript · GitHub
Open Graph Title: bug: constructor parameter members initialized in wrong order · Issue #1918 · AssemblyScript/assemblyscript
X Title: bug: constructor parameter members initialized in wrong order · Issue #1918 · AssemblyScript/assemblyscript
Description: Given the code class Foo { c: number = this.a + this.b constructor(public a: number, public b: number) { } } const f = new Foo(1, 2) the value of f.c should be 3, but it is 0. This assemblyscript playground example shows 0. This equivale...
Open Graph Description: Given the code class Foo { c: number = this.a + this.b constructor(public a: number, public b: number) { } } const f = new Foo(1, 2) the value of f.c should be 3, but it is 0. This assemblyscript p...
X Description: Given the code class Foo { c: number = this.a + this.b constructor(public a: number, public b: number) { } } const f = new Foo(1, 2) the value of f.c should be 3, but it is 0. This assemblyscript p...
Opengraph URL: https://github.com/AssemblyScript/assemblyscript/issues/1918
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"bug: constructor parameter members initialized in wrong order","articleBody":"\u003c!--\r\n Thanks for submitting an issue to AssemblyScript! Please take a moment to\r\n read the contributing guidelines linked below to get off to a good start 🙂\r\n-->\r\n\r\nGiven the code\r\n\r\n```ts\r\nclass Foo {\r\n c: number = this.a + this.b\r\n constructor(public a: number, public b: number) { }\r\n}\r\n\r\nconst f = new Foo(1, 2)\r\n```\r\n\r\nthe value of `f.c` should be `3`, but it is `0`.\r\n\r\nThis [assemblyscript playground](https://www.assemblyscript.org/editor.html#IyFvcHRpbWl6ZT1zcGVlZCZydW50aW1lPXN0dWIKY2xhc3MgRm9vIHsKICBjOiBpMzIgPSB0aGlzLmEgKyB0aGlzLmIKICBjb25zdHJ1Y3RvcihwdWJsaWMgYTogaTMyLCBwdWJsaWMgYjogaTMyKSB7fQp9CgoKLyoqIENhbGN1bGF0ZXMgdGhlIG4tdGggRmlib25hY2NpIG51bWJlci4gKi8KZXhwb3J0IGZ1bmN0aW9uIGZpYihuOiBpMzIpOiBpMzIgewogIGNvbnN0IGYgPSBuZXcgRm9vKDEsIDIpCgogIHJldHVybiBmLmMgLy8gd2Ugc2hvdWxkIHNlZSAzLCBidXQgd2Ugc2VlIDAKfQojIWh0bWwKPHRleHRhcmVhIGlkPSJvdXRwdXQiIHN0eWxlPSJoZWlnaHQ6IDEwMCU7IHdpZHRoOiAxMDAlIiByZWFkb25seT48L3RleHRhcmVhPgo8c2NyaXB0Pgpsb2FkZXIuaW5zdGFudGlhdGUobW9kdWxlX3dhc20sIHsgLyogaW1wb3J0cyAqLyB9KQogIC50aGVuKCh7IGV4cG9ydHMgfSkgPT4gewogICAgY29uc3Qgb3V0cHV0ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ291dHB1dCcpCiAgICBmb3IgKGxldCBpID0gMDsgaSA8PSAxMDsgKytpKSB7CiAgICAgIG91dHB1dC52YWx1ZSArPSBgZmliKCR7aX0pID0gJHtleHBvcnRzLmZpYihpKX1cbmAKICAgIH0KICB9KQo8L3NjcmlwdD4=) example shows `0`.\r\n\r\nThis equivalent [TypeScript playground](https://www.typescriptlang.org/play?#code/MYGwhgzhAEBiD29oG8BQ1rAFzQHYFcBbAIwFMAnaAXmgBcALASwgDoxoBqOp149TeLgi1y+YLXjkAFAAd8xEI2DQwOAiQoAaaHIVLoxNUTLkAlCmgBfVNdTBBw6ADNqeUgHc4iKQEZtAJlNUOwd4EFIWEHgAcyknFmBzAHok6CjomAAiAGZMoA) example shows the expected `3`.","author":{"url":"https://github.com/trusktr","@type":"Person","name":"trusktr"},"datePublished":"2021-06-22T03:33:41Z","url":"https://github.com/AssemblyScript/assemblyscript/issues/1918"}
| 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:2e40d5dd-b77f-f358-cd8c-17d0fee8ce45 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB34:172B92:B7322:FAD56:6B00B9FA |
| html-safe-nonce | 8f7b7ab4c5d286d27dfb76be8e064bc7a784932ff8e11011a2edd1c6b7caa0ca |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjM0OjE3MkI5MjpCNzMyMjpGQUQ1Njo2QjAwQjlGQSIsInZpc2l0b3JfaWQiOiI1Mjc2MjU4NjA2NDI0MDQ2MDc1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 3289dfef9220f790d5365ff476e2aa7204cb7c6aa17056eecae9234847b8fe2b |
| hovercard-subject-tag | issue:926790697 |
| 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/AssemblyScript/assemblyscript/1918/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5ee6938fc052dfbf6a95124255920fb83fb4ee5e28dbace891a4923bebd6fdfe/AssemblyScript/assemblyscript/issues/1918 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5ee6938fc052dfbf6a95124255920fb83fb4ee5e28dbace891a4923bebd6fdfe/AssemblyScript/assemblyscript/issues/1918 |
| og:image:alt | Given the code class Foo { c: number = this.a + this.b constructor(public a: number, public b: number) { } } const f = new Foo(1, 2) the value of f.c should be 3, but it is 0. This assemblyscript p... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | trusktr |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1d07c25977adfc5ff6acb0a962a9bc168c07afbda6fef765f9761c350c2ae4a2 |
| turbo-cache-control | no-preview |
| go-import | github.com/AssemblyScript/assemblyscript git https://github.com/AssemblyScript/assemblyscript.git |
| octolytics-dimension-user_id | 28916798 |
| octolytics-dimension-user_login | AssemblyScript |
| octolytics-dimension-repository_id | 105138356 |
| octolytics-dimension-repository_nwo | AssemblyScript/assemblyscript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 105138356 |
| octolytics-dimension-repository_network_root_nwo | AssemblyScript/assemblyscript |
| 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 | 5429cbfc6aca8c7b9a086a3c8f47400346f38cc9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width