Search code examples
actionscript-3flashflash-builderrobotlegs

VerifyError: Error #1053: Illegal override of (Constructor) in (Class)


I'm using Flash Builder 4.7 and I've come across a bizarre issue, without any changes to the class this is occurring in I get:

VerifyError: Error #1053: Illegal override of HUDScreen in mobile_ui.screens.HUDScreen.

This class extends Sprite, and implements an interface. As far as I know, all methods in the interface have the proper prototypes. There are no overridden properties or functions in this class. We are using robotlegs for dependency injection as well, if that is relevant.

Class Definition

public class HUDScreen extends Sprite implements IHUDScreen
{
}

Constructor

public function HUDScreen()
{

}

Interface Definition

public interface IHUDScreen extends IEventDispatcher
{

}

I've tried cleaning the project, I've deleted and re-imported the project, I've changed the package from ui.screens.HUDScreen to mobile_ui.screens.HUDScreen. Nothing changed the error.

Any other suggestions would be greatly appreciated at this point!

Thank you for your time.

Edit: I've added the class definition, interface definition, and constructor.

UPDATE: I've been able to move past this problem, I've outlined what I did in my answer below. I'm still interested in anyone's thoughts or ideas on how this could have happened, or perhaps a more concrete solution.

Thanks again to everyone who took the time to view this question!


Solution

  • It seems this is caused by an incorrect implementation of an interface that the compiler doesn't detect. The following code snipped causes the error:

    public class Foo implements IFoo
    {
        public function bar():String { return ""; }
    }
    
    public interface IFoo
    {
        function get bar():String;
    }
    

    The problem is caused by the fact that IFoo.bar is a getter, but Foo.bar() is a normal method. This is a kind of error that could be easily missed when looking through your code, and that would be fixed if you delete and rewrite everything.