[Native] Don't produce broken @Deprecated annotations in c-interop
#KT-58651
diff --git a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/StubIrMetadataEmitter.kt b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/StubIrMetadataEmitter.kt
index fb92921..87ba2f3 100644
--- a/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/StubIrMetadataEmitter.kt
+++ b/kotlin-native/Interop/StubGenerator/src/main/kotlin/org/jetbrains/kotlin/native/interop/gen/StubIrMetadataEmitter.kt
@@ -370,14 +370,16 @@
}
fun AnnotationStub.map(): KmAnnotation {
- fun Pair<String, String>.asAnnotationArgument() =
- (first to KmAnnotationArgument.StringValue(second)).takeIf { second.isNotEmpty() }
+ fun Pair<String, String>.asOptionalAnnotationArgument(): Pair<String, KmAnnotationArgument.StringValue>? {
+ val (argumentName, argumentValue) = this
+ return if (argumentValue.isEmpty()) null else argumentName to KmAnnotationArgument.StringValue(argumentValue)
+ }
fun replaceWith(replaceWith: String) = KmAnnotationArgument.AnnotationValue(KmAnnotation(
Classifier.topLevel("kotlin", "ReplaceWith").fqNameSerialized,
mapOfNotNull(
"imports" to KmAnnotationArgument.ArrayValue(emptyList()),
- ("expression" to replaceWith).asAnnotationArgument()
+ "expression" to KmAnnotationArgument.StringValue(replaceWith)
)
))
@@ -390,35 +392,35 @@
AnnotationStub.ObjC.ConsumesReceiver -> emptyMap()
AnnotationStub.ObjC.ReturnsRetained -> emptyMap()
is AnnotationStub.ObjC.Method -> mapOfNotNull(
- ("selector" to selector).asAnnotationArgument(),
- ("encoding" to encoding).asAnnotationArgument(),
+ ("selector" to selector).asOptionalAnnotationArgument(),
+ ("encoding" to encoding).asOptionalAnnotationArgument(),
("isStret" to KmAnnotationArgument.BooleanValue(isStret))
)
is AnnotationStub.ObjC.Direct -> mapOfNotNull(
- ("symbol" to symbol).asAnnotationArgument(),
+ ("symbol" to symbol).asOptionalAnnotationArgument(),
)
is AnnotationStub.ObjC.Factory -> mapOfNotNull(
- ("selector" to selector).asAnnotationArgument(),
- ("encoding" to encoding).asAnnotationArgument(),
+ ("selector" to selector).asOptionalAnnotationArgument(),
+ ("encoding" to encoding).asOptionalAnnotationArgument(),
("isStret" to KmAnnotationArgument.BooleanValue(isStret))
)
AnnotationStub.ObjC.Consumed -> emptyMap()
is AnnotationStub.ObjC.Constructor -> mapOfNotNull(
("designated" to KmAnnotationArgument.BooleanValue(designated)),
- ("initSelector" to selector).asAnnotationArgument()
+ ("initSelector" to selector).asOptionalAnnotationArgument()
)
is AnnotationStub.ObjC.ExternalClass -> mapOfNotNull(
- ("protocolGetter" to protocolGetter).asAnnotationArgument(),
- ("binaryName" to binaryName).asAnnotationArgument()
+ ("protocolGetter" to protocolGetter).asOptionalAnnotationArgument(),
+ ("binaryName" to binaryName).asOptionalAnnotationArgument()
)
AnnotationStub.CCall.CString -> emptyMap()
AnnotationStub.CCall.WCString -> emptyMap()
is AnnotationStub.CCall.Symbol -> mapOfNotNull(
- ("id" to symbolName).asAnnotationArgument()
+ ("id" to symbolName).asOptionalAnnotationArgument()
)
is AnnotationStub.CCall.CppClassConstructor -> emptyMap()
is AnnotationStub.CStruct -> mapOfNotNull(
- ("spelling" to struct).asAnnotationArgument()
+ ("spelling" to struct).asOptionalAnnotationArgument()
)
is AnnotationStub.CNaturalStruct ->
error("@CNaturalStruct should not be used for Kotlin/Native interop")
@@ -426,12 +428,12 @@
"value" to KmAnnotationArgument.LongValue(length)
)
is AnnotationStub.Deprecated -> mapOfNotNull(
- ("message" to message).asAnnotationArgument(),
+ ("message" to message).asOptionalAnnotationArgument(),
("replaceWith" to replaceWith(replaceWith)),
("level" to deprecationLevel(level))
)
is AnnotationStub.CEnumEntryAlias -> mapOfNotNull(
- ("entryName" to entryName).asAnnotationArgument()
+ ("entryName" to entryName).asOptionalAnnotationArgument()
)
is AnnotationStub.CEnumVarTypeSize -> mapOfNotNull(
("size" to KmAnnotationArgument.IntValue(size))
diff --git a/native/native.tests/testData/CInterop/KT-39120/defs/ForwardEnum/pod1.contents.gold.txt b/native/native.tests/testData/CInterop/KT-39120/defs/ForwardEnum/pod1.contents.gold.txt
index 517bd8b..e1aa38c 100644
--- a/native/native.tests/testData/CInterop/KT-39120/defs/ForwardEnum/pod1.contents.gold.txt
+++ b/native/native.tests/testData/CInterop/KT-39120/defs/ForwardEnum/pod1.contents.gold.txt
@@ -1,6 +1,6 @@
enum class ForwardEnumPOD private constructor(value: Int) : Enum<ForwardEnumPOD>, CEnum {
var value: ForwardEnumPOD
- @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(imports = {})) fun byValue(value: Int): ForwardEnumPOD
+ @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(expression = "", imports = {})) fun byValue(value: Int): ForwardEnumPOD
var varPOD: ForwardEnumPOD
@CCall(id = "knifunptr_pod10_varPOD_getter") get
@CCall(id = "knifunptr_pod11_varPOD_setter") set
\ No newline at end of file
diff --git a/native/native.tests/testData/CInterop/KT-39120/defs/ForwardEnum/pod2.contents.gold.txt b/native/native.tests/testData/CInterop/KT-39120/defs/ForwardEnum/pod2.contents.gold.txt
index 6df5b2d..1591f50 100644
--- a/native/native.tests/testData/CInterop/KT-39120/defs/ForwardEnum/pod2.contents.gold.txt
+++ b/native/native.tests/testData/CInterop/KT-39120/defs/ForwardEnum/pod2.contents.gold.txt
@@ -2,4 +2,4 @@
@ConstantValue.Int(value = 0) enum entry Value1POD
@ConstantValue.Int(value = 1) enum entry Value2POD
var value: ForwardEnumPOD
- @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(imports = {})) fun byValue(value: Int): ForwardEnumPOD
\ No newline at end of file
+ @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(expression = "", imports = {})) fun byValue(value: Int): ForwardEnumPOD
\ No newline at end of file
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.ARM32.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.ARM32.txt
index 33557bb..d7bfe49 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.ARM32.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.ARM32.txt
@@ -5,7 +5,7 @@
var __ap: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 0.toLong()) get
@CStruct.MemberAt(offset = 0.toLong()) set
- @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.ARM64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.ARM64.txt
index 6fc0317..568bc7d 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.ARM64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.ARM64.txt
@@ -17,7 +17,7 @@
var __vr_top: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.X64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.X64.txt
index cf8e15e..ae27c9c 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.X64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterA/contents.gold.X64.txt
@@ -14,7 +14,7 @@
var reg_save_area: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.ARM32.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.ARM32.txt
index 9e29640..7c626ed8 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.ARM32.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.ARM32.txt
@@ -5,7 +5,7 @@
var __ap: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 0.toLong()) get
@CStruct.MemberAt(offset = 0.toLong()) set
- @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.ARM64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.ARM64.txt
index 1afa4d5..bde3728 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.ARM64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.ARM64.txt
@@ -17,7 +17,7 @@
var __vr_top: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.X64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.X64.txt
index 1f6dea1..2de85d7 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.X64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/filterStdargH/contents.gold.X64.txt
@@ -14,7 +14,7 @@
var reg_save_area: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.ARM32.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.ARM32.txt
index 3612d3a..5821a87 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.ARM32.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.ARM32.txt
@@ -5,7 +5,7 @@
var __ap: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 0.toLong()) get
@CStruct.MemberAt(offset = 0.toLong()) set
- @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.ARM64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.ARM64.txt
index ff199d6..bd33e04 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.ARM64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.ARM64.txt
@@ -17,7 +17,7 @@
var __vr_top: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.X64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.X64.txt
index 1980b8b..382c66d 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.X64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullA/contents.gold.X64.txt
@@ -14,7 +14,7 @@
var reg_save_area: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.ARM32.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.ARM32.txt
index 9e29640..7c626ed8 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.ARM32.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.ARM32.txt
@@ -5,7 +5,7 @@
var __ap: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 0.toLong()) get
@CStruct.MemberAt(offset = 0.toLong()) set
- @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.ARM64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.ARM64.txt
index 1afa4d5..bde3728 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.ARM64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.ARM64.txt
@@ -17,7 +17,7 @@
var __vr_top: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.X64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.X64.txt
index 1f6dea1..2de85d7 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.X64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/fullStdargH/contents.gold.X64.txt
@@ -14,7 +14,7 @@
var reg_save_area: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.ARM32.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.ARM32.txt
index 33557bb..d7bfe49 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.ARM32.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.ARM32.txt
@@ -5,7 +5,7 @@
var __ap: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 0.toLong()) get
@CStruct.MemberAt(offset = 0.toLong()) set
- @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.ARM64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.ARM64.txt
index 6fc0317..568bc7d 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.ARM64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.ARM64.txt
@@ -17,7 +17,7 @@
var __vr_top: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 32.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.X64.txt b/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.X64.txt
index cf8e15e..ae27c9c 100644
--- a/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.X64.txt
+++ b/native/native.tests/testData/CInterop/builtins/builtinsDefs/modulesA/contents.gold.X64.txt
@@ -14,7 +14,7 @@
var reg_save_area: COpaquePointer? /* = CPointer<out CPointed>? */
@CStruct.MemberAt(offset = 16.toLong()) get
@CStruct.MemberAt(offset = 16.toLong()) set
- @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 8, size = 24.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
}
diff --git a/native/native.tests/testData/CInterop/framework/frameworkDefs/explicitSubmodule/contents.gold.txt b/native/native.tests/testData/CInterop/framework/frameworkDefs/explicitSubmodule/contents.gold.txt
index c758587..bb61e47 100644
--- a/native/native.tests/testData/CInterop/framework/frameworkDefs/explicitSubmodule/contents.gold.txt
+++ b/native/native.tests/testData/CInterop/framework/frameworkDefs/explicitSubmodule/contents.gold.txt
@@ -5,7 +5,7 @@
var x: Int
@CStruct.MemberAt(offset = 0.toLong()) get
@CStruct.MemberAt(offset = 0.toLong()) set
- @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CStructVar.Type
+ @CStruct.VarType(align = 4, size = 4.toLong()) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CStructVar.Type
}
enum class NXMouseButton private constructor(value: UInt) : Enum<NXMouseButton>, CEnum {
@@ -14,11 +14,11 @@
class Var constructor(rawPtr: NativePtr /* = NativePtr */) : CEnumVar {
var value: NXMouseButton
- @CEnumVarTypeSize(size = 4) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CPrimitiveVar.Type
+ @CEnumVarTypeSize(size = 4) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CPrimitiveVar.Type
}
companion object {
- @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(imports = {})) fun byValue(value: UInt): NXMouseButton
+ @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(expression = "", imports = {})) fun byValue(value: UInt): NXMouseButton
}
}
diff --git a/native/native.tests/testData/CInterop/framework/frameworkDefs/forwardEnum/contents.gold.txt b/native/native.tests/testData/CInterop/framework/frameworkDefs/forwardEnum/contents.gold.txt
index 8a0b399..92da02d 100644
--- a/native/native.tests/testData/CInterop/framework/frameworkDefs/forwardEnum/contents.gold.txt
+++ b/native/native.tests/testData/CInterop/framework/frameworkDefs/forwardEnum/contents.gold.txt
@@ -6,11 +6,11 @@
class Var constructor(rawPtr: NativePtr /* = NativePtr */) : CEnumVar {
var value: EnumWithoutConstant
- @CEnumVarTypeSize(size = 8) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CPrimitiveVar.Type
+ @CEnumVarTypeSize(size = 8) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CPrimitiveVar.Type
}
companion object {
- @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(imports = {})) fun byValue(value: Long): EnumWithoutConstant
+ @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(expression = "", imports = {})) fun byValue(value: Long): EnumWithoutConstant
}
}
@@ -22,11 +22,11 @@
class Var constructor(rawPtr: NativePtr /* = NativePtr */) : CEnumVar {
var value: ForwardEnum
- @CEnumVarTypeSize(size = 8) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(imports = {})) companion object : CPrimitiveVar.Type
+ @CEnumVarTypeSize(size = 8) @Deprecated(level = DeprecationLevel.WARNING, message = "Use sizeOf<T>() or alignOf<T>() instead.", replaceWith = ReplaceWith(expression = "", imports = {})) companion object : CPrimitiveVar.Type
}
companion object {
- @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(imports = {})) fun byValue(value: Long): ForwardEnum
+ @Deprecated(level = DeprecationLevel.WARNING, message = "Will be removed.", replaceWith = ReplaceWith(expression = "", imports = {})) fun byValue(value: Long): ForwardEnum
}
}
diff --git a/native/native.tests/testData/CInterop/frameworkIncludeCategories/cases/smoke1/contents.gold.txt b/native/native.tests/testData/CInterop/frameworkIncludeCategories/cases/smoke1/contents.gold.txt
index 7bd5862..b978689 100644
--- a/native/native.tests/testData/CInterop/frameworkIncludeCategories/cases/smoke1/contents.gold.txt
+++ b/native/native.tests/testData/CInterop/frameworkIncludeCategories/cases/smoke1/contents.gold.txt
@@ -30,11 +30,11 @@
}
package dependency {
- @ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryClassMethod") @Deprecated(level = DeprecationLevel.WARNING, message = "Use class method instead", replaceWith = ReplaceWith(imports = {})) external fun MyClassMeta.categoryClassMethod()
+ @ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryClassMethod") @Deprecated(level = DeprecationLevel.WARNING, message = "Use class method instead", replaceWith = ReplaceWith(expression = "", imports = {})) external fun MyClassMeta.categoryClassMethod()
@ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryClassMethod") external fun SkipClassMeta.categoryClassMethod()
- @ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryClassMethod2") @Deprecated(level = DeprecationLevel.WARNING, message = "Use class method instead", replaceWith = ReplaceWith(imports = {})) external fun MyClassMeta.categoryClassMethod2()
- @ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryInstanceMethod") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(imports = {})) external fun MyClass.categoryInstanceMethod()
+ @ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryClassMethod2") @Deprecated(level = DeprecationLevel.WARNING, message = "Use class method instead", replaceWith = ReplaceWith(expression = "", imports = {})) external fun MyClassMeta.categoryClassMethod2()
+ @ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryInstanceMethod") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(expression = "", imports = {})) external fun MyClass.categoryInstanceMethod()
@ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryInstanceMethod") external fun SkipClass.categoryInstanceMethod()
- @ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryInstanceMethod2") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(imports = {})) external fun MyClass.categoryInstanceMethod2()
+ @ObjCMethod(encoding = "v16@0:8", isStret = false, selector = "categoryInstanceMethod2") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(expression = "", imports = {})) external fun MyClass.categoryInstanceMethod2()
}
diff --git a/native/native.tests/testData/CInterop/frameworkIncludeCategories/cases/smoke2/contents.gold.txt b/native/native.tests/testData/CInterop/frameworkIncludeCategories/cases/smoke2/contents.gold.txt
index 9f662ec..45fd4d8 100644
--- a/native/native.tests/testData/CInterop/frameworkIncludeCategories/cases/smoke2/contents.gold.txt
+++ b/native/native.tests/testData/CInterop/frameworkIncludeCategories/cases/smoke2/contents.gold.txt
@@ -23,10 +23,10 @@
}
package dependency {
- @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance property instead", replaceWith = ReplaceWith(imports = {})) var MyClass.categoryProperty: Float
- @ObjCMethod(encoding = "f16@0:8", isStret = false, selector = "categoryProperty") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(imports = {})) get
- @ObjCMethod(encoding = "v20@0:8f16", isStret = false, selector = "setCategoryProperty:") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(imports = {})) set
- @ObjCMethod(encoding = "f16@0:8", isStret = false, selector = "categoryProperty") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(imports = {})) external fun MyClass.categoryProperty(): Float
- @ObjCMethod(encoding = "v20@0:8f16", isStret = false, selector = "setCategoryProperty:") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(imports = {})) external fun MyClass.setCategoryProperty(categoryProperty: Float)
+ @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance property instead", replaceWith = ReplaceWith(expression = "", imports = {})) var MyClass.categoryProperty: Float
+ @ObjCMethod(encoding = "f16@0:8", isStret = false, selector = "categoryProperty") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(expression = "", imports = {})) get
+ @ObjCMethod(encoding = "v20@0:8f16", isStret = false, selector = "setCategoryProperty:") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(expression = "", imports = {})) set
+ @ObjCMethod(encoding = "f16@0:8", isStret = false, selector = "categoryProperty") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(expression = "", imports = {})) external fun MyClass.categoryProperty(): Float
+ @ObjCMethod(encoding = "v20@0:8f16", isStret = false, selector = "setCategoryProperty:") @Deprecated(level = DeprecationLevel.WARNING, message = "Use instance method instead", replaceWith = ReplaceWith(expression = "", imports = {})) external fun MyClass.setCategoryProperty(categoryProperty: Float)
}