apache / apache/royale-asjs

VerifyError: Error #1053 in Flash Debug Player because Royale compiler allows incompatible function signatures

Open
#953 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
ActionScript
Stars
380
Forks
120
PR merge metrics
No merged PRs in 30d

Description

flashplayer_32_sa_debug.exe throws this error:

`VerifyError: Error #1053: Illegal override of A in a.A.`

With this:

```
public interface B
{
function foo(c:Object):void;
}

public class A implements B
{
public function foo(c:String):void {}
}
```

Royale mxmlc happily compiles this. Flex mxmlc will give this compile error:

`Error: Interface method foo in namespace a:B is implemented with an incompatible signature in class a:A.`

Why is this important?

If you have:

```
import org.apache.royale.events.Event;

class ... implements IEventDispatcher
{
...
public function dispatchEvent( event : Event ) : Boolean { ... }
}
```

Royale mxmlc compiles it just fine. And it runs fine in JS. But in Flash Debugger, it throws VerifyError: Error #1053.

The correct definition is:

```
COMPILE::SWF
{
import flash.events.Event;
}

class ... implements IEventDispatcher
{
...
COMPILE::SWF
public function dispatchEvent( event : flash.events.Event ) : Boolean { ... }

COMPILE::JS
public function dispatchEvent( event : Object ) : Boolean { ... }
}
```

And this kind of problem is hard to track down.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the incompatible interface implementation shown in the issue with Royale mxmlc and the Flash Debug Player, then compare it with Flex mxmlc's rejection. Done means the Royale compiler rejects incompatible function signatures before Flash produces VerifyError #1053, while preserving the compatible JavaScript case.

Written by the indexing model from the issue text.

Assessment

Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.