majindong
09/26/2022, 3:21 AMprivate fun trackableSubClass(
thisDescriptor: ClassDescriptor
): ClassDescriptorImpl = object : ClassDescriptorImpl(
thisDescriptor,
Name.identifier(SUBCLASS_NAME),
Modality.FINAL,
ClassKind.CLASS,
emptyList<KotlinType>(),
thisDescriptor.source,
false,
LockBasedStorageManager.NO_LOCKS
) {
}.apply {
val a = ClassConstructorDescriptorImpl.create(
this,
Annotations.EMPTY,
true,
this.source
)
val b = a.initialize(
emptyList(),
DescriptorVisibilities.PUBLIC,
emptyList(),
)
this.initialize(
// 内部类的成员范围 MemberScope.Empty
MemberScope.Empty,
// 构造方法集合
emptySet(),
b
)
}
dmitriy.novozhilov
09/28/2022, 11:02 AM