// Regression: extractvalue {ptr,ptr} on ptr function pointer. // // When a function was stored in a local variable and later called, the // stage4 emitter's emitCall function assumed all indirect call targets // were {ptr,ptr} closure structs. But a loaded function pointer is a bare // ptr. The emitter generated extractvalue {ptr,ptr} on a ptr-typed value, // producing: "error: '%t48' defined with type 'ptr' but expected // '{ ptr, ptr }'" from clang. // // Reproduces: store a function in a variable, then call it. // Fixed in: pkg/emit/calls.mx (SSAType-based needsExtract check). package main func greet() { println("hello") } func main() { f := greet f() }