Static import of package-private type from the same package

Issue #295 resolved
Jesper Öqvist
created an issue

ExtendJ 8.1.0-58-gbbb70a7 Java SE 8

ExtendJ incorrectly gives an error for this program:

Test.java:

// It is allowed to static-import a package-private type from the same package.
//
// .result: COMPILE_PASS
package my.thing;

import static my.thing.A.Thing; // OK: same package.

public class Test { }

A.java:

package my.thing;

public class A {
  static class Thing { }
}

Expected result: no compile error.

Actual result: ExtendJ reports an error:

tests/pkg/static_import_09p/Test.java:6: error: can not access non-public type my.thing.A.Thing

Comments (1)

  1. Log in to comment