Split constant and method entries #1949
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
First step for #1950, which will unblock ancestor linearization
Currently, we are putting all types of entries in the same data structure, mixing constants and methods. This leads to the following issues:
Array
class andArray()
method. We end up having different types of entries for the same nameresolve_method
, we need to apply a bunch of casts since we know that the returned entry will be a methodImplementation
Created separate data structures for methods. We now have a separate hash and separate prefix tree for methods.
resolve_constant
andresolve_method
), I do not think this impacts the DX of using the index. We always know if something is a method call or a constant reference, there would never be a scenario where we are in doubt about which API to invokeAutomated Tests
Adapted our tests.