mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			352 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			352 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
pragma abicoder               v2;
 | 
						|
 | 
						|
contract C {
 | 
						|
    enum E { A, B }
 | 
						|
    function f(E e) public pure returns (uint x) {
 | 
						|
        assembly { x := e }
 | 
						|
    }
 | 
						|
}
 | 
						|
// ====
 | 
						|
// compileToEwasm: also
 | 
						|
// ----
 | 
						|
// f(uint8): 0 -> 0
 | 
						|
// f(uint8): 1 -> 1
 | 
						|
// f(uint8): 2 -> FAILURE
 | 
						|
// f(uint8): 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff -> FAILURE
 |