Introduce UnsafeVariance annotation

This commit is contained in:
Denis Zharkov
2015-10-07 10:28:11 +03:00
parent 013b257347
commit e800be18c6
8 changed files with 54 additions and 1 deletions
+8
View File
@@ -119,6 +119,14 @@ public annotation class HiddenDeclaration
@MustBeDocumented
private annotation class external
/**
* Suppresses errors about variance conflict
*/
@Target(TYPE)
@Retention(SOURCE)
@MustBeDocumented
public annotation class UnsafeVariance
/**
* Specifies that the corresponding type should be ignored during type inference.
*/
@@ -151,6 +151,7 @@ public abstract class KotlinBuiltIns {
public final FqName retention = annotationName("Retention");
public final FqName repeatable = annotationName("Repeatable");
public final FqName mustBeDocumented = annotationName("MustBeDocumented");
public final FqName unsafeVariance = fqName("UnsafeVariance");
public final FqName mutableList = fqName("MutableList");
public final FqName mutableSet = fqName("MutableSet");
@@ -26,6 +26,8 @@ public interface Annotations : Iterable<AnnotationDescriptor> {
public fun findAnnotation(fqName: FqName): AnnotationDescriptor?
public fun hasAnnotation(fqName: FqName) = findAnnotation(fqName) != null
public fun findExternalAnnotation(fqName: FqName): AnnotationDescriptor?
public fun getUseSiteTargetedAnnotations(): List<AnnotationWithTarget>