mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
20 lines
497 B
Solidity
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 |