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

Better exception on invalid subscript #2177

Merged
merged 2 commits into from
Oct 9, 2020

Conversation

iamdefinitelyahuman
Copy link
Contributor

What I did

Improve the exception raised on an invalid subscript.

How I did it

Prior to the general "Subscript must be a literal integer", first check that the subscript is a valid something. If it isn't, the exception raised can be more useful in determining what went wrong. For example, a typo in a constant variable name.

Cute Animal Picture

image

@codecov-commenter
Copy link

codecov-commenter commented Oct 3, 2020

Codecov Report

Merging #2177 into master will increase coverage by 0.02%.
The diff coverage is 80.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2177      +/-   ##
==========================================
+ Coverage   85.32%   85.34%   +0.02%     
==========================================
  Files          83       83              
  Lines        8403     8408       +5     
  Branches     2032     2033       +1     
==========================================
+ Hits         7170     7176       +6     
+ Misses        731      730       -1     
  Partials      502      502              
Impacted Files Coverage Δ
vyper/context/validation/utils.py 91.70% <80.00%> (+0.75%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a0c561c...6ef2d7f. Read the comment docs.

@fubuloubu fubuloubu merged commit 0b456c8 into vyperlang:master Oct 9, 2020
@iamdefinitelyahuman iamdefinitelyahuman deleted the fix-subscript-error branch October 9, 2020 17:36
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.

3 participants