mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			487 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			487 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
contract C {
 | 
						|
    bytes constant a = "\x03\x01\x02";
 | 
						|
    bytes constant b = hex"030102";
 | 
						|
    string constant c = "hello";
 | 
						|
 | 
						|
    function f() public returns (bytes memory) {
 | 
						|
        return a;
 | 
						|
    }
 | 
						|
 | 
						|
    function g() public returns (bytes memory) {
 | 
						|
        return b;
 | 
						|
    }
 | 
						|
 | 
						|
    function h() public returns (bytes memory) {
 | 
						|
        return bytes(c);
 | 
						|
    }
 | 
						|
}
 | 
						|
 | 
						|
// ====
 | 
						|
// compileViaYul: also
 | 
						|
// ----
 | 
						|
// f() -> 0x20, 3, "\x03\x01\x02"
 | 
						|
// g() -> 0x20, 3, "\x03\x01\x02"
 | 
						|
// h() -> 0x20, 5, "hello"
 |