| Issue 9: | Compile error while extending generic classes | |
| 1 person starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
While the neko version is running fine, this does not compile for c++.
class Base<T>
{
public function getValue () : T
{
return null;
}
}
class Extend extends Base<Bool>
{
override public function getValue () : Bool
{
return true;
}
}
class Main
{
public static function main () {}
}
What is the expected output?
successfull compilation
What do you see instead?
D:\work\playground\hxcpp_test\bin\cpp\include\Extend.h(33) : error C2555:
'Extend_obj::getValue': overriding virtual function return type differs and
is not covariant from 'Base_obj::getValue'
D:\work\playground\hxcpp_test\bin\cpp\include\Base.h(28) : see
declaration of 'Base_obj::getValue'
Base.cpp
Called from <null> line 1
Called from BuildTool.hx line 845
Called from BuildTool.hx line 437
Called from BuildTool.hx line 460
Called from BuildTool.hx line 533
Called from BuildTool.hx line 604
Uncaught exception - Error in building thread
Error : Build failed
What version of the product are you using? On what operating system?
2.05.1
Jul 23, 2010
Project Member
#1
gameh...@gmail.com
Status:
Fixed
|