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

Fixed-size arrays code alignment #401

Open
dvpublic opened this issue Jul 15, 2023 · 0 comments
Open

Fixed-size arrays code alignment #401

dvpublic opened this issue Jul 15, 2023 · 0 comments

Comments

@dvpublic
Copy link

Fixed-size arrays are aligned as following

  function f(uint a, uint[4] memory b) internal {
    b[0] = a;
  }
  function callerF() internal {
    uint b = 1;
    bool c = false;
    f(
      4,
      [
        c ? 1 : 0,
      b,  // (!)
      5,  // (!)
        b == 2 ? 1 : 0
      ]
    );

it would be nice to have following aligning

  function f(uint a, uint[4] memory b) internal {
    b[0] = a;
  }
  function callerF() internal {
    uint b = 1;
    bool c = false;
    f(
      4,
      [
        c ? 1 : 0,
        b,
        5,
        b == 2 ? 1 : 0
      ]
    );
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

1 participant