KT-2262 Cannot access protected member from inner class of subclass
#KT-2262 fixed
This commit is contained in:
@@ -63,7 +63,7 @@ public class Visibilities {
|
|||||||
if (DescriptorUtils.isSubclass(fromClass, classDescriptor)) {
|
if (DescriptorUtils.isSubclass(fromClass, classDescriptor)) {
|
||||||
return true;
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user