ask-lang/ask-old

Meet a strange compile error when compile flipper example

yjhmelody opened this issue · 1 comments

$ 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)
$ 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.