Bug
The monomorphizer only scans non-generic function bodies for generic call sites. When a generic function calls another generic function (e.g. array_map calls array_map_go), the inner call is never collected and monomorphized.
Example
forall<A, B> fn array_map(@Array<A>, @Fn<A,B> -> @Array<B>) {
array_map_go(@Array<A>.0, @Fn<A,B>.0, 0, [])
}
The user calls array_map([1,2,3], fn(...)), which generates array_map$Int_Int. But array_map_go$Int_Int is never generated because the monomorphizer doesn't scan the body of array_map$Int_Int for further generic calls.
Impact
Any generic function that delegates to another generic function fails to compile with 'unknown func'.
Fix
Replaced the single-pass monomorphization with a worklist-based transitive closure. After generating each monomorphized function, its body is scanned for further generic calls, which are added to the worklist. Fixed in the feat/array-operations branch.
Bug
The monomorphizer only scans non-generic function bodies for generic call sites. When a generic function calls another generic function (e.g.
array_mapcallsarray_map_go), the inner call is never collected and monomorphized.Example
The user calls
array_map([1,2,3], fn(...)), which generatesarray_map$Int_Int. Butarray_map_go$Int_Intis never generated because the monomorphizer doesn't scan the body ofarray_map$Int_Intfor further generic calls.Impact
Any generic function that delegates to another generic function fails to compile with 'unknown func'.
Fix
Replaced the single-pass monomorphization with a worklist-based transitive closure. After generating each monomorphized function, its body is scanned for further generic calls, which are added to the worklist. Fixed in the
feat/array-operationsbranch.