-
-
Notifications
You must be signed in to change notification settings - Fork 807
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
Folding Not Supported in Certain Locations #4190
Labels
Comments
One more location to add: default values. Example:
does not compile with:
|
this one is expected behavior i think, since |
The following have been fixed in 75fb059:
|
The |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version Information
vyper --version
OR linkable commit hash vyperlang/vyper@): b43ffacIssue Description
Several Vyper constructs require or can be optimized if constant values
are provided. To achieve this, AST nodes can be folded to constants by
the compiler, however, the following locations do not support folding:
length
inslice(x, start, length)
whenx
ismsg.data
oraddress.code
:length
inslice(x, start, length)
:index
invariable[index]
when the variable is an array.index
invariable[index]
when the variable is a tuple.x
ory
inx ** y
:x
inconvert(x, T)
topic
inraw_log(topic, data)
.POC
The following example demonstrates the different issues.
The text was updated successfully, but these errors were encountered: