My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 190: polymorphism error. (haxe 2.10 + hxcpp 2.10)
4 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Oct 2012


 
Reported by lucadelt...@googlemail.com, Jul 19, 2012
class Test {
    static var x:ErrorChild;

    static function main() {
        x = new ErrorChild();
        x.error().push(10);
    }

}


class ErrorBase {
    var elts:Array<Int>;
    public inline function error() {
        return {
            if (elts == null) elts = [];
            elts;
        }
    }
}


class ErrorChild extends ErrorBase {
    public function new() {}
}

I've posted this as a hxcpp issue too on googlecode, I'm posting here as hxcpp issue page seems... unusually quit and worried it's not being checked frequently.

This is the best, minimal example I could find to produce the error in generated c++, the error being:

./src/Test.cpp: In static member function ‘static Array<int> Test_obj::main()::_Function_1_1::Block()’:
./src/Test.cpp:60:39: error: no matching function for call to ‘Test_obj::main()::_Function_1_1::Block()::_Function_2_1::Block(ErrorChild&)’
./src/Test.cpp:60:39: note: candidate is:
./src/Test.cpp:45:34: note: static Array<int> Test_obj::main()::_Function_1_1::Block()::_Function_2_1::Block(ErrorBase&)
./src/Test.cpp:45:34: note:   no known conversion for argument 1 from ‘ErrorChild {aka hx::ObjectPtr<ErrorChild_obj>}’ to ‘ErrorBase& {aka hx::ObjectPtr<ErrorBase_obj>&}’
Oct 7, 2012
Project Member #1 gameh...@gmail.com
Thanks for the concise error report.  Should be fixed on haxe svn. 
Status: Fixed

Powered by Google Project Hosting