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

Incorrect output while passing multi-dimensional array as argument #2183

Closed
saikat041 opened this issue Oct 7, 2020 · 1 comment · Fixed by #2184
Closed

Incorrect output while passing multi-dimensional array as argument #2183

saikat041 opened this issue Oct 7, 2020 · 1 comment · Fixed by #2184
Labels
bug Bug that shouldn't change language semantics when fixed.

Comments

@saikat041
Copy link
Contributor

Version Information

  • vyper Version: 0.2.4+commit.14327e9
  • OS: linux
  • Python Version: 3.6.9

What's your issue about?

When we pass a multi-dimensional array like [[1, 2]] as an argument to internal/external functions we get incorrect output.
The following test case fails:

def test_multiple_dim_array_as_argument(get_contract):
    code = """
@internal
def test_input(arr: int128[2][1], i: int128) -> (int128[2][1], int128):
    return arr, i

@external
def test_values(arr: int128[2][1], i: int128) -> (int128[2][1], int128):
    return self.test_input(arr, i)
    """

    c = get_contract(code)
    assert c.test_values([[1, 2]], 3) == [[[1, 2]], 3]

How can it be fixed?

Working on it

@iamdefinitelyahuman iamdefinitelyahuman added the bug Bug that shouldn't change language semantics when fixed. label Oct 7, 2020
@fubuloubu
Copy link
Member

Good find!

saikat041 added a commit to saikat041/vyper that referenced this issue Oct 8, 2020
fubuloubu added a commit that referenced this issue Oct 8, 2020
fix-#2183: Incorrect output while passing multi-dimensional array as argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug that shouldn't change language semantics when fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants