Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

explicit-types autofix issues #549

Closed
noisekit opened this issue Feb 13, 2024 · 3 comments
Closed

explicit-types autofix issues #549

noisekit opened this issue Feb 13, 2024 · 3 comments

Comments

@noisekit
Copy link

noisekit commented Feb 13, 2024

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

@dbale-altoros
Copy link
Collaborator

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

@dbale-altoros
Copy link
Collaborator

@noisekit
made fix here
#551

now it seems to be working

@noisekit
Copy link
Author

noisekit commented Mar 6, 2024

Thanks. Will wait for the next release 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants