protofire/solhint

`explicit-types` autofix issues

noisekit opened this issue · 3 comments

After applying the rule to synthetix v3 codebase few issues were observed

  1. Parser crashes on syntax like type(uint).max and int(_price) because typeNameNode.typeName is undefined in this bit of code:
    fixer.replaceTextRange(
      typeNameNode.typeName.range,
      this.isExplicit ? EXPLICIT_TYPES[configFileIndex] : IMPLICIT_TYPES[configFileIndex]
    )
  2. Arrays are getting lost: uint[] memory result; is transformed into uint256 memory result;
  3. Mappings are getting lost: mapping(address => uint) is transformed into uint256

Some of the manual rollbacks can be seen in this commit Synthetixio/synthetix-v3@4295243

thanks a lot @noisekit for this and sorry for the delay
I will take a look at this!

@noisekit
made fix here
#551

now it seems to be working

Thanks. Will wait for the next release 🙏