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.
17 lines
849 B
Plaintext
17 lines
849 B
Plaintext
// issue 0105 / F4 — same-name VALUE const TYPE inference is source-aware. Two
|
|
// flat-imported modules each declare a top-level `K` with a DIFFERENT declared
|
|
// TYPE (A: `i32`, B: `f64`) and an inferred-return function that reads `K` bare.
|
|
// The inferred return type must come from each module's OWN `K` (own-wins), not
|
|
// the global last-wins const TYPE: `a_k` infers A's `i32` and yields the integer
|
|
// `1` (printed `1`, not `1.000000`), while `b_k` infers B's `f64` and yields
|
|
// `2.500000`. Selection routes through the source-aware `selectModuleConst`, the
|
|
// same author selector emission/folding use — type inference must agree.
|
|
#import "modules/std.sx";
|
|
#import "0793-modules-same-name-const-type-infer/a.sx";
|
|
#import "0793-modules-same-name-const-type-infer/b.sx";
|
|
|
|
main :: () -> i32 {
|
|
print("a={} b={}\n", a_k(), b_k());
|
|
0
|
|
}
|