diff --git a/ChangeLog.md b/ChangeLog.md index 4e6f3b2fcb1..39fc724ab00 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -3,6 +3,13 @@ +## 1.1-M03 (EAP-3) + +### Compiler + +#### Coroutines related issues +- Make fields for storing lambda parameters non-final (as they get assigned within `invoke` call) + ## 1.1-M02 (EAP-2) ### Language features diff --git a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt index 742b018f5ff..0acd0c7d2c5 100644 --- a/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt +++ b/compiler/backend/src/org/jetbrains/kotlin/codegen/coroutines/CoroutineCodegen.kt @@ -59,7 +59,7 @@ class CoroutineCodegen( for (parameter in funDescriptor.valueParameters) { v.newField( OtherOrigin(parameter), - Opcodes.ACC_PRIVATE or Opcodes.ACC_FINAL, + Opcodes.ACC_PRIVATE, COROUTINE_LAMBDA_PARAMETER_PREFIX + parameter.index, typeMapper.mapType(parameter.type).descriptor, null, null) } diff --git a/compiler/testData/codegen/bytecodeListing/coroutineFields.txt b/compiler/testData/codegen/bytecodeListing/coroutineFields.txt index a51e1efbb2c..959727121c8 100644 --- a/compiler/testData/codegen/bytecodeListing/coroutineFields.txt +++ b/compiler/testData/codegen/bytecodeListing/coroutineFields.txt @@ -10,8 +10,8 @@ final class CoroutineFieldsKt$box$1 { private field J$0: long private field L$0: java.lang.Object private field L$1: java.lang.Object - private final field p$0: java.lang.String - private final field p$1: long + private field p$0: java.lang.String + private field p$1: long inner class CoroutineFieldsKt$box$1 method (p0: kotlin.jvm.internal.Ref$ObjectRef): void protected final method doResume(@org.jetbrains.annotations.Nullable p0: java.lang.Object, @org.jetbrains.annotations.Nullable p1: java.lang.Throwable): void