Cleanup: smart casts of safe call receiver applied (do NOT cherry-pick to 1.0.X)
This commit is contained in:
@@ -133,7 +133,7 @@ class FrameVisitor(context: EvaluationContextImpl) {
|
||||
|
||||
private fun isFunctionType(type: Type?): Boolean {
|
||||
return type?.sort == Type.OBJECT &&
|
||||
type!!.internalName.startsWith(InlineCodegenUtil.NUMBERED_FUNCTION_PREFIX)
|
||||
type.internalName.startsWith(InlineCodegenUtil.NUMBERED_FUNCTION_PREFIX)
|
||||
}
|
||||
|
||||
private fun findLocalVariable(name: String, asmType: Type?, checkType: Boolean): Value? {
|
||||
|
||||
@@ -79,7 +79,7 @@ class AddLoopLabelFix(loop: KtLoopExpression, val jumpExpression: KtElement): Ko
|
||||
assert(element is KtBreakExpression || element is KtContinueExpression)
|
||||
assert((element as? KtLabeledExpression)?.getLabelName() == null)
|
||||
val loop = element?.getStrictParentOfType<KtLoopExpression>() ?: return null
|
||||
return AddLoopLabelFix(loop, element!!)
|
||||
return AddLoopLabelFix(loop, element)
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -51,7 +51,7 @@ class KotlinParameterUsage(
|
||||
) : KotlinExplicitReferenceUsage<KtElement>(element) {
|
||||
override fun processReplacedElement(element: KtElement) {
|
||||
val qualifiedExpression = element.parent as? KtQualifiedExpression
|
||||
val elementToShorten = if (qualifiedExpression?.receiverExpression == element) qualifiedExpression!! else element
|
||||
val elementToShorten = if (qualifiedExpression?.receiverExpression == element) qualifiedExpression else element
|
||||
elementToShorten.addToShorteningWaitSet(Options(removeThis = true, removeThisLabels = true))
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -720,7 +720,7 @@ private fun ExtractionData.suggestFunctionNames(returnType: KotlinType): List<St
|
||||
expressions.singleOrNull()?.let { expr ->
|
||||
val property = expr.getStrictParentOfType<KtProperty>()
|
||||
if (property?.initializer == expr) {
|
||||
property?.name?.let { functionNames.add(KotlinNameSuggester.suggestNameByName("get" + it.capitalize(), validator)) }
|
||||
property.name?.let { functionNames.add(KotlinNameSuggester.suggestNameByName("get" + it.capitalize(), validator)) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user