bitcoin-sv / sol2scrypt

Solidity to sCrypt Transplier
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Unrecognized early-occurring member function `_f` #182

Closed zhfnjust closed 2 years ago

zhfnjust commented 2 years ago
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;

contract DataLocations {
    uint[3] public arr;
    mapping(uint => address) map;
    struct MyStruct {
        uint foo;
    }
    mapping(uint => MyStruct) myStructs;

    function f() external {
        // call _f with state variables
        _f(arr, map, myStructs[1]);

    }

    function _f(
        uint[3] storage _arr,
        mapping(uint => address) storage _map,
        MyStruct storage _myStruct
    ) internal {
        // do something with storage variables
    }
xhliu commented 2 years ago

Same applies to property & struct, besides function.

Use first, define later.