diff --git a/contracts/Inheritance.sol b/contracts/Inheritance.sol new file mode 100644 index 0000000..6ae2357 --- /dev/null +++ b/contracts/Inheritance.sol @@ -0,0 +1,26 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.0; + +abstract contract Parent1 { + constructor(uint x) {} + + function _testParent1() internal {} +} + +abstract contract Parent2 { + constructor(uint y) {} +} + +abstract contract Parent3 { + constructor(uint z) {} +} + +abstract contract Child1 is Parent1 {} + +abstract contract Child2 is Parent1, Parent2 {} + +abstract contract Child3 is Parent1, Parent2, Child2 {} + +abstract contract Child4 is Parent1, Parent2, Parent3 { + constructor(uint c) {} +} diff --git a/contracts/Test.sol b/contracts/Test.sol index 2cde8a0..1136fb2 100644 --- a/contracts/Test.sol +++ b/contracts/Test.sol @@ -118,30 +118,6 @@ contract Concrete2 is Abs { uint public override abs = 42; } -abstract contract Parent1 { - constructor(uint x) {} - - function _testParent1() internal {} -} - -abstract contract Parent2 { - constructor(uint y) {} -} - -abstract contract Parent3 { - constructor(uint z) {} -} - -abstract contract Child1 is Parent1 {} - -abstract contract Child2 is Parent1, Parent2 {} - -abstract contract Child3 is Parent1, Parent2, Child2 {} - -abstract contract Child4 is Parent1, Parent2, Parent3 { - constructor(uint c) {} -} - contract Types { enum Enum { A diff --git a/src/core.test.ts.md b/src/core.test.ts.md index 7194a6e..5bf1c20 100644 --- a/src/core.test.ts.md +++ b/src/core.test.ts.md @@ -84,6 +84,91 @@ Generated by [AVA](https://avajs.dev). > Snapshot 4 + `// SPDX-License-Identifier: UNLICENSED␊ + ␊ + pragma solidity >=0.6.0;␊ + ␊ + import "../contracts/Inheritance.sol";␊ + ␊ + contract $Parent1 is Parent1 {␊ + bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ + ␊ + constructor(uint256 x) Parent1(x) {}␊ + ␊ + function $_testParent1() external {␊ + super._testParent1();␊ + }␊ + ␊ + receive() external payable {}␊ + }␊ + ␊ + contract $Parent2 is Parent2 {␊ + bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ + ␊ + constructor(uint256 y) Parent2(y) {}␊ + ␊ + receive() external payable {}␊ + }␊ + ␊ + contract $Parent3 is Parent3 {␊ + bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ + ␊ + constructor(uint256 z) Parent3(z) {}␊ + ␊ + receive() external payable {}␊ + }␊ + ␊ + contract $Child1 is Child1 {␊ + bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ + ␊ + constructor(uint256 x) Parent1(x) {}␊ + ␊ + function $_testParent1() external {␊ + super._testParent1();␊ + }␊ + ␊ + receive() external payable {}␊ + }␊ + ␊ + contract $Child2 is Child2 {␊ + bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ + ␊ + constructor(uint256 x, uint256 y) Parent1(x) Parent2(y) {}␊ + ␊ + function $_testParent1() external {␊ + super._testParent1();␊ + }␊ + ␊ + receive() external payable {}␊ + }␊ + ␊ + contract $Child3 is Child3 {␊ + bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ + ␊ + constructor(uint256 x, uint256 y) Parent1(x) Parent2(y) {}␊ + ␊ + function $_testParent1() external {␊ + super._testParent1();␊ + }␊ + ␊ + receive() external payable {}␊ + }␊ + ␊ + contract $Child4 is Child4 {␊ + bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ + ␊ + constructor(uint256 x, uint256 y, uint256 z, uint256 c) Parent1(x) Parent2(y) Parent3(z) Child4(c) {}␊ + ␊ + function $_testParent1() external {␊ + super._testParent1();␊ + }␊ + ␊ + receive() external payable {}␊ + }␊ + ` + +> Snapshot 5 + `// SPDX-License-Identifier: UNLICENSED␊ ␊ pragma solidity >=0.6.0;␊ @@ -292,82 +377,6 @@ Generated by [AVA](https://avajs.dev). receive() external payable {}␊ }␊ ␊ - contract $Parent1 is Parent1 {␊ - bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ - ␊ - constructor(uint256 x) Parent1(x) {}␊ - ␊ - function $_testParent1() external {␊ - super._testParent1();␊ - }␊ - ␊ - receive() external payable {}␊ - }␊ - ␊ - contract $Parent2 is Parent2 {␊ - bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ - ␊ - constructor(uint256 y) Parent2(y) {}␊ - ␊ - receive() external payable {}␊ - }␊ - ␊ - contract $Parent3 is Parent3 {␊ - bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ - ␊ - constructor(uint256 z) Parent3(z) {}␊ - ␊ - receive() external payable {}␊ - }␊ - ␊ - contract $Child1 is Child1 {␊ - bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ - ␊ - constructor(uint256 x) Parent1(x) {}␊ - ␊ - function $_testParent1() external {␊ - super._testParent1();␊ - }␊ - ␊ - receive() external payable {}␊ - }␊ - ␊ - contract $Child2 is Child2 {␊ - bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ - ␊ - constructor(uint256 x, uint256 y) Parent1(x) Parent2(y) {}␊ - ␊ - function $_testParent1() external {␊ - super._testParent1();␊ - }␊ - ␊ - receive() external payable {}␊ - }␊ - ␊ - contract $Child3 is Child3 {␊ - bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ - ␊ - constructor(uint256 x, uint256 y) Parent1(x) Parent2(y) {}␊ - ␊ - function $_testParent1() external {␊ - super._testParent1();␊ - }␊ - ␊ - receive() external payable {}␊ - }␊ - ␊ - contract $Child4 is Child4 {␊ - bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ - ␊ - constructor(uint256 x, uint256 y, uint256 z, uint256 c) Parent1(x) Parent2(y) Parent3(z) Child4(c) {}␊ - ␊ - function $_testParent1() external {␊ - super._testParent1();␊ - }␊ - ␊ - receive() external payable {}␊ - }␊ - ␊ contract $Types is Types {␊ bytes32 public __hh_exposed_bytecode_marker = "hardhat-exposed";␊ ␊ diff --git a/src/core.test.ts.snap b/src/core.test.ts.snap index 8fb71bc..4efaea4 100644 Binary files a/src/core.test.ts.snap and b/src/core.test.ts.snap differ