[FIR] Get rid of all usages of safeAs in FIR modules

This commit is contained in:
Dmitriy Novozhilov
2022-09-30 15:52:30 +03:00
committed by teamcity
parent 8d33de4297
commit ee21c966e1
33 changed files with 99 additions and 143 deletions
@@ -30,7 +30,6 @@ import org.jetbrains.kotlin.types.TypeCheckerState
import org.jetbrains.kotlin.types.model.*
import org.jetbrains.kotlin.utils.DFS
import org.jetbrains.kotlin.utils.addToStdlib.cast
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
interface ConeInferenceContext : TypeSystemInferenceExtensionContext, ConeTypeContext {
@@ -503,7 +502,7 @@ interface ConeInferenceContext : TypeSystemInferenceExtensionContext, ConeTypeCo
override fun KotlinTypeMarker.isExtensionFunctionType(): Boolean {
require(this is ConeKotlinType)
return this.lowerBoundIfFlexible().safeAs<ConeKotlinType>()?.isExtensionFunctionType(session) == true
return (this.lowerBoundIfFlexible() as? ConeKotlinType)?.isExtensionFunctionType(session) == true
}
override fun KotlinTypeMarker.extractArgumentsForFunctionalTypeOrSubtype(): List<KotlinTypeMarker> {