80efa34926
- 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
558 lines
14 KiB
Plaintext
Vendored
558 lines
14 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
|
|
|
|
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: true
|
|
isStatic: false
|
|
isSuspend: false
|
|
modality: FINAL
|
|
name: foo
|
|
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
|
|
|
|
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: true
|
|
isStatic: false
|
|
isSuspend: false
|
|
modality: FINAL
|
|
name: foo
|
|
origin: SOURCE
|
|
receiverParameter: null
|
|
returnType: KtUsualClassType:
|
|
annotationsList: []
|
|
ownTypeArguments: []
|
|
type: kotlin/Unit
|
|
symbolKind: CLASS_MEMBER
|
|
typeParameters: []
|
|
valueParameters: []
|
|
visibility: Public
|
|
getDispatchReceiver(): KtUsualClassType:
|
|
annotationsList: []
|
|
ownTypeArguments: []
|
|
type: MyEnumClass.SecondEntry
|
|
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>/i)
|
|
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: true
|
|
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.SecondEntry
|
|
getContainingModule: KtSourceModule "Sources of main"
|
|
deprecationStatus: null
|
|
hasBackingField: false
|
|
hasGetter: true
|
|
hasSetter: false
|
|
initializer: null
|
|
isActual: false
|
|
isConst: false
|
|
isDelegatedProperty: false
|
|
isExpect: false
|
|
isExtension: false
|
|
isFromPrimaryConstructor: false
|
|
isLateInit: false
|
|
isOverride: true
|
|
isStatic: false
|
|
isVal: true
|
|
modality: FINAL
|
|
name: i
|
|
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.SecondEntry
|
|
getContainingModule: KtSourceModule "Sources of main"
|
|
deprecationStatus: null
|
|
getterDeprecationStatus: null
|
|
javaGetterName: getI
|
|
javaSetterName: null
|
|
setterDeprecationStatus: null
|
|
|
|
KtEnumEntrySymbol:
|
|
annotationsList: []
|
|
callableIdIfNonLocal: /MyEnumClass.SecondEntry
|
|
containingEnumClassIdIfNonLocal: MyEnumClass
|
|
contextReceivers: []
|
|
enumEntryInitializer: KtEnumEntrySymbol(/MyEnumClass.SecondEntry)
|
|
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: true
|
|
isStatic: false
|
|
isSuspend: false
|
|
modality: FINAL
|
|
name: foo
|
|
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: true
|
|
isStatic: false
|
|
isSuspend: false
|
|
modality: FINAL
|
|
name: foo
|
|
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
|
|
|
|
KtFunctionSymbol:
|
|
annotationsList: []
|
|
callableIdIfNonLocal: /MyEnumClass.foo
|
|
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: ABSTRACT
|
|
name: foo
|
|
origin: SOURCE
|
|
receiverParameter: null
|
|
returnType: KtUsualClassType:
|
|
annotationsList: []
|
|
ownTypeArguments: []
|
|
type: kotlin/Unit
|
|
symbolKind: CLASS_MEMBER
|
|
typeParameters: []
|
|
valueParameters: []
|
|
visibility: Public
|
|
getDispatchReceiver(): KtUsualClassType:
|
|
annotationsList: []
|
|
ownTypeArguments: []
|
|
type: MyEnumClass
|
|
getContainingModule: KtSourceModule "Sources of main"
|
|
deprecationStatus: null
|
|
|
|
KtFunctionSymbol:
|
|
annotationsList: []
|
|
callableIdIfNonLocal: /MyEnumClass.foo
|
|
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: OPEN
|
|
name: foo
|
|
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
|
|
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(/MyEnumClass.i)
|
|
receiverParameter: null
|
|
returnType: KtUsualClassType:
|
|
annotationsList: []
|
|
ownTypeArguments: []
|
|
type: kotlin/Int
|
|
symbolKind: LOCAL
|
|
typeParameters: []
|
|
getContainingModule: KtSourceModule "Sources of main"
|
|
deprecationStatus: null
|
|
callableIdIfNonLocal: /MyEnumClass.i
|
|
contextReceivers: []
|
|
getter: KtPropertyGetterSymbol:
|
|
annotationsList: []
|
|
callableIdIfNonLocal: null
|
|
contextReceivers: []
|
|
hasBody: false
|
|
hasStableParameterNames: true
|
|
isDefault: true
|
|
isExtension: false
|
|
isInline: false
|
|
isOverride: false
|
|
modality: OPEN
|
|
origin: SOURCE
|
|
receiverParameter: null
|
|
returnType: KtUsualClassType:
|
|
annotationsList: []
|
|
ownTypeArguments: []
|
|
type: kotlin/Int
|
|
symbolKind: ACCESSOR
|
|
typeParameters: []
|
|
valueParameters: []
|
|
visibility: Public
|
|
getDispatchReceiver(): KtUsualClassType:
|
|
annotationsList: []
|
|
ownTypeArguments: []
|
|
type: MyEnumClass
|
|
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: OPEN
|
|
name: i
|
|
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
|
|
getContainingModule: KtSourceModule "Sources of main"
|
|
deprecationStatus: null
|
|
getterDeprecationStatus: null
|
|
javaGetterName: getI
|
|
javaSetterName: null
|
|
setterDeprecationStatus: 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 |