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 75: op==, field refs
2 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  gameh...@gmail.com
Closed:  Jan 2011


 
Project Member Reported by gameh...@gmail.com, Oct 25, 2010
 
I'm having a problem with the cpp target where I know that spriteTarget ==
i.target, but:
 
trace(spriteTarget==i.target); // false
trace("sprite target is:"+spriteTarget); // DisplayObjectContainer 35
trace("i.target is:"+i.target); // DisplayObjectContainer 35
 
I saw a similar problem in known issues, but in my case reversing the order
has no effect:
 
trace(spriteTarget==i.target); // false
trace(i.target==spriteTarget); // false
 
I am trying to boil this down to a simple class that proves the error but
the code around it is complicated and I haven't succeeded yet.  Any other
info I can provide or possible workarounds?

Note:check interfaces too
Jan 19, 2011
Project Member #1 gameh...@gmail.com
The following now works, so I think this should be fixed.

class Main
{
  public static function main():Void
  {
    var b = new B();
    var a:A = b;
    var a2:A = b;
    var c:C = b;

    var d:Dynamic = c;

    trace(a==b);
    trace(b==a);

    trace(c==b);
    trace(b==c);

    trace(a==d);

    var d = { c : c };
    trace(c==d.c);
    trace(d.c==c);

    trace(b==d.c);
    trace(d.c==b);

    trace(a==a2);
  }
}

interface A { var x:Float; }
interface C { function foo():Void; }

class B implements A , implements C
{
   public var x:Float;

   public function new()
   {
   }

   public function foo() { }
}

Status: Fixed

Powered by Google Project Hosting