| Issue 207: | could be 'bool hx::ObjectPtr<OBJ_>::operator !=(const hx::ObjectPtr<OBJ_> &) const' | |
| 4 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem? 1. Clone HaxeFlixel repo 2. git clone https://github.com/Beeblerox/HaxeFlixel/tree/dev 3. Compile for Windows What is the expected output? What do you see instead? I get a build error: ./src/org/flixel/FlxText.cpp(194) : error C2666: 'hx::ObjectPtr<OBJ_>::operator !=' : 2 overloads have similar conversions with [ OBJ_=neash::display::BitmapData_obj ] C:\Motion-Twin\Haxe\lib\hxcpp\dev\include\hx/Object.h(204): could be 'bool hx::ObjectPtr<OBJ_>::operator !=(const hx::ObjectPtr<OBJ_> &) const' with [ OBJ_=neash::display::BitmapData_obj ] c:\motion-twin\haxe\lib\hxcpp\dev\include\Dynamic.h(264): or 'bool operator !=(const String &,const Dynamic &)' while trying to match the argument list '(neash::display::BitmapData, Dynamic)' Code compiles. What version of the product are you using? On what operating system? Latest SVN. Please provide any additional information below. The seems to be caused by this check: if (_pixels != FlxG._cache.get(_bitmapDataKey)) _pixels is of type BitmapData _cache is of type Hash<BitmapData>
Nov 21, 2012
#1
poxvu...@gmail.com
Dec 23, 2012
I have this issue also. but switching the line
if (_pixels != FlxG._cache.get(_bitmapDataKey))
to
if (FlxG._cache.get(_bitmapDataKey) != _pixels)
makes project compile
note: FlxG._cache is Hash<BitmapData> and _pixels is BitmapData.
Here is simple class that reproduces this issue:
package;
import nme.Assets;
import nme.display.BitmapData;
import nme.display.Sprite;
import nme.events.Event;
import nme.Lib;
class Main extends Sprite
{
private var bitmapHash:Hash<BitmapData>;
public function new()
{
super();
#if iphone
Lib.current.stage.addEventListener(Event.RESIZE, init);
#else
addEventListener(Event.ADDED_TO_STAGE, init);
#end
}
private function init(e)
{
bitmapHash = new Hash<BitmapData>();
var bitmap:BitmapData = new BitmapData(10, 10, true);
var cachedBmd:BitmapData = bitmapHash.get("testKey");
if (bitmap != bitmapHash.get("testKey")) // this line prevents project from compiling
{
trace("false");
}
}
static public function main()
{
var stage = Lib.current.stage;
stage.scaleMode = nme.display.StageScaleMode.NO_SCALE;
stage.align = nme.display.StageAlign.TOP_LEFT;
Lib.current.addChild(new Main());
}
}
Dec 23, 2012
Should be fixed on SVN now.
Status:
Fixed
Jan 13, 2013
Some other problems;.
class A { public function new() { } }
class B extends A { public function new() { super(); } }
class Test
{
public static function main()
{
var a = new A();
var b = new B();
var d:Dynamic = a;
trace(a==a);
trace(a==b);
trace(a==d);
trace(b==a);
trace(b==b);
trace(b==d);
trace(d==a);
trace(d==b);
trace(d==d);
}
}
Status:
Verified
|