Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Main
- {
- public static function main()
- {
- var a = new Test();
- var b = new Test();
- a.checkTest(b);
- var c = new Foo();
- a.checkFoo(c);
- }
- }
- class Test
- {
- public function new()
- {
- }
- public function checkTest(p:Test):Void
- {
- p.test();//t should not have access to private function test
- }
- public function checkFoo(p:Foo):Void
- {
- p.test();//works as expected :Cannot access to private field test
- }
- private function test():Void
- {
- trace("hello");
- }
- }
- class Foo
- {
- public function new()
- {
- }
- private function test():Void
- {
- trace("hello");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment