mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			30 lines
		
	
	
		
			552 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			552 B
		
	
	
	
		
			Solidity
		
	
	
	
	
	
contract A {
 | 
						|
    uint public i;
 | 
						|
    uint public k;
 | 
						|
 | 
						|
    constructor(uint newI, uint newK) {
 | 
						|
        i = newI;
 | 
						|
        k = newK;
 | 
						|
    }
 | 
						|
}
 | 
						|
abstract contract B is A {
 | 
						|
    uint public j;
 | 
						|
    constructor(uint newJ) {
 | 
						|
        j = newJ;
 | 
						|
    }
 | 
						|
}
 | 
						|
contract C is A {
 | 
						|
    constructor(uint newI, uint newK) A(newI, newK) {}
 | 
						|
}
 | 
						|
contract D is B, C {
 | 
						|
    constructor(uint newI, uint newK) B(newI) C(newI, newK + 1) {}
 | 
						|
}
 | 
						|
// ----
 | 
						|
// constructor(): 2, 0 ->
 | 
						|
// gas irOptimized: 154331
 | 
						|
// gas legacy: 170115
 | 
						|
// gas legacyOptimized: 145429
 | 
						|
// i() -> 2
 | 
						|
// j() -> 2
 | 
						|
// k() -> 1
 |