Evaluate: Fix annotation value evaluation (#KT-23058)

This commit is contained in:
Yan Zhulanow
2018-03-15 02:17:09 +03:00
parent 4d13e38948
commit 81f3346329
4 changed files with 38 additions and 1 deletions
@@ -202,7 +202,15 @@ public class JvmCodegenUtil {
}
if (!isCallInsideSameClassAsFieldRepresentingProperty(property, context)) {
if (!isDebuggerContext(context)) {
DeclarationDescriptor propertyOwner = property.getContainingDeclaration();
boolean isAnnotationValue;
if (propertyOwner instanceof ClassDescriptor) {
isAnnotationValue = ((ClassDescriptor) propertyOwner).getKind() == ANNOTATION_CLASS;
} else {
isAnnotationValue = false;
}
if (isAnnotationValue || !isDebuggerContext(context)) {
// Unless we are evaluating expression in debugger context, only properties of the same class can be directly accessed
return false;
}