I've encountered a peculiar behavior when generating AS3 source. When I override a private function and call its super function, the super class' function signature becomes public. I expect it to be protected. This causes a compile-time error:
Error: Incompatible override.
Here's a test case to reproduce the problem:
package;
class Foo
{
public function new()
{
}
private function someFunc():Bool
{
return false;
}
}
package;
class Bar extends Foo
{
public function new()
{
}
private override function someFunc():Bool
{
return super.someFunc();
}
}
The net result is that Foo now has:
public function someFunc():Bool
{
return false;
}
...and Bar now has:
protected override function someFunc():Bool
{
return super.someFunc();
}
Can anyone shed some light on what's going on here? Why does calling super.someFunc() modify the access to the parent class' someFunc()?