Update Kotlin-metadata-jvm to 2.3.10
This should support Kotlin 2.4.
Fixes: b/483341894
Change-Id: Id03c136e286f4f9c826ae30c37c613c9e35b0084
diff --git a/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt b/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt
index ffdedcd..0da4e3c 100644
--- a/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt
+++ b/d8_r8/commonBuildSrc/src/main/kotlin/DependenciesPlugin.kt
@@ -450,7 +450,7 @@
public const val javassist = "3.29.2-GA"
public const val junitVersion = "4.13-beta-2"
public const val kotlinVersion = "1.9.20"
- public const val kotlinMetadataVersion = "2.2.10"
+ public const val kotlinMetadataVersion = "2.3.10"
public const val mockito = "2.10.0"
public const val smaliVersion = "3.0.3"
public const val protobufVersion = "3.19.3"
diff --git a/src/main/java/com/android/tools/r8/kotlin/ConcreteKotlinPropertyInfo.java b/src/main/java/com/android/tools/r8/kotlin/ConcreteKotlinPropertyInfo.java
index 6fa9e6b..0615f95 100644
--- a/src/main/java/com/android/tools/r8/kotlin/ConcreteKotlinPropertyInfo.java
+++ b/src/main/java/com/android/tools/r8/kotlin/ConcreteKotlinPropertyInfo.java
@@ -45,7 +45,7 @@
private final KotlinJvmMethodSignatureInfo syntheticMethodForDelegate;
// Collection of context receiver types
- private final List<KotlinTypeInfo> contextReceiverTypes;
+ private final List<KotlinValueParameterInfo> contextParameters;
private ConcreteKotlinPropertyInfo(
KmProperty kmProperty,
@@ -58,7 +58,7 @@
KotlinJvmMethodSignatureInfo setterSignature,
KotlinJvmMethodSignatureInfo syntheticMethodForAnnotations,
KotlinJvmMethodSignatureInfo syntheticMethodForDelegate,
- List<KotlinTypeInfo> contextReceiverTypes) {
+ List<KotlinValueParameterInfo> contextParameters) {
assert returnType != null;
this.kmProperty = kmProperty;
this.returnType = returnType;
@@ -70,7 +70,7 @@
this.setterSignature = setterSignature;
this.syntheticMethodForAnnotations = syntheticMethodForAnnotations;
this.syntheticMethodForDelegate = syntheticMethodForDelegate;
- this.contextReceiverTypes = contextReceiverTypes;
+ this.contextParameters = contextParameters;
}
public static ConcreteKotlinPropertyInfo create(
@@ -91,8 +91,9 @@
KotlinJvmMethodSignatureInfo.create(
JvmExtensionsKt.getSyntheticMethodForDelegate(kmProperty), factory),
ListUtils.map(
- kmProperty.getContextReceiverTypes(),
- contextRecieverType -> KotlinTypeInfo.create(contextRecieverType, factory, reporter)));
+ kmProperty.getContextParameters(),
+ kmValueParameter ->
+ KotlinValueParameterInfo.create(kmValueParameter, factory, reporter)));
}
@Override
@@ -155,9 +156,9 @@
rewritten |=
rewriteList(
appView,
- contextReceiverTypes,
- rewrittenKmProperty.getContextReceiverTypes(),
- KotlinTypeInfo::rewrite);
+ contextParameters,
+ rewrittenKmProperty.getContextParameters(),
+ KotlinValueParameterInfo::rewrite);
rewrittenKmProperty.getVersionRequirements().addAll(kmProperty.getVersionRequirements());
if (fieldSignature != null) {
rewritten |=
@@ -209,7 +210,7 @@
setterParameter.trace(registry);
}
forEachApply(typeParameters, param -> param::trace, registry);
- forEachApply(contextReceiverTypes, type -> type::trace, registry);
+ forEachApply(contextParameters, type -> type::trace, registry);
if (fieldSignature != null) {
fieldSignature.trace(registry);
}
diff --git a/src/main/java/com/android/tools/r8/kotlin/KotlinFunctionInfo.java b/src/main/java/com/android/tools/r8/kotlin/KotlinFunctionInfo.java
index ac718b1..6d94fd9 100644
--- a/src/main/java/com/android/tools/r8/kotlin/KotlinFunctionInfo.java
+++ b/src/main/java/com/android/tools/r8/kotlin/KotlinFunctionInfo.java
@@ -39,7 +39,7 @@
// A value describing if any of the parameters are crossinline.
private final boolean crossInlineParameter;
// Collection of context receiver types
- private final List<KotlinTypeInfo> contextReceiverTypes;
+ private final List<KotlinValueParameterInfo> contextParameters;
private KotlinFunctionInfo(
KmFunction kmFunction,
@@ -51,7 +51,7 @@
KotlinTypeReference lambdaClassOrigin,
KotlinContractInfo contract,
boolean crossInlineParameter,
- List<KotlinTypeInfo> contextReceiverTypes) {
+ List<KotlinValueParameterInfo> contextParameters) {
this.kmFunction = kmFunction;
this.returnType = returnType;
this.receiverParameterType = receiverParameterType;
@@ -61,7 +61,7 @@
this.lambdaClassOrigin = lambdaClassOrigin;
this.contract = contract;
this.crossInlineParameter = crossInlineParameter;
- this.contextReceiverTypes = contextReceiverTypes;
+ this.contextParameters = contextParameters;
}
public boolean hasCrossInlineParameter() {
@@ -90,8 +90,9 @@
KotlinContractInfo.create(kmFunction.getContract(), factory, reporter),
isCrossInline,
ListUtils.map(
- kmFunction.getContextReceiverTypes(),
- contextReceiverType -> KotlinTypeInfo.create(contextReceiverType, factory, reporter)));
+ kmFunction.getContextParameters(),
+ contextParameter ->
+ KotlinValueParameterInfo.create(contextParameter, factory, reporter)));
}
private static KotlinTypeReference getlambdaClassOrigin(
@@ -146,9 +147,9 @@
rewritten |=
rewriteList(
appView,
- contextReceiverTypes,
- rewrittenKmFunction.getContextReceiverTypes(),
- KotlinTypeInfo::rewrite);
+ contextParameters,
+ rewrittenKmFunction.getContextParameters(),
+ KotlinValueParameterInfo::rewrite);
rewritten |=
rewriteIfNotNull(
appView,
@@ -201,7 +202,7 @@
receiverParameterType.trace(registry);
}
forEachApply(typeParameters, param -> param::trace, registry);
- forEachApply(contextReceiverTypes, type -> type::trace, registry);
+ forEachApply(contextParameters, type -> type::trace, registry);
if (signature != null) {
signature.trace(registry);
}
diff --git a/src/main/java/com/android/tools/r8/kotlin/KotlinMetadataWriter.java b/src/main/java/com/android/tools/r8/kotlin/KotlinMetadataWriter.java
index 8ff5684..408189b 100644
--- a/src/main/java/com/android/tools/r8/kotlin/KotlinMetadataWriter.java
+++ b/src/main/java/com/android/tools/r8/kotlin/KotlinMetadataWriter.java
@@ -462,8 +462,9 @@
newNewIndent,
"KmType",
sb,
- function.getContextReceiverTypes(),
- (nextIndent, kmType) -> appendKmType(nextIndent, sb, kmType)));
+ function.getContextParameters(),
+ (nextIndent, kmValueParameter) ->
+ appendValueParameter(nextIndent, sb, kmValueParameter)));
JvmMethodSignature signature = JvmExtensionsKt.getSignature(function);
appendKeyValue(newIndent, "signature", sb, Objects.toString(signature));
appendKeyValue(
diff --git a/third_party/dependencies.tar.gz.sha1 b/third_party/dependencies.tar.gz.sha1
index 8bdb923..6deb57c 100644
--- a/third_party/dependencies.tar.gz.sha1
+++ b/third_party/dependencies.tar.gz.sha1
@@ -1 +1 @@
-380d4c9807121e1a7d9e9482fd655617a5aec05f
\ No newline at end of file
+bf08c21862f8aa6ffadc15d834926c0852de581b
\ No newline at end of file
diff --git a/tools/create_local_maven_with_dependencies.py b/tools/create_local_maven_with_dependencies.py
index 40c6984..38b1c53 100755
--- a/tools/create_local_maven_with_dependencies.py
+++ b/tools/create_local_maven_with_dependencies.py
@@ -25,7 +25,7 @@
ANDROIDX_TRACING_VERSION = '2.0.0-SNAPSHOT'
ASM_VERSION = '9.9' # When updating update tools/asmifier.py and Toolhelper as well.
FASTUTIL_VERSION = '7.2.1'
-KOTLIN_METADATA_VERSION = '2.2.10'
+KOTLIN_METADATA_VERSION = '2.3.10'
KOTLIN_VERSION = '2.0.21'
GUAVA_VERSION = '32.1.2-jre'
GSON_VERSION = '2.10.1'