// Repro for issue 0060: a closure LITERAL passed directly as a function-type // argument, where the callee calls it with a literal, miscompiles. The working // contrast is examples/0302-closures-closures.sx, where the value flows in as a // SEPARATE argument (`apply(f, x) { return f(x); }`). // // Expected: block=10, arrow=10. Actual: block=192, arrow=20. #import "modules/std.sx"; apply :: (f: (s64) -> s64) -> s64 { return f(5); } main :: () { print("block={}\n", apply(closure((x: s64) -> s64 { return x * 2; }))); // want 10 print("arrow={}\n", apply(closure((x: s64) -> s64 => x * 2))); // want 10 }