mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			22 lines
		
	
	
		
			394 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			22 lines
		
	
	
		
			394 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| ==== Source: A ====
 | |
| struct S { uint x; }
 | |
| function set(S storage a, uint v) { a.x = v; }
 | |
| 
 | |
| ==== Source: B ====
 | |
| import "A";
 | |
| import "A" as A;
 | |
| contract C {
 | |
|   A.S data;
 | |
|   function f(uint v) public returns (uint one, uint two) {
 | |
|     A.set(data, v);
 | |
|     one = data.x;
 | |
|     set(data, v + 1);
 | |
|     two = data.x;
 | |
|   }
 | |
| }
 | |
| // ====
 | |
| // compileToEwasm: also
 | |
| // compileViaYul: also
 | |
| // ----
 | |
| // f(uint256): 7 -> 7, 8
 |