// A typed module-level constant whose initializer does not match its // annotation is a compile-time type error — not a silently-accepted const. // Each declaration below pairs a literal with an incompatible annotation, so // the compiler must emit a `type mismatch` diagnostic at the initializer and // abort (exit 1) rather than registering a usable const. // // Regression (issue 0088): `N : string : 4` was accepted; `print(N)` then // segfaulted (an integer emitted as a `string` const → a bogus pointer) and // `[N]s64` folded `N` to 4. The fix rejects the declaration at the root. #import "modules/std.sx"; N : string : 4; // integer literal where a string is annotated F : s64 : "x"; // string literal where an integer is annotated B : s64 : true; // boolean literal where an integer is annotated G : s64 : 1.5; // float literal where an integer is annotated main :: () { print("unreachable\n"); }