-
-
Notifications
You must be signed in to change notification settings - Fork 836
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
feat[ux]: allow conversion of bytestring literals to bytes_M #4480
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #4480 +/- ##
==========================================
- Coverage 92.12% 92.07% -0.06%
==========================================
Files 119 120 +1
Lines 16962 17340 +378
Branches 2872 2935 +63
==========================================
+ Hits 15626 15965 +339
- Misses 919 957 +38
- Partials 417 418 +1 ☔ View full report in Codecov by Sentry. |
…/convert_literal_bytestring
i think maybe instead of actually implementing the compile-time evaluation, we should just mark it as |
In order to mark it as a constant, wouldn't we need to perform compile-time evaluation even earlier at the stage of `vyper/semantics/analysis/constant_folding.py? Otherwise, the checks in |
that's one way to do it, but we don't even need to go that far
i think that's fine, the user can do |
If I understood correctly, what we want is to be able to set the value for a constant as |
What I did
Allow compile-time evaluation of
convert("VYPER", bytes5)
for literal bytestrings.How I did it
Add a branch to handle conversion from literal bytestrings to bytes_M.
How to verify it
Commit message
Description for the changelog
Allow conversion of bytestring literals to bytes_M
Cute Animal Picture