|
|
|
|
@ -754,9 +754,8 @@ namespace ICSharpCode.Decompiler.Ast
@@ -754,9 +754,8 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
return ace; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (declaringType.IsAnonymousType()) { |
|
|
|
|
MethodDefinition ctor = ((MethodReference)operand).Resolve(); |
|
|
|
|
if (methodDef != null) { |
|
|
|
|
if (declaringType.IsAnonymousType() && methodDef != null) { |
|
|
|
|
AnonymousTypeCreateExpression atce = new AnonymousTypeCreateExpression(); |
|
|
|
|
if (CanInferAnonymousTypePropertyNamesFromArguments(args, ctor.Parameters)) { |
|
|
|
|
atce.Initializers.AddRange(args); |
|
|
|
|
@ -771,9 +770,12 @@ namespace ICSharpCode.Decompiler.Ast
@@ -771,9 +770,12 @@ namespace ICSharpCode.Decompiler.Ast
|
|
|
|
|
} |
|
|
|
|
return atce; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
var oce = new Ast.ObjectCreateExpression(); |
|
|
|
|
oce.Type = AstBuilder.ConvertType(declaringType); |
|
|
|
|
// seems like IsIn/IsOut information for parameters is only correct on the ctor's MethodDefinition
|
|
|
|
|
if (ctor != null) { |
|
|
|
|
AdjustArgumentsForMethodCall(ctor, args); |
|
|
|
|
} |
|
|
|
|
oce.Arguments.AddRange(args); |
|
|
|
|
return oce.WithAnnotation(operand); |
|
|
|
|
} |
|
|
|
|
|