mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			18 lines
		
	
	
		
			330 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			18 lines
		
	
	
		
			330 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| ==== Source: A ====
 | |
| function inc(uint x) pure returns (uint) {
 | |
|     return x + 1;
 | |
| }
 | |
| 
 | |
| ==== Source: B ====
 | |
| contract C {
 | |
| 	function f(uint x) public returns (uint) {
 | |
|         return x.f() + x.inc();
 | |
|     }
 | |
| }
 | |
| using {A.inc, f} for uint;
 | |
| import {inc as f} from "A";
 | |
| import "A" as A;
 | |
| // ----
 | |
| // f(uint256): 5 -> 12
 | |
| // f(uint256): 10 -> 0x16
 |