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 { companion object {
@JvmStatic fun create( @JvmStatic
fun create(
expectedType: KotlinType, expectedType: KotlinType,
expressionType: KotlinType, expressionType: KotlinType,
dataFlowExtras: DataFlowExtras dataFlowExtras: DataFlowExtras
@@ -96,7 +97,12 @@ class RuntimeAssertionsDataFlowExtras(
} }
object RuntimeAssertionsTypeChecker : AdditionalTypeChecker { 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 if (TypeUtils.noExpectedType(c.expectedType)) return
val assertionInfo = RuntimeAssertionInfo.create( val assertionInfo = RuntimeAssertionInfo.create(
@@ -177,8 +183,11 @@ object RuntimeAssertionsOnDeclarationBodyChecker {
) { ) {
if (declaration.typeReference != null || declaration.hasBlockBody()) return if (declaration.typeReference != null || declaration.hasBlockBody()) return
checkNullabilityAssertion(declaration.bodyExpression ?: return, descriptor.returnType ?: return, checkNullabilityAssertion(
bindingTrace) declaration.bodyExpression ?: return,
descriptor.returnType ?: return,
bindingTrace
)
} }
private fun checkProperty( private fun checkProperty(
@@ -201,8 +210,11 @@ object RuntimeAssertionsOnDeclarationBodyChecker {
) { ) {
if (declaration.property.typeReference != null || declaration.hasBlockBody()) return if (declaration.property.typeReference != null || declaration.hasBlockBody()) return
checkNullabilityAssertion(declaration.bodyExpression ?: return, descriptor.correspondingProperty.type, checkNullabilityAssertion(
bindingTrace) declaration.bodyExpression ?: return,
descriptor.correspondingProperty.type,
bindingTrace
)
} }