[Analysis API] add tests for delegate field

^KT-64584
This commit is contained in:
Dmitrii Gridin
2023-12-27 17:50:23 +01:00
committed by Space Team
parent 3f337bf62d
commit 06950f57db
22 changed files with 573 additions and 2 deletions
@@ -0,0 +1,13 @@
// FILE: A.kt
interface A {
var Int.zoo: Unit
fun foo()
fun Int.smth(): Short
val foo: Int
var bar: Long
val Int.doo: String
}
®
class I(private val p: A) : A by p
// class: I
@@ -0,0 +1,3 @@
private val p: A
constructor(p: A)
@@ -0,0 +1,229 @@
KtKotlinPropertySymbol:
annotationsList: []
backingFieldSymbol: KtBackingFieldSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
name: field
origin: PROPERTY_BACKING_FIELD
owningProperty: KtKotlinPropertySymbol(/I.p)
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
symbolKind: LOCAL
typeParameters: []
getContainingFileSymbol: KtFileSymbol(A.kt)
getContainingJvmClassName: I
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
callableIdIfNonLocal: /I.p
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: false
hasStableParameterNames: true
isDefault: true
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Private
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: I
getContainingFileSymbol: KtFileSymbol(A.kt)
getContainingJvmClassName: I
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
hasBackingField: true
hasGetter: true
hasSetter: false
initializer: KtNonConstantInitializerValue(private val p: A)
isActual: false
isConst: false
isDelegatedProperty: false
isExpect: false
isExtension: false
isFromPrimaryConstructor: true
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: p
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Private
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: I
getContainingFileSymbol: KtFileSymbol(A.kt)
getContainingJvmClassName: I
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
getterDeprecationStatus: null
javaGetterName: getP
javaSetterName: null
setterDeprecationStatus: null
KtConstructorSymbol:
annotationsList: []
callableIdIfNonLocal: null
containingClassIdIfNonLocal: I
contextReceivers: []
hasStableParameterNames: true
isActual: false
isExpect: false
isExtension: false
isPrimary: true
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: I
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: KtKotlinPropertySymbol:
annotationsList: []
backingFieldSymbol: KtBackingFieldSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
name: field
origin: PROPERTY_BACKING_FIELD
owningProperty: KtKotlinPropertySymbol(/I.p)
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
symbolKind: LOCAL
typeParameters: []
getContainingFileSymbol: KtFileSymbol(A.kt)
getContainingJvmClassName: I
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
callableIdIfNonLocal: /I.p
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: false
hasStableParameterNames: true
isDefault: true
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Private
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: I
getContainingFileSymbol: KtFileSymbol(A.kt)
getContainingJvmClassName: I
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
hasBackingField: true
hasGetter: true
hasSetter: false
initializer: KtNonConstantInitializerValue(private val p: A)
isActual: false
isConst: false
isDelegatedProperty: false
isExpect: false
isExtension: false
isFromPrimaryConstructor: true
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: p
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Private
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: I
getContainingFileSymbol: KtFileSymbol(A.kt)
getContainingJvmClassName: I
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
getterDeprecationStatus: null
javaGetterName: getP
javaSetterName: null
setterDeprecationStatus: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: p
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
symbolKind: LOCAL
typeParameters: []
getContainingFileSymbol: KtFileSymbol(A.kt)
getContainingJvmClassName: I
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
]
visibility: Public
getContainingFileSymbol: KtFileSymbol(A.kt)
getContainingJvmClassName: I
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
@@ -0,0 +1,16 @@
// MODULE: main
// MODULE_KIND: LibraryBinary
// FILE: A.kt
interface A {
var Int.zoo: Unit
fun foo()
fun Int.smth(): Short
val foo: Int
var bar: Long
val Int.doo: String
}
class I(private val p: A) : A by p
// class: I
@@ -0,0 +1,3 @@
private val p: A
constructor(p: A)
@@ -0,0 +1,140 @@
KtKotlinPropertySymbol:
annotationsList: []
backingFieldSymbol: KtBackingFieldSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
name: field
origin: PROPERTY_BACKING_FIELD
owningProperty: KtKotlinPropertySymbol(/I.p)
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
symbolKind: LOCAL
typeParameters: []
getContainingFileSymbol: KtFileSymbol(I.class)
getContainingJvmClassName: I
getContainingModule: KtLibraryModule "Library main"
deprecationStatus: null
callableIdIfNonLocal: /I.p
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: false
hasStableParameterNames: true
isDefault: true
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Private
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: I
getContainingFileSymbol: KtFileSymbol(I.class)
getContainingJvmClassName: I
getContainingModule: KtLibraryModule "Library main"
deprecationStatus: null
hasBackingField: true
hasGetter: true
hasSetter: false
initializer: null
isActual: false
isConst: false
isDelegatedProperty: false
isExpect: false
isExtension: false
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: p
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Private
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: I
getContainingFileSymbol: KtFileSymbol(I.class)
getContainingJvmClassName: I
getContainingModule: KtLibraryModule "Library main"
deprecationStatus: null
getterDeprecationStatus: null
javaGetterName: getP
javaSetterName: null
setterDeprecationStatus: null
KtConstructorSymbol:
annotationsList: []
callableIdIfNonLocal: null
containingClassIdIfNonLocal: I
contextReceivers: []
hasStableParameterNames: true
isActual: false
isExpect: false
isExtension: false
isPrimary: true
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: I
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: [
KtValueParameterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
generatedPrimaryConstructorProperty: null
hasDefaultValue: false
isCrossinline: false
isExtension: false
isImplicitLambdaParameter: false
isNoinline: false
isVararg: false
name: p
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: A
symbolKind: LOCAL
typeParameters: []
getContainingFileSymbol: KtFileSymbol(I.class)
getContainingJvmClassName: I
getContainingModule: KtLibraryModule "Library main"
deprecationStatus: null
]
visibility: Public
getContainingFileSymbol: KtFileSymbol(I.class)
getContainingJvmClassName: I
getContainingModule: KtLibraryModule "Library main"
deprecationStatus: null