mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			19 lines
		
	
	
		
			357 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			357 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
pragma abicoder v2;
 | 
						|
 | 
						|
contract C {
 | 
						|
	struct S { uint256 x; }
 | 
						|
	struct S2 { uint256 x; uint256 y; }
 | 
						|
	function f(S calldata s, S2 calldata s2) public pure returns (uint256 r, uint256 r2) {
 | 
						|
		assembly {
 | 
						|
			s := s2
 | 
						|
			s2 := 4
 | 
						|
		}
 | 
						|
		r = s.x;
 | 
						|
		r2 = s2.x;
 | 
						|
	}
 | 
						|
}
 | 
						|
// ====
 | 
						|
// compileViaYul: also
 | 
						|
// ----
 | 
						|
// f((uint256),(uint256,uint256)): 0x42, 0x07, 0x77 -> 0x07, 0x42
 |