provide access object for captured wildcards (IDEA-128542)

This commit is contained in:
Anna Kozlova
2015-12-03 15:27:26 +01:00
parent 36ea2f9041
commit 3aa29923c6
3 changed files with 37 additions and 0 deletions
@@ -0,0 +1,19 @@
abstract class A {
protected void bar(){}
}
abstract class Strange extends A {
private void foo(){}
static void fooBar(Class<? extends Strange> clazz){
getInstance(clazz).<error descr="'foo()' has private access in 'Strange'">foo</error>();
getInstance(clazz).bar();
}
public static <T> T getInstance(Class<T> clazz) {
return (T) new StrangeImpl();
}
}
class StrangeImpl extends Strange{}