[NI] Add checking @NotNull parameters for candidates
This commit is contained in:
@@ -27,6 +27,10 @@ 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,6 +333,10 @@ 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 {
|
||||
|
||||
Reference in New Issue
Block a user