Skip to content
This repository has been archived by the owner on Apr 29, 2022. It is now read-only.

Meet a strange compile error when compile flipper example #5

Closed
yjhmelody opened this issue Jan 22, 2021 · 1 comment
Closed

Meet a strange compile error when compile flipper example #5

yjhmelody opened this issue Jan 22, 2021 · 1 comment

Comments

@yjhmelody
Copy link
Contributor

$ asc --importMemory --initialMemory 2 --maximumMemory 16 --noExportMemory --runtime none --use abort= flipper.ts -O2 -b flipper.wasm -t flipper.wast
ERROR TS2554: Expected 1 arguments, but got 2.  

     v.populateFromBytes(readbuf.valueBytes, 0);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 in ../../src/primitives/readbuffer.ts(18,5)    

FAILURE 1 compile error(s)
@van-bright
Copy link
Collaborator

$ asc --importMemory --initialMemory 2 --maximumMemory 16 --noExportMemory --runtime none --use abort= flipper.ts -O2 -b flipper.wasm -t flipper.wast
ERROR TS2554: Expected 1 arguments, but got 2.  

     v.populateFromBytes(readbuf.valueBytes, 0);
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 in ../../src/primitives/readbuffer.ts(18,5)    

FAILURE 1 compile error(s)

if v is some type implements Codec, you should override method populateFromBytes, which need 2 arguments as default. But normally you can set the argument index a default value.
refer to assembly/deps/as-scale-codec/AbstractInt.ts Line 55 for more detail.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants