mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			493 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			493 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
interface I {
 | 
						|
    function f(uint256[] calldata a) external returns (uint256);
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
contract A is I {
 | 
						|
    function f(uint256[] calldata a) external override returns (uint256) {
 | 
						|
        return 42;
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
 | 
						|
contract B {
 | 
						|
    function f(uint256[] memory a) public returns (uint256) {
 | 
						|
        return a[1];
 | 
						|
    }
 | 
						|
 | 
						|
    function g() public returns (uint256) {
 | 
						|
        I i = I(new A());
 | 
						|
        return i.f(new uint256[](2));
 | 
						|
    }
 | 
						|
}
 | 
						|
// ----
 | 
						|
// g() -> 42
 | 
						|
// gas irOptimized: 80813
 | 
						|
// gas legacy: 122471
 |