{"action":"created","issue":{"url":"https://api.github.com/repos/AssemblyScript/assemblyscript/issues/304","repository_url":"https://api.github.com/repos/AssemblyScript/assemblyscript","labels_url":"https://api.github.com/repos/AssemblyScript/assemblyscript/issues/304/labels{/name}","comments_url":"https://api.github.com/repos/AssemblyScript/assemblyscript/issues/304/comments","events_url":"https://api.github.com/repos/AssemblyScript/assemblyscript/issues/304/events","html_url":"https://github.com/AssemblyScript/assemblyscript/issues/304","id":373378780,"node_id":"MDU6SXNzdWUzNzMzNzg3ODA=","number":304,"title":"[question] compile TS code failed: ERROR TS1042: 'public' modifier cannot be used here.","user":{"login":"mygithubsunny","id":5791895,"node_id":"MDQ6VXNlcjU3OTE4OTU=","avatar_url":"https://avatars2.githubusercontent.com/u/5791895?v=4","gravatar_id":"","url":"https://api.github.com/users/mygithubsunny","html_url":"https://github.com/mygithubsunny","followers_url":"https://api.github.com/users/mygithubsunny/followers","following_url":"https://api.github.com/users/mygithubsunny/following{/other_user}","gists_url":"https://api.github.com/users/mygithubsunny/gists{/gist_id}","starred_url":"https://api.github.com/users/mygithubsunny/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mygithubsunny/subscriptions","organizations_url":"https://api.github.com/users/mygithubsunny/orgs","repos_url":"https://api.github.com/users/mygithubsunny/repos","events_url":"https://api.github.com/users/mygithubsunny/events{/privacy}","received_events_url":"https://api.github.com/users/mygithubsunny/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-24T09:05:09Z","updated_at":"2018-10-24T12:16:31Z","closed_at":null,"author_association":"NONE","body":"Hi, I used assemblyscript to compile [a ts example](https://github.com/EOSArgentina/eostypescript), and got follow errors:\r\n\r\n```\r\n$ cd ~/eostypescript/example\r\n$ bash -x ./scripts/02-compile.sh \r\n+ asc ./src/gameoflife.ts -o ./gameoflife-ts/gameoflife-ts.wast --optimize --validate\r\nERROR TS1042: 'public' modifier cannot be used here.\r\n\r\n   public static from_ds(ds : DataStream) : void {};\r\n   ~~~~~~\r\n in ../src/eoslib.ts(24,2)\r\n\r\nERROR TS1042: 'static' modifier cannot be used here.\r\n\r\n   public static from_ds(ds : DataStream) : void {};\r\n          ~~~~~~\r\n in ../src/eoslib.ts(24,9)\r\n\r\nERROR TS1042: 'public' modifier cannot be used here.\r\n\r\n   public static to_ds(instance :T, ds : DataStream) : void {};\r\n   ~~~~~~\r\n in ../src/eoslib.ts(25,2)\r\n\r\nERROR TS1042: 'static' modifier cannot be used here.\r\n\r\n   public static to_ds(instance :T, ds : DataStream) : void {};\r\n          ~~~~~~\r\n in ../src/eoslib.ts(25,9)\r\n\r\nERROR: Parse error\r\n    at Object.main (/Users/user/assemblyscript/cli/asc.js:389:23)\r\n    at Object.<anonymous> (/Users/user/assemblyscript/bin/asc:3:60)\r\n    at Module._compile (internal/modules/cjs/loader.js:688:30)\r\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)\r\n    at Module.load (internal/modules/cjs/loader.js:598:32)\r\n    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)\r\n    at Function.Module._load (internal/modules/cjs/loader.js:529:3)\r\n    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)\r\n    at startup (internal/bootstrap/node.js:285:19)\r\n    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)\r\n+ cd ./gameoflife-ts/\r\n+ sed -i.bak s/,/_/g gameoflife-ts.wast\r\n+ rm gameoflife-ts.wast.bak\r\n```\r\n\r\nIt looks like there is no grammar problem, and the source code of eoslib.ts likes this:\r\n```\r\nexport interface ISerializable<T> {\r\n  public static from_ds(ds : DataStream) : void {};\r\n  public static to_ds(instance :T, ds : DataStream) : void {};\r\n}\r\n```\r\n\r\ncould anyone help explain it ? thanks a lot"},"comment":{"url":"https://api.github.com/repos/AssemblyScript/assemblyscript/issues/comments/432631473","html_url":"https://github.com/AssemblyScript/assemblyscript/issues/304#issuecomment-432631473","issue_url":"https://api.github.com/repos/AssemblyScript/assemblyscript/issues/304","id":432631473,"node_id":"MDEyOklzc3VlQ29tbWVudDQzMjYzMTQ3Mw==","user":{"login":"MaxGraey","id":1301959,"node_id":"MDQ6VXNlcjEzMDE5NTk=","avatar_url":"https://avatars3.githubusercontent.com/u/1301959?v=4","gravatar_id":"","url":"https://api.github.com/users/MaxGraey","html_url":"https://github.com/MaxGraey","followers_url":"https://api.github.com/users/MaxGraey/followers","following_url":"https://api.github.com/users/MaxGraey/following{/other_user}","gists_url":"https://api.github.com/users/MaxGraey/gists{/gist_id}","starred_url":"https://api.github.com/users/MaxGraey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MaxGraey/subscriptions","organizations_url":"https://api.github.com/users/MaxGraey/orgs","repos_url":"https://api.github.com/users/MaxGraey/repos","events_url":"https://api.github.com/users/MaxGraey/events{/privacy}","received_events_url":"https://api.github.com/users/MaxGraey/received_events","type":"User","site_admin":false},"created_at":"2018-10-24T12:16:31Z","updated_at":"2018-10-24T12:16:31Z","author_association":"MEMBER","body":"That's correct. In typescript interface's fields shouldn't contain any access modifiers like `static` or `public`"}}
{"actor":{"display_login":"MaxGraey"}}