diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt index b37561c565b..f577a8a8276 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.kt @@ -12,11 +12,11 @@ public @interface A { [A(*array("5", "6"), "7", y = 3)] fun test3() {} -[A("1", "2", "3", x = javaClass(), y = 4)] fun test4() {} +[A("1", "2", "3", x = String::class, y = 4)] fun test4() {} [A("4", y = 5)] fun test5() {} -[A(*array("5", "6"), "7", x = javaClass(), y = 6)] fun test6() {} +[A(*array("5", "6"), "7", x = Any::class, y = 6)] fun test6() {} [A(y = 7)] fun test7() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.txt index 50088cd7bcb..ad3b2fa34e5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArray.txt @@ -3,9 +3,9 @@ package A(value = {"1", "2", "3"}: kotlin.Array, y = IntegerValueType(1): IntegerValueType(1)) internal fun test1(): kotlin.Unit A(value = {"4"}: kotlin.Array, y = IntegerValueType(2): IntegerValueType(2)) internal fun test2(): kotlin.Unit A(value = {{"5", "6"}, "7"}: kotlin.Array, y = IntegerValueType(3): IntegerValueType(3)) internal fun test3(): kotlin.Unit -A(value = {"1", "2", "3"}: kotlin.Array, x = javaClass(): java.lang.Class, y = IntegerValueType(4): IntegerValueType(4)) internal fun test4(): kotlin.Unit +A(value = {"1", "2", "3"}: kotlin.Array, x = kotlin.String::class: kotlin.reflect.KClass, y = IntegerValueType(4): IntegerValueType(4)) internal fun test4(): kotlin.Unit A(value = {"4"}: kotlin.Array, y = IntegerValueType(5): IntegerValueType(5)) internal fun test5(): kotlin.Unit -A(value = {{"5", "6"}, "7"}: kotlin.Array, x = javaClass(): java.lang.Class, y = IntegerValueType(6): IntegerValueType(6)) internal fun test6(): kotlin.Unit +A(value = {{"5", "6"}, "7"}: kotlin.Array, x = kotlin.Any::class: kotlin.reflect.KClass, y = IntegerValueType(6): IntegerValueType(6)) internal fun test6(): kotlin.Unit A(value = {}: kotlin.Array, y = IntegerValueType(7): IntegerValueType(7)) internal fun test7(): kotlin.Unit A(value = {"8", "9", "10"}: kotlin.Array) internal fun test8(): kotlin.Unit diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt index 0973f947905..6849ebe61e8 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.kt @@ -12,16 +12,16 @@ public @interface A { [A(*array("5", "6"), "7")] fun test3() {} -[A("1", "2", "3", x = javaClass())] fun test4() {} +[A("1", "2", "3", x = String::class)] fun test4() {} [A("4", y = 2)] fun test5() {} -[A(*array("5", "6"), "7", x = javaClass(), y = 3)] fun test6() {} +[A(*array("5", "6"), "7", x = Any::class, y = 3)] fun test6() {} [A()] fun test7() {} [A] fun test8() {} -[A(x = ; java.lang.Class)!>javaClass(), *array("5", "6"), "7", y = 3)] fun test9() {} -[A(x = ; java.lang.Class)!>javaClass(), value = *array("5", "6"), "7", y = 3)] fun test10() {} -[A(x = javaClass(), value = *array("5", "6", "7"), y = 3)] fun test11() {} +[A(x = Any::class, *array("5", "6"), "7", y = 3)] fun test9() {} +[A(x = Any::class, value = *array("5", "6"), "7", y = 3)] fun test10() {} +[A(x = Any::class, value = *array("5", "6", "7"), y = 3)] fun test11() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.txt index f07179326b5..19c60c856d5 100644 --- a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.txt +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefault.txt @@ -1,16 +1,16 @@ package A(value = {"1", "2", "3"}: kotlin.Array) internal fun test1(): kotlin.Unit -A(value = {"5", "6"}: kotlin.Array, x = javaClass(): java.lang.Class, y = IntegerValueType(3): IntegerValueType(3)) internal fun test10(): kotlin.Unit -A(value = {"5", "6", "7"}: kotlin.Array, x = javaClass(): java.lang.Class, y = IntegerValueType(3): IntegerValueType(3)) internal fun test11(): kotlin.Unit +A(value = {"5", "6"}: kotlin.Array, x = kotlin.Any::class: kotlin.reflect.KClass, y = IntegerValueType(3): IntegerValueType(3)) internal fun test10(): kotlin.Unit +A(value = {"5", "6", "7"}: kotlin.Array, x = kotlin.Any::class: kotlin.reflect.KClass, y = IntegerValueType(3): IntegerValueType(3)) internal fun test11(): kotlin.Unit A(value = {"4"}: kotlin.Array) internal fun test2(): kotlin.Unit A(value = {{"5", "6"}, "7"}: kotlin.Array) internal fun test3(): kotlin.Unit -A(value = {"1", "2", "3"}: kotlin.Array, x = javaClass(): java.lang.Class) internal fun test4(): kotlin.Unit +A(value = {"1", "2", "3"}: kotlin.Array, x = kotlin.String::class: kotlin.reflect.KClass) internal fun test4(): kotlin.Unit A(value = {"4"}: kotlin.Array, y = IntegerValueType(2): IntegerValueType(2)) internal fun test5(): kotlin.Unit -A(value = {{"5", "6"}, "7"}: kotlin.Array, x = javaClass(): java.lang.Class, y = IntegerValueType(3): IntegerValueType(3)) internal fun test6(): kotlin.Unit +A(value = {{"5", "6"}, "7"}: kotlin.Array, x = kotlin.Any::class: kotlin.reflect.KClass, y = IntegerValueType(3): IntegerValueType(3)) internal fun test6(): kotlin.Unit A(value = {}: kotlin.Array) internal fun test7(): kotlin.Unit A(value = {}: kotlin.Array) internal fun test8(): kotlin.Unit -A(value = {}: kotlin.Array, x = javaClass(): java.lang.Class, y = IntegerValueType(3): IntegerValueType(3)) internal fun test9(): kotlin.Unit +A(value = {}: kotlin.Array, x = kotlin.Any::class: kotlin.reflect.KClass, y = IntegerValueType(3): IntegerValueType(3)) internal fun test9(): kotlin.Unit public final annotation class A : kotlin.Annotation { public /*synthesized*/ constructor A(/*0*/ vararg value: kotlin.String /*kotlin.Array*/, /*1*/ x: java.lang.Class<*> = ..., /*2*/ y: kotlin.Int = ...) diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.kt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.kt new file mode 100644 index 00000000000..163eac28170 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.kt @@ -0,0 +1,8 @@ +// FILE: A.java +public @interface A { + Class x() default Integer.class; + int y(); +} + +// FILE: b.kt +[A(x = ; java.lang.Class)!>javaClass(), y = "")] fun test1() {} diff --git a/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.txt b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.txt new file mode 100644 index 00000000000..85722927b12 --- /dev/null +++ b/compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.txt @@ -0,0 +1,13 @@ +package + +A(x = javaClass(): java.lang.Class, y = "": kotlin.String) internal fun test1(): kotlin.Unit + +public final annotation class A : kotlin.Annotation { + public /*synthesized*/ constructor A(/*0*/ x: java.lang.Class<*> = ..., /*1*/ y: kotlin.Int) + public constructor A(/*0*/ x: kotlin.reflect.KClass<*> = ..., /*1*/ y: kotlin.Int) + public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean + public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int + public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String + public abstract fun x(): kotlin.reflect.KClass<*> + public abstract fun y(): kotlin.Int +} diff --git a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java index 909247fed02..16ff8282609 100644 --- a/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java +++ b/compiler/tests/org/jetbrains/kotlin/checkers/JetDiagnosticsTestWithStdLibGenerated.java @@ -141,6 +141,12 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic doTest(fileName); } + @TestMetadata("valueArrayAndOtherDefaultError.kt") + public void testValueArrayAndOtherDefaultError() throws Exception { + String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayAndOtherDefaultError.kt"); + doTest(fileName); + } + @TestMetadata("valueArrayOnly.kt") public void testValueArrayOnly() throws Exception { String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.kt");