haxe icon indicating copy to clipboard operation
haxe copied to clipboard

[cpp] Implemented abstract methods are not called

Open AxGord opened this issue 4 months ago • 1 comments

Haxe version: 4.3.6


new Test().t();  // <----- false

class Test extends AbstractTest {

    private function test(flag:Bool = false):Bool return true;

}

abstract class AbstractTest {
    public function new() {}

    public function t(): Void {
        trace(test()); // <----- false
    }

    abstract private function test(flag:Bool = false):Bool;

}

This works correctly if you don't use optional arguments. Or call the implemented method inside the Test class.

AxGord avatar Aug 06 '25 17:08 AxGord

Hello, this is due to default arguments: #11666. It is fixed in the haxe 5 preview, hopefully it will also be added if there is a haxe 4.3.8 release.

tobil4sk avatar Aug 06 '25 18:08 tobil4sk