// Entry-point signature gate (ERR step E4.2). `main` must take no parameters // and have a single-slot return: void, an integer (POSIX exit code), or `-> !` // (the error tag rides the single return register). Anything else is a clean // diagnostic — previously `main :: () -> string` SEGFAULTED (the JIT calls main // as `() -> i32`, so a string return is read as garbage). The value-carrying // failable `-> (T, !)` is also rejected for now: its multi-slot return ABI- // mismatches the entry-point call (lands with the E4.2 wrapper). Accepted // shapes are exercised elsewhere (e.g. 238 for integer-exit truncation). // This file is expected to FAIL compilation (exit 1). // // Run: ./zig-out/bin/sx run examples/239-main-signature-reject.sx #import "modules/std.sx"; main :: () -> string { // ERROR: return type must be void, an integer, or `!` return "not an exit code"; }