Files
kotlin-fork/analysis/analysis-api/testData/symbols/symbolByPsi/enumEntryFunctions.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

221 lines
5.4 KiB
Plaintext
Vendored

KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: a
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Unit
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass.FirstEntry
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: 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
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: one
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Unit
symbolKind: CLASS_MEMBER
typeParameters: []
valueParameters: []
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass.ThirdEntry
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
KtFunctionSymbol:
annotationsList: []
callableIdIfNonLocal: null
contextReceivers: []
contractEffects: []
hasStableParameterNames: true
isActual: false
isBuiltinFunctionInvoke: false
isExpect: false
isExtension: false
isExternal: false
isInfix: false
isInline: false
isOperator: false
isOverride: false
isStatic: false
isSuspend: false
modality: FINAL
name: one
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Unit
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: i
origin: SOURCE
receiverParameter: null
returnType: KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: kotlin/Int
symbolKind: LOCAL
typeParameters: []
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: null
]
visibility: Public
getDispatchReceiver(): KtUsualClassType:
annotationsList: []
ownTypeArguments: []
type: MyEnumClass.ThirdEntry
getContainingModule: KtSourceModule "Sources of main"
deprecationStatus: 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