Summary
Storing function references in an array (`[func]`) passes typechecking but fails at C compilation. The codegen emits `int64_t[]` for the element storage instead of function pointer types.
Reproduction
```ez
do add(a int, b int) -> int { return a + b }
do sub(a int, b int) -> int { return a - b }
do main() {
mut ops [func] = {()add, ()sub}
println(ops[0](10, 3))
println(ops[1](10, 3))
}
```
Expected: Prints `13` then `7`
Actual: C compilation error: `incompatible pointer to integer conversion`
Where to Fix
`ezc/src/codegen/codegen.c` — the array element type dispatch needs a case for function pointer types, emitting the correct C function pointer type instead of `int64_t`.
Summary
Storing function references in an array (`[func]`) passes typechecking but fails at C compilation. The codegen emits `int64_t[]` for the element storage instead of function pointer types.
Reproduction
```ez
do add(a int, b int) -> int { return a + b }
do sub(a int, b int) -> int { return a - b }
do main() {
mut ops [func] = {()add, ()sub}
println(ops[0](10, 3))
println(ops[1](10, 3))
}
```
Expected: Prints `13` then `7`
Actual: C compilation error: `incompatible pointer to integer conversion`
Where to Fix
`ezc/src/codegen/codegen.c` — the array element type dispatch needs a case for function pointer types, emitting the correct C function pointer type instead of `int64_t`.