mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			258 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			258 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
| contract A {
 | |
| 	uint8 immutable a;
 | |
| 	uint8 x;
 | |
| 
 | |
| 	constructor() {
 | |
| 		a = 3;
 | |
| 		x = readA();
 | |
| 	}
 | |
| 
 | |
| 	function readX() public view returns (uint8) {
 | |
| 		return x;
 | |
| 	}
 | |
| 
 | |
| 	function readA() public view returns (uint8) {
 | |
| 		return a;
 | |
| 	}
 | |
| }
 | |
| // ----
 | |
| // readX() -> 3
 | |
| // readA() -> 3
 |