aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/types/mapping/mapping_return_internal.sol
blob: a46003f8bc5f2fa57997af5c791a12573a520d87 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// This should be allowed in a future release.
contract C {
    mapping(uint=>uint) m;
    function f() internal view returns (mapping(uint=>uint) storage) {
        return m;
    }
    function g() private view returns (mapping(uint=>uint) storage) {
        return m;
    }
    function h() internal view returns (mapping(uint=>uint) storage r) {
        r = m;
    }
    function i() private view returns (mapping(uint=>uint) storage r) {
        (r,r) = (m,m);
    }
}
// ----
// TypeError: (127-146): Type is required to live outside storage.
// TypeError: (221-240): Type is required to live outside storage.
// TypeError: (316-345): Type is required to live outside storage.
// TypeError: (409-438): Type is required to live outside storage.