# Type Coercion failed and inheritance

**URL:** <https://forum.kirupa.com/t/type-coercion-failed-and-inheritance/300165>\
**Category:** flash\
**Created:** [November 17, 2009, 1:46am UTC](https://forum.kirupa.com/t/type-coercion-failed-and-inheritance/300165 "2009-11-17T01:46:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![BoppreH](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@BoppreH](https://forum.kirupa.com/u/BoppreH)\
**Post date:** [November 17, 2009, 1:46am UTC](https://forum.kirupa.com/t/type-coercion-failed-and-inheritance/300165/1 "2009-11-17T01:46:56Z")

</div>

I’ve beem trying different approaches for a couple of hours now, with no success so far.

I have a simple method that accepts a parameter of type Section, a simple class. Now, I have some other classes, like Account, that extend Section.

The problem starts when I try to pass one of this extended classes to the method.

Here’s the method and class signatures:

```auto
public static function registerSection(option:Class, section:Section):void

public class Account extends Section

```

The code that I’m trying to run…

```auto
Section.registerSection(OptAccount, new Account())

```

And the compiler-time error:

```auto
1067: Implicit coercion of a value of type Account to an unrelated type sections:Section.

```

If I try to cast it using “Section(new Account())”, it throws the following error during the execution:

```auto
TypeError: Error #1034: Type Coercion failed: cannot convert Account@110fdaf9 to sections.Section.

```

Also,

```auto
trace((new Account()) is Section)

```

yields false.

And this is not the only class that’s having this problem.

Am I missing something here? What could be the problem(s)?
