Files
sx/issues/0112-int-literal-out-of-range-silent-wrap.sx
agra e81780e32e fix(0111): unannotated decl literals no longer adopt the fn return type
lowerVarDecl (unannotated) and lowerDestructureDecl now clear target_type
around the initializer lowering: a declaration without annotation provides
no target, so int/float literals take their spec defaults (s64/f64) instead
of the enclosing function's implicit-return type (x := 0 in a -> s8 fn was
s8; big := 3000000000 in -> s32 silently wrapped to -1294967296).

Regression: examples/0173-types-int-literal-default-s64.sx. The remaining
explicit-annotation wrap (x : s8 = 300) is filed as issue 0112.
2026-06-10 17:21:44 +03:00

9 lines
128 B
Plaintext

#import "modules/std.sx";
main :: () {
x : s8 = 300;
print("x: {}\n", x);
y : u8 = 256;
print("y: {}\n", y);
}