Support private package properties in inline functions

This commit is contained in:
Michael Bogdanov
2015-05-27 15:48:39 +03:00
parent be9cc2e91b
commit e20a5121c7
7 changed files with 70 additions and 13 deletions
@@ -171,7 +171,10 @@ public class JvmCodegenUtil {
if (JetTypeMapper.isAccessor(property)) return false;
// Inline functions can't use direct access because a field may not be visible at the call site
if (context.isInlineFunction() && !Visibilities.isPrivate(property.getVisibility())) return false;
if (context.isInlineFunction() &&
(!Visibilities.isPrivate(property.getVisibility()) || DescriptorUtils.isTopLevelDeclaration(property))) {
return false;
}
// Only properties of the same class can be directly accessed, except when we are evaluating expressions in the debugger
if (!isCallInsideSameClassAsDeclared(property, context) && !isDebuggerContext(context)) return false;