Closed andersfugmann closed 8 months ago
The PR is split in three commits.
get_scoped_name
to return correctly scoped name. string list
rather than as a concatenated string I don't think a deep review is needed as the code is reasonably tested, but I do appreciate comments on coding style and other comments.
The current lookup function (
Scope.get_scoped_name
) did not account for Ocaml's name resolution when constructing a name. This lead to:Example:
In the above case,
a1
would resolve to the wrong A, anda2
cannot be resolved if the package decl is removed.The new solution follows the Ocaml's name resolution to build the shortest symbol reference, and will raise an error if no solution can be found.
The PR also changes package module names to be recursive modules to allow referencing top level from within sub-modules.
It could potentially be possible to inject a new unique module name if the current scoping does no contain usable unique names, but that's for another PR.