This commit is contained in:
@@ -129,6 +129,21 @@ static const struct row rows[] = {
|
||||
" if (len(tbl) != 3) { return 1; };\n"
|
||||
" return 0;\n"
|
||||
"};\n", 0, K_RUN, NULL },
|
||||
/* #119: scalar &fn module-globals — DISTINCT fns, each called back
|
||||
* through the reloc (pre-#119: no DATA → undefined ref / garbage). */
|
||||
{ "scalar_fnptr",
|
||||
"package main;\n"
|
||||
"fn fa(c: rune) bool = { return c == 'a'; };\n"
|
||||
"fn fz(c: rune) bool = { return c == 'z'; };\n"
|
||||
"let pf: *fn(c: rune) bool = &fa;\n"
|
||||
"let pg: *fn(c: rune) bool = &fz;\n"
|
||||
"export fn main() i32 = {\n"
|
||||
" if (!(*pf)('a')) { return 1; };\n"
|
||||
" if ((*pf)('z')) { return 2; };\n"
|
||||
" if (!(*pg)('z')) { return 3; };\n"
|
||||
" if ((*pg)('a')) { return 4; };\n"
|
||||
" return 0;\n"
|
||||
"};\n", 0, K_RUN, NULL },
|
||||
/* honest boundary (rule 7): a non-tuple aggregate element (here a
|
||||
* bare []str) stays LOUD, symmetric both stages — #117 is NARROW to
|
||||
* the (str,*fn) tuple form, not the full slice-of-aggregate family. */
|
||||
|
||||
Reference in New Issue
Block a user