Skip to content

Game Of Life example does not compile #497

@IngwiePhoenix

Description

@IngwiePhoenix

Hey!

I just cloned this repo and wanted to test it out (while getting a little into TypeScript in general) and, following the instructions, came across this:

Ingwie@Ingwies-Macbook-Pro.local ~/W/g/a/e/game-of-life $ npm run asbuild

> @assemblyscript/game-of-life-example@1.0.0 asbuild /Users/Ingwie/Work/Git/assemblyscript/examples/game-of-life
> npm run asbuild:untouched && npm run asbuild:optimized


> @assemblyscript/game-of-life-example@1.0.0 asbuild:untouched /Users/Ingwie/Work/Git/assemblyscript/examples/game-of-life
> asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --use Math=JSMath --importMemory --sourceMap --debug --validate --measure


9 @inline
  ~

assembly/index.ts(9,1): error TS1206: Decorators are not valid here.


15 @inline
   ~

assembly/index.ts(15,1): error TS1206: Decorators are not valid here.


21 @inline
   ~

assembly/index.ts(21,1): error TS1206: Decorators are not valid here.


23   var a = max<i32>((v >>> 24) - BIT_ROT, 0);
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

assembly/index.ts(23,11): error TS2558: Expected 0 type arguments, but got 1.


36       set(x, y, Math.random() > 0.1 ? BGR_DEAD & 0x00ffffff : BGR_ALIVE | 0xff000000);
                   ~~~~

assembly/index.ts(36,17): error TS2304: Cannot find name 'Math'.


82     if (Math.random() < p) set(ix, y, BGR_ALIVE | 0xff000000);
           ~~~~

assembly/index.ts(82,9): error TS2304: Cannot find name 'Math'.


85     if (Math.random() < p) set(x, iy, BGR_ALIVE | 0xff000000);
           ~~~~

assembly/index.ts(85,9): error TS2304: Cannot find name 'Math'.

npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! @assemblyscript/game-of-life-example@1.0.0 asbuild:untouched: `asc assembly/index.ts -b build/untouched.wasm -t build/untouched.wat --use Math=JSMath --importMemory --sourceMap --debug --validate --measure`
npm ERR! Exit status 3
npm ERR! 
npm ERR! Failed at the @assemblyscript/game-of-life-example@1.0.0 asbuild:untouched script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Ingwie/.npm/_logs/2019-02-20T18_24_32_068Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 3
npm ERR! @assemblyscript/game-of-life-example@1.0.0 asbuild: `npm run asbuild:untouched && npm run asbuild:optimized`
npm ERR! Exit status 3
npm ERR! 
npm ERR! Failed at the @assemblyscript/game-of-life-example@1.0.0 asbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Ingwie/.npm/_logs/2019-02-20T18_24_32_099Z-debug.log

Any idea why this happens?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions