2

I'm using Spring4d where are interfaced containers like IList<T>. If I use normal version of container I can spy its content in debug by move mouse over variable. But if variable is interface I see somethink like this: TClassName($1234567) as IClassName. There is any way to spy it in debug?

I Have Delphi XE2.

Stefan Glienke
  • 20,860
  • 2
  • 48
  • 102
aQuu
  • 565
  • 8
  • 18
  • 2
    In Delphi 2010 and later, a Delphi-style interfaced object (not a COM-style interfaced object) can be directly type-casted to its implementing class type, eg: `var Intf: IClassName; obj: TClassName; begin Intf := ...; obj := Intf as TClassName; // or obj := TClassName(Intf); end;` You should be able to do a similar typecast in the debugger. – Remy Lebeau Mar 16 '17 at 18:39
  • 1
    Unfortunately the debugger does not understand generics pretty well, so when typing `TList(list)` it complains about `E2029 '(' expected but '>' found`. However since most collection types inherit from `Spring.Collections.IEnumerable` you can use `list.ToArray`. – Stefan Glienke Mar 21 '17 at 13:53

0 Answers0