Parcelable: Add CREATOR field (and other generated declarations) in light classes (KT-19300, KT-19853)
This commit is contained in:
@@ -392,10 +392,12 @@ public class ImplementationBodyCodegen extends ClassBodyCodegen {
|
||||
if (context.closure != null)
|
||||
genClosureFields(context.closure, v, typeMapper);
|
||||
|
||||
if (state.getClassBuilderMode() == ClassBuilderMode.LIGHT_CLASSES) return;
|
||||
|
||||
for (ExpressionCodegenExtension extension : ExpressionCodegenExtension.Companion.getInstances(state.getProject())) {
|
||||
extension.generateClassSyntheticParts(this);
|
||||
if (state.getClassBuilderMode() != ClassBuilderMode.LIGHT_CLASSES
|
||||
|| extension.getShouldGenerateClassSyntheticPartsInLightClassesMode()
|
||||
) {
|
||||
extension.generateClassSyntheticParts(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+3
@@ -47,4 +47,7 @@ interface ExpressionCodegenExtension {
|
||||
fun applyFunction(receiver: StackValue, resolvedCall: ResolvedCall<*>, c: Context): StackValue? = null
|
||||
|
||||
fun generateClassSyntheticParts(codegen: ImplementationBodyCodegen) {}
|
||||
|
||||
val shouldGenerateClassSyntheticPartsInLightClassesMode: Boolean
|
||||
get() = false
|
||||
}
|
||||
Reference in New Issue
Block a user