Auto-import bare RawBuf in type-constructor positions, not only op positions #50
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The kernel-tier auto-import makes a bare
RawBufresolve to the kerneltype
raw_buf.RawBufin value/op positions ((new RawBuf ...),RawBuf.get, etc.), but NOT in a type-constructor position inside auser ADT field declaration. A field typed
(con RawBuf (con Int))stays the unqualified
RawBuf<Int>and does not unify withraw_buf.RawBuf<Int>, so a RawBuf cannot be stored in a user ADT fieldunless the author spells the qualified
raw_buf.RawBuf.This is the
Seriessubstrate shape (the design ledger describesSeries aas a RawBuf wrapped in a user ADT with bookkeeping —design/models/0007-kernel-extensions.md §Series), so the inconsistency
will be hit by the pending series milestone.
Reproduction (verified, current HEAD)
Bare
RawBuffield type — rejected:Qualified
raw_buf.RawBuffield type — works:So storing a RawBuf in a user ADT field, reading it through a borrow,
and the drop cascade (the ADT's drop frees the RawBuf slab) all work
correctly with the qualified name; only the bare-name resolution in the
type-constructor position is missing.
Impact
A downstream author following the auto-import story (bare
RawBufworkswithout an import) gets a confusing type-mismatch the moment they wrap a
RawBuf in their own type, with no hint that the qualified
raw_buf.RawBufis required. The op-position and type-position handling of the same
auto-imported name diverge.
Context
Found probing the RawBuf-in-ADT substrate during the raw-buf usability
repair (commits 75109f1..d5cc6e9, fieldtest docs/specs/0058). Not a
regression from that work; the auto-import has always been op-position
only. Adjacent to issue #34 (workspace search path) and #14, but
distinct: this is name-resolution of an auto-imported kernel type in a
type-constructor position.
Acceptance
(con RawBuf (con Int))resolvesto
raw_buf.RawBuf<Int>and checks/builds/runs