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 224: problem on fluent interface
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Feb 2013


 
Reported by andy@onthewings.net, Feb 1, 2013
Using Haxe r5997, hxcpp r636, the following produce C++ code that cannot be compiled.

class A {
	public function new():Void {}
	public function chain():A {
		return this;
	}
}

class ASub extends A{
	override public function chain():ASub {
		super.chain();
		return this;
	}
}

class Main
{
	static function main():Void {
		trace(new ASub().chain());
	}
}



===================
haxelib run hxcpp Build.xml haxe -Dcpp -Ddce -Dhaxe_207 -Dhaxe_208 -Dhaxe_209 -Dhaxe_210 -Dhaxe_211 -Dsys -Dtrue
mkdir obj
mkdir obj/darwin
mkdir obj/darwin/src
mkdir obj/darwin/src/haxe
mkdir obj/darwin/__pch
mkdir obj/darwin/__pch/haxe
Creating obj/darwin//__pch/haxe/hxcpp.h.gch...
g++ -Iinclude -c -fvisibility=hidden -O2 -I/Users/andy/Documents/repo/hxcpp//include -DHX_MACOS -m32 -DHXCPP_VISIT_ALLOCS -Dhaxe_210 -frtti -o obj/darwin//__pch/haxe/hxcpp.h.gch /Users/andy/Documents/repo/hxcpp//include/hxcpp.h
g++ -Iinclude -c -fvisibility=hidden -O2 -I/Users/andy/Documents/repo/hxcpp//include -DHX_MACOS -m32 -DHXCPP_VISIT_ALLOCS -Dhaxe_210 -x c++ -frtti -Iobj/darwin//__pch/haxe ./src/haxe/Log.cpp -oobj/darwin//src/haxe/Log.o
g++ -Iinclude -c -fvisibility=hidden -O2 -I/Users/andy/Documents/repo/hxcpp//include -DHX_MACOS -m32 -DHXCPP_VISIT_ALLOCS -Dhaxe_210 -x c++ -frtti -Iobj/darwin//__pch/haxe ./src/Main.cpp -oobj/darwin//src/Main.o
./src/Main.cpp: In static member function ‘static Void Main_obj::main()’: ./src/Main.cpp:38: error: ‘<::’ cannot begin a template-argument list ./src/Main.cpp:38: note: ‘<:’ is an alternate spelling for ‘[’. Insert whitespace between ‘<’ and ‘::’ ./src/Main.cpp:38: note: (if you use -fpermissive G++ will accept your code) Called from ? line 1 Called from BuildTool.hx line 1448 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 : 1 - build cancelled Error : Build failed
Feb 2, 2013
Project Member #1 gameh...@gmail.com
This looks like a gcc problem - the extra spaces should do the trick now.
Status: Fixed

Powered by Google Project Hosting