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

Expected single expr evaluation of index expression #54

Closed
maurelian opened this issue May 19, 2023 · 0 comments · Fixed by #62
Closed

Expected single expr evaluation of index expression #54

maurelian opened this issue May 19, 2023 · 0 comments · Fixed by #62

Comments

@maurelian
Copy link

maurelian commented May 19, 2023

Version:

➜ pyrometer --version
cli 0.1.0

Issue

This line in our repo triggers an error.

Error: Unexpected type as array index
     ╭─[contracts/L1/L2OutputOracle.sol:296:16]
     │
 296 │         return l2Outputs[getL2OutputIndexAfter(_l2BlockNumber)];
     │                ────────────────────────┬───────────────────────
     │                                        ╰───────────────────────── Expected single expr evaluation of index expression, but was: (Single(NodeIndex(2871)), Multi([Single(NodeIndex(2864))])). This is a bug. Please report it at github.com/nascentxyz/pyrometer.

The command I'm using is:

cd packages/contracts-bedrock
pyrometer contracts/L1/L2OutputOracle.sol --remappings remappings.txt

Repro

A minimal test case is:

contract Test28 is Test {
  bytes32[] public arr;

  constructor() {
    arr.push(hex"1234");
    arr.push(hex"5678");
  }

  function getNum() public pure returns (uint256) {
    return 1;
  }

  function test_pyrobug() external returns (bytes32) {
    return arr[getNum()];
  }
}
@brockelmore brockelmore linked a pull request Jun 1, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant