Revert "[NI] Add checking @NotNull parameters for candidates"

This reverts commit 910177ab17.
This commit is contained in:
Mikhail Zarechenskiy
2019-05-29 00:40:40 +03:00
parent 25371734e8
commit 86a95e1a7b
12 changed files with 11 additions and 46 deletions
@@ -215,7 +215,7 @@ private object EnhancedTypeAnnotationDescriptor : AnnotationDescriptor {
override fun toString() = "[EnhancedType]"
}
internal class NotNullTypeParameter(override val delegate: SimpleType) : NotNullTypeVariable, DelegatingSimpleType() {
internal class NotNullTypeParameter(override val delegate: SimpleType) : CustomTypeVariable, DelegatingSimpleType() {
override val isTypeVariable: Boolean
get() = true
@@ -27,10 +27,6 @@ interface CustomTypeVariable {
fun substitutionResult(replacement: KotlinType): KotlinType
}
// That interface is needed to provide information about definitely not null
// type parameters (e.g. from @NotNull annotation) to type system
interface NotNullTypeVariable : CustomTypeVariable
fun KotlinType.isCustomTypeVariable(): Boolean = (unwrap() as? CustomTypeVariable)?.isTypeVariable ?: false
fun KotlinType.getCustomTypeVariable(): CustomTypeVariable? =
(unwrap() as? CustomTypeVariable)?.let {
@@ -333,10 +333,6 @@ interface ClassicTypeSystemContext : TypeSystemInferenceExtensionContext {
return builtIns.nothingType
}
override fun anyType(): SimpleTypeMarker {
return builtIns.anyType
}
val builtIns: KotlinBuiltIns get() = throw UnsupportedOperationException("Not supported")
override fun KotlinTypeMarker.makeDefinitelyNotNullOrNotNull(): KotlinTypeMarker {
@@ -49,7 +49,6 @@ interface TypeSystemBuiltInsContext {
fun nullableNothingType(): SimpleTypeMarker
fun nullableAnyType(): SimpleTypeMarker
fun nothingType(): SimpleTypeMarker
fun anyType(): SimpleTypeMarker
}
interface TypeSystemTypeFactoryContext {