aboutsummaryrefslogtreecommitdiffstats
path: root/test/libsolidity/syntaxTests/nameAndTypeResolution/262_bound_function_in_var.sol
blob: c3cc5232d611c4cacecaf019564a9a417bed34f6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
library D { struct s { uint a; } function mul(s storage self, uint x) public returns (uint) { return self.a *= x; } }
contract C {
    using D for D.s;
    D.s x;
    function f(uint a) public returns (uint) {
        function (D.s storage, uint) returns (uint) g = x.mul;
        g(x, a);
        g(a);
    }
}
// ----
// TypeError: (218-271): Type function (struct D.s storage pointer,uint256) returns (uint256) is not implicitly convertible to expected type function (struct D.s storage pointer,uint256) returns (uint256).
// TypeError: (298-302): Wrong argument count for function call: 1 arguments given but expected 2.