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

fix[ux]: indexing empty literal arrays #4034

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tserg
Copy link
Collaborator

@tserg tserg commented May 20, 2024

What I did

Fix #4001

How I did it

  • Check if reduced value is a literal list in visit_Subscript in local visitor
  • Special handling for folding of dynamic arrays for empty builtin.

How to verify it

Commit message

fix: indexing empty literal array

This PR properly handles the exception for indexing into an 
empty literal array.

Description for the changelog

Cute Animal Picture

Put a link to a cute animal picture inside the parenthesis-->

@tserg tserg changed the title fix: indexing empty literal arrays fix[ux]: indexing empty literal arrays May 20, 2024
@charles-cooper
Copy link
Member

is that an axolotl?

@tserg
Copy link
Collaborator Author

tserg commented May 20, 2024

is that an axolotl?

yes ser

@charles-cooper
Copy link
Member

maybe we should add rules for all the other types?

@tserg
Copy link
Collaborator Author

tserg commented May 20, 2024

maybe we should add rules for all the other types?

do you mean to return a vyper node where possible in builtin(empty)._try_fold()?

@charles-cooper
Copy link
Member

do you mean to return a vyper node where possible in builtin(empty)._try_fold()?

yea, we might be able to remove some ~empty things in codegen (but i'm not sure, it's been awhile since that code has been touched)

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 this pull request may close these issues.

compiler panic on indexing empty literal arrays
2 participants