Refactor PSI for destructuring declarations in for: they are now children of KtParameter and not instead of it

This commit is contained in:
Mikhail Glukhikh
2016-10-03 17:19:41 +03:00
parent 48437d5965
commit e7d290f726
35 changed files with 786 additions and 753 deletions
@@ -62,7 +62,7 @@ class DestructuringDeclarationReferenceSearcher(
is KtContainerNode -> {
if (parent.node.elementType == KtNodeTypes.LOOP_RANGE) {
(parent.parent as KtForExpression).destructuringParameter
(parent.parent as KtForExpression).destructuringDeclaration
}
else {
null
@@ -543,7 +543,7 @@ class ExpressionsOfTypeProcessor(
is KtContainerNode -> {
if (parent.node.elementType == KtNodeTypes.LOOP_RANGE) { // "for (x in <expr>) ..."
val forExpression = parent.parent as KtForExpression
(forExpression.destructuringParameter ?: forExpression.loopParameter as KtDeclaration?)?.let {
(forExpression.destructuringDeclaration ?: forExpression.loopParameter as KtDeclaration?)?.let {
processSuspiciousDeclaration(it)
}
break@ParentsLoop