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 92: interface and Generic problem
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jan 2011


 
Reported by Andy.onthewings, Jan 20, 2011
interface A<T>
{
	public function fill(values:Array<T>):Void;
}

class AA<T> implements A<T>, implements haxe.rtti.Generic
{
	public function new():Void {
		
	}
	
	public function fill(values:Array<T>) {
		values[0]; //error here
	}
}

class OFExample{
	static function main():Void {
		var mv = new AA<Int>();
	}
}
--------------------------------------------------------------------------------
Tha above fails to be compiled using haxe r3637, hxcpp r283, VS2010.

The error is:

D:\workspace\hxcv>haxe compile.hxml
haxelib run hxcpp Build.xml haxe -DHXOF -Dcasalib -Dcpp -Dhaxe_206 -Dhsl-1 -Dhsl
_1 -Dtrue
Using cl version: 16
BuildTool.hx:154: Creating hxcpp.pch.
cl.exe -Iinclude -nologo -O2 -MT -DHX_WINDOWS -GR -Zi -c -EHsc -ID:\repo\hxcpp//
include -D_CRT_SECURE_NO_DEPRECATE -wd4996 -Ychxcpp.h __pch.cpp /Fphxcpp.pch
__pch.cpp
cl.exe -I. -Iinclude -nologo -O2 -MT -DHX_WINDOWS -GR -Zi -c -EHsc -ID:\repo\hxc
pp//include -D_CRT_SECURE_NO_DEPRECATE -wd4996 -Yuhxcpp.h ./src/AA_Int.cpp -Foob
j/Release/src/AA_Int.obj
AA_Int.cpp
./src/AA_Int.cpp(40) : error C2039: '__get' : is not a member of 'hx::Object'
        D:\repo\hxcpp\include\hx/Object.h(53) : see declaration of 'hx::Object'
Called from ? line 1
Called from BuildTool.hx line 1123
Called from BuildTool.hx line 509
Called from BuildTool.hx line 538
Called from BuildTool.hx line 652
Called from BuildTool.hx line 724
Uncaught exception - Error in building thread
Error : Build failed
Jan 20, 2011
Project Member #1 gameh...@gmail.com
I see it is a bug, but the intended efficiency will not work, even if after the bug is fixed.  Since the interface does not implement haxe.rtti.Generic, the fill function will actually take a "Dynamic" parameter, so the correct fix is to ensure that AA is stripped of its haxe.rtti.Generic ability.
Jan 20, 2011
#2 Andy.onthewings
What about making A implements Generic too? I'm not sure does it really make sense.
Currently, if I do so, the haxe compiler will throw me "File "codegen.ml", line 224, characters 10-16: Assertion failed".
Jan 22, 2011
Project Member #3 gameh...@gmail.com
This is fixed.
I have reported the case when A implements Generic on the haxe issue list.
Status: Fixed

Powered by Google Project Hosting