-
-
Notifications
You must be signed in to change notification settings - Fork 669
Open
Description
Input:
class MyClass {
[coolKeys: number]: boolean
}
const o = new MyClass
o[1] = true
TypeScript playground (works)
AssemblyScript playground (error)
The error had me thinking that it was an unsupported feature:
;; ERROR TS1005: 'key' expected.
;;
;; [coolKeys: number]: boolean
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 asdom
I did not have the new error that the previous example has, and it all is working well (NodeList
bindings with []
indexed access).