Test component type for errors too.
With regression test.

Rationale:
Moved erroneous check in convenience method, so we
put all the same logic in one place. When testing
for erroneous T[], check both the array type
as well at the component type T for errors
(it is possible T[] is not marked erroneous
even though T is eventually).

BUG=28358598

(cherry picked from commit f417ff44d1eb111854d7a213f106912b3dd9e3d4)

Change-Id: Ieba66aa4b55d8e7ebddf200239c7e4095dfd4678
8 files changed