Title: misleading compiler error · Issue #1699 · AssemblyScript/assemblyscript · GitHub
Open Graph Title: misleading compiler error · Issue #1699 · AssemblyScript/assemblyscript
X Title: misleading compiler error · Issue #1699 · AssemblyScript/assemblyscript
Description: See the output from my travis build using the latest AssemblyScript 0.18.11 ( upgrading from 0.17.7 ) https://travis-ci.com/github/petersalomonsen/javascriptmusic/jobs/485666265#L267 ERROR TS2469: The '++' operator cannot be applied to t...
Open Graph Description: See the output from my travis build using the latest AssemblyScript 0.18.11 ( upgrading from 0.17.7 ) https://travis-ci.com/github/petersalomonsen/javascriptmusic/jobs/485666265#L267 ERROR TS2469: ...
X Description: See the output from my travis build using the latest AssemblyScript 0.18.11 ( upgrading from 0.17.7 ) https://travis-ci.com/github/petersalomonsen/javascriptmusic/jobs/485666265#L267 ERROR TS2469: ...
Opengraph URL: https://github.com/AssemblyScript/assemblyscript/issues/1699
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"misleading compiler error","articleBody":"See the output from my travis build using the latest AssemblyScript 0.18.11 ( upgrading from 0.17.7 )\r\n\r\nhttps://travis-ci.com/github/petersalomonsen/javascriptmusic/jobs/485666265#L267\r\n\r\n```\r\nERROR TS2469: The '++' operator cannot be applied to type 'assembly/midi/midisynth/MidiVoice'.\r\n for (let n=0; n \u003c numActiveVoices; n++) {\r\n ~~~\r\n```\r\n\r\nI would expect that `n` is interpreted as type `i32` and not as `MidiVoice`.\r\n\r\nThe exact same code pass in AssemblyScript 0.17.7.\r\n\r\nAlso tested with 0.17.13 and 0.18.0, and found that the error was introduced in 0.18.0\r\n\r\n------------------\r\nTest case for reproducing:\r\n\r\n```\r\nclass Foo {\r\n\r\n}\r\n\r\nfunction test(): void {\r\n const foos = new Array\u003cFoo>(1);\r\n foos[0] = foos[0] = new Foo();\r\n\r\n for (let n = 0; n \u003c foos.length; n++) {\r\n const v = foos[n];\r\n }\r\n}\r\n\r\ntest();\r\n```\r\n\r\nThe error is actually caused by a mistake in my code in the line `foos[0] = foos[0] = new Foo();` which should have been `foos[0] = new Foo();`. However the compile error message is misleading, and is not really a compile error.\r\n\r\nI'll look into this myself later on, but just wanted to file the issue in case anyone else get an instant idea of what it might be.\r\n","author":{"url":"https://github.com/petersalomonsen","@type":"Person","name":"petersalomonsen"},"datePublished":"2021-02-23T20:36:51Z","url":"https://github.com/AssemblyScript/assemblyscript/issues/1699"}
| 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:f1dbbae1-96bd-7cac-c8e8-5d08ba37af45 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 91FA:2A02D3:72BA62:9EEE0B:6B009E59 |
| html-safe-nonce | 0f26224d32f11676dd95974ec9ddcc8cce4030207e5807f52a90e811d49f05dc |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MUZBOjJBMDJEMzo3MkJBNjI6OUVFRTBCOjZCMDA5RTU5IiwidmlzaXRvcl9pZCI6IjU4MDY0OTM5ODcyMjUyNDczMjEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6103770786d0265b0f82526158108e8488971ad2bd0b3de57f102cf0f543aa09 |
| hovercard-subject-tag | issue:814811015 |
| 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/1699/issue_layout |
| twitter:image | https://opengraph.githubassets.com/78785112dd3eeca2e117b86571ea2848f211ac12c42ce35d2abf12e336c6edfe/AssemblyScript/assemblyscript/issues/1699 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/78785112dd3eeca2e117b86571ea2848f211ac12c42ce35d2abf12e336c6edfe/AssemblyScript/assemblyscript/issues/1699 |
| og:image:alt | See the output from my travis build using the latest AssemblyScript 0.18.11 ( upgrading from 0.17.7 ) https://travis-ci.com/github/petersalomonsen/javascriptmusic/jobs/485666265#L267 ERROR TS2469: ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | petersalomonsen |
| hostname | github.com |
| expected-hostname | github.com |
| None | 52c95ce7e48016ae14399656b4ee812462b6f1fa28c5008c8394da64794c00b8 |
| 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 | 1c9ddec8215f9a94e295c8310c3579b9c54ba31a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width