-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Clean-up lookup functions in semanal.py #4157
Comments
I think we need to fix this soon. Already three lookup functions and two lookup helpers sneaked in the plugin API (which is I believe too many). |
(Added the new analyzer label. Although it is not specific to the new analyzer, it is a great opportunity to clean things up.) |
There also exist several lookup funcs in checker.py. I just have a glanced at them and it seems they share the same logic with those in other files. Shall we extract them to lookup.py? |
Yeah, I think moving everything to one place should be good. |
Removes the redundant lookup funcs in fixup.py. Related to #4157. * Removes lookup_qualified_stnode: uncessary nested call to lookup_fully_qualified. * Removes lookup_qualified: inconsistency return types with other lookup_qualified funcs. Let the callers extract the SymbolNode from the SymbolTableNode.
Second pass of semantic analysis has 6 lookup functions:
lookup
lookup_qualified
lookup_fully_qualified
lookup_fully_qualified_or_none
lookup_type_node
plus 3 related helpers:
builtin_type
named_type
named_type_or_none
I think 9 lookup functions is too much and can cause confusions (this happened to me several times). I think we can leave only 3 lookup functions plus 2 helpers.
The text was updated successfully, but these errors were encountered: