Code cleanup: type parameters can have in / out variance

This commit is contained in:
Mikhail Glukhikh
2016-04-29 15:09:06 +03:00
parent 9afb0d5f59
commit 733f3e8025
45 changed files with 76 additions and 74 deletions
@@ -152,7 +152,7 @@ private fun List<Annotations>.compositeAnnotationsOrSingle() = when (size) {
private fun TypeComponentPosition.shouldEnhance() = this != TypeComponentPosition.INFLEXIBLE
private data class EnhancementResult<T>(val result: T, val enhancementAnnotations: Annotations?)
private data class EnhancementResult<out T>(val result: T, val enhancementAnnotations: Annotations?)
private fun <T> T.noChange() = EnhancementResult(this, null)
private fun <T> T.enhancedNullability() = EnhancementResult(this, ENHANCED_NULLABILITY_ANNOTATIONS)
private fun <T> T.enhancedMutability() = EnhancementResult(this, ENHANCED_MUTABILITY_ANNOTATIONS)
@@ -347,7 +347,7 @@ abstract class AbstractBinaryClassAnnotationAndConstantLoader<A : Any, C : Any,
}
}
private class Storage<A, C>(
private class Storage<out A, out C>(
val memberAnnotations: Map<MemberSignature, List<A>>,
val propertyConstants: Map<MemberSignature, C>
)