-
Notifications
You must be signed in to change notification settings - Fork 47
Retain references to ImportDeconstructionSymbols instead of following to the aliased definition
#1510
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
base: main
Are you sure you want to change the base?
Retain references to ImportDeconstructionSymbols instead of following to the aliased definition
#1510
Conversation
If an identifier resolves lexically to an `ImportDeconstructionSymbol` definition, register that instead of skipping it and registering to the actual aliased definition. This allows keeping better track of referenced imports. The conterpart is that we need to explicitly follow through the aliases whenever we need access to the actual definition, eg. when resolving types, members, etc.
|
teofr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mainly some questions to understand the change better.
crates/solidity/outputs/cargo/crate/src/backend/ir/ast/node_extensions/identifiers.rs
Outdated
Show resolved
Hide resolved
crates/solidity/outputs/cargo/crate/src/backend/ir/ast/node_extensions/identifiers.rs
Show resolved
Hide resolved
crates/solidity/outputs/cargo/crate/src/backend/passes/p3_linearise_contracts/mod.rs
Show resolved
Hide resolved
crates/solidity/outputs/cargo/crate/src/backend/passes/p4_type_definitions/resolution.rs
Show resolved
Hide resolved
…tensions/identifiers.rs Co-authored-by: Teodoro Freund <[email protected]>
crates/solidity/outputs/cargo/crate/src/backend/ir/ast/node_extensions/identifiers.rs
Outdated
Show resolved
Hide resolved
teofr
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Sorry for the annoying nits.
If an identifier resolves lexically to an
ImportDeconstructionSymboldefinition, register that instead of skipping it and registering to the actual aliased definition. This allows keeping better track of referenced imports, which would otherwise appear to have no references pointing to them.The drawback is that we need to explicitly follow through the aliases whenever we need access to the actual definition, eg. when resolving types, members, etc.