[Stubs] Fix stub inconsistency on unnamed setter parameters
If an unused setter parameter was replaced with an underscore ('_'),
it had a special name in the stub ('<anonymous parameter 0>'). The text
version of the stub inserted it as is, leading to an extra
'PsiErrorElement'.
^KTIJ-28194 Fixed
This commit is contained in:
@@ -42,6 +42,7 @@ import org.jetbrains.kotlin.diagnostics.Errors;
|
||||
import org.jetbrains.kotlin.incremental.components.NoLookupLocation;
|
||||
import org.jetbrains.kotlin.lexer.KtTokens;
|
||||
import org.jetbrains.kotlin.name.Name;
|
||||
import org.jetbrains.kotlin.name.SpecialNames;
|
||||
import org.jetbrains.kotlin.psi.*;
|
||||
import org.jetbrains.kotlin.psi.psiUtil.PsiUtilsKt;
|
||||
import org.jetbrains.kotlin.resolve.calls.components.InferenceSession;
|
||||
@@ -366,7 +367,7 @@ public class DescriptorResolver {
|
||||
// of containing class where, it can not find a descriptor with special name.
|
||||
// Thus, to preserve behavior, we don't use a special name for val/var.
|
||||
parameterName = !valueParameter.hasValOrVar() && UnderscoreUtilKt.isSingleUnderscore(valueParameter)
|
||||
? Name.special("<anonymous parameter " + index + ">")
|
||||
? SpecialNames.anonymousParameterName(index)
|
||||
: KtPsiUtil.safeName(valueParameter.getName());
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user