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 228: -Dgeneric is broken?
1 person starred this issue and may be notified of changes. Back to list
Status:  WontFix
Owner:  ----
Closed:  Feb 2013


 
Reported by rao...@gmail.com, Feb 14, 2013
polygonal-ds 1.38+ breaks when 'generic' is used.
Feb 16, 2013
Project Member #1 gameh...@gmail.com
Hi,
I tried this:
commented out "Sprintf", because it is not haxe3 ready.
Added "@:generic" to ObjectPool, as well as ObjectPoolIterator and then:

import de.polygonal.ds.pooling.ObjectPool;

class Test {
static var x:ObjectPool<Test>;
public static function main() {
  x = new ObjectPool<Test>(10);
} }

haxe -main Test -lib polygonal-ds -D generic -dce no -cpp cpp

And it seemed to compile ok.
Do you have a more tricky example?
Feb 16, 2013
#2 rao...@gmail.com
dunno. all i heard was that polygonal-ds 1.38+ with -Dgeneric hits some hxcpp bug. i'm hoping Michael Baczynski will comment further here.
Feb 18, 2013
#3 michaelbaczynski@gmail.com
Hi, here is something that breaks (I can bake it down to a small code snippet if you want):

class Main {
	public static function main() {
		new de.polygonal.ds.ArrayedQueue<Int>(10).toDA();
	}
}


I'm using latest haxe3 from svn and compiling with -D generic -D haxe3 flags. (It also fails with haxe 2.10).

error:

C:\SDKs\code.google\hxcpp\include\hx/Object.h(162) : error C2664: 'hx::ObjectPtr<OBJ_>::CastPtr' : cannot convert parameter 1 from 'de::polygonal::ds::DA_obj *const ' to 'hx::Object *'
with
[
	OBJ_=de::polygonal::ds::DA_Int_obj
]
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\SDKs\code.google\hxcpp\include\hx/Operators.h(241) : see reference to function template instantiation 'hx::ObjectPtr<OBJ_>::ObjectPtr<de::polygonal::ds::DA_obj>(const hx::ObjectPtr<de::polygonal::ds::DA_obj> &)' being compiled
with
[
	OBJ_=de::polygonal::ds::DA_Int_obj
]
./src/Main.cpp(44) : see reference to function template instantiation 'hx::ObjectPtr<OBJ_> hx::TCast<T>::cast<de::polygonal::ds::DA_obj>(hx::ObjectPtr<de::polygonal::ds::DA_obj>)' being compiled
with
[
	OBJ_=de::polygonal::ds::DA_Int_obj,
	T=de::polygonal::ds::DA_Int
]
Feb 22, 2013
Project Member #4 gameh...@gmail.com
Hi,
This is due to the use of the unsafe 1-arg "cast" operator:

interface Comparable { function i():Void; }
class Main
{
  public static function main()
   {
      var pivot:Comparable = null;
      var b:Int = cast pivot;
  }
}

In this case, "Int" simply does not implement the Comparable interface, and the "cast" operator prevents the haxe compiler from complaining.
Status: WontFix

Powered by Google Project Hosting