solidity/test/libsolidity/semanticTests/functionCall/bound_function_to_string.sol
2022-05-19 20:23:28 +02:00

20 lines
435 B
Solidity

library D { function length(string memory self) public returns (uint) { return bytes(self).length; } }
contract C {
using D for string;
string x;
function f() public returns (uint) {
x = "abc";
return x.length();
}
function g() public returns (uint) {
string memory s = "abc";
return s.length();
}
}
// ====
// compileToEwasm: false
// ----
// library: D
// f() -> 3
// g() -> 3