mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
		
			338 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
		
			338 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
contract test {
 | 
						|
    function x() public returns (uint) { return 1; }
 | 
						|
    function y() public returns (uint) { return 2; }
 | 
						|
 | 
						|
    function f(bool cond) public returns (uint) {
 | 
						|
        function () returns (uint) z = cond ? x : y;
 | 
						|
        return z();
 | 
						|
    }
 | 
						|
}
 | 
						|
// ====
 | 
						|
// compileViaYul: also
 | 
						|
// ----
 | 
						|
// f(bool): true -> 1
 | 
						|
// f(bool): false -> 2
 |