use unification instead of equality for array access resolution (closes #2004)