Bug
_get_arg_type_info in monomorphize.py only handles SlotRef and ConstructorCall expressions. When a generic function is called with an array literal ([1, 2, 3]) or the result of another function call (array_range(0, 5)), type variable inference fails and defaults to Bool (phantom fallback).
Example
array_map([1, 2, 3], fn(@Int -> @Int) effects(pure) { @Int.0 * 2 })
The first argument [1, 2, 3] is an ArrayLit. _get_arg_type_info returns None for it, so A defaults to Bool instead of Int, producing array_map$Bool_Bool instead of array_map$Int_Int.
Impact
Calling generic functions with array literal or function call arguments produces incorrect monomorphization — wrong types, potential runtime crashes.
Fix
Added ArrayLit and FnCall cases to _get_arg_type_info. ArrayLit infers element type from first element; FnCall handles known return types like array_range → Array<Int>. Fixed in the feat/array-operations branch.
Bug
_get_arg_type_infoinmonomorphize.pyonly handlesSlotRefandConstructorCallexpressions. When a generic function is called with an array literal ([1, 2, 3]) or the result of another function call (array_range(0, 5)), type variable inference fails and defaults toBool(phantom fallback).Example
The first argument
[1, 2, 3]is anArrayLit._get_arg_type_inforeturnsNonefor it, soAdefaults toBoolinstead ofInt, producingarray_map$Bool_Boolinstead ofarray_map$Int_Int.Impact
Calling generic functions with array literal or function call arguments produces incorrect monomorphization — wrong types, potential runtime crashes.
Fix
Added
ArrayLitandFnCallcases to_get_arg_type_info. ArrayLit infers element type from first element; FnCall handles known return types likearray_range→Array<Int>. Fixed in thefeat/array-operationsbranch.