Files
kotlin-fork/analysis/analysis-api/testData/symbols/symbolByPsi/enumEntryProperties.descriptors.txt
T
Marco Pennekamp 80efa34926 [AA] Add KtEnumEntryInitializerSymbol
- An enum entry's body is an initializer with members only accessible
  within that body. Because users of the Analysis API might want to
  analyze the members of the enum entry initializer, we expose this
  initializer via `KtEnumEntrySymbol`. The initializer only exists if
  the enum entry has a body.
  - We already have some usages of the initializer inside symbol light
    classes, which generate a light class for each enum entry, which
    includes the enum entry's hidden members.
- To hide the implementation detail that initializers are anonymous
  objects, `KtEnumEntryInitializerSymbol` is simply a
  `KtSymbolWithMembers`.
- The advantage of making it a `KtSymbolWithMembers`, instead of
  providing a custom way to get a member scope, is that we can pass
  around the initializer easily, e.g. in `KtEnumEntrySymbolRenderer`.
- We implement `KtEnumEntryInitializerSymbol` directly as a
  `KtFirAnonymousObjectSymbol` without a wrapper. This has a few
  advantages:
  1. We can directly benefit from the anonymous object symbol being a
     `KtSymbolWithMembers`, so we don't have to handle enum entry
     initializers specially in e.g. `KtFirScopeProvider`.
  2. We don't have to implement a new symbol restoration mechanism for
     the initializer.
  3. This implementation matches the actual FIR tree structure (with a
     simplification that the connecting anonymous object expression
     between the enum entry and the initializing anonymous object is
     omitted).

^KT-61425 fixed
2023-09-08 11:13:28 +00:00

363 lines
9.5 KiB
Plaintext
Vendored

KtKotlinPropertySymbol:
annotationsList: []
backingFieldSymbol: KtBackingFieldSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
name: field
origin: PROPERTY_BACKING_FIELD
owningProperty: KtKotlinPropertySymbol(<local>/a)
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
callableIdIfNonLocal: null
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: kotlin/Int
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass.FirstEntry
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
hasBackingField: true
hasGetter: true
hasSetter: false
initializer: KtConstantInitializerValue(1)
isActual: false
isConst: false
isDelegatedProperty: false
isExpect: false
isExtension: false
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: a
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass.FirstEntry
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
getterDeprecationStatus: null
javaGetterName: getA
javaSetterName: null
setterDeprecationStatus: null
KtEnumEntrySymbol:
annotationsList: []
callableIdIfNonLocal: /MyEnumClass.FirstEntry
containingEnumClassIdIfNonLocal: MyEnumClass
contextReceivers: []
enumEntryInitializer: KtEnumEntrySymbol(/MyEnumClass.FirstEntry)
isExtension: false
name: FirstEntry
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass
symbolKind: CLASS_MEMBER
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtEnumEntrySymbol:
annotationsList: []
callableIdIfNonLocal: /MyEnumClass.SecondEntry
containingEnumClassIdIfNonLocal: MyEnumClass
contextReceivers: []
enumEntryInitializer: null
isExtension: false
name: SecondEntry
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass
symbolKind: CLASS_MEMBER
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtKotlinPropertySymbol:
annotationsList: []
backingFieldSymbol: KtBackingFieldSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
name: field
origin: PROPERTY_BACKING_FIELD
owningProperty: KtKotlinPropertySymbol(<local>/b)
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
callableIdIfNonLocal: null
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: kotlin/Int
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass.ThirdEntry
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
hasBackingField: true
hasGetter: true
hasSetter: false
initializer: KtConstantInitializerValue(2)
isActual: false
isConst: false
isDelegatedProperty: false
isExpect: false
isExtension: false
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: b
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass.ThirdEntry
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
getterDeprecationStatus: null
javaGetterName: getB
javaSetterName: null
setterDeprecationStatus: null
KtKotlinPropertySymbol:
annotationsList: []
backingFieldSymbol: KtBackingFieldSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
isExtension: false
name: field
origin: PROPERTY_BACKING_FIELD
owningProperty: KtKotlinPropertySymbol(<local>/d)
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
callableIdIfNonLocal: null
contextReceivers: []
getter: KtPropertyGetterSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
hasBody: true
hasStableParameterNames: true
isDefault: false
isExtension: false
isInline: false
isOverride: false
modality: FINAL
origin: SOURCE
receiverParameter: KtReceiverParameterSymbol:
annotationsList: []
origin: SOURCE
owningCallableSymbol: KtKotlinPropertySymbol(<local>/d)
type: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: ACCESSOR
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass.ThirdEntry
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
hasBackingField: false
hasGetter: true
hasSetter: false
initializer: null
isActual: false
isConst: false
isDelegatedProperty: false
isExpect: false
isExtension: true
isFromPrimaryConstructor: false
isLateInit: false
isOverride: false
isStatic: false
isVal: true
modality: FINAL
name: d
origin: SOURCE
receiverParameter: KtReceiverParameterSymbol:
annotationsList: []
origin: SOURCE
owningCallableSymbol: KtKotlinPropertySymbol(<local>/d)
type: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
setter: null
symbolKind: CLASS_MEMBER
typeParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass.ThirdEntry
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
getterDeprecationStatus: null
javaGetterName: getD
javaSetterName: null
setterDeprecationStatus: null
KtEnumEntrySymbol:
annotationsList: []
callableIdIfNonLocal: /MyEnumClass.ThirdEntry
containingEnumClassIdIfNonLocal: MyEnumClass
contextReceivers: []
enumEntryInitializer: KtEnumEntrySymbol(/MyEnumClass.ThirdEntry)
isExtension: false
name: ThirdEntry
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass
symbolKind: CLASS_MEMBER
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtNamedClassOrObjectSymbol:
annotationsList: []
classIdIfNonLocal: MyEnumClass
classKind: ENUM_CLASS
companionObject: null
contextReceivers: []
isActual: false
isData: false
isExpect: false
isExternal: false
isFun: false
isInline: false
isInner: false
modality: FINAL
name: MyEnumClass
origin: SOURCE
superTypes: [
KtUsualClassType:
annotationsList: []
ownTypeArguments: [
KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass
]
type: kotlin/Enum<MyEnumClass>
]
symbolKind: TOP_LEVEL
typeParameters: []
visibility: Public
getContainingModule: KtSourceModule "Sources of main"
annotationApplicableTargets: null
deprecationStatus: null