[FE 1.0] Remove usages of safeAs and cast from most of FE 1.0 modules:
- :core:descriptors - :core:descriptors.jvm - :core:deserialization - :compiler:cli - :compiler:frontend - :compiler:frontend:cfg - :compiler:frontend.java - :compiler:frontend.common.jvm - :compiler:psi - :compiler:resolution - :compiler:resolution.common - :compiler:resolution.common.jvm - :kotlin-reflect-api
This commit is contained in:
committed by
Space Team
parent
6afceb1e84
commit
d423782fac
@@ -22,7 +22,6 @@ import org.jetbrains.kotlin.name.SpecialNames
|
||||
import org.jetbrains.kotlin.psi.*
|
||||
import org.jetbrains.kotlin.psi.stubs.KotlinClassOrObjectStub
|
||||
import org.jetbrains.kotlin.types.expressions.OperatorConventions
|
||||
import org.jetbrains.kotlin.utils.addToStdlib.safeAs
|
||||
import java.util.*
|
||||
|
||||
// NOTE: in this file we collect only Kotlin-specific methods working with PSI and not modifying it
|
||||
@@ -674,7 +673,7 @@ fun isTopLevelInFileOrScript(element: PsiElement): Boolean {
|
||||
fun KtFile.getFileOrScriptDeclarations() = if (isScript()) script!!.declarations else declarations
|
||||
|
||||
fun KtExpression.getBinaryWithTypeParent(): KtBinaryExpressionWithTypeRHS? {
|
||||
val callExpression = parent.safeAs<KtCallExpression>() ?: return null
|
||||
val callExpression = parent as? KtCallExpression ?: return null
|
||||
val possibleQualifiedExpression = callExpression.parent
|
||||
|
||||
val targetExpression = if (possibleQualifiedExpression is KtQualifiedExpression) {
|
||||
|
||||
Reference in New Issue
Block a user