jan_flanders

Untitled

Jul 28th, 2012
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. class Main
  2. {
  3.     public static function main()
  4.     {
  5.         var a = new Test();
  6.         var b = new Test();
  7.         b.test();//works as expected :Cannot access to private field test
  8.        
  9.         a.check(b);
  10.     }
  11. }
  12. class Test
  13. {
  14.     public function new()
  15.     {
  16.     }
  17.     public function check(b:Test):Void
  18.     {
  19.         b.test();//does NOT work as expected: b suddenly has access to private field test
  20.     }
  21.     private function test():Void
  22.     {
  23.         trace("hello");
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment