gh-2399 prevent casting for discriminator models when pushing to array

Not explicitly specified in style guide, but please indent multi-line expressions by 2 spaces instead of 'match start of expression'