Browse Source

fix expanding the IEnumrable

pull/191/merge
Eusebiu Marcu 15 years ago
parent
commit
ec0750df43
  1. 8
      Debugger/ILSpy.Debugger/Services/Debugger/DebuggerHelper.cs

8
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); var iEnumerableType = DebugType.CreateFromType(itemType.AppDomain, typeof(IEnumerable<>), itemType);
// explicitely cast the variable to IEnumerable<T>, where T is itemType // explicitely cast the variable to IEnumerable<T>, where T is itemType
Expression iEnumerableVariableExplicitCast = new CastExpression { Expression = iEnumerableVariable.Clone() , Type = iEnumerableType.GetTypeReference() }; Expression iEnumerableVariableExplicitCast = new CastExpression { Expression = iEnumerableVariable.Clone() , Type = iEnumerableType.GetTypeReference() };
return new ObjectCreateExpression() { var obj = new ObjectCreateExpression() {
Type = listType.GetTypeReference()/*, Type = listType.GetTypeReference()/*,
Arguments = iEnumerableVariableExplicitCast.ToList() */ Arguments = iEnumerableVariableExplicitCast.ToList() */
}; };
foreach (var element in iEnumerableVariableExplicitCast.ToList()) {
obj.AddChild(element, AstNode.Roles.Argument);
}
return obj;
} }
/// <summary> /// <summary>

Loading…
Cancel
Save