[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:
Yan Zhulanow
2023-12-14 15:27:26 +09:00
committed by Space Team
parent 552ee1ee38
commit c8af3381d6
14 changed files with 104 additions and 12 deletions
@@ -0,0 +1,8 @@
// FIR_IDENTICAL
package test
class UnderscoreParameterName {
var foo: String?
get() = null
set(_) {}
}
@@ -0,0 +1,30 @@
PsiJetFileStubImpl[package=test]
PACKAGE_DIRECTIVE
REFERENCE_EXPRESSION[referencedName=test]
IMPORT_LIST
CLASS[classId=test/UnderscoreParameterName, fqName=test.UnderscoreParameterName, isEnumEntry=false, isInterface=false, isLocal=false, isTopLevel=true, name=UnderscoreParameterName, superNames=[]]
MODIFIER_LIST[public final]
PRIMARY_CONSTRUCTOR[fqName=null, hasBody=false, isDelegatedCallToThis=false, isExtension=false, isTopLevel=false, name=UnderscoreParameterName]
MODIFIER_LIST[public]
VALUE_PARAMETER_LIST
CLASS_BODY
PROPERTY[fqName=test.UnderscoreParameterName.foo, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=true, name=foo]
MODIFIER_LIST[public final]
TYPE_REFERENCE
NULLABLE_TYPE
USER_TYPE
USER_TYPE
REFERENCE_EXPRESSION[referencedName=kotlin]
REFERENCE_EXPRESSION[referencedName=String]
PROPERTY_ACCESSOR[hasBlockBody=true, hasBody=false, isGetter=true]
MODIFIER_LIST[public final]
PROPERTY_ACCESSOR[hasBlockBody=true, hasBody=true, isGetter=false]
MODIFIER_LIST[public final]
VALUE_PARAMETER_LIST
VALUE_PARAMETER[fqName=null, hasDefaultValue=false, hasValOrVar=false, isMutable=false, name=_]
TYPE_REFERENCE
NULLABLE_TYPE
USER_TYPE
USER_TYPE
REFERENCE_EXPRESSION[referencedName=kotlin]
REFERENCE_EXPRESSION[referencedName=String]