Fix some nullable usages of not-null type parameters (KT-36770)

This commit is contained in:
Mikhail Glukhikh
2020-02-18 16:11:50 +03:00
parent a2e7b6d20e
commit 26f919df03
6 changed files with 7 additions and 7 deletions
@@ -80,5 +80,5 @@ fun KotlinType.getSubtypesPredicate(): TypePredicate = when {
private fun KotlinType.render(): String = DescriptorRenderer.SHORT_NAMES_IN_TYPES.renderType(this)
fun <T> TypePredicate.expectedTypeFor(keys: Iterable<T>): Map<T, TypePredicate> =
fun <T : Any> TypePredicate.expectedTypeFor(keys: Iterable<T>): Map<T, TypePredicate> =
keys.fold(SmartFMap.emptyMap<T, TypePredicate>()) { map, key -> map.plus(key, this) }
@@ -9,7 +9,7 @@ import com.intellij.openapi.extensions.ExtensionPoint
import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.extensions.Extensions
open class ApplicationExtensionDescriptor<T>(name: String, private val extensionClass: Class<T>) {
open class ApplicationExtensionDescriptor<T : Any>(name: String, private val extensionClass: Class<T>) {
val extensionPointName: ExtensionPointName<T> = ExtensionPointName.create(name)
fun registerExtensionPoint() {
@@ -21,7 +21,7 @@ import com.intellij.openapi.extensions.ExtensionPointName
import com.intellij.openapi.extensions.Extensions
import com.intellij.openapi.project.Project
open class ProjectExtensionDescriptor<T>(name: String, private val extensionClass: Class<T>) {
open class ProjectExtensionDescriptor<T : Any>(name: String, private val extensionClass: Class<T>) {
val extensionPointName: ExtensionPointName<T> = ExtensionPointName.create(name)
fun registerExtensionPoint(project: Project) {
@@ -47,7 +47,7 @@ object CallDiagnosticToDiagnostic {
}
}
private inline fun <reified E : PsiElement, A, C : KotlinCallDiagnostic> put(
private inline fun <reified E : PsiElement, A : Any, C : KotlinCallDiagnostic> put(
factory1: DiagnosticFactory1<E, A>,
klass: Class<C>,
crossinline getA: C.() -> A
@@ -57,7 +57,7 @@ object CallDiagnosticToDiagnostic {
}
}
private inline fun <reified E : PsiElement, A, B, C : KotlinCallDiagnostic> put(
private inline fun <reified E : PsiElement, A : Any, B : Any, C : KotlinCallDiagnostic> put(
factory2: DiagnosticFactory2<E, A, B>, klass: Class<C>, crossinline getA: C.() -> A, crossinline getB: C.() -> B
) {
checkPut<E, C>(klass) {