Implement absolute paths with a leading :: - #29571
Draft
mohammadfawaz wants to merge 2 commits into
Draft
Conversation
A path written with a leading `::` (e.g. `::c::item`) is now anchored at the root module of the current program or library instead of resolving relative to the current module, so sibling modules can share a common submodule. Explicit program locators (e.g. `dep.aleo::Item`) are now also root-anchored rather than prefixed with the current module, which fixes resolution of external items referenced from inside a module.
mohammadfawaz
force-pushed
the
mohammadfawaz/28772
branch
2 times, most recently
from
July 2, 2026 23:56
fd82a1f to
c64f601
Compare
The fmt validate job type-checks each target fixture as a standalone file, so the absolute-paths fixture carries its own program block and root-level items. Review fixes: absolute paths consult imported libraries exactly like root-module relative paths; `::group::GEN` no longer canonicalizes to the group generator intrinsic; a bare `::` in type position produces a parse error instead of a panic; the absolute-prefix recovery is shared between the expression and type grammars; new parser errors quote `::`. The tree-sitter grammar accepts a leading `::` on path expressions and types, with corpus and rowan-compat coverage. `Path::absolute` is skipped during serialization when false, keeping the large AST snapshot expectations unchanged.
mohammadfawaz
force-pushed
the
mohammadfawaz/28772
branch
from
July 3, 2026 00:05
c64f601 to
f301d19
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Paths written with a leading
::(e.g.::c::item) are anchored at the root module of the current program or library, so sibling modules can share a common submodule. Explicit program locators (e.g.dep.aleo::Item) are now also root-anchored instead of being prefixed with the current module, fixing resolution of external items referenced from inside a module.Closes #28772. Closes #29561.