-
Notifications
You must be signed in to change notification settings - Fork 22
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
Resolve references lazily #1228
base: main
Are you sure you want to change the base?
Conversation
|
Only don't include extensions when recursion is not allowed in resolution.
de03aee
to
0dad66e
Compare
…ol is pushed next This avoids a lot of extra work for the resolution when the identifier being resolved is a variable that has a type. Since the definition is found but then replace by the sequence `@typeof` and the type of the variable, which will never resolve. This path *is* used when resolving for members of the type of the variable.
This hopefully reduces resolution time when not all references (eg. those in dependencies) need to be resolved, but requires the
BindingGraph
to retain both theStackGraph
and theResolver
(with the database of partial path candidates and the partial paths arena).This PR also includes an optimization to the resolution algorithm. When selecting candidates to extend an already complete partial path, discard those that would immediately push a
@typeof
symbol (eg. through the path that replaces a variable by its type) since we know those will never resolve. This can halve the number of evaluated partial paths (ie. references that resolve to a variable/field definition) and provide a very significant performance gain in some cases.