Introduce warning about forbidden referencing to underscore named parameter of the catch block in a future release (KT-31567)
This commit is contained in:
@@ -140,6 +140,10 @@ public class KtParameter extends KtNamedDeclarationStub<KotlinParameterStub> imp
|
||||
return getParent() instanceof KtForExpression;
|
||||
}
|
||||
|
||||
public boolean isCatchParameter() {
|
||||
return getParent().getParent() instanceof KtCatchClause;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public KtParameterList getValueParameterList() {
|
||||
|
||||
@@ -673,3 +673,6 @@ fun getTrailingCommaByElementsList(elementList: PsiElement?): PsiElement? {
|
||||
val lastChild = elementList?.lastChild?.let { if (it !is PsiComment) it else it.getPrevSiblingIgnoringWhitespaceAndComments() }
|
||||
return lastChild?.takeIf { it.node.elementType == KtTokens.COMMA }
|
||||
}
|
||||
|
||||
val KtNameReferenceExpression.isUnderscoreInBackticks
|
||||
get() = getReferencedName() == "`_`"
|
||||
|
||||
Reference in New Issue
Block a user