IDEA-67385 (explicitly imported types should shadow inherited ones)

This commit is contained in:
Roman Shevchenko
2011-04-05 13:29:18 +02:00
parent 14dcdbebb3
commit bf9add7eb8
8 changed files with 51 additions and 5 deletions

View File

@@ -0,0 +1,9 @@
import p.Base.*;
import p.BaseImpl;
class Test extends BaseImpl {
void m() {
Inner inner = new Inner() { }; // imported public Base.Inner should shadow inherited package-private BaseImpl.Inner
BaseImpl.<error descr="'p.BaseImpl.Inner' is not public in 'p.BaseImpl'. Cannot be accessed from outside package">Inner</error> i2 = null;
}
}

View File

@@ -0,0 +1,5 @@
package p;
public interface Base {
interface Inner { }
}

View File

@@ -0,0 +1,5 @@
package p;
public class BaseImpl implements Base {
static class Inner implements Inner { }
}

View File

@@ -0,0 +1,9 @@
import p.Base.Inner;
import p.BaseImpl;
class Test extends BaseImpl {
void m() {
Inner inner = new Inner() { }; // imported public Base.Inner should shadow inherited package-private BaseImpl.Inner
BaseImpl.<error descr="'p.BaseImpl.Inner' is not public in 'p.BaseImpl'. Cannot be accessed from outside package">Inner</error> i2 = null;
}
}

View File

@@ -0,0 +1,5 @@
package p;
public interface Base {
interface Inner { }
}

View File

@@ -0,0 +1,5 @@
package p;
public class BaseImpl implements Base {
static class Inner implements BaseImpl.Inner { }
}