SI-7231 Fix assertion when adapting Null type to Array type

GenICode was doing a sanity check when adapting an expression of type
Null to something else. It was just doing the wrong one. Instead of
checking whether the result expression type was a reference type it
was checking to see if it was an class reference type. This commit fixes
that and adds a test to make sure both forms of adaptation work as
expected.
Merge pull request #2216 from JamesIry/master_7231

SI-7231 Fix assertion when adapting Null type to Array type