jan_flanders

Untitled

Jul 28th, 2012
109
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 t0 = new Test();
  6.         var t1 = new Test(t0);
  7.         t1.check();
  8.     }
  9. }
  10.  
  11. class Test
  12. {
  13.     var t:Test;
  14.     public function new(?t:Test)
  15.     {
  16.         this.t = t;
  17.     }
  18.     public function check():Void
  19.     {
  20.         if(t!=null)
  21.         {
  22.             t.test();//t should have no access to private function test
  23.         }
  24.     }
  25.     private function test():Void
  26.     {
  27.         trace("hello");
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment