fix Issue 8589 - Incorrect conversion of function returning `typeof(null)` to function returning an array