[Tests] Version Overloads KAPT cases KT-85195
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtCompanion.kt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtCompanion.kt new file mode 100644 index 0000000..beaadbd --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtCompanion.kt
@@ -0,0 +1,37 @@ +class ClassWithCompanion() { + companion object { + fun companionFun( + a: Int, + @IntroducedAt("1") b: String = "hello", + @IntroducedAt("2") c: Boolean = true, + ) = "$this/$b/$c" + } + + companion { + fun companionBlockFun( + a: Int, + @IntroducedAt("1") b: String = "hello", + @IntroducedAt("2") c: Boolean = true, + ) = "$this/$b/$c" + } + + companion { + @JvmExposeBoxed + fun companionBlockFun( + a: Int, + @IntroducedAt("1") b: UInt = 3u, + @IntroducedAt("2") c: Boolean = true, + ) = "$this/$b/$c" + } +} + +class ClassWithJvmStaticCompanion() { + companion object { + @JvmStatic + fun staticCompanionFun( + a: Int, + @IntroducedAt("1") b: String = "hello", + @IntroducedAt("2") c: Boolean = true, + ) = "$this/$b/$c" + } +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtCompanion.txt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtCompanion.txt new file mode 100644 index 0000000..2b76e2a --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtCompanion.txt
@@ -0,0 +1,115 @@ +/** + * public final class ClassWithCompanion : kotlin/Any { + * + * // signature: <init>()V + * public constructor() + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class ClassWithCompanion { + @org.jetbrains.annotations.NotNull() + public static final ClassWithCompanion.Companion Companion = null; + + public ClassWithCompanion() { + super(); + } + + /** + * public final companion object ClassWithCompanion.Companion : kotlin/Any { + * + * // signature: <init>()V + * private constructor() + * + * // signature: companionFun(ILjava/lang/String;Z)Ljava/lang/String; + * public final fun companionFun(a: kotlin/Int, @kotlin/IntroducedAt(version = "1") b: kotlin/String (* = ... *), @kotlin/IntroducedAt(version = "2") c: kotlin/Boolean (* = ... *)): kotlin/String + * + * // module name: main + * } + */ + @kotlin.Metadata() + public static final class Companion { + + private Companion() { + super(); + } + + @org.jetbrains.annotations.NotNull() + public final java.lang.String companionFun(int a, @kotlin.IntroducedAt(version = "1") + @org.jetbrains.annotations.NotNull() + java.lang.String b, @kotlin.IntroducedAt(version = "2") + boolean c) { + return null; + } + } +} + +//////////////////// + + +/** + * public final class ClassWithJvmStaticCompanion : kotlin/Any { + * + * // signature: <init>()V + * public constructor() + * + * // companion object: Companion + * + * // nested class: Companion + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class ClassWithJvmStaticCompanion { + @org.jetbrains.annotations.NotNull() + public static final ClassWithJvmStaticCompanion.Companion Companion = null; + + public ClassWithJvmStaticCompanion() { + super(); + } + + @kotlin.jvm.JvmStatic() + @org.jetbrains.annotations.NotNull() + public static final java.lang.String staticCompanionFun(int a, @kotlin.IntroducedAt(version = "1") + @org.jetbrains.annotations.NotNull() + java.lang.String b, @kotlin.IntroducedAt(version = "2") + boolean c) { + return null; + } + + /** + * public final companion object ClassWithJvmStaticCompanion.Companion : kotlin/Any { + * + * // signature: <init>()V + * private constructor() + * + * // signature: staticCompanionFun(ILjava/lang/String;Z)Ljava/lang/String; + * @kotlin/jvm/JvmStatic + * public final fun staticCompanionFun(a: kotlin/Int, @kotlin/IntroducedAt(version = "1") b: kotlin/String (* = ... *), @kotlin/IntroducedAt(version = "2") c: kotlin/Boolean (* = ... *)): kotlin/String + * + * // module name: main + * } + */ + @kotlin.Metadata() + public static final class Companion { + + private Companion() { + super(); + } + + @kotlin.jvm.JvmStatic() + @org.jetbrains.annotations.NotNull() + public final java.lang.String staticCompanionFun(int a, @kotlin.IntroducedAt(version = "1") + @org.jetbrains.annotations.NotNull() + java.lang.String b, @kotlin.IntroducedAt(version = "2") + boolean c) { + return null; + } + } +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtConstructor.kt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtConstructor.kt new file mode 100644 index 0000000..ca03767 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtConstructor.kt
@@ -0,0 +1,4 @@ +class ClassWithCompanion() { + // @IntroducedAt on constructor parameters +} +
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctions.kt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctions.kt new file mode 100644 index 0000000..1a7e455 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctions.kt
@@ -0,0 +1,38 @@ +fun topLevelFun( + a: Int, + @IntroducedAt("1") b: String = "hello", + @IntroducedAt("2") c: Boolean = true, +) {} + + +fun Int.extendFun( + a: Int, + @IntroducedAt("1") b: String = "hello", + @IntroducedAt("2") c: Boolean = true, +) {} + +suspend fun suspendFun( + a : Int = 1, + @IntroducedAt("1") b: String = "hello", + @IntroducedAt("2") c: Boolean = true, +) {} + +@JvmName("javaName") +fun kotlinName( + a : Int = 1, + @IntroducedAt("1") b: String = "hello", + @IntroducedAt("2") c: Boolean = true, +) {} + +context(d: Boolean) fun contextFun( + a : Int = 1, + @IntroducedAt("1") b: String = "hello", + @IntroducedAt("2") c: Boolean = true, +) {} + +fun inTrailing( + x: String, + @IntroducedAt("1") y: Int = 1, + @IntroducedAt("2") z: Boolean = true, + block: (String) -> String = { x.uppercase() } +) {} \ No newline at end of file
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctions.txt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctions.txt new file mode 100644 index 0000000..09b9b6a --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctions.txt
@@ -0,0 +1,70 @@ +/** + * package { + * + * // signature: contextFun(ZILjava/lang/String;Z)V + * context(d: kotlin/Boolean) + * public final fun contextFun(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "1") b: kotlin/String (* = ... *), @kotlin/IntroducedAt(version = "2") c: kotlin/Boolean (* = ... *)): kotlin/Unit + * + * // signature: extendFun(IILjava/lang/String;Z)V + * public final fun kotlin/Int.extendFun(a: kotlin/Int, @kotlin/IntroducedAt(version = "1") b: kotlin/String (* = ... *), @kotlin/IntroducedAt(version = "2") c: kotlin/Boolean (* = ... *)): kotlin/Unit + * + * // signature: inTrailing(Ljava/lang/String;IZLkotlin/jvm/functions/Function1;)V + * public final fun inTrailing(x: kotlin/String, @kotlin/IntroducedAt(version = "1") y: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "2") z: kotlin/Boolean (* = ... *), block: kotlin/Function1<kotlin/String, kotlin/String> (* = ... *)): kotlin/Unit + * + * // signature: javaName(ILjava/lang/String;Z)V + * @kotlin/jvm/JvmName(name = "javaName") + * public final fun kotlinName(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "1") b: kotlin/String (* = ... *), @kotlin/IntroducedAt(version = "2") c: kotlin/Boolean (* = ... *)): kotlin/Unit + * + * // signature: suspendFun(ILjava/lang/String;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object; + * public final suspend fun suspendFun(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "1") b: kotlin/String (* = ... *), @kotlin/IntroducedAt(version = "2") c: kotlin/Boolean (* = ... *)): kotlin/Unit + * + * // signature: topLevelFun(ILjava/lang/String;Z)V + * public final fun topLevelFun(a: kotlin/Int, @kotlin/IntroducedAt(version = "1") b: kotlin/String (* = ... *), @kotlin/IntroducedAt(version = "2") c: kotlin/Boolean (* = ... *)): kotlin/Unit + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class IntroducedAtFunctionsKt { + + public static final void topLevelFun(int a, @kotlin.IntroducedAt(version = "1") + @org.jetbrains.annotations.NotNull() + java.lang.String b, @kotlin.IntroducedAt(version = "2") + boolean c) { + } + + public static final void extendFun(int $this$extendFun, int a, @kotlin.IntroducedAt(version = "1") + @org.jetbrains.annotations.NotNull() + java.lang.String b, @kotlin.IntroducedAt(version = "2") + boolean c) { + } + + @org.jetbrains.annotations.Nullable() + public static final java.lang.Object suspendFun(int a, @kotlin.IntroducedAt(version = "1") + @org.jetbrains.annotations.NotNull() + java.lang.String b, @kotlin.IntroducedAt(version = "2") + boolean c, @org.jetbrains.annotations.NotNull() + kotlin.coroutines.Continuation<? super kotlin.Unit> $completion) { + return null; + } + + @kotlin.jvm.JvmName(name = "javaName") + public static final void javaName(int a, @kotlin.IntroducedAt(version = "1") + @org.jetbrains.annotations.NotNull() + java.lang.String b, @kotlin.IntroducedAt(version = "2") + boolean c) { + } + + public static final void contextFun(boolean d, int a, @kotlin.IntroducedAt(version = "1") + @org.jetbrains.annotations.NotNull() + java.lang.String b, @kotlin.IntroducedAt(version = "2") + boolean c) { + } + + public static final void inTrailing(@org.jetbrains.annotations.NotNull() + java.lang.String x, @kotlin.IntroducedAt(version = "1") + int y, @kotlin.IntroducedAt(version = "2") + boolean z, @org.jetbrains.annotations.NotNull() + kotlin.jvm.functions.Function1<? super java.lang.String, java.lang.String> block) { + } +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClass.kt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClass.kt new file mode 100644 index 0000000..73cbf12 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClass.kt
@@ -0,0 +1,15 @@ +// WITH_STDLIB + +class EverythingC { // TODO: add same for constructor without JvmExposeBoxed but with value classes + fun foo_no_introduce( + a: Int = 1, + a1: UInt = 2u, + b : Boolean = true, + ) = "$a/$a1/$b" + + fun foo_with_introduce( + a: Int = 1, + @IntroducedAt("2") a1: UInt = 2u, + @IntroducedAt("3") b : Boolean = true, + ) = "$a/$a1/$b" +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClass.txt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClass.txt new file mode 100644 index 0000000..0e4ba81 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClass.txt
@@ -0,0 +1,22 @@ +/** + * public final class EverythingC : kotlin/Any { + * + * // signature: <init>()V + * public constructor() + * + * // signature: foo_no_introduce-OsBMiQA(IIZ)Ljava/lang/String; + * public final fun foo_no_introduce(a: kotlin/Int (* = ... *), a1: kotlin/UInt (* = ... *), b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // signature: foo_with_introduce-OsBMiQA(IIZ)Ljava/lang/String; + * public final fun foo_with_introduce(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "2") a1: kotlin/UInt (* = ... *), @kotlin/IntroducedAt(version = "3") b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class EverythingC { + + public EverythingC() { + super(); + } +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClassJvmOverloads.kt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClassJvmOverloads.kt new file mode 100644 index 0000000..4728ba7 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClassJvmOverloads.kt
@@ -0,0 +1,17 @@ +// WITH_STDLIB + +class EverythingC { + @JvmOverloads + fun foo_no_introduce( + a: Int = 1, + a1: UInt = 2u, + b : Boolean = true, + ) = "$a/$a1/$b" + + @JvmOverloads + fun foo_with_introduce( + a: Int = 1, + @IntroducedAt("2") a1: UInt = 2u, + @IntroducedAt("3") b : Boolean = true, + ) = "$a/$a1/$b" +} \ No newline at end of file
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClassJvmOverloads.txt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClassJvmOverloads.txt new file mode 100644 index 0000000..f669894 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtFunctionsInlineClassJvmOverloads.txt
@@ -0,0 +1,42 @@ +/** + * public final class EverythingC : kotlin/Any { + * + * // signature: <init>()V + * public constructor() + * + * // signature: foo_no_introduce-OsBMiQA(IIZ)Ljava/lang/String; + * @kotlin/jvm/JvmOverloads + * public final fun foo_no_introduce(a: kotlin/Int (* = ... *), a1: kotlin/UInt (* = ... *), b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // signature: foo_with_introduce-OsBMiQA(IIZ)Ljava/lang/String; + * @kotlin/jvm/JvmOverloads + * public final fun foo_with_introduce(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "2") a1: kotlin/UInt (* = ... *), @kotlin/IntroducedAt(version = "3") b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class EverythingC { + + public EverythingC() { + super(); + } + + @kotlin.jvm.JvmOverloads() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo_no_introduce() { + return null; + } + + @kotlin.jvm.JvmOverloads() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo_no_introduce(int a) { + return null; + } + + @kotlin.jvm.JvmOverloads() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo_with_introduce() { + return null; + } +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmExposeBoxed.kt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmExposeBoxed.kt new file mode 100644 index 0000000..ec118e3 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmExposeBoxed.kt
@@ -0,0 +1,19 @@ +// WITH_STDLIB + +class EverythingC { + @JvmOverloads + @JvmExposeBoxed + fun foo( + a: Int = 1, + @IntroducedAt("2") a1: UInt = 3u, + @IntroducedAt("3") b : Boolean = true, + ) = "$a/$a1/$b" + + @JvmOverloads + @JvmExposeBoxed("exposed_bar") + fun bar( + a: Int = 1, + @IntroducedAt("2") a1: UInt = 3u, + @IntroducedAt("3") b : Boolean = true, + ) = "$a/$a1/$b" +} \ No newline at end of file
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmExposeBoxed.txt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmExposeBoxed.txt new file mode 100644 index 0000000..90e1b92 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmExposeBoxed.txt
@@ -0,0 +1,60 @@ +/** + * public final class EverythingC : kotlin/Any { + * + * // signature: <init>()V + * public constructor() + * + * // signature: bar-OsBMiQA(IIZ)Ljava/lang/String; + * @kotlin/jvm/JvmOverloads + * @kotlin/jvm/JvmExposeBoxed(jvmName = "exposed_bar") + * public final fun bar(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "2") a1: kotlin/UInt (* = ... *), @kotlin/IntroducedAt(version = "3") b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // signature: foo-OsBMiQA(IIZ)Ljava/lang/String; + * @kotlin/jvm/JvmOverloads + * @kotlin/jvm/JvmExposeBoxed + * public final fun foo(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "2") a1: kotlin/UInt (* = ... *), @kotlin/IntroducedAt(version = "3") b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class EverythingC { + + public EverythingC() { + super(); + } + + @kotlin.jvm.JvmOverloads() + @kotlin.jvm.JvmExposeBoxed() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo() { + return null; + } + + @kotlin.jvm.JvmOverloads() + @kotlin.jvm.JvmExposeBoxed() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo(int a, @kotlin.IntroducedAt(version = "2") + @org.jetbrains.annotations.NotNull() + kotlin.UInt a1, @kotlin.IntroducedAt(version = "3") + boolean b) { + return null; + } + + @kotlin.jvm.JvmOverloads() + @kotlin.jvm.JvmExposeBoxed(jvmName = "exposed_bar") + @org.jetbrains.annotations.NotNull() + public final java.lang.String exposed_bar() { + return null; + } + + @kotlin.jvm.JvmOverloads() + @kotlin.jvm.JvmExposeBoxed(jvmName = "exposed_bar") + @org.jetbrains.annotations.NotNull() + public final java.lang.String exposed_bar(int a, @kotlin.IntroducedAt(version = "2") + @org.jetbrains.annotations.NotNull() + kotlin.UInt a1, @kotlin.IntroducedAt(version = "3") + boolean b) { + return null; + } +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmName.kt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmName.kt new file mode 100644 index 0000000..db304b5 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmName.kt
@@ -0,0 +1,10 @@ +// WITH_STDLIB + +class EverythingC { + @JvmName("jvmname_foo") + fun foo( + a: Int = 1, + @IntroducedAt("2") a1: UInt = 3u, + @IntroducedAt("3") b : Boolean = true, + ) = "$a/$a1/$b" +} \ No newline at end of file
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmName.txt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmName.txt new file mode 100644 index 0000000..ca8273f --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmName.txt
@@ -0,0 +1,28 @@ +/** + * public final class EverythingC : kotlin/Any { + * + * // signature: <init>()V + * public constructor() + * + * // signature: jvmname_foo(IIZ)Ljava/lang/String; + * @kotlin/jvm/JvmName(name = "jvmname_foo") + * public final fun foo(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "2") a1: kotlin/UInt (* = ... *), @kotlin/IntroducedAt(version = "3") b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class EverythingC { + + public EverythingC() { + super(); + } + + @kotlin.jvm.JvmName(name = "jvmname_foo") + @org.jetbrains.annotations.NotNull() + public final java.lang.String jvmname_foo(int a, @kotlin.IntroducedAt(version = "2") + int a1, @kotlin.IntroducedAt(version = "3") + boolean b) { + return null; + } +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloads.kt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloads.kt new file mode 100644 index 0000000..2433a65 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloads.kt
@@ -0,0 +1,15 @@ +class EverythingC { + @JvmOverloads + fun foo_no_introduce( + a: Int = 1, + a1: String = "hello", + b : Boolean = true, + ) = "$a/$a1/$b" + + @JvmOverloads + fun foo_with_introduce( + a: Int = 1, + @IntroducedAt("2") a1: String = "hello", + @IntroducedAt("3") b : Boolean = true, + ) = "$a/$a1/$b" +} \ No newline at end of file
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloads.txt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloads.txt new file mode 100644 index 0000000..63c343e --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloads.txt
@@ -0,0 +1,65 @@ +/** + * public final class EverythingC : kotlin/Any { + * + * // signature: <init>()V + * public constructor() + * + * // signature: foo_no_introduce(ILjava/lang/String;Z)Ljava/lang/String; + * @kotlin/jvm/JvmOverloads + * public final fun foo_no_introduce(a: kotlin/Int (* = ... *), a1: kotlin/String (* = ... *), b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // signature: foo_with_introduce(ILjava/lang/String;Z)Ljava/lang/String; + * @kotlin/jvm/JvmOverloads + * public final fun foo_with_introduce(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "2") a1: kotlin/String (* = ... *), @kotlin/IntroducedAt(version = "3") b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class EverythingC { + + public EverythingC() { + super(); + } + + @kotlin.jvm.JvmOverloads() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo_no_introduce() { + return null; + } + + @kotlin.jvm.JvmOverloads() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo_no_introduce(int a) { + return null; + } + + @kotlin.jvm.JvmOverloads() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo_no_introduce(int a, @org.jetbrains.annotations.NotNull() + java.lang.String a1) { + return null; + } + + @kotlin.jvm.JvmOverloads() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo_no_introduce(int a, @org.jetbrains.annotations.NotNull() + java.lang.String a1, boolean b) { + return null; + } + + @kotlin.jvm.JvmOverloads() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo_with_introduce() { + return null; + } + + @kotlin.jvm.JvmOverloads() + @org.jetbrains.annotations.NotNull() + public final java.lang.String foo_with_introduce(int a, @kotlin.IntroducedAt(version = "2") + @org.jetbrains.annotations.NotNull() + java.lang.String a1, @kotlin.IntroducedAt(version = "3") + boolean b) { + return null; + } +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloadsJvmExposeBoxed.kt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloadsJvmExposeBoxed.kt new file mode 100644 index 0000000..26f19f5 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloadsJvmExposeBoxed.kt
@@ -0,0 +1,12 @@ +// WITH_STDLIB + +class EverythingC { // TODO: add constructor with all these annotations as well + @JvmOverloads + @JvmName("jvmname_foo") + @JvmExposeBoxed("exposed_foo") + fun foo( + a: Int = 1, + @IntroducedAt("2") a1: UInt = 3u, + @IntroducedAt("3") b : Boolean = true, + ) = "$a/$a1/$b" +}
diff --git a/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloadsJvmExposeBoxed.txt b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloadsJvmExposeBoxed.txt new file mode 100644 index 0000000..d5e5f49 --- /dev/null +++ b/plugins/kapt/kapt-compiler/testData/converter/versionOverloads/introducedAtJvmOverloadsJvmExposeBoxed.txt
@@ -0,0 +1,49 @@ +/** + * public final class EverythingC : kotlin/Any { + * + * // signature: <init>()V + * public constructor() + * + * // signature: jvmname_foo(IIZ)Ljava/lang/String; + * @kotlin/jvm/JvmOverloads + * @kotlin/jvm/JvmName(name = "jvmname_foo") + * @kotlin/jvm/JvmExposeBoxed(jvmName = "exposed_foo") + * public final fun foo(a: kotlin/Int (* = ... *), @kotlin/IntroducedAt(version = "2") a1: kotlin/UInt (* = ... *), @kotlin/IntroducedAt(version = "3") b: kotlin/Boolean (* = ... *)): kotlin/String + * + * // module name: main + * } + */ +@kotlin.Metadata() +public final class EverythingC { + + public EverythingC() { + super(); + } + + @kotlin.jvm.JvmOverloads() + @kotlin.jvm.JvmExposeBoxed(jvmName = "exposed_foo") + @org.jetbrains.annotations.NotNull() + public final java.lang.String exposed_foo(int a, @kotlin.IntroducedAt(version = "2") + @org.jetbrains.annotations.NotNull() + kotlin.UInt a1, @kotlin.IntroducedAt(version = "3") + boolean b) { + return null; + } + + @kotlin.jvm.JvmOverloads() + @kotlin.jvm.JvmName(name = "jvmname_foo") + @kotlin.jvm.JvmExposeBoxed(jvmName = "exposed_foo") + @org.jetbrains.annotations.NotNull() + public final java.lang.String jvmname_foo() { + return null; + } + + @kotlin.jvm.JvmOverloads() + @kotlin.jvm.JvmName(name = "jvmname_foo") + @org.jetbrains.annotations.NotNull() + public final java.lang.String jvmname_foo(int a, @kotlin.IntroducedAt(version = "2") + int a1, @kotlin.IntroducedAt(version = "3") + boolean b) { + return null; + } +}
diff --git a/plugins/kapt/kapt-compiler/tests-gen/org/jetbrains/kotlin/kapt/test/KaptStubConverterJTreeTestGenerated.java b/plugins/kapt/kapt-compiler/tests-gen/org/jetbrains/kotlin/kapt/test/KaptStubConverterJTreeTestGenerated.java index 8219e60..f496571 100644 --- a/plugins/kapt/kapt-compiler/tests-gen/org/jetbrains/kotlin/kapt/test/KaptStubConverterJTreeTestGenerated.java +++ b/plugins/kapt/kapt-compiler/tests-gen/org/jetbrains/kotlin/kapt/test/KaptStubConverterJTreeTestGenerated.java
@@ -977,4 +977,66 @@ run("noCompatibility1.8.kt"); } } + + @Nested + @TestMetadata("plugins/kapt/kapt-compiler/testData/converter/versionOverloads") + @TestDataPath("$PROJECT_ROOT") + public class VersionOverloads { + private void run(String fileName) { + runTest("plugins/kapt/kapt-compiler/testData/converter/versionOverloads/" + fileName); + } + + @Test + public void testAllFilesPresentInVersionOverloads() { + KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("plugins/kapt/kapt-compiler/testData/converter/versionOverloads"), Pattern.compile("^(.+)\\.kt$"), null, true); + } + + @Test + @TestMetadata("introducedAtCompanion.kt") + public void testIntroducedAtCompanion() { + run("introducedAtCompanion.kt"); + } + + @Test + @TestMetadata("introducedAtFunctions.kt") + public void testIntroducedAtFunctions() { + run("introducedAtFunctions.kt"); + } + + @Test + @TestMetadata("introducedAtFunctionsInlineClass.kt") + public void testIntroducedAtFunctionsInlineClass() { + run("introducedAtFunctionsInlineClass.kt"); + } + + @Test + @TestMetadata("introducedAtFunctionsInlineClassJvmOverloads.kt") + public void testIntroducedAtFunctionsInlineClassJvmOverloads() { + run("introducedAtFunctionsInlineClassJvmOverloads.kt"); + } + + @Test + @TestMetadata("introducedAtJvmExposeBoxed.kt") + public void testIntroducedAtJvmExposeBoxed() { + run("introducedAtJvmExposeBoxed.kt"); + } + + @Test + @TestMetadata("introducedAtJvmName.kt") + public void testIntroducedAtJvmName() { + run("introducedAtJvmName.kt"); + } + + @Test + @TestMetadata("introducedAtJvmOverloads.kt") + public void testIntroducedAtJvmOverloads() { + run("introducedAtJvmOverloads.kt"); + } + + @Test + @TestMetadata("introducedAtJvmOverloadsJvmExposeBoxed.kt") + public void testIntroducedAtJvmOverloadsJvmExposeBoxed() { + run("introducedAtJvmOverloadsJvmExposeBoxed.kt"); + } + } }