what this means ?
Func compilation error: contracts/3.fc:35:22: error: cannot apply function ~push_back : (tuple, cell) -> (tuple, ??9) to arguments of type (tuple, int): cannot unify type int with cell
here is the code :
tuple find_and_replace(int flag, int value, cell linked_list) method_id {
slice s = linked_list.begin_parse();
tuple stack = null();
stack~push_back(linked_list);
tuple res = empty_tuple();
while (~ stack.is_null()) {
slice cs = stack~pop_back().begin_parse();
int ci = cs~load_uint(8);
res~push_back(ci);
repeat (current_slice.slice_refs()) {
stack~push_back(current_slice~load_ref());
}
}
Aug 16, 2023, 7:10 AM
Looks like you put int into the place should be the Cell data type.
I see, you should add these line of code I think:
forall X -> int is_null (X x) asm "ISNULL";
forall X -> (tuple, ()) push_back (tuple tail, X head) asm "CONS";
forall X -> (tuple, (X)) pop_back (tuple t) asm "UNCONS";
forall X -> int is_null (X x) asm "ISNULL";
forall X -> (tuple, ()) push_back (tuple tail, X head) asm "CONS";
forall X -> (tuple, (X)) pop_back (tuple t) asm "UNCONS";
Aug 16, 2023, 8:30 AM
oh yes thank you i forgot about 🙏
Aug 16, 2023, 9:42 AM