Fixes a bug when type checking an array function argument

fixes test12