lang: rename signed integer types sN -> iN
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.
This commit is contained in:
@@ -52,7 +52,7 @@ test "protocols: getProtocolInfo resolves registered protocol structs only" {
|
||||
try std.testing.expectEqual(@as(usize, 1), info.methods.len);
|
||||
|
||||
// A builtin and an unrelated plain struct are not protocols.
|
||||
try std.testing.expect(pr.getProtocolInfo(.s32) == null);
|
||||
try std.testing.expect(pr.getProtocolInfo(.i32) == null);
|
||||
const plain = module.types.intern(.{ .@"struct" = .{ .name = module.types.internString("Point"), .fields = &.{} } });
|
||||
try std.testing.expect(pr.getProtocolInfo(plain) == null);
|
||||
|
||||
@@ -162,8 +162,8 @@ test "protocols: registerParamImpl flags a same-file duplicate impl" {
|
||||
const pr = ProtocolResolver{ .l = &l };
|
||||
_ = module.types.intern(.{ .@"struct" = .{ .name = module.types.internString("IntCell"), .fields = &.{} } });
|
||||
|
||||
// impl Into(s64) for IntCell { ... } — a parameterised-protocol impl.
|
||||
const args = [_]*Node{typeExpr(alloc, "s64")};
|
||||
// impl Into(i64) for IntCell { ... } — a parameterised-protocol impl.
|
||||
const args = [_]*Node{typeExpr(alloc, "i64")};
|
||||
const conv = mk(alloc, .{ .fn_decl = .{ .name = "convert", .params = &.{}, .return_type = null, .body = emptyBody(alloc) } });
|
||||
const methods = [_]*Node{conv};
|
||||
const ib = ast.ImplBlock{
|
||||
@@ -218,8 +218,8 @@ test "protocols: findVisibleImpls filters by transitive import visibility" {
|
||||
var l = Lowering.init(&module);
|
||||
const pr = ProtocolResolver{ .l = &l };
|
||||
|
||||
const here_entry: Lowering.ParamImplEntry = .{ .methods = &.{}, .source_ty = .s64, .target_args = &.{}, .defining_module = "a.sx", .span = .{ .start = 0, .end = 0 } };
|
||||
const other_entry: Lowering.ParamImplEntry = .{ .methods = &.{}, .source_ty = .s64, .target_args = &.{}, .defining_module = "b.sx", .span = .{ .start = 0, .end = 0 } };
|
||||
const here_entry: Lowering.ParamImplEntry = .{ .methods = &.{}, .source_ty = .i64, .target_args = &.{}, .defining_module = "a.sx", .span = .{ .start = 0, .end = 0 } };
|
||||
const other_entry: Lowering.ParamImplEntry = .{ .methods = &.{}, .source_ty = .i64, .target_args = &.{}, .defining_module = "b.sx", .span = .{ .start = 0, .end = 0 } };
|
||||
const entries = [_]Lowering.ParamImplEntry{ here_entry, other_entry };
|
||||
|
||||
// No source-file context → falls open (all entries visible).
|
||||
@@ -279,6 +279,6 @@ test "protocols: matchPackImpl selects a pack impl whose prefix + return match"
|
||||
try std.testing.expectEqual(TypeId.void, m.src_ret);
|
||||
|
||||
// A non-closure source does not match; an unknown key does not match.
|
||||
try std.testing.expect(pr.matchPackImpl(.s64, pack_key) == null);
|
||||
try std.testing.expect(pr.matchPackImpl(.i64, pack_key) == null);
|
||||
try std.testing.expect(pr.matchPackImpl(src, "Into\x00Nope") == null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user