Surface rename of the signed integer family: s1..s64 become i1..i64
(u1..u64, usize, isize unchanged). 'string' keeps the s-prefix arm in
name classification; width parsing moves to the i-prefix arm next to
isize.
Internal TypeId tags follow the surface (.s8/.s16/.s32/.s64 ->
.i8/.i16/.i32/.i64), as do mono-key mangle fragments (ptr_i64,
tu_i64_bool) and all display/diagnostic formatting (i{d}).
Migrated in the same sweep: stdlib + examples + issue repros + FFI C
companions (shared symbol names like ffi_id_i64), expected
stdout/stderr/ir snapshots, specs.md, readme.md, CLAUDE.md/AGENTS.md,
implementation_plan.md, docs/, issue writeups. Vendored stb_image and
historical flow state left untouched.
zig build test: 426/426; examples suite: 595/595.
25 lines
1.2 KiB
Plaintext
25 lines
1.2 KiB
Plaintext
// A caller-owned helper passed as a comptime-ONLY `$`-arg to a NAMESPACED
|
|
// imported metaprogram resolves in the CALLER's visibility context — not the
|
|
// metaprogram's defining module (regression, issue 0106 follow-up).
|
|
//
|
|
// `emit` is reachable only as `m.emit`; the comptime arg `caller_name()` is
|
|
// authored HERE in the caller. When `emit` splices that arg into its `#insert`
|
|
// body and lowers it, the bare name `caller_name` must stay visible in the
|
|
// caller's context. Before the fix, the body's defining-module pin also covered
|
|
// the substituted caller arg, so `caller_name` was wrongly checked against
|
|
// `emit.sx` and rejected as "not visible". The metaprogram's OWN code still
|
|
// resolves in `emit.sx` (where `concat`/`print` are flat-imported), so this
|
|
// stays compatible with the 0106 defining-context pin.
|
|
//
|
|
// Comptime-ONLY: `caller_name()` is evaluated at compile time and its value is
|
|
// embedded as a literal in the generated `print(...)` statement — it is never
|
|
// materialized at runtime (so this does NOT exercise issue 0107).
|
|
m :: #import "0738-modules-comptime-arg-caller-context/emit.sx";
|
|
|
|
caller_name :: () -> string { return "world"; }
|
|
|
|
main :: () -> i32 {
|
|
m.emit(caller_name());
|
|
return 0;
|
|
}
|