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
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.idea.caches
import com.intellij.openapi.vfs.VirtualFile
data class CachedAttributeData<T>(val value: T, val timeStamp: Long)
data class CachedAttributeData<out T>(val value: T, val timeStamp: Long)
interface FileAttributeService {
fun register(id: String, version: Int) {}
@@ -20,7 +20,7 @@ import com.intellij.openapi.project.Project
import com.intellij.psi.util.CachedValuesManager
import com.intellij.psi.util.CachedValueProvider
class SynchronizedCachedValue<V>(project: Project, provider: () -> CachedValueProvider.Result<V>, trackValue: Boolean = true) {
class SynchronizedCachedValue<out V>(project: Project, provider: () -> CachedValueProvider.Result<V>, trackValue: Boolean = true) {
private val cachedValue = CachedValuesManager.getManager(project).createCachedValue(
provider,
trackValue
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.utils.keysToMap
data class DecompiledText(val text: String, val index: DecompiledTextIndex)
interface DecompiledTextIndexer<T: Any> {
interface DecompiledTextIndexer<out T: Any> {
fun indexDescriptor(descriptor: DeclarationDescriptor): Collection<T>
}