Refactor PSI for destructuring declarations in for: they are now children of KtParameter and not instead of it
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+1
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user