mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			403 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			403 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract C {
 | |
| 	struct Struct {
 | |
| 		function () external el;
 | |
| 	}
 | |
| 	Struct[] array;
 | |
| 	int externalCalled = 0;
 | |
| 
 | |
| 	function ext() external {
 | |
| 		externalCalled++;
 | |
| 	}
 | |
| 
 | |
| 	function f() public {
 | |
| 		array.push(Struct(this.ext));
 | |
| 		array.push(array[0]);
 | |
| 
 | |
| 		array[0].el();
 | |
| 		array[1].el();
 | |
| 
 | |
| 		assert(externalCalled == 2);
 | |
| 	}
 | |
| }
 | |
| // ----
 | |
| // f() ->
 | |
| // gas irOptimized: 113019
 | |
| // gas legacy: 112931
 | |
| // gas legacyOptimized: 112602
 |