Codegen generates static backing fields for object properties.
They are initialized in class constructor but some of them are final static
and such access is prohibited in specification but it's allowed in
java bytecode <= 1.8. Such access in 1.9 bytecode cause
"IllegalAccessError: Update to static final field Object.INSTANCE
attempted from a different method (<init>) than the initializer method <clinit>"
Added additional hidden field in interface companion to pass out
companion instance from <clinit>.
#KT-15894 Fixed
The reason is that when it gets captured into the field
having name $$continuation inliner fails with an exception
as it skips fields starting with '$$'
At the same time it doesn't really matter how to call
that parameter because it's only visible in Java
#KT-17585 In Progress
#KT-16603 In Progress
The meaning of `setDropOriginalInContainingParts()` call is that
it makes copyBuilder forget the original parts, in particular
the valueParameter.original.containingDeclaration does not reference
original descriptor no more
Otherwise the following exception is happening:
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl.getOverriddenDescriptors(ValueParameterDescriptorImpl.kt:119)
at java.util.ArrayList.RangeCheck(ArrayList.java:547)
at java.util.ArrayList.get(ArrayList.java:322)
at org.jetbrains.kotlin.descriptors.impl.ValueParameterDescriptorImpl.getOverriddenDescriptors(ValueParameterDescriptorImpl.kt:119)
at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt$hasDefaultValue$1.getNeighbors(DescriptorUtils.kt:192)
at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt$hasDefaultValue$1.getNeighbors(DescriptorUtils.kt)
at org.jetbrains.kotlin.utils.DFS.doDfs(DFS.java:98)
at org.jetbrains.kotlin.utils.DFS.doDfs(DFS.java:99)
at org.jetbrains.kotlin.utils.DFS.dfs(DFS.java:27)
at org.jetbrains.kotlin.utils.DFS.dfs(DFS.java:37)
at org.jetbrains.kotlin.utils.DFS.ifAny(DFS.java:47)
at org.jetbrains.kotlin.resolve.descriptorUtil.DescriptorUtilsKt.hasDefaultValue(DescriptorUtils.kt:189)
at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderValueParameter(DescriptorRendererImpl.kt:803)
at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderValueParameters(DescriptorRendererImpl.kt:767)
at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.renderFunction(DescriptorRendererImpl.kt:683)
at org.jetbrains.kotlin.renderer.DescriptorRendererImpl.access$renderFunction(DescriptorRendererImpl.kt:42)
at org.jetbrains.kotlin.renderer.DescriptorRendererImpl$RenderDeclarationDescriptorVisitor.visitFunctionDescriptor(DescriptorRendererImpl.kt:1039)
at org.jetbrains.kotlin.renderer.DescriptorRendererImpl$RenderDeclarationDescriptorVisitor.visitFunctionDescriptor(DescriptorRendererImpl.kt:1002)
at org.jetbrains.kotlin.descriptors.impl.FunctionDescriptorImpl.accept(FunctionDescriptorImpl.java:760)
Do not query MultifileClassCodegen#classBuilder early on: this causes the class
file for the facade to be prematurely dumped to the disk in some cases, when
that class file is not yet completely generated. Instead fork the logic in
PropertyCodegen#generateSyntheticMethodIfNeeded: save metadata in parts,
generate method in the facade