A program stays one compilation, which is why a generic's body is always there

This commit is contained in:
Joseph Ferano 2026-09-25 10:10:33 +07:00
parent 9cc820cb52
commit 96b7ffb654

View File

@ -737,10 +737,12 @@ call site that asked for that type. The data is there — =instantiation_origin=
exists and the session already uses it — and wiring it into every failure under an
instantiation is a lane of its own.
** TODO Generics across a real compilation-unit boundary
It works today because =Load= flattens imports before checking. A package boundary
that ever becomes a real unit boundary needs the generic's body to cross it, which
separate compilation cannot do — which is why C++ puts templates in headers.
** DONE A program is one compilation, so a generic's body is always visible
CLOSED: [2026-09-25]
Odin's and Zig's model: packages are never compiled separately. The cost is build
time proportional to the whole program and no binary-only packages. If separate
compilation is ever wanted, Rust's answer is the one to take — a compiled package
carries its generics' checked bodies and the user instantiates them.
** DONE Collapsing the prelude buys 27 to 15, not 27 to 6
CLOSED: [2026-09-13]