KT-2262 Cannot access protected member from inner class of subclass

#KT-2262 fixed
This commit is contained in:
Svetlana Isakova
2012-06-13 17:03:04 +04:00
parent 15086258c0
commit 2f0278d63b
2 changed files with 17 additions and 1 deletions
@@ -63,7 +63,7 @@ public class Visibilities {
if (DescriptorUtils.isSubclass(fromClass, classDescriptor)) {
return true;
}
return false;
return isVisible(what, fromClass.getContainingDeclaration());
}
};
@@ -0,0 +1,16 @@
package kt2262
//KT-2262 Cannot access protected member from inner class of subclass
abstract class Foo {
protected val color: String = "red"
}
class Bar : Foo() {
protected val i: Int = 1
class Baz {
val copy = color // INVISIBLE_MEMBER: Cannot access 'color' in 'Bar'
val j = i
}
}