Skip to content

Commit

Permalink
Change Signature: Always put last lambda argument outside of value ar…
Browse files Browse the repository at this point in the history
…gument list
  • Loading branch information
asedunov committed Apr 17, 2015
1 parent daebf56 commit 4542889
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -168,8 +168,7 @@ else if (parameterInfo.getDefaultValueForCall().isEmpty()) {
}

List<JetFunctionLiteralArgument> lambdaArguments = element.getFunctionLiteralArguments();
boolean hasLambdaArgumentsBefore = !lambdaArguments.isEmpty();
if (hasLambdaArgumentsBefore) {
if (!lambdaArguments.isEmpty()) {
element.deleteChildRange(KotlinPackage.first(lambdaArguments), KotlinPackage.last(lambdaArguments));
}

Expand Down Expand Up @@ -197,7 +196,7 @@ else if (parameterInfo.getDefaultValueForCall().isEmpty()) {
newElement = (JetElement) elementToReplace.replace(replacingElement);
}

if (hasLambdaArgumentsBefore && hasTrailingLambdaInArgumentListAfter) {
if (hasTrailingLambdaInArgumentListAfter) {
JetCallElement newCallElement =
(JetCallElement) (newElement instanceof JetQualifiedExpression
? ((JetQualifiedExpression) newElement).getSelectorExpression()
Expand Down

0 comments on commit 4542889

Please sign in to comment.