diff options
Diffstat (limited to 'compiler-plugin/testData')
-rw-r--r-- | compiler-plugin/testData/api/annotationValue_java.kt (renamed from compiler-plugin/testData/api/annotationValue.kt) | 23 | ||||
-rw-r--r-- | compiler-plugin/testData/api/annotationValue_kt.kt | 73 |
2 files changed, 73 insertions, 23 deletions
diff --git a/compiler-plugin/testData/api/annotationValue.kt b/compiler-plugin/testData/api/annotationValue_java.kt index 700c951e..448ea5e0 100644 --- a/compiler-plugin/testData/api/annotationValue.kt +++ b/compiler-plugin/testData/api/annotationValue_java.kt @@ -22,17 +22,6 @@ // 42 // Foo // File -// Local -// Array -// @Foo -// @Suppress -// G -// ONE -// 31 -// Str -// 42 -// Foo -// File // Error type synthetic declaration // Array // @Foo @@ -41,7 +30,6 @@ // ONE // 31 // [warning1, warning 2] -// Throws // END // FILE: a.kt @@ -49,12 +37,6 @@ enum class RGB { R, G, B } -class ThrowsClass { - @Throws(Exception::class) - protected open fun throwsException() { - } -} - annotation class Foo(val s: Int) annotation class Bar( @@ -71,11 +53,6 @@ annotation class Bar( val argDef: Int = 31 ) -fun Fun() { - @Bar("Str", 40 + 2, Foo::class, java.io.File::class, Local::class, Array<String>::class, Foo(17), Suppress("name1", "name2"), RGB.G, JavaEnum.ONE) - class Local -} - // FILE: C.java @SuppressWarnings({"warning1", "warning 2"}) diff --git a/compiler-plugin/testData/api/annotationValue_kt.kt b/compiler-plugin/testData/api/annotationValue_kt.kt new file mode 100644 index 00000000..28c28772 --- /dev/null +++ b/compiler-plugin/testData/api/annotationValue_kt.kt @@ -0,0 +1,73 @@ +/* + * Copyright 2020 Google LLC + * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// WITH_RUNTIME +// TEST PROCESSOR: AnnotationArgumentProcessor +// EXPECTED: +// defaultInNested +// Str +// 42 +// Foo +// File +// Local +// Array +// @Foo +// @Suppress +// G +// ONE +// 31 +// Throws +// END +// FILE: a.kt + +enum class RGB { + R, G, B +} + +class ThrowsClass { + @Throws(Exception::class) + protected open fun throwsException() { + } +} + +annotation class Foo(val s: Int) { + annotation class Nested(val nestedDefault:String = "defaultInNested") +} + +annotation class Bar( + val argStr: String, + val argInt: Int, + val argClsUser: kotlin.reflect.KClass<*>, + val argClsLib: kotlin.reflect.KClass<*>, + val argClsLocal: kotlin.reflect.KClass<*>, + val argClsArray: kotlin.reflect.KClass<*>, + val argAnnoUser: Foo, + val argAnnoLib: Suppress, + val argEnum: RGB, + val argJavaNum: JavaEnum, + val argDef: Int = 31 +) + +fun Fun() { + @Foo.Nested + @Bar("Str", 40 + 2, Foo::class, java.io.File::class, Local::class, Array<String>::class, Foo(17), Suppress("name1", "name2"), RGB.G, JavaEnum.ONE) + class Local +} + +// FILE: JavaEnum.java + +enum JavaEnum { ONE, TWO, THREE } |