From ec0750df43e5e4fb12faea310cbd7a147e298242 Mon Sep 17 00:00:00 2001 From: Eusebiu Marcu Date: Mon, 28 Feb 2011 14:04:33 +0200 Subject: [PATCH] fix expanding the IEnumrable --- .../ILSpy.Debugger/Services/Debugger/DebuggerHelper.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Debugger/ILSpy.Debugger/Services/Debugger/DebuggerHelper.cs b/Debugger/ILSpy.Debugger/Services/Debugger/DebuggerHelper.cs index 4beadd3a2..089ac0d34 100644 --- a/Debugger/ILSpy.Debugger/Services/Debugger/DebuggerHelper.cs +++ b/Debugger/ILSpy.Debugger/Services/Debugger/DebuggerHelper.cs @@ -28,10 +28,16 @@ namespace ILSpy.Debugger.Services.Debugger var iEnumerableType = DebugType.CreateFromType(itemType.AppDomain, typeof(IEnumerable<>), itemType); // explicitely cast the variable to IEnumerable, where T is itemType Expression iEnumerableVariableExplicitCast = new CastExpression { Expression = iEnumerableVariable.Clone() , Type = iEnumerableType.GetTypeReference() }; - return new ObjectCreateExpression() { + var obj = new ObjectCreateExpression() { Type = listType.GetTypeReference()/*, Arguments = iEnumerableVariableExplicitCast.ToList() */ }; + + foreach (var element in iEnumerableVariableExplicitCast.ToList()) { + obj.AddChild(element, AstNode.Roles.Argument); + } + + return obj; } ///