More cleanup: lift return / assignment out

This commit is contained in:
Mikhail Glukhikh
2017-07-07 13:57:36 +03:00
parent 9269de721e
commit dfe2c16bc7
116 changed files with 472 additions and 517 deletions
@@ -30,12 +30,12 @@ object DynamicTypeDeserializer : FlexibleTypeDeserializer {
override fun create(proto: ProtoBuf.Type, flexibleId: String, lowerBound: SimpleType, upperBound: SimpleType): KotlinType {
if (flexibleId != id) return ErrorUtils.createErrorType("Unexpected id: $flexibleId. ($lowerBound..$upperBound)")
if (StrictEqualityTypeChecker.strictEqualTypes(lowerBound, lowerBound.builtIns.nothingType) &&
StrictEqualityTypeChecker.strictEqualTypes(upperBound, upperBound.builtIns.nullableAnyType)) {
return createDynamicType(lowerBound.builtIns)
return if (StrictEqualityTypeChecker.strictEqualTypes(lowerBound, lowerBound.builtIns.nothingType) &&
StrictEqualityTypeChecker.strictEqualTypes(upperBound, upperBound.builtIns.nullableAnyType)) {
createDynamicType(lowerBound.builtIns)
}
else {
return ErrorUtils.createErrorType("Illegal type range for dynamic type: $lowerBound..$upperBound")
ErrorUtils.createErrorType("Illegal type range for dynamic type: $lowerBound..$upperBound")
}
}
}