Fix for KT-6154: Inlining a private class function accessing a private val member throws exception at runtime in accessing the val getter

#KT-6154 Fixed
This commit is contained in:
Michael Bogdanov
2014-10-30 12:30:45 +03:00
parent 951ce827a6
commit 59917f3727
5 changed files with 46 additions and 1 deletions
@@ -166,7 +166,7 @@ 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()) return false;
if (context.isInlineFunction() && property.getVisibility() != Visibilities.PRIVATE) 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;