Fix annotation class modality in stubs
^KT-49428
This commit is contained in:
@@ -244,6 +244,14 @@ abstract class DeclarationStubGenerator(
|
||||
}
|
||||
}
|
||||
|
||||
// in IR Generator enums also have special handling, but here we have not enough data for it
|
||||
// probably, that is not a problem, because you can't add new enum value to external module
|
||||
private fun getEffectiveModality(classDescriptor: ClassDescriptor): Modality =
|
||||
if (DescriptorUtils.isAnnotationClass(classDescriptor))
|
||||
Modality.OPEN
|
||||
else
|
||||
classDescriptor.modality
|
||||
|
||||
fun generateClassStub(descriptor: ClassDescriptor): IrClass {
|
||||
val referenceClass = symbolTable.referenceClass(descriptor)
|
||||
if (referenceClass.isBound) {
|
||||
@@ -254,7 +262,7 @@ abstract class DeclarationStubGenerator(
|
||||
IrLazyClass(
|
||||
UNDEFINED_OFFSET, UNDEFINED_OFFSET, origin,
|
||||
it, descriptor,
|
||||
descriptor.name, descriptor.kind, descriptor.visibility, descriptor.modality,
|
||||
descriptor.name, descriptor.kind, descriptor.visibility, getEffectiveModality(descriptor),
|
||||
isCompanion = descriptor.isCompanionObject,
|
||||
isInner = descriptor.isInner,
|
||||
isData = descriptor.isData,
|
||||
|
||||
Reference in New Issue
Block a user