Volatile is no more allowed on values #KT-7670 Fixed

This commit is contained in:
Mikhail Glukhikh
2015-10-13 11:33:25 +03:00
parent 8473be357f
commit ccf0c363fa
8 changed files with 51 additions and 1 deletions
@@ -54,6 +54,7 @@ public class DescriptorUtils {
public static final Name ENUM_VALUE_OF = Name.identifier("valueOf");
public static final FqName JVM_NAME = new FqName("kotlin.jvm.JvmName");
public static final FqName PLATFORM_NAME = new FqName("kotlin.platform.platformName");
public static final FqName VOLATILE = new FqName("kotlin.jvm.Volatile");
private DescriptorUtils() {
}
@@ -605,6 +606,11 @@ public class DescriptorUtils {
return getJvmNameAnnotation(annotated.getAnnotations());
}
@Nullable
public static AnnotationDescriptor getVolatileAnnotation(@NotNull Annotated annotated) {
return annotated.getAnnotations().findAnnotation(VOLATILE);
}
@NotNull
public static SourceFile getContainingSourceFile(@NotNull DeclarationDescriptor descriptor) {
if (descriptor instanceof PropertySetterDescriptor) {