Skip to content

Commit da87efe

Browse files
committed
Added ACC_SYNTHETIC flag to generated by kotlin Android extensions onDestroyView method
#KT-14610 Fixed
1 parent db1d2bf commit da87efe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/android-extensions/android-extensions-compiler/src/org/jetbrains/kotlin/android/synthetic/codegen/AndroidExpressionCodegenExtension.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import org.jetbrains.kotlin.types.lowerIfFlexible
4040
import org.jetbrains.org.objectweb.asm.Label
4141
import org.jetbrains.org.objectweb.asm.Opcodes.ACC_PRIVATE
4242
import org.jetbrains.org.objectweb.asm.Opcodes.ACC_PUBLIC
43+
import org.jetbrains.org.objectweb.asm.Opcodes.ACC_SYNTHETIC
4344
import org.jetbrains.org.objectweb.asm.Type
4445
import org.jetbrains.org.objectweb.asm.commons.InstructionAdapter
4546

@@ -282,7 +283,7 @@ class AndroidExpressionCodegenExtension : ExpressionCodegenExtension {
282283
// This generates a simple onDestroy(): Unit = super.onDestroy() function.
283284
// CLEAR_CACHE_METHOD_NAME() method call will be inserted in ClassBuilder interceptor.
284285
private fun SyntheticPartsGenerateContext.generateOnDestroyFunctionForFragment() {
285-
val methodVisitor = classBuilder.newMethod(JvmDeclarationOrigin.NO_ORIGIN, ACC_PUBLIC, ON_DESTROY_METHOD_NAME, "()V", null, null)
286+
val methodVisitor = classBuilder.newMethod(JvmDeclarationOrigin.NO_ORIGIN, ACC_PUBLIC or ACC_SYNTHETIC, ON_DESTROY_METHOD_NAME, "()V", null, null)
286287
methodVisitor.visitCode()
287288
val iv = InstructionAdapter(methodVisitor)
288289

0 commit comments

Comments
 (0)