KT-34740 Make getImplicitReceiversWithInstanceToExpression keep script implicit receivers

- This makes completion aware of scripts implicit receivers (it matters in .gradle.kts files, for example)
- ^KT-34740 Fixed
This commit is contained in:
Roman Golyshev
2019-11-21 13:09:06 +03:00
committed by Roman Golyshev
parent be2fe256ba
commit 28e2d2faf2
7 changed files with 99 additions and 0 deletions
@@ -83,6 +83,7 @@ fun LexicalScope.getImplicitReceiversWithInstanceToExpression(
val owner = receiver.containingDeclaration
if (owner is ScriptDescriptor) {
result[receiver] = null
outerDeclarationsWithInstance.addAll(owner.implicitReceivers)
continue
}
val (expressionText, isImmediateThis) = if (owner in outerDeclarationsWithInstance) {