Do not drop analysis results for the code fragment context, allow to re-use it

Otherwise labels declared in the expression context become unresolved.
This is needed for the `this@label` expression evaluation support (KT-28134).
This commit is contained in:
Yan Zhulanow
2018-06-01 17:23:09 +03:00
parent 4c681c787d
commit e8c066605b
4 changed files with 50 additions and 36 deletions
@@ -41,7 +41,7 @@ object LabelResolver {
if (name != null && name == labelName) {
elements.add(getExpressionUnderLabel(parent as KtExpression))
}
parent = parent.parent
parent = if (parent is KtCodeFragment) parent.context else parent.parent
}
return elements
}