Fix formatting of RuntimeAssertion.kt

This commit is contained in:
Victor Petukhov
2020-02-18 16:01:13 +03:00
parent 6793b27330
commit f10696da5e
@@ -39,7 +39,8 @@ class RuntimeAssertionInfo(val needNotNullAssertion: Boolean, val message: Strin
}
companion object {
@JvmStatic fun create(
@JvmStatic
fun create(
expectedType: KotlinType,
expressionType: KotlinType,
dataFlowExtras: DataFlowExtras
@@ -96,7 +97,12 @@ class RuntimeAssertionsDataFlowExtras(
}
object RuntimeAssertionsTypeChecker : AdditionalTypeChecker {
override fun checkType(expression: KtExpression, expressionType: KotlinType, expressionTypeWithSmartCast: KotlinType, c: ResolutionContext<*>) {
override fun checkType(
expression: KtExpression,
expressionType: KotlinType,
expressionTypeWithSmartCast: KotlinType,
c: ResolutionContext<*>
) {
if (TypeUtils.noExpectedType(c.expectedType)) return
val assertionInfo = RuntimeAssertionInfo.create(
@@ -177,8 +183,11 @@ object RuntimeAssertionsOnDeclarationBodyChecker {
) {
if (declaration.typeReference != null || declaration.hasBlockBody()) return
checkNullabilityAssertion(declaration.bodyExpression ?: return, descriptor.returnType ?: return,
bindingTrace)
checkNullabilityAssertion(
declaration.bodyExpression ?: return,
descriptor.returnType ?: return,
bindingTrace
)
}
private fun checkProperty(
@@ -201,8 +210,11 @@ object RuntimeAssertionsOnDeclarationBodyChecker {
) {
if (declaration.property.typeReference != null || declaration.hasBlockBody()) return
checkNullabilityAssertion(declaration.bodyExpression ?: return, descriptor.correspondingProperty.type,
bindingTrace)
checkNullabilityAssertion(
declaration.bodyExpression ?: return,
descriptor.correspondingProperty.type,
bindingTrace
)
}