Any name for index type signatures like TS (not just "key"). #1972
Comments
|
As far as I'm aware, the error is because the parser expects |
|
@willemneal In Here is the implementation (see that it has both): https://github.com/lume/asdom/blob/01a9dc3c6259a9418a50f53766b68c54bb47f5c1/assembly/NodeList.ts And here is the usage (no errors in VSCode or AS): |
|
Oooh, the second error is Here is the corrected example with no errors: playground. |
|
Looking at your code, just wanted to mention that currently |
|
Plus in TypeScript this is how one actually makes the index type read-only: |
Input:
TypeScript playground (works)
AssemblyScript playground (error)
The error had me thinking that it was an unsupported feature:
I thought "a key is required here? I put a key there, but it must not support it".
I didn't realize that it is saying I need to actually name my key "key". Changing it to "key" gets past that error, although in the following example it has some other error I don't understand:
AssemblyScript playground (no more "
'key' expected" error)In
asdomI did not have the new error that the previous example has, and it all is working well (NodeListbindings with[]indexed access).The text was updated successfully, but these errors were encountered: