You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Another improvement to the Vyper AST would be disambiguating calls and references to state variables from accesses to field of structure types. This is something that Solidity has done poorly and it creates a lot of complexity in the AST especially as the language has evolved and expressions like X.Y can represent a whole host of constructs. Below is an example of several instances of this in Vyper. In order to resolve shadowing like self.caller = caller, it requires keeping track of context like the namespace is self rather than just explicitly distinguishing that this is a reference to a state variable. Accessing attributes of self like balance and address could also be made distinct from variables or fields by creating a unique representation in the AST. This eliminates a lot of special casing, branching, and other complexities required in consumers of the AST by representing precisely info the Vyper has already gathered during compilation.
Version Information
vyper --version
): 0.3.7python --version
): 3.11What's your issue about?
Another improvement to the Vyper AST would be disambiguating calls and references to state variables from accesses to field of structure types. This is something that Solidity has done poorly and it creates a lot of complexity in the AST especially as the language has evolved and expressions like
X.Y
can represent a whole host of constructs. Below is an example of several instances of this in Vyper. In order to resolve shadowing likeself.caller = caller
, it requires keeping track of context like the namespace isself
rather than just explicitly distinguishing that this is a reference to a state variable. Accessing attributes ofself
likebalance
andaddress
could also be made distinct from variables or fields by creating a unique representation in the AST. This eliminates a lot of special casing, branching, and other complexities required in consumers of the AST by representing precisely info the Vyper has already gathered during compilation.How can it be fixed?
Make field access distinct from referring to state variables or calls like
SELFBALANCE
andADDRESS
The text was updated successfully, but these errors were encountered: