jan_flanders

Untitled

Jul 28th, 2012
60
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.        
  6.         var t = new Test();
  7.        
  8.         var foo = new Foo();
  9.         foo.check(t);
  10.        
  11.         var test = new Test();
  12.         test.check(t);
  13.     }
  14. }
  15.  
  16. class Foo
  17. {
  18.     public function new(){}
  19.  
  20.     public function check(t:Test)
  21.     {
  22.         t.test();//works as expected :Cannot access to private field test
  23.     }
  24. }
  25.  
  26. class Test
  27. {
  28.     public function new(){}
  29.  
  30.     public function check(t:Test)
  31.     {
  32.         t.test();//b should not have access to private function test
  33.     }
  34.    
  35.     private function test(){}
  36. }
Advertisement
Add Comment
Please, Sign In to add comment