File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
core/descriptor.loader.java/src/org/jetbrains/kotlin/load/kotlin Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,12 @@ open class JvmBuiltInsSettings(
107
107
108
108
override fun getFunctions (name : Name , classDescriptor : DeserializedClassDescriptor ): Collection <SimpleFunctionDescriptor > {
109
109
if (name == CloneableClassScope .CLONE_NAME && KotlinBuiltIns .isArrayOrPrimitiveArray(classDescriptor)) {
110
+ // Do not create clone for arrays deserialized from metadata in the old (1.0) runtime, because clone is declared there anyway
111
+ if (classDescriptor.classProto.functionList.any { functionProto ->
112
+ classDescriptor.c.nameResolver.getName(functionProto.name) == CloneableClassScope .CLONE_NAME
113
+ }) {
114
+ return emptyList()
115
+ }
110
116
return listOf (createCloneForArray(
111
117
classDescriptor, cloneableType.memberScope.getContributedFunctions(name, NoLookupLocation .FROM_BUILTINS ).single()
112
118
))
@@ -199,6 +205,7 @@ open class JvmBuiltInsSettings(
199
205
setOwner(arrayClassDescriptor)
200
206
setVisibility(Visibilities .PUBLIC )
201
207
setReturnType(arrayClassDescriptor.defaultType)
208
+ setDispatchReceiverParameter(arrayClassDescriptor.thisAsReceiverParameter)
202
209
}.build()!!
203
210
204
211
private fun SimpleFunctionDescriptor.isMutabilityViolation (isMutable : Boolean ): Boolean {
You can’t perform that action at this time.
0 commit comments