solidity/test/libsolidity/semanticTests/using/using_global_for_global.sol
2022-03-14 17:39:14 +01:00

20 lines
497 B
Solidity

==== Source: A ====
type global is uint;
using { f } for global global;
function f(global x) pure returns (global) { return global.wrap(global.unwrap(x) + 1); }
==== Source: B ====
import { global } from "A";
function g(global x) pure returns (global) { return global.wrap(global.unwrap(x) + 10); }
contract C {
using { g } for global;
function f(global r) public pure returns (global) {
return r.f().g();
}
}
// ====
// compileViaYul: also
// ----
// f(uint256): 100 -> 111