mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			371 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			371 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract C {
 | |
| 	int x;
 | |
| 
 | |
| 	function g() public  {
 | |
| 		x = 42;
 | |
| 	}
 | |
| 
 | |
| 	function f() public {
 | |
| 		x = 0;
 | |
| 		try this.g() {
 | |
| 			assert(x == 42); // should hold
 | |
| 		} catch (bytes memory s) {
 | |
| 			assert(x == 0); // should hold
 | |
| 		}
 | |
| 	}
 | |
| }
 | |
| // ====
 | |
| // SMTEngine: all
 | |
| // ----
 | |
| // Warning 5667: (155-169): Unused try/catch parameter. Remove or comment out the variable name to silence this warning.
 |