Issue 71: object comparison fails
Status:  Fixed
Owner: ----
Closed:  Jan 2011
Reported by michaelbaczynski@gmail.com, Oct 14, 2010
Below is a simple binary tree, where the Node#unlink method fails.
Tested with haXe+hxcpp from svn.

class Main
{
	static var _app:Main;
	public static function main():Void
	{
		var node = new Node('root');
		
		node.setL('e1');
		node.setR('e2');
		
		node.left.unlink(); //failure
	}
}

class Node
{
	public var val:String;
	
	public var parent:Node;
	
	public var left:Node;
	
	public var right:Node;
	
	public function new(x:String)
	{
		this.val = x;
	}
	
	public function setL(x:String):Void
	{
		if (left == null)
		{
			left = new Node(x);
			left.parent = this;
		}
		else
			left.val = x;
	}

	public function setR(x:String):Void
	{
		if (right == null)
		{
			right = new Node(x);
			right.parent = this;
		}
		else
			right.val = x;
	}
	
	public function unlink():Void
	{
		trace(this == parent.left); //should be true
		trace(this == parent.right); //should be true
	}
}
Oct 15, 2010
#1 Andy.onthewings
Should be the same as  issue 65 : https://code.google.com/p/hxcpp/issues/detail?id=65

You can workaround it at this moment by changing "this == parent.left" to "parent.left == this"
Jan 17, 2011
Project Member #2 gameh...@gmail.com
Fixed on SVN
Status: Fixed
Jan 20, 2011
Project Member #3 gameh...@gmail.com
I presume the last line should be false: left.parent.right!=left