mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			304 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			304 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
contract A {
 | 
						|
    uint x;
 | 
						|
    constructor() {
 | 
						|
        x = 42;
 | 
						|
    }
 | 
						|
    function f() public returns(uint256) {
 | 
						|
        return x;
 | 
						|
    }
 | 
						|
}
 | 
						|
contract B is A {
 | 
						|
    uint public y = f();
 | 
						|
}
 | 
						|
// ====
 | 
						|
// compileToEwasm: also
 | 
						|
// compileViaYul: true
 | 
						|
// ----
 | 
						|
// constructor() ->
 | 
						|
// gas irOptimized: 122233
 | 
						|
// y() -> 42
 |