# \[AS3\] Subclass Method Return Type

**URL:** https://forum.kirupa.com/t/as3-subclass-method-return-type/193965
**Category:** flash
**Created:** [July 19, 2006, 4:42pm UTC](https://forum.kirupa.com/t/as3-subclass-method-return-type/193965 "2006-07-19T16:42:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![krilnon](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/krilnon/32/34_2.png) [@krilnon](https://forum.kirupa.com/u/krilnon)
#### Post date: [July 19, 2006, 4:42pm UTC](https://forum.kirupa.com/t/as3-subclass-method-return-type/193965/1 "2006-07-19T16:42:50Z")

</div>

I am extending the Array class. Many of its methods return Array objects, but I would like them to return instances of my subclass. I only need to change the return type (and the argument if it is also of the Array class), as the method does just what I want it to otherwise.

Overriding the method won’t work, as the return type has to be the same. Attempting to use a method that returns an Array to assign the value of a subclass of Array generates an error, how can I fix this? (Or is more detail needed?)
