solhint icon indicating copy to clipboard operation
solhint copied to clipboard

no-empty-blocks false positive in inherited constructor

Open quezak opened this issue 5 years ago • 4 comments

Hello! I'm migrating from ethlint and found the same issue that I reported there some time ago :)

In an inherited contract, the constructor often just calls the base constructor, and its block is empty. This should be an exception from the no-empty-block rule, but now it causes a warning Code contains empty block.

Copied from the official example.

contract Base {
    uint x;
    constructor(uint _x) { x = _x; }
}

// or through a "modifier" of the derived constructor.
contract Derived2 is Base {
    constructor(uint _y) Base(_y * _y) {}
}

quezak avatar Jul 31 '20 13:07 quezak

Yes, this makes a lot of sense! Should be easy to implement. I can give you some pointers if you feel like giving this a shot. If not, I'll try to fix it soon.

fvictorio avatar Aug 05 '20 14:08 fvictorio

same issue here.

emretepedev avatar Jun 22 '22 09:06 emretepedev

Ethlint did address this issue duaraghav8/Ethlint/issues/264

Any thoughts on this one?

Janther avatar Jun 25 '22 04:06 Janther

Same here as well.

johnnyshankman avatar Jul 08 '22 05:07 johnnyshankman

@fvictorio any progress here?

sebastianst avatar Nov 30 '22 15:11 sebastianst