//ww:error "calling non-function" // #14: a deref-less call through a pointer-to-pointer-to-fn (`pf(21)` where // pf: **fn) is a hard reject in BOTH stages. The #181-cgen path lowers an // indirect call by using the callee VALUE as the target, so it autoderefs // exactly ONE pointer level — correct for a single `*fn`, but for a `**fn` // the value is only the *address of* the fn-ptr, so a deref-less call ships // a CALL through that address and segfaults. cstage rejected at one-level // peel (cmd/wcc/check.c:1947); wwstage was the SILENT-miscompile side until // it was aligned DOWN to the same one-level peel (selfhost/cmd/wcc/check.ww, // task #14). Multi-level fn-ptr autoderef is a deferred FEATURE (#181); the // legal one-explicit-deref `(*pf)(21)` stays accepted (test/lang/ // fnptr_derefless_call_test.ww derefless_pp_one_explicit_deref). REVERT // MANIFESTATION: revert the wwstage peel loop->if and this case COMPILES // again under w6c_ww (the runww ERROR arm runs both stages). package main; fn add1(x: i32) i32 = { return x + 21; }; export fn main() i32 = { let f: *fn(x: i32) i32 = &add1; let pf: **fn(x: i32) i32 = &f; return pf(21); };