Set hasValueArguments in KotlinAnnotationEntryStub to 'true' only if some arguments exist

Currently '()' is used for resolving ambiguity in parsing when annotating function types. This way a decompiled code
will need brackets, but compile code will have annotation without parameters. This commit will allow to make both stub-trees consistent.

Tested in ClsStubBuilderTestGenerated.testAnnotationsOnNullableTypes()
This commit is contained in:
Nikolay Krasko
2016-10-24 15:51:33 +03:00
parent a344ad0644
commit 22999fe67d
5 changed files with 22 additions and 2 deletions
@@ -1,4 +1,5 @@
@a public class Annotations private @a constructor(private @property:a @param:a val c1: Int, @property:a @param:a val c2: Int) {
@a() val hasValueArguments = 42
protected @a fun f() {
}
@@ -88,6 +88,18 @@ PsiJetFileStubImpl[package=]
USER_TYPE
REFERENCE_EXPRESSION[referencedName=kotlin]
REFERENCE_EXPRESSION[referencedName=Int]
PROPERTY[fqName=Annotations.hasValueArguments, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=hasValueArguments]
MODIFIER_LIST[public final]
ANNOTATION_ENTRY[hasValueArguments=false, shortName=a]
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION[referencedName=a]
TYPE_REFERENCE
USER_TYPE
USER_TYPE
REFERENCE_EXPRESSION[referencedName=kotlin]
REFERENCE_EXPRESSION[referencedName=Int]
PROPERTY[fqName=Annotations.withCustomAccessors, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=true, name=withCustomAccessors]
MODIFIER_LIST[public final]
TYPE_REFERENCE
@@ -54,6 +54,11 @@ PsiJetFileStubImpl[package=]
PROPERTY[fqName=AnnotationsOnNullableTypes.lambdaType, hasDelegate=false, hasDelegateExpression=false, hasInitializer=false, hasReturnTypeRef=true, isExtension=false, isTopLevel=false, isVar=false, name=lambdaType]
MODIFIER_LIST[public final]
TYPE_REFERENCE
ANNOTATION_ENTRY[hasValueArguments=false, shortName=A]
CONSTRUCTOR_CALLEE
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION[referencedName=A]
NULLABLE_TYPE
FUNCTION_TYPE
VALUE_PARAMETER_LIST