Closed martong closed 5 years ago
The change is OK.
Probably a better solution is to include the ImportedFromDecls
in the lookup table (instead of calling the add-remove functions always in consistent way).
Probably a better solution is to include the ImportedFromDecls in the lookup table (instead of calling the add-remove functions always in consistent way).
That is indeed a good idea, however, the lookup table is independent from the 'from' context and it holds decls only for one context. So, perhaps a higher abstraction class would be the most proper, which holds both the ImportedFromDecls and the lookuptable.
Add/remove from the Lookuptable in consistency with ImportedFromDecls. When we map a decl in the 'to' context to something in the 'from' context then and only then we add it to the lookup table. When we remove a mapping then and only then we remove it from the lookup table.