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.
31 lines
1.1 KiB
Plaintext
31 lines
1.1 KiB
Plaintext
// A `*self`-mutating streaming pattern with NON-reserved binding names
|
|
// (`hasher`, `ctx`) compiles and accumulates state correctly through BOTH
|
|
// call styles — explicit address-of `update(@h, ...)` and autoref
|
|
// `h.update(...)` — across multiple mutating calls. Proves the
|
|
// `.identifier`-only address-of paths in lowering are correct as-is, with no
|
|
// type-shaped-name special-case (companion to the issue-0076 rejection of
|
|
// type-named identifiers).
|
|
#import "modules/std.sx";
|
|
|
|
Hasher :: struct { total: i64 = 0; count: i64 = 0; }
|
|
|
|
update :: ufcs (self: *Hasher, n: i64) {
|
|
self.total += n;
|
|
self.count += 1;
|
|
}
|
|
|
|
main :: () -> i32 {
|
|
hasher := Hasher.{ total = 0, count = 0 };
|
|
update(@hasher, 10); // explicit address-of receiver
|
|
hasher.update(20); // autoref receiver
|
|
update(@hasher, 30);
|
|
hasher.update(40);
|
|
print("hasher total={} count={}\n", hasher.total, hasher.count);
|
|
|
|
ctx := Hasher.{ total = 100, count = 0 };
|
|
ctx.update(5);
|
|
update(@ctx, 7);
|
|
print("ctx total={} count={}\n", ctx.total, ctx.count);
|
|
return 0;
|
|
}
|