Open
Description
Summary
While trying to compile from latest master branch kept getting ERROR TS2304: Cannot find name 'null'.
Steps to reproduce
-
git clone https://github.com/nearprotocol/assemblyscript-json cd assemblyscript-json yarn
yarn asbuild
Actual Behaviour
yarn run v1.22.5
$ yarn asbuild:untouched && yarn asbuild:optimized
$ asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --sourceMap --validate --debug
WARNING Unknown option '--validate'
ERROR TS2304: Cannot find name 'null'.
valueOf(): null {
~~~~
in assembly/JSON.ts(252,14)
WARNING AS232: Exported generic function or class has no concrete instances.
set<T>(key: string, value: T): void {
~~~
in assembly/JSON.ts(358,5)
WARNING AS232: Exported generic function or class has no concrete instances.
export function from<T>(val: T): Value {
~~~~
in assembly/JSON.ts(446,17)
WARNING AS232: Exported generic function or class has no concrete instances.
export function parse<T = Uint8Array>(str: T): Value {
~~~~~
in assembly/JSON.ts(479,17)
WARNING AS232: Exported generic function or class has no concrete instances.
export class JSONDecoder<JSONHandlerT extends JSONHandler> {
~~~~~~~~~~~
in assembly/decoder.ts(118,14)
FAILURE 1 compile error(s)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Expected Behviour
Compile to wasm without error
Machine Info
- node v14.15.0
- assemblyscript@0.15.2
Potential Fix
After replacing with below, I was able to compile successfully.
valueOf(): Null | null {
Metadata
Metadata
Assignees
Labels
No labels