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.
9 lines
128 B
Plaintext
9 lines
128 B
Plaintext
#import "modules/std.sx";
|
|
|
|
main :: () {
|
|
x : s8 = 300;
|
|
print("x: {}\n", x);
|
|
y : u8 = 256;
|
|
print("y: {}\n", y);
|
|
}
|