mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
14 lines
635 B
Solidity
14 lines
635 B
Solidity
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 9574: (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 6160: (298-302): Wrong argument count for function call: 1 arguments given but expected 2.
|