Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Main
- {
- public static function main()
- {
- var t0 = new Test();
- var t1 = new Test(t0);
- t1.check();
- }
- }
- class Test
- {
- var t:Test;
- public function new(?t:Test)
- {
- this.t = t;
- }
- public function check():Void
- {
- if(t!=null)
- {
- t.test();//t should have no access to private function test
- }
- }
- private function test():Void
- {
- trace("hello");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment