Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Solidity binding fixes driven by Sanctuary (#1149)
This PR contains fixes to bindings for issues that were found by trying to resolve all references in Sanctuary, as well as test cases to verify them. It also improves documentation of the rules and improvements (renames and rearrangements) for readability. The built-in types are also standardized with a PascalCase naming convention. Most notably, it introduces extension scopes to support resolving attached function set via `using` directives. These extension scopes need to be accessible at any point during the resolution of a symbol stack if the originating reference is located in a lexical scope which is affected by a `using` directive. This forced a refactor of the lexical scope node structure, introducing a new `.extended_scope` available in nodes where references may need to resolve to attached functions (ie. function bodies, constant initialization expressions, etc.) Also, for Solidity < 0.7.0 `using` directives are inherited, so we need to propagate the new extension scopes for all sub-contracts relative to where the directive is located. The extension scope mechanism is implemented using the _jump to scope_ and scope stack features of the stack graphs. The extended scope would optionally push the extension scope for the current contract and then continue resolution through the normal lexical scope. This effectively doubles the search space in the graph when performing a resolution, and this happens every time we inject a new extension scope to the scope stack. This has the potential to exponentially increase the running times and memory requirements. This is a known caveat which will be addressed in a future PR.
- Loading branch information