Add jet.deprecated to library
This commit is contained in:
@@ -5,6 +5,7 @@ public trait Annotation
|
||||
public annotation class volatile : Annotation
|
||||
public annotation class atomic : Annotation
|
||||
public annotation class data : Annotation
|
||||
public annotation class deprecated(value: String) : Annotation
|
||||
|
||||
public fun <R> synchronized(lock: Any, block : () -> R) : R
|
||||
|
||||
|
||||
@@ -431,6 +431,11 @@ public class KotlinBuiltIns {
|
||||
return getBuiltInClassByName("volatile");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ClassDescriptor getDeprecatedAnnotation() {
|
||||
return getBuiltInClassByName("deprecated");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public ClassDescriptor getString() {
|
||||
return getBuiltInClassByName("String");
|
||||
@@ -831,6 +836,10 @@ public class KotlinBuiltIns {
|
||||
return containsAnnotation(classDescriptor, getDataClassAnnotation());
|
||||
}
|
||||
|
||||
public boolean isDeprecated(@NotNull DeclarationDescriptor declarationDescriptor) {
|
||||
return containsAnnotation(declarationDescriptor, getDeprecatedAnnotation());
|
||||
}
|
||||
|
||||
private boolean containsAnnotation(DeclarationDescriptor descriptor, ClassDescriptor annotationClass) {
|
||||
List<AnnotationDescriptor> annotations = descriptor.getOriginal().getAnnotations();
|
||||
if (annotations != null) {
|
||||
|
||||
@@ -1454,6 +1454,9 @@ public final annotation class jet.atomic : jet.Annotation {
|
||||
public final annotation class jet.data : jet.Annotation {
|
||||
public final /*constructor*/ fun <init>(): jet.data
|
||||
}
|
||||
public final annotation class jet.deprecated : jet.Annotation {
|
||||
public final /*constructor*/ fun <init>(/*0*/ value: jet.String): jet.deprecated
|
||||
}
|
||||
public final annotation class jet.volatile : jet.Annotation {
|
||||
public final /*constructor*/ fun <init>(): jet.volatile
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user