- Annotate package facades with java.lang.Deprecated.
- Provide KotlinDelegatedMethod annotation on package facade members.
This commit is contained in:
+18
@@ -0,0 +1,18 @@
|
||||
package test
|
||||
|
||||
fun findClassOrFail(className: String): Class<*> =
|
||||
try {
|
||||
Class.forName(className)
|
||||
}
|
||||
catch (e: Exception) {
|
||||
throw AssertionError("Class $className not found")
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val testPackage = findClassOrFail("test.TestPackage")
|
||||
val deprecated = findClassOrFail("java.lang.Deprecated") as Class<Annotation>
|
||||
val ann = testPackage.getAnnotation(deprecated)
|
||||
assert(ann != null) { "Package facade ${testPackage.name} is not deprecated" }
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user