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

Usage of kwargs not prevented for range(N,M) or range(x,x+N) #3550

Closed
trocher opened this issue Aug 4, 2023 · 0 comments · Fixed by #3551
Closed

Usage of kwargs not prevented for range(N,M) or range(x,x+N) #3550

trocher opened this issue Aug 4, 2023 · 0 comments · Fixed by #3551

Comments

@trocher
Copy link
Contributor

trocher commented Aug 4, 2023

Version Information

  • vyper Version (output of vyper --version): 0.3.10+commit.855f7349
  • OS: OSX
  • Python Version (output of python --version): 3.11.4

What's your issue about?

Using the keyword argument bound for ranges on the form range(N, M) and range(x, x + N) is not syntactically forbidden. The generated bytecode of the following examples is identical to the one that would have been generated without having the bound keyword.

@external
def bar():
    for i in range(1,2,bound=2):
        pass
@external
def bar():
    x:uint256 = 1
    for i in range(x,x+1,bound=2):
        pass

How can it be fixed?

Only allow ranges on the form range(N) to have kwargs.

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