[AA] more tests on receiver annotations

^KT-54311
^KT-54385
^KT-54417
This commit is contained in:
Dmitrii Gridin
2022-10-12 15:22:23 +02:00
committed by Space Team
parent b8a64d20ac
commit ba7d340090
22 changed files with 648 additions and 4 deletions
@@ -0,0 +1,8 @@
fun (@ReceiverTypeAnnotation kotlin.Int).foo()
val (@ReceiverTypeAnnotation kotlin.Long).prop: kotlin.Boolean
annotation class ReceiverAnnotation
@kotlin.annotation.Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE])
annotation class ReceiverTypeAnnotation
@@ -0,0 +1,157 @@
KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: ReceiverAnnotation
classKind: ANNOTATION_CLASS
companionObject: null
contextReceivers: []
isData: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: ReceiverAnnotation
origin: SOURCE
superTypes: [
kotlin/Annotation
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtNamedClassOrObjectSymbol:
annotationsList: [
kotlin/annotation/Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE])
psi: KtAnnotationEntry
]
classIdIfNonLocal: ReceiverTypeAnnotation
classKind: ANNOTATION_CLASS
companionObject: null
contextReceivers: []
isData: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: ReceiverTypeAnnotation
origin: SOURCE
superTypes: [
kotlin/Annotation
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /foo
contextReceivers: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: true
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: foo
origin: SOURCE
receiverType: [
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @R|ReceiverTypeAnnotation|() kotlin/Int
returnType: kotlin/Unit
symbolKind: TOP_LEVEL
typeParameters: []
valueParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: true
hasStableParameterNames: true
isDefault: false
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverType: [
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: /prop
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: true
hasStableParameterNames: true
isDefault: false
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverType: [
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
hasBackingField: false
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: true
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: prop
origin: SOURCE
receiverType: [
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
setter: null
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
getterDeprecationStatus: null
javaGetterName: getProp
javaSetterName: null
setterDeprecationStatus: null
@@ -0,0 +1,7 @@
annotation class ReceiverAnnotation
@Target(AnnotationTarget.TYPE)
annotation class ReceiverTypeAnnotation
fun @receiver:ReceiverAnnotation @ReceiverTypeAnnotation Int.foo() {}
val @receiver:ReceiverAnnotation @ReceiverTypeAnnotation Long.prop: Boolean get() = true
@@ -0,0 +1,8 @@
fun @ReceiverAnnotation @ReceiverTypeAnnotation kotlin.Int.foo()
val @ReceiverAnnotation @ReceiverTypeAnnotation kotlin.Long.prop: kotlin.Boolean
annotation class ReceiverAnnotation
@kotlin.annotation.Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE])
annotation class ReceiverTypeAnnotation
@@ -0,0 +1,165 @@
KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: ReceiverAnnotation
classKind: ANNOTATION_CLASS
companionObject: null
contextReceivers: []
isData: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: ReceiverAnnotation
origin: SOURCE
superTypes: [
kotlin/Annotation
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtNamedClassOrObjectSymbol:
annotationsList: [
kotlin/annotation/Target(allowedTargets = [kotlin.annotation.AnnotationTarget.TYPE])
psi: KtAnnotationEntry
]
classIdIfNonLocal: ReceiverTypeAnnotation
classKind: ANNOTATION_CLASS
companionObject: null
contextReceivers: []
isData: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: ReceiverTypeAnnotation
origin: SOURCE
superTypes: [
kotlin/Annotation
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /foo
contextReceivers: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: true
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: foo
origin: SOURCE
receiverType: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Int
returnType: kotlin/Unit
symbolKind: TOP_LEVEL
typeParameters: []
valueParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: true
hasStableParameterNames: true
isDefault: false
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverType: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: /prop
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: true
hasStableParameterNames: true
isDefault: false
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverType: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
hasBackingField: false
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: true
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: prop
origin: SOURCE
receiverType: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
setter: null
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
getterDeprecationStatus: null
javaGetterName: getProp
javaSetterName: null
setterDeprecationStatus: null
@@ -0,0 +1 @@
fun (@ReceiverTypeAnnotation kotlin.Int).foo()
@@ -0,0 +1,28 @@
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: /foo
contextReceivers: []
hasStableParameterNames: true
isBuiltinFunctionInvoke: false
isExtension: true
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: foo
origin: SOURCE
receiverType: [
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @R|ReceiverTypeAnnotation|() kotlin/Int
returnType: kotlin/Unit
symbolKind: TOP_LEVEL
typeParameters: []
valueParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
@@ -0,0 +1,9 @@
// DO_NOT_CHECK_SYMBOL_RESTORE_K2
annotation class ReceiverAnnotation
@Target(AnnotationTarget.TYPE)
annotation class ReceiverTypeAnnotation
fun @receiver:ReceiverAnnotation @ReceiverTypeAnnotation Int.foo() {
thi<caret>s
}
@@ -0,0 +1,9 @@
KtReceiverParameterSymbol:
origin: SOURCE
owningCallableSymbol: KtFunctionSymbol(/foo)
type: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Int
@@ -0,0 +1,12 @@
KtReceiverParameterSymbol:
origin: SOURCE
owningCallableSymbol: KtFunctionSymbol(/foo)
type: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Int
getContainingModule: Could not render due to java.lang.IllegalArgumentException: Failed requirement.
deprecationStatus: Could not render due to java.lang.IllegalArgumentException: Failed requirement.
@@ -0,0 +1 @@
val (@ReceiverTypeAnnotation kotlin.Long).prop: kotlin.Boolean
@@ -0,0 +1,55 @@
KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: /prop
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: true
hasStableParameterNames: true
isDefault: false
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverType: [
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
hasBackingField: false
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: true
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: prop
origin: SOURCE
receiverType: [
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
setter: null
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
getterDeprecationStatus: null
javaGetterName: getProp
javaSetterName: null
setterDeprecationStatus: null
@@ -0,0 +1,7 @@
annotation class ReceiverAnnotation
@Target(AnnotationTarget.TYPE)
annotation class ReceiverTypeAnnotation
val @receiver:ReceiverAnnotation @ReceiverTypeAnnotation Long.prop: Boolean get() = { t<caret>his == 1 }
// DO_NOT_CHECK_SYMBOL_RESTORE_K2
@@ -0,0 +1,61 @@
KtReceiverParameterSymbol:
origin: SOURCE
owningCallableSymbol: KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: /prop
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: true
hasStableParameterNames: true
isDefault: false
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverType: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
hasBackingField: false
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: true
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: prop
origin: SOURCE
receiverType: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
setter: null
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
type: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Long
@@ -0,0 +1,64 @@
KtReceiverParameterSymbol:
origin: SOURCE
owningCallableSymbol: KtKotlinPropertySymbol:
annotationsList: []
callableIdIfNonLocal: /prop
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: true
hasStableParameterNames: true
isDefault: false
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverType: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
hasBackingField: false
hasGetter: true
hasSetter: false
initializer: null
isConst: false
isDelegatedProperty: false
isExtension: true
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: prop
origin: SOURCE
receiverType: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Long
returnType: kotlin/Boolean
setter: null
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
type: [
ReceiverAnnotation()
psi: KtAnnotationEntry
ReceiverTypeAnnotation()
psi: KtAnnotationEntry
] @RECEIVER:R|ReceiverAnnotation|() @R|ReceiverTypeAnnotation|() kotlin/Long
getContainingModule: Could not render due to java.lang.IllegalArgumentException: Failed requirement.
deprecationStatus: Could not render due to java.lang.IllegalArgumentException: Failed requirement.