File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
ICSharpCode.Decompiler/CSharp/Transforms Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -57,8 +57,18 @@ void ProcessInvocationExpression(InvocationExpression invocationExpression)
5757 var arguments = invocationExpression . Arguments . ToArray ( ) ;
5858
5959 // Reduce "String.Concat(a, b)" to "a + b"
60- if ( IsStringConcat ( method ) && context . Settings . StringConcat && CheckArgumentsForStringConcat ( arguments ) )
60+ if ( IsStringConcat ( method ) && context . Settings . StringConcat )
6161 {
62+ if ( arguments is [ ArrayCreateExpression ace ] && method . Parameters is [ { Type : ArrayType } ] )
63+ {
64+ arguments = ace . Initializer . Elements . ToArray ( ) ;
65+ }
66+
67+ if ( ! CheckArgumentsForStringConcat ( arguments ) )
68+ {
69+ return ;
70+ }
71+
6272 bool isInExpressionTree = invocationExpression . Ancestors . OfType < LambdaExpression > ( ) . Any (
6373 lambda => lambda . Annotation < IL . ILFunction > ( ) ? . Kind == IL . ILFunctionKind . ExpressionTree ) ;
6474 Expression arg0 = arguments [ 0 ] . Detach ( ) ;
You can’t perform that action at this time.
0 commit comments