Is it possible to use string literal types in AssemblyScript?

232 Views Asked by At

Is it possible to create a string literal type in AssemblyScript that resembles the type keyword used in TypeScript?

TypeScript example:

export type MyType = 'foo' | 'bar';
1

There are 1 best solutions below

0
On BEST ANSWER

Not currently:

> asc assembly/index.ts --target debug

ERROR AS100: Not implemented: union types
   :
 1 │ export type MyType = 'foo' | 'bar';
   │                              ~~~~~
   └─ in assembly/index.ts(1,30)

There is an issue open.