Skip to content

Better exception on invalid subscript#2177

Merged
fubuloubu merged 2 commits into
vyperlang:masterfrom
iamdefinitelyahuman:fix-subscript-error
Oct 9, 2020
Merged

Better exception on invalid subscript#2177
fubuloubu merged 2 commits into
vyperlang:masterfrom
iamdefinitelyahuman:fix-subscript-error

Conversation

@iamdefinitelyahuman

Copy link
Copy Markdown
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

codecov-commenter commented Oct 3, 2020

Copy link
Copy Markdown

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