Minor: reformat

This commit is contained in:
Dmitry Petrov
2018-07-18 13:30:25 +03:00
parent 76bfb94538
commit 4061a36506
@@ -111,7 +111,7 @@ fun StatementGenerator.generateSingletonReference(
)
else -> {
val companionObjectDescriptor = descriptor.companionObjectDescriptor
?: throw java.lang.AssertionError("Class value without companion object: $descriptor")
?: throw java.lang.AssertionError("Class value without companion object: $descriptor")
IrGetObjectValueImpl(
startOffset, endOffset, irType,
context.symbolTable.referenceClass(companionObjectDescriptor)
@@ -230,7 +230,7 @@ fun StatementGenerator.generateVarargExpression(
for (argument in varargArgument.arguments) {
val ktArgumentExpression = argument.getArgumentExpression()
?: throw AssertionError("No argument expression for vararg element ${argument.asElement().text}")
?: throw AssertionError("No argument expression for vararg element ${argument.asElement().text}")
val irVarargElement =
if (argument.getSpreadElement() != null)
IrSpreadElementImpl(
@@ -289,11 +289,11 @@ fun getTypeArguments(resolvedCall: ResolvedCall<*>?): Map<TypeParameterDescripto
fun StatementGenerator.pregenerateExtensionInvokeCall(resolvedCall: ResolvedCall<*>): CallBuilder {
val extensionInvoke = resolvedCall.resultingDescriptor
val functionNClass = extensionInvoke.containingDeclaration as? ClassDescriptor
?: throw AssertionError("'invoke' should be a class member: $extensionInvoke")
?: throw AssertionError("'invoke' should be a class member: $extensionInvoke")
val unsubstitutedPlainInvokes =
functionNClass.unsubstitutedMemberScope.getContributedFunctions(extensionInvoke.name, NoLookupLocation.FROM_BACKEND)
val unsubstitutedPlainInvoke = unsubstitutedPlainInvokes.singleOrNull()
?: throw AssertionError("There should be a single 'invoke' in FunctionN class: $unsubstitutedPlainInvokes")
?: throw AssertionError("There should be a single 'invoke' in FunctionN class: $unsubstitutedPlainInvokes")
assert(unsubstitutedPlainInvoke.typeParameters.isEmpty()) {
"'operator fun invoke' should have no type parameters: $unsubstitutedPlainInvoke"
@@ -306,7 +306,7 @@ fun StatementGenerator.pregenerateExtensionInvokeCall(resolvedCall: ResolvedCall
val functionNType = extensionInvoke.dispatchReceiverParameter!!.type
val plainInvoke = unsubstitutedPlainInvoke.substitute(TypeSubstitutor.create(functionNType))
?: throw AssertionError("Substitution failed for $unsubstitutedPlainInvoke, type=$functionNType")
?: throw AssertionError("Substitution failed for $unsubstitutedPlainInvoke, type=$functionNType")
val ktCallElement = resolvedCall.call.callElement
@@ -405,7 +405,7 @@ fun unwrapCallableDescriptorAndTypeArguments(resolvedCall: ResolvedCall<*>): Cal
unsubstitutedUnwrappedTypeParameters.associate {
val originalTypeParameter = originalDescriptor.original.typeParameters[it.index]
val originalTypeArgument = originalTypeArguments[originalTypeParameter]
?: throw AssertionError("No type argument for $originalTypeParameter")
?: throw AssertionError("No type argument for $originalTypeParameter")
it to originalTypeArgument
}
}
@@ -437,7 +437,7 @@ fun unwrapCallableDescriptorAndTypeArguments(resolvedCall: ResolvedCall<*>): Cal
originalTypeArguments.keys.associate { originalTypeParameter ->
val unwrappedTypeParameter = unsubstitutedUnwrappedTypeParameters[originalTypeParameter.index]
val originalTypeArgument = originalTypeArguments[originalTypeParameter]
?: throw AssertionError("No type argument for $unwrappedTypeParameter <= $originalTypeParameter")
?: throw AssertionError("No type argument for $unwrappedTypeParameter <= $originalTypeParameter")
unwrappedTypeParameter to originalTypeArgument
}
}