Loading
The source project of this merge request has been removed.
Fix several issues related to name resolving
Closes #358 (closed) Closes #191 (closed) Closes #139 (closed) Closes #300 (closed) Closes #274 (closed) Closes #155 (closed)
Helpful context for reviewing
std::convexisted, butstddidn't, which made lookup hard and errorprone, so I added a dummy module for that.- Looking at the SymbolTable, I saw that written modules showed up as
mod <their_name>whereas stdlib file modules were allmod std, found out that they used the first instead of their last path segment as a name and fixed that. - Made
lookup_type_symbol,lookup_variableand macro_generated lookup functions uselookup_final_idinstead of their own half-baked alias resolving thing lookup_final_idnow also keeps track of already used aliases and forbids them for the next lookuptry_lookup_idnow callslookup_idinstead of the other way around, to give errors more detailed context (same forlookup_final_id)lookup_id_with_forbiddenis now justlookup_idlookup_idnow searches for the first thing in the path if it can't find something directly, resolves that to an absolute path if it's an alias and prepends that on the given path.
Open stuff
lookup_id_in_namespacecurrently only changes the namespace, but not the base_namespace, which means that using an alias starting withlib::from another library would in theory use the wrong library.
This is probably fine tho because in add_alias we already expand the lib:: to the base namespace.
#358 (comment 2326833144) Better error message for this
Author checklist
- New Diagnostics have at least one snapshot test that triggers it
- Added a changelog entry, if relevant
- You can use
./add_changelog <MR number or a_descriptive_name>to do this
- You can use
Edited by DasLixou