Repository navigation
imports: qualified references follow the Rust model (core#290) - #193
Merged
Merged
Conversation
Rewrites the Imports guide for the rule (core#290): what each use brings in, full paths without a use, walking down from a name in scope, aliases replacing the name, defined twice, and the three errors. Marks the proposal section built and notes the superseded 2026-10-04 design decision.
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.
Closes #191
Rewrites
guides/idl/use.mdfor the rule that shipped in core#297 (core#290, merged as 69039e7). The accepted and refused forms, and the diagnostic codes, are the ones in the specification'scompiler/src/references.cue(specification#17, #18).In
use.md:usebrings in only its name, a glob brings in the names and not the namespace.usebrings in and how to write the type after it (a dependency too,use greetingincluded).use(package::,parent::,self::,std::, a dependency's name), walking down from a name in scope, and one type however it is written (frozen as its resolved path).use package::types as t,types::Useris refused.reference::not-in-scope,reference::qualifier-not-in-scopeandreference::defined-twice, with when each happens and its fix, and every error being reported at once.use typse::Usersuggestion is nowpackage::types::User(core#286).comline fixacross a package (cli#162), and non-type names (validators, constants, thrown errors) still read the old way (core#298).Elsewhere:
proposals/use-paths-and-groups/relative-use.md: the Qualified references section is marked built, with links to core#290 and core#297, in the> **Built**form ofschema-compatibility.md; the "as built" paragraph about core#285 is now in the past tense; core#289 is noted as fixed by core#294.proposals/index.md: the entry says what of the proposal is built.design/editor-dependency-packages.md: decision 2 (whole-namespace imports bring names in bare) is marked superseded, since it is the opposite of the rule.guides/idl/index.md: one sentence on how a type is written after ause.Checked and left alone: every other
usein anidsblock in the docs (guides/idl/index.md,validator.md,const.md, the std examples) is an item or{ ... }usefollowed by bare names, which the rule accepts. The docs have no diagnostics reference page, so there is nowhere else to add the three codes.Not run locally; the docs build runs in CI.