Issue 217: problem with generic
Status:  Done
Owner: ----
Closed:  Dec 2012
Reported by andy@onthewings.net, Dec 10, 2012
The following code produce compilation error with haxe r5653, hxcpp r607.

class Main
{
	static function main():Void {
		function test<T>() return new haxe.FastList<T>();
		trace(test());
	}
}

The error is:

In file included from ./src/haxe/FastList.cpp:4:
include/haxe/FastList.h:35: error: ‘FastCell’ in namespace ‘haxe’ does not name a type
./src/haxe/FastList.cpp: In member function ‘virtual String haxe::FastList_obj::toString()’:
./src/haxe/FastList.cpp:36: error: ‘FastCell’ is not a member of ‘haxe’
./src/haxe/FastList.cpp:36: error: expected `;' before ‘l’
./src/haxe/FastList.cpp:38: error: ‘l’ was not declared in this scope
./src/haxe/FastList.cpp: In member function ‘virtual void haxe::FastList_obj::__Mark(hx::MarkContext*)’:
./src/haxe/FastList.cpp:59: error: ‘head’ was not declared in this scope
./src/haxe/FastList.cpp: In member function ‘virtual void haxe::FastList_obj::__Visit(hx::VisitContext*)’:
./src/haxe/FastList.cpp:65: error: ‘head’ was not declared in this scope
./src/haxe/FastList.cpp: In member function ‘virtual Dynamic haxe::FastList_obj::__Field(const String&, bool)’:
./src/haxe/FastList.cpp:72: error: ‘head’ was not declared in this scope
./src/haxe/FastList.cpp: In member function ‘virtual Dynamic haxe::FastList_obj::__SetField(const String&, const Dynamic&, bool)’:
./src/haxe/FastList.cpp:84: error: ‘head’ was not declared in this scope
./src/haxe/FastList.cpp:84: error: ‘FastCell’ is not a member of ‘haxe’
./src/haxe/FastList.cpp:84: error: ‘FastCell’ is not a member of ‘haxe’
./src/haxe/FastList.cpp:84: error: no matching function for call to ‘Dynamic::Cast() const’
Called from ? line 1
Called from BuildTool.hx line 1438
Called from BuildTool.hx line 667
Called from a C function
Called from BuildTool.hx line 702
Called from BuildTool.hx line 836
Called from BuildTool.hx line 883
Called from BuildTool.hx line 244
Uncaught exception - Error : 256 - build cancelled
Dec 12, 2012
Project Member #1 si...@haxe.org
This is not a hxcpp-only problem apparently, I've opened an issue for haxe: https://code.google.com/p/haxe/issues/detail?id=1319
Status: Done