Main.hx 652 B

1234567891011121314151617181920212223
  1. import pack.BasePack;
  2. import pack.IPack;
  3. import pack.Pvt;
  4. import pack.sub.AccessSubPvt;
  5. class Main {
  6. static function main() {
  7. //should pass, because pack.sub.SubPvt has @:allow(pack)
  8. AccessSubPvt.constructExtSubPvt();
  9. }
  10. }
  11. class Sub extends BasePack implements IPack {
  12. override public function test() {
  13. // should fail, because it allows access to specific package - pack
  14. Pvt1.testPack();
  15. Pvt2.testPack();
  16. // should pass, because it allows access to all instances of pack.BasePack (including descendant classes)
  17. Pvt2.testClass();
  18. // should pass, because it allows access to all implementers of pack.IPack
  19. Pvt2.testInterface();
  20. }
  21. }