assemblyscript
assemblyscript copied to clipboard
String literals are failing
Assembly script fails on parsing union string literals (https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#literal-types). An example as simple as this fails:
export type BufferEncoding = 'utf8' | 'ascii';
ERROR TS1005: 'null' expected.
export type BufferEncoding = 'utf8' | 'ascii';
union string literals doesn't support yet
Is there anyway I can help to make this happen ?
The implementation of only union string literals (without mixed types like "str" | 123 | true
) should not be too difficult. The only place where there may be difficulties is in type checking (diagnostics).
If AS treats a string union as just string
(for now, at least), then (I think...) TypeScript will be able to handle the rest (f.e. good type errors in VS Code or with tsc
).