supporting instanceof for array types
VisitorWriteGen now uses methods to reduce size